Skip to content

Commit

Permalink
Merge branch 'rustdesk:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangbo8418 authored Oct 11, 2024
2 parents a8d20ce + 844b853 commit b08a722
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 22 deletions.
2 changes: 1 addition & 1 deletion flutter/lib/common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2383,7 +2383,7 @@ connect(BuildContext context, String id,
),
);
} else {
if (isWebDesktop) {
if (isWeb) {
Navigator.push(
context,
MaterialPageRoute(
Expand Down
2 changes: 1 addition & 1 deletion flutter/lib/models/model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ class FfiModel with ChangeNotifier {
} else if (name == 'plugin_option') {
handleOption(evt);
} else if (name == "sync_peer_hash_password_to_personal_ab") {
if (desktopType == DesktopType.main) {
if (desktopType == DesktopType.main || isWeb) {
final id = evt['id'];
final hash = evt['hash'];
if (id != null && hash != null) {
Expand Down
6 changes: 6 additions & 0 deletions flutter/lib/models/web_model.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// ignore_for_file: avoid_web_libraries_in_flutter

import 'dart:convert';
import 'dart:js_interop';
import 'dart:typed_data';
import 'dart:js';
import 'dart:html';
Expand Down Expand Up @@ -107,6 +108,10 @@ class PlatformFFI {
sessionId: sessionId, display: display, ptr: ptr);

Future<void> init(String appType) async {
Completer completer = Completer();
context["onInitFinished"] = () {
completer.complete();
};
context.callMethod('init');
version = getByName('version');
window.onContextMenu.listen((event) {
Expand All @@ -121,6 +126,7 @@ class PlatformFFI {
print('json.decode fail(): $e');
}
};
return completer.future;
}

void setEventCallback(void Function(Map<String, dynamic>) fun) {
Expand Down
22 changes: 14 additions & 8 deletions flutter/lib/web/bridge.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ class RustdeskImpl {
dynamic hint}) {
return js.context.callMethod('setByName', [
'session_add_sync',
jsonEncode({'id': id, 'password': password})
jsonEncode({
'id': id,
'password': password,
'is_shared_password': isSharedPassword
})
]);
}

Expand Down Expand Up @@ -1118,7 +1122,8 @@ class RustdeskImpl {
}

Future<void> mainRemovePeer({required String id, dynamic hint}) {
return Future(() => js.context.callMethod('setByName', ['remove', id]));
return Future(
() => js.context.callMethod('setByName', ['remove_peer', id]));
}

bool mainHasHwcodec({dynamic hint}) {
Expand Down Expand Up @@ -1146,27 +1151,28 @@ class RustdeskImpl {
}

Future<void> mainSaveAb({required String json, dynamic hint}) {
throw UnimplementedError();
return Future(() => js.context.callMethod('setByName', ['save_ab', json]));
}

Future<void> mainClearAb({dynamic hint}) {
throw UnimplementedError();
return Future(() => js.context.callMethod('setByName', ['clear_ab']));
}

Future<String> mainLoadAb({dynamic hint}) {
throw UnimplementedError();
return Future(() => js.context.callMethod('getByName', ['load_ab']));
}

Future<void> mainSaveGroup({required String json, dynamic hint}) {
throw UnimplementedError();
return Future(
() => js.context.callMethod('setByName', ['save_group', json]));
}

Future<void> mainClearGroup({dynamic hint}) {
throw UnimplementedError();
return Future(() => js.context.callMethod('setByName', ['clear_group']));
}

Future<String> mainLoadGroup({dynamic hint}) {
throw UnimplementedError();
return Future(() => js.context.callMethod('getByName', ['load_group']));
}

Future<void> sessionSendPointer(
Expand Down
24 changes: 12 additions & 12 deletions src/lang/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ lazy_static::lazy_static! {
pub static ref T: std::collections::HashMap<&'static str, &'static str> =
[
("Status", "Status"),
("Your Desktop", "Desktop Kamu"),
("desk_tip", "Desktop kamu dapat diakses dengan ID dan kata sandi ini."),
("Your Desktop", "Layar Utama"),
("desk_tip", "Layar kamu dapat diakses dengan ID dan kata sandi ini."),
("Password", "Kata sandi"),
("Ready", "Sudah siap"),
("Established", "Didirikan"),
Expand All @@ -12,10 +12,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Start service", "Mulai Layanan"),
("Service is running", "Layanan berjalan"),
("Service is not running", "Layanan tidak berjalan"),
("not_ready_status", "Belum siap. Silakan periksa koneksi"),
("Control Remote Desktop", "Kontrol Remote Desktop"),
("Transfer file", "File Transfer"),
("Connect", "Hubungkan"),
("not_ready_status", "Belum siap digunakan. Silakan periksa koneksi"),
("Control Remote Desktop", "Kontrol PC dari jarak jauh"),
("Transfer file", "Transfer File"),
("Connect", "Sambungkan"),
("Recent sessions", "Sesi Terkini"),
("Address book", "Buku Alamat"),
("Confirmation", "Konfirmasi"),
Expand Down Expand Up @@ -172,14 +172,14 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Local Port", "Port Lokal"),
("Local Address", "Alamat lokal"),
("Change Local Port", "Ubah Port Lokal"),
("setup_server_tip", "Untuk mendapatkan koneksi yang lebih baik, disarankan untuk menginstal di server anda sendiri"),
("setup_server_tip", "Untuk koneksi yang lebih baik, silakan konfigurasi di server pribadi"),
("Too short, at least 6 characters.", "Terlalu pendek, setidaknya 6 karekter."),
("The confirmation is not identical.", "Konfirmasi tidak identik."),
("Permissions", "Perizinan"),
("Accept", "Terima"),
("Dismiss", "Hentikan"),
("Disconnect", "Terputus"),
("Enable file copy and paste", "Izinkan salin dan tempel file"),
("Enable file copy and paste", "Izinkan copy dan paste"),
("Connected", "Terhubung"),
("Direct and encrypted connection", "Koneksi langsung dan terenkripsi"),
("Relayed and encrypted connection", "Koneksi relay dan terenkripsi"),
Expand All @@ -199,7 +199,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Please enter the folder name", "Silahkan masukkan nama folder"),
("Fix it", "Perbaiki"),
("Warning", "Peringatan"),
("Login screen using Wayland is not supported", "Layar masuk menggunakan Wayland tidak didukung"),
("Login screen using Wayland is not supported", "Login screen dengan Wayland tidak didukung"),
("Reboot required", "Diperlukan boot ulang"),
("Unsupported display server", "Server tampilan tidak didukung "),
("x11 expected", "Diperlukan x11"),
Expand Down Expand Up @@ -394,9 +394,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Accept sessions via click", "Izinkan sesi dengan klik"),
("Accept sessions via both", "Izinkan sesi dengan keduanya"),
("Please wait for the remote side to accept your session request...", "Harap tunggu pihak pengguna remote untuk menerima permintaan sesi..."),
("One-time Password", "Kata sandi sekali pakai"),
("Use one-time password", "Gunakan kata sandi sekali pakai"),
("One-time password length", "Panjang kata sandi sekali pakai"),
("One-time Password", "Kata sandi sementara"),
("Use one-time password", "Gunakan kata sandi sementara"),
("One-time password length", "Panjang kata sandi sementara"),
("Request access to your device", "Permintaan akses ke perangkat ini"),
("Hide connection management window", "Sembunyikan jendela pengaturan koneksi"),
("hide_cm_tip", "Izinkan untuk menyembunyikan hanya jika menerima sesi melalui kata sandi dan menggunakan kata sandi permanen"),
Expand Down

0 comments on commit b08a722

Please sign in to comment.