mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-11-28 23:59:05 +08:00
more api
This commit is contained in:
parent
2cf2fb7804
commit
f17aff8bb4
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,3 +5,4 @@ dist-ssr
|
||||
*.local
|
||||
*log
|
||||
ogvjs
|
||||
.vscode
|
||||
|
57
gen_js_from_hbb.py
Executable file
57
gen_js_from_hbb.py
Executable file
@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import glob
|
||||
from tabnanny import check
|
||||
|
||||
def main():
|
||||
print('export const LANGS = {')
|
||||
for fn in glob.glob('../hbb/src/lang/*'):
|
||||
lang = os.path.basename(fn)[:-3]
|
||||
print(' %s: {'%lang)
|
||||
for ln in open(fn):
|
||||
ln = ln.strip()
|
||||
if ln.startswith('("'):
|
||||
toks = ln.split('", "')
|
||||
assert(len(toks) == 2)
|
||||
a = toks[0][2:]
|
||||
b = toks[1][:-3]
|
||||
print(' "%s": "%s",'%(a, b))
|
||||
print(' },')
|
||||
print('}')
|
||||
check_if_retry = ['', False]
|
||||
KEY_MAP = ['', False]
|
||||
for ln in open('../hbb/src/client.rs'):
|
||||
ln = ln.strip()
|
||||
if 'check_if_retry' in ln:
|
||||
check_if_retry[1] = True
|
||||
continue
|
||||
if ln.startswith('}') and check_if_retry[1]:
|
||||
check_if_retry[1] = False
|
||||
continue
|
||||
if check_if_retry[1]:
|
||||
check_if_retry[0] += ln + '\n'
|
||||
if 'KEY_MAP' in ln:
|
||||
KEY_MAP[1] = True
|
||||
continue
|
||||
if '.collect' in ln and KEY_MAP[1]:
|
||||
KEY_MAP[1] = False
|
||||
continue
|
||||
if KEY_MAP[1] and ln.startswith('('):
|
||||
toks = ln.split('", Key::')
|
||||
assert(len(toks) == 2)
|
||||
a = toks[0][2:]
|
||||
b = toks[1].replace('ControlKey(ControlKey::', '').replace("Chr('", '').replace("' as _)),", '').replace(')),', '')
|
||||
KEY_MAP[0] += ' "%s": "%s",\n'%(a, b)
|
||||
print()
|
||||
print('export function checkIfRetry(msgtype: string, title: string, text: string) {')
|
||||
print(' return %s'%check_if_retry[0].replace('to_lowercase', 'toLowerCase').replace('contains', 'indexOf').replace('!', '').replace('")', '") < 0'))
|
||||
print(';}')
|
||||
print()
|
||||
print('export const KEY_MAP: any = {')
|
||||
print(KEY_MAP[0])
|
||||
print('}')
|
||||
|
||||
|
||||
|
||||
main()
|
66
src/common.ts
Normal file
66
src/common.ts
Normal file
@ -0,0 +1,66 @@
|
||||
import * as zstd from "zstddec";
|
||||
import { KeyEvent, controlKeyFromJSON, ControlKey } from "./message";
|
||||
import { KEY_MAP, LANGS } from "./gen_js_from_hbb";
|
||||
|
||||
let decompressor: zstd.ZSTDDecoder;
|
||||
|
||||
export async function initZstd() {
|
||||
const tmp = new zstd.ZSTDDecoder();
|
||||
await tmp.init();
|
||||
console.log("zstd ready");
|
||||
decompressor = tmp;
|
||||
}
|
||||
|
||||
export async function decompress(compressedArray: Uint8Array) {
|
||||
const MAX = 1024 * 1024 * 64;
|
||||
const MIN = 1024 * 1024;
|
||||
let n = 30 * compressedArray.length;
|
||||
if (n > MAX) {
|
||||
n = MAX;
|
||||
}
|
||||
if (n < MIN) {
|
||||
n = MIN;
|
||||
}
|
||||
try {
|
||||
if (!decompressor) {
|
||||
await initZstd();
|
||||
}
|
||||
return decompressor.decode(compressedArray, n);
|
||||
} catch (e) {
|
||||
console.error("decompress failed: " + e);
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
export function translate(locale: string, text: string): string {
|
||||
const lang = locale.substr(locale.length - 2).toLowerCase();
|
||||
let en = LANGS.en as any;
|
||||
let dict = (LANGS as any)[lang];
|
||||
if (!dict) dict = en;
|
||||
let res = dict[text];
|
||||
if (!res && lang != "en") res = en[text];
|
||||
return res || text;
|
||||
}
|
||||
|
||||
const zCode = "z".charCodeAt(0);
|
||||
const aCode = "a".charCodeAt(0);
|
||||
|
||||
export function mapKey(name: string) {
|
||||
const tmp = KEY_MAP[name];
|
||||
if (!tmp) return undefined;
|
||||
if (tmp.length == 1) {
|
||||
const chr = tmp.charCodeAt(0);
|
||||
if (chr > zCode || chr < aCode)
|
||||
return KeyEvent.fromPartial({ unicode: chr });
|
||||
else return KeyEvent.fromPartial({ chr });
|
||||
}
|
||||
const control_key = controlKeyFromJSON(name);
|
||||
if (control_key == ControlKey.UNRECOGNIZED) {
|
||||
console.error("Unknown control key " + name);
|
||||
}
|
||||
return KeyEvent.fromPartial({ control_key });
|
||||
}
|
||||
|
||||
export async function sleep(ms: number) {
|
||||
await new Promise((r) => setTimeout(r, ms));
|
||||
}
|
@ -4,6 +4,7 @@ import * as rendezvous from "./rendezvous.js";
|
||||
import { loadVp9, loadOpus } from "./codec";
|
||||
import * as sha256 from "fast-sha256";
|
||||
import * as globals from "./globals";
|
||||
import { decompress, mapKey, sleep } from "./common";
|
||||
|
||||
const PORT = 21116;
|
||||
const HOST = "rs-sg.rustdesk.com";
|
||||
@ -65,20 +66,20 @@ export default class Connection {
|
||||
);
|
||||
await ws.open();
|
||||
console.log(new Date() + ": Connected to rendezvoous server");
|
||||
const connType = rendezvous.ConnType.DEFAULT_CONN;
|
||||
const natType = rendezvous.NatType.SYMMETRIC;
|
||||
const punchHoleRequest = rendezvous.PunchHoleRequest.fromPartial({
|
||||
const conn_type = rendezvous.ConnType.DEFAULT_CONN;
|
||||
const nat_type = rendezvous.NatType.SYMMETRIC;
|
||||
const punch_hole_request = rendezvous.PunchHoleRequest.fromPartial({
|
||||
id,
|
||||
licenceKey: localStorage.getItem("key") || undefined,
|
||||
connType,
|
||||
natType,
|
||||
licence_key: localStorage.getItem("key") || undefined,
|
||||
conn_type,
|
||||
nat_type,
|
||||
});
|
||||
ws.sendRendezvous({ punchHoleRequest });
|
||||
ws.sendRendezvous({ punch_hole_request });
|
||||
const msg = ws.parseRendezvous(await ws.next());
|
||||
ws.close();
|
||||
console.log(new Date() + ": Got relay response");
|
||||
const phr = msg.punchHoleResponse;
|
||||
const rr = msg.relayResponse;
|
||||
const phr = msg.punch_hole_response;
|
||||
const rr = msg.relay_response;
|
||||
if (phr) {
|
||||
if (phr.failure != rendezvous.PunchHoleResponse_Failure.UNRECOGNIZED) {
|
||||
switch (phr?.failure) {
|
||||
@ -92,8 +93,8 @@ export default class Connection {
|
||||
this.msgbox("error", "Error", "Key mismatch");
|
||||
break;
|
||||
default:
|
||||
if (phr?.otherFailure) {
|
||||
this.msgbox("error", "Error", phr?.otherFailure);
|
||||
if (phr?.other_failure) {
|
||||
this.msgbox("error", "Error", phr?.other_failure);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -104,7 +105,7 @@ export default class Connection {
|
||||
|
||||
async connectRelay(rr: rendezvous.RelayResponse) {
|
||||
const pk = rr.pk;
|
||||
let uri = rr.relayServer;
|
||||
let uri = rr.relay_server;
|
||||
if (uri) {
|
||||
uri = getrUriFromRs(uri);
|
||||
} else {
|
||||
@ -116,11 +117,11 @@ export default class Connection {
|
||||
await ws.open();
|
||||
console.log(new Date() + ": Connected to relay server");
|
||||
this._ws = ws;
|
||||
const requestRelay = rendezvous.RequestRelay.fromPartial({
|
||||
licenceKey: localStorage.getItem("key") || undefined,
|
||||
const request_relay = rendezvous.RequestRelay.fromPartial({
|
||||
licence_key: localStorage.getItem("key") || undefined,
|
||||
uuid,
|
||||
});
|
||||
ws.sendRendezvous({ requestRelay });
|
||||
ws.sendRendezvous({ request_relay });
|
||||
const secure = (await this.secure(pk)) || false;
|
||||
globals.pushEvent("connection_ready", { secure, direct: false });
|
||||
await this.msgLoop();
|
||||
@ -149,7 +150,7 @@ export default class Connection {
|
||||
return;
|
||||
}
|
||||
const msg = this._ws?.parseMessage(await this._ws?.next());
|
||||
let signedId: any = msg?.signedId;
|
||||
let signedId: any = msg?.signed_id;
|
||||
if (!signedId) {
|
||||
console.error("Handshake failed: invalid message type");
|
||||
this._ws?.sendMessage({});
|
||||
@ -161,8 +162,8 @@ export default class Connection {
|
||||
console.error(e);
|
||||
// fall back to non-secure connection in case pk mismatch
|
||||
console.error("pk mismatch, fall back to non-secure");
|
||||
const publicKey = message.PublicKey.fromPartial({});
|
||||
this._ws?.sendMessage({ publicKey });
|
||||
const public_key = message.PublicKey.fromPartial({});
|
||||
this._ws?.sendMessage({ public_key });
|
||||
return;
|
||||
}
|
||||
signedId = new TextDecoder().decode(signedId!);
|
||||
@ -182,15 +183,16 @@ export default class Connection {
|
||||
this._ws?.sendMessage({});
|
||||
return;
|
||||
}
|
||||
const [mySk, asymmetricValue] = globals.genBoxKeyPair();
|
||||
const secretKey = globals.genSecretKey();
|
||||
const symmetricValue = globals.seal(secretKey, theirPk, mySk);
|
||||
const publicKey = message.PublicKey.fromPartial({
|
||||
asymmetricValue,
|
||||
symmetricValue,
|
||||
const [mySk, asymmetric_value] = globals.genBoxKeyPair();
|
||||
const secret_key = globals.genSecretKey();
|
||||
const symmetric_value = globals.seal(secret_key, theirPk, mySk);
|
||||
const public_key = message.PublicKey.fromPartial({
|
||||
asymmetric_value,
|
||||
symmetric_value,
|
||||
});
|
||||
this._ws?.sendMessage({ publicKey });
|
||||
this._ws?.setSecretKey(secretKey);
|
||||
this._ws?.sendMessage({ public_key });
|
||||
this._ws?.setSecretKey(secret_key);
|
||||
console.log("secured");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -202,35 +204,41 @@ export default class Connection {
|
||||
if (!this._password)
|
||||
this.msgbox("input-password", "Password Required", "");
|
||||
this.login(this._password);
|
||||
} else if (msg?.testDelay) {
|
||||
const testDelay = msg?.testDelay;
|
||||
if (!testDelay.fromClient) {
|
||||
this._ws?.sendMessage({ testDelay });
|
||||
} else if (msg?.test_delay) {
|
||||
const test_delay = msg?.test_delay;
|
||||
if (!test_delay.from_client) {
|
||||
this._ws?.sendMessage({ test_delay });
|
||||
}
|
||||
} else if (msg?.loginResponse) {
|
||||
const r = msg?.loginResponse;
|
||||
} else if (msg?.login_response) {
|
||||
const r = msg?.login_response;
|
||||
if (r.error) {
|
||||
this.msgbox("error", "Error", r.error);
|
||||
} else if (r.peerInfo) {
|
||||
this.handlePeerInfo(r.peerInfo);
|
||||
} else if (r.peer_info) {
|
||||
this.handlePeerInfo(r.peer_info);
|
||||
}
|
||||
} else if (msg?.videoFrame) {
|
||||
this.handleVideoFrame(msg?.videoFrame!);
|
||||
} else if (msg?.video_frame) {
|
||||
this.handleVideoFrame(msg?.video_frame!);
|
||||
} else if (msg?.clipboard) {
|
||||
const cb = msg?.clipboard;
|
||||
if (cb.compress) cb.content = await globals.decompress(cb.content)!;
|
||||
if (cb.compress) {
|
||||
const c = await decompress(cb.content);
|
||||
if (!c) continue;
|
||||
cb.content = c;
|
||||
}
|
||||
globals.pushEvent("clipboard", cb);
|
||||
} else if (msg?.cursorData) {
|
||||
const cd = msg?.cursorData;
|
||||
cd.colors = await globals.decompress(cd.colors)!;
|
||||
} else if (msg?.cursor_data) {
|
||||
const cd = msg?.cursor_data;
|
||||
const c = await decompress(cd.colors);
|
||||
if (!c) continue;
|
||||
cd.colors = c;
|
||||
globals.pushEvent("cursor_data", cd);
|
||||
} else if (msg?.cursorId) {
|
||||
globals.pushEvent("cursor_id", { id: msg?.cursorId });
|
||||
} else if (msg?.cursorPosition) {
|
||||
globals.pushEvent("cursor_position", msg?.cursorPosition);
|
||||
} else if (msg?.cursor_id) {
|
||||
globals.pushEvent("cursor_id", { id: msg?.cursor_id });
|
||||
} else if (msg?.cursor_position) {
|
||||
globals.pushEvent("cursor_position", msg?.cursor_position);
|
||||
} else if (msg?.misc) {
|
||||
this.handleMisc(msg?.misc);
|
||||
} else if (msg?.audioFrame) {
|
||||
} else if (msg?.audio_frame) {
|
||||
//
|
||||
}
|
||||
}
|
||||
@ -254,7 +262,7 @@ export default class Connection {
|
||||
|
||||
refresh() {
|
||||
const misc = message.Misc.fromPartial({
|
||||
refreshVideo: true,
|
||||
refresh_video: true,
|
||||
});
|
||||
this._ws?.sendMessage({ misc });
|
||||
}
|
||||
@ -287,14 +295,14 @@ export default class Connection {
|
||||
}
|
||||
|
||||
_sendLoginMessage(password: Uint8Array | undefined = undefined) {
|
||||
const loginRequest = message.LoginRequest.fromPartial({
|
||||
const login_request = message.LoginRequest.fromPartial({
|
||||
username: this._id!,
|
||||
myId: "web", // to-do
|
||||
myName: "web", // to-do
|
||||
my_id: "web", // to-do
|
||||
my_name: "web", // to-do
|
||||
password,
|
||||
option: this.getOptionMessage(),
|
||||
});
|
||||
this._ws?.sendMessage({ loginRequest });
|
||||
this._ws?.sendMessage({ login_request });
|
||||
}
|
||||
|
||||
getOptionMessage(): message.OptionMessage | undefined {
|
||||
@ -303,27 +311,27 @@ export default class Connection {
|
||||
const q = this.getImageQualityEnum(this._options["image-quality"], true);
|
||||
const yes = message.OptionMessage_BoolOption.Yes;
|
||||
if (q != undefined) {
|
||||
msg.imageQuality = q;
|
||||
msg.image_quality = q;
|
||||
n += 1;
|
||||
}
|
||||
if (this._options["show-remote-cursor"]) {
|
||||
msg.showRemoteCursor = yes;
|
||||
msg.show_remote_cursor = yes;
|
||||
n += 1;
|
||||
}
|
||||
if (this._options["lock-after-session-end"]) {
|
||||
msg.lockAfterSessionEnd = yes;
|
||||
msg.lock_after_session_end = yes;
|
||||
n += 1;
|
||||
}
|
||||
if (this._options["privacy-mode"]) {
|
||||
msg.privacyMode = yes;
|
||||
msg.privacy_mode = yes;
|
||||
n += 1;
|
||||
}
|
||||
if (this._options["disable-audio"]) {
|
||||
msg.disableAudio = yes;
|
||||
msg.disable_audio = yes;
|
||||
n += 1;
|
||||
}
|
||||
if (this._options["disable-clipboard"]) {
|
||||
msg.disableClipboard = yes;
|
||||
msg.disable_clipboard = yes;
|
||||
n += 1;
|
||||
}
|
||||
return n > 0 ? msg : undefined;
|
||||
@ -358,10 +366,10 @@ export default class Connection {
|
||||
}
|
||||
|
||||
handleMisc(misc: message.Misc) {
|
||||
if (misc.audioFormat) {
|
||||
if (misc.audio_format) {
|
||||
//
|
||||
} else if (misc.permissionInfo) {
|
||||
const p = misc.permissionInfo;
|
||||
} else if (misc.permission_info) {
|
||||
const p = misc.permission_info;
|
||||
console.info("Change permission " + p.permission + " -> " + p.enabled);
|
||||
let name;
|
||||
switch (p.permission) {
|
||||
@ -378,10 +386,10 @@ export default class Connection {
|
||||
return;
|
||||
}
|
||||
globals.pushEvent("permission", { [name]: p.enabled });
|
||||
} else if (misc.switchDisplay) {
|
||||
globals.pushEvent("switch_display", misc.switchDisplay);
|
||||
} else if (misc.closeReason) {
|
||||
this.msgbox("error", "Connection Error", misc.closeReason);
|
||||
} else if (misc.switch_display) {
|
||||
globals.pushEvent("switch_display", misc.switch_display);
|
||||
} else if (misc.close_reason) {
|
||||
this.msgbox("error", "Connection Error", misc.close_reason);
|
||||
}
|
||||
}
|
||||
|
||||
@ -397,30 +405,87 @@ export default class Connection {
|
||||
this._options[name] = value;
|
||||
}
|
||||
|
||||
inputKey() {
|
||||
// name: string, x: number, y: number, alt: Boolean, ctrl: Boolean, shift: Boolean, command: Boolean) {
|
||||
}
|
||||
|
||||
inputString(seq: string) {
|
||||
const keyEvent = message.KeyEvent.fromPartial({ seq });
|
||||
this._ws?.sendMessage({ keyEvent });
|
||||
}
|
||||
|
||||
inputMouse(
|
||||
mask: number,
|
||||
x: number,
|
||||
y: number,
|
||||
inputKey(
|
||||
name: string,
|
||||
alt: Boolean,
|
||||
ctrl: Boolean,
|
||||
shift: Boolean,
|
||||
command: Boolean
|
||||
) {
|
||||
const mouseEvent = message.MouseEvent.fromPartial({ mask, x, y });
|
||||
if (alt) mouseEvent.modifiers.push(message.ControlKey.Alt);
|
||||
if (ctrl) mouseEvent.modifiers.push(message.ControlKey.Control);
|
||||
if (shift) mouseEvent.modifiers.push(message.ControlKey.Shift);
|
||||
if (command) mouseEvent.modifiers.push(message.ControlKey.Meta);
|
||||
this._ws?.sendMessage({ mouseEvent });
|
||||
const key_event = mapKey(name);
|
||||
if (!key_event) return;
|
||||
key_event.press = true;
|
||||
key_event.modifiers = this.getMod(alt, ctrl, shift, command);
|
||||
this._ws?.sendMessage({ key_event });
|
||||
}
|
||||
|
||||
ctrlAltDel() {
|
||||
const key_event = message.KeyEvent.fromPartial({ down: true });
|
||||
if (this._peerInfo?.platform == "Windows") {
|
||||
key_event.control_key = message.ControlKey.CtrlAltDel;
|
||||
} else {
|
||||
key_event.control_key = message.ControlKey.Delete;
|
||||
key_event.modifiers = this.getMod(true, true, false, false);
|
||||
}
|
||||
this._ws?.sendMessage({ key_event });
|
||||
}
|
||||
|
||||
inputString(seq: string) {
|
||||
const key_event = message.KeyEvent.fromPartial({ seq });
|
||||
this._ws?.sendMessage({ key_event });
|
||||
}
|
||||
|
||||
switchDisplay(display: number) {
|
||||
const switch_display = message.SwitchDisplay.fromPartial({ display });
|
||||
const misc = message.Misc.fromPartial({ switch_display });
|
||||
this._ws?.sendMessage({ misc });
|
||||
}
|
||||
|
||||
async inputOsPassword(seq: string) {
|
||||
this.inputMouse();
|
||||
await sleep(50);
|
||||
this.inputMouse(0, 3, 3);
|
||||
await sleep(50);
|
||||
this.inputMouse(1 | (1 << 3));
|
||||
this.inputMouse(2 | (1 << 3));
|
||||
await sleep(1200);
|
||||
const key_event = message.KeyEvent.fromPartial({ press: true, seq });
|
||||
this._ws?.sendMessage({ key_event });
|
||||
}
|
||||
|
||||
lockScreen() {
|
||||
const key_event = message.KeyEvent.fromPartial({
|
||||
down: true,
|
||||
control_key: message.ControlKey.LockScreen,
|
||||
});
|
||||
this._ws?.sendMessage({ key_event });
|
||||
}
|
||||
|
||||
getMod(alt: Boolean, ctrl: Boolean, shift: Boolean, command: Boolean) {
|
||||
const mod: message.ControlKey[] = [];
|
||||
if (alt) mod.push(message.ControlKey.Alt);
|
||||
if (ctrl) mod.push(message.ControlKey.Control);
|
||||
if (shift) mod.push(message.ControlKey.Shift);
|
||||
if (command) mod.push(message.ControlKey.Meta);
|
||||
return mod;
|
||||
}
|
||||
|
||||
inputMouse(
|
||||
mask: number = 0,
|
||||
x: number = 0,
|
||||
y: number = 0,
|
||||
alt: Boolean = false,
|
||||
ctrl: Boolean = false,
|
||||
shift: Boolean = false,
|
||||
command: Boolean = false
|
||||
) {
|
||||
const mouse_event = message.MouseEvent.fromPartial({
|
||||
mask,
|
||||
x,
|
||||
y,
|
||||
modifiers: this.getMod(alt, ctrl, shift, command),
|
||||
});
|
||||
this._ws?.sendMessage({ mouse_event });
|
||||
}
|
||||
|
||||
toggleOption(name: string) {
|
||||
@ -431,25 +496,25 @@ export default class Connection {
|
||||
: message.OptionMessage_BoolOption.No;
|
||||
switch (name) {
|
||||
case "show-remote-cursor":
|
||||
option.showRemoteCursor = v2;
|
||||
option.show_remote_cursor = v2;
|
||||
break;
|
||||
case "disable-audio":
|
||||
option.disableAudio = v2;
|
||||
option.disable_audio = v2;
|
||||
break;
|
||||
case "disable-clipboard":
|
||||
option.disableClipboard = v2;
|
||||
option.disable_clipboard = v2;
|
||||
break;
|
||||
case "lock-after-session-end":
|
||||
option.lockAfterSessionEnd = v2;
|
||||
option.lock_after_session_end = v2;
|
||||
break;
|
||||
case "privacy-mode":
|
||||
option.privacyMode = v2;
|
||||
option.privacy_mode = v2;
|
||||
break;
|
||||
case "block-input":
|
||||
option.blockInput = message.OptionMessage_BoolOption.Yes;
|
||||
option.block_input = message.OptionMessage_BoolOption.Yes;
|
||||
break;
|
||||
case "unblock-input":
|
||||
option.blockInput = message.OptionMessage_BoolOption.No;
|
||||
option.block_input = message.OptionMessage_BoolOption.No;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
@ -477,9 +542,9 @@ export default class Connection {
|
||||
|
||||
setImageQuality(value: string) {
|
||||
this.setOption("image-quality", value);
|
||||
const imageQuality = this.getImageQualityEnum(value, false);
|
||||
if (imageQuality == undefined) return;
|
||||
const option = message.OptionMessage.fromPartial({ imageQuality });
|
||||
const image_quality = this.getImageQualityEnum(value, false);
|
||||
if (image_quality == undefined) return;
|
||||
const option = message.OptionMessage.fromPartial({ image_quality });
|
||||
const misc = message.Misc.fromPartial({ option });
|
||||
this._ws?.sendMessage({ misc });
|
||||
}
|
||||
|
743
src/gen_js_from_hbb.ts
Normal file
743
src/gen_js_from_hbb.ts
Normal file
@ -0,0 +1,743 @@
|
||||
export const LANGS = {
|
||||
cn: {
|
||||
"Status": "状态",
|
||||
"Your Desktop": "你的桌面",
|
||||
"desk_tip": "你的桌面可以通过下面的ID和密码访问。",
|
||||
"Password": "密码",
|
||||
"Ready": "就绪",
|
||||
"connecting_status": "正在接入RustDesk网络...",
|
||||
"Enable Service": "允许服务",
|
||||
"Start Service": "启动服务",
|
||||
"Service is not running": "服务没有启动",
|
||||
"not_ready_status": "未就绪,请检查网络连接",
|
||||
"Control Remote Desktop": "控制远程桌面",
|
||||
"Transfer File": "传输文件",
|
||||
"Connect": "连接",
|
||||
"Recent Sessions": "最近访问过",
|
||||
"Address Book": "地址簿",
|
||||
"Confirmation": "确认",
|
||||
"TCP Tunneling": "TCP隧道",
|
||||
"Remove": "删除",
|
||||
"Refresh random password": "刷新随机密码",
|
||||
"Set your own password": "设置密码",
|
||||
"Enable Keyboard/Mouse": "允许控制键盘/鼠标",
|
||||
"Enable Clipboard": "允许同步剪贴板",
|
||||
"Enable File Transfer": "允许传输文件",
|
||||
"Enable TCP Tunneling": "允许建立TCP隧道",
|
||||
"IP Whitelisting": "IP白名单",
|
||||
"ID/Relay Server": "ID/中继服务器",
|
||||
"Stop service": "停止服务",
|
||||
"Change ID": "改变ID",
|
||||
"Website": "网站",
|
||||
"About": "关于",
|
||||
"Mute": "静音",
|
||||
"Audio Input": "音频输入",
|
||||
"ID Server": "ID服务器",
|
||||
"Relay Server": "中继服务器",
|
||||
"API Server": "API服务器",
|
||||
"invalid_http": "必须以http://或者https://开头",
|
||||
"Invalid IP": "无效IP",
|
||||
"id_change_tip": "只可以使用字母a-z, A-Z, 0-9, _ (下划线)。首字母必须是a-z, A-Z。长度在6与16之间。",
|
||||
"Invalid format": "无效格式",
|
||||
"This function is turned off by the server": "服务器关闭了此功能",
|
||||
"Not available": "已被占用",
|
||||
"Too frequent": "修改太频繁,请稍后再试",
|
||||
"Cancel": "取消",
|
||||
"Skip": "跳过",
|
||||
"Close": "关闭",
|
||||
"Retry": "再试",
|
||||
"OK": "确认",
|
||||
"Password Required": "需要密码",
|
||||
"Please enter your password": "请输入密码",
|
||||
"Remember password": "记住密码",
|
||||
"Wrong Password": "密码错误",
|
||||
"Do you want to enter again?": "还想输入一次吗?",
|
||||
"Connection Error": "连接错误",
|
||||
"Error": "错误",
|
||||
"Reset by the peer": "连接被对方关闭",
|
||||
"Connecting...": "正在连接...",
|
||||
"Connection in progress. Please wait.": "连接进行中,请稍等。",
|
||||
"Please try 1 minute later": "一分钟后再试",
|
||||
"Login Error": "登录错误",
|
||||
"Successful": "成功",
|
||||
"Connected, waiting for image...": "已连接,等待画面传输...",
|
||||
"Name": "文件名",
|
||||
"Modified": "修改时间",
|
||||
"Size": "大小",
|
||||
"Show Hidden Files": "显示隐藏文件",
|
||||
"Receive": "接受",
|
||||
"Send": "发送",
|
||||
"Remote Computer": "远程电脑",
|
||||
"Local Computer": "本地电脑",
|
||||
"Confirm Delete": "确认删除",
|
||||
"Are you sure you want to delete this file?": "是否删除此文件?",
|
||||
"Do this for all conflicts": "应用于其它冲突",
|
||||
"Deleting": "正在删除",
|
||||
"files": "文件",
|
||||
"Waiting": "等待...",
|
||||
"Finished": "完成",
|
||||
"Custom Image Quality": "设置画面质量",
|
||||
"Privacy mode": "隐私模式",
|
||||
"Block user input": "阻止用户输入",
|
||||
"Unblock user input": "取消阻止用户输入",
|
||||
"Adjust Window": "调节窗口",
|
||||
"Original": "原始比例",
|
||||
"Shrink": "收缩",
|
||||
"Stretch": "伸展",
|
||||
"Good image quality": "好画质",
|
||||
"Balanced": "一般画质",
|
||||
"Optimize reaction time": "优化反应时间",
|
||||
"Custom": "自定义画质",
|
||||
"Show remote cursor": "显示远程光标",
|
||||
"Disable clipboard": "禁止剪贴板",
|
||||
"Lock after session end": "断开后锁定远程电脑",
|
||||
"Insert": "插入",
|
||||
"Insert Lock": "锁定远程电脑",
|
||||
"Refresh": "刷新画面",
|
||||
"ID does not exist": "ID不存在",
|
||||
"Failed to connect to rendezvous server": "连接注册服务器失败",
|
||||
"Please try later": "请稍后再试",
|
||||
"Remote desktop is offline": "远程电脑不在线",
|
||||
"Key mismatch": "Key不匹配",
|
||||
"Timeout": "连接超时",
|
||||
"Failed to connect to relay server": "无法连接到中继服务器",
|
||||
"Failed to connect via rendezvous server": "无法通过注册服务器建立连接",
|
||||
"Failed to connect via relay server": "无法通过中继服务器建立连接",
|
||||
"Failed to make direct connection to remote desktop": "无法建立直接连接",
|
||||
"Set Password": "设置密码",
|
||||
"OS Password": "操作系统密码",
|
||||
"install_tip": "你正在运行未安装版本,由于UAC限制,作为被控端,会在某些情况下无法控制鼠标键盘,或者录制屏幕,请点击下面的按钮将RustDesk安装到系统,从而规避上述问题。",
|
||||
"Click to upgrade": "点击这里升级",
|
||||
"Click to download": "点击这里下载",
|
||||
"Click to update": "点击这里更新",
|
||||
"Configuration Permissions": "配置权限",
|
||||
"Configure": "配置",
|
||||
"config_acc": "为了能够远程控制你的桌面, 请给予RustDesk\"辅助功能\" 权限。",
|
||||
"config_screen": "为了能够远程访问你的桌面, 请给予RustDesk\"屏幕录制\" 权限。",
|
||||
"Installing ...": "安装 ...",
|
||||
"Install": "安装",
|
||||
"Installation": "安装",
|
||||
"Installation Path": "安装路径",
|
||||
"Create start menu shortcuts": "创建启动菜单快捷方式",
|
||||
"Create desktop icon": "创建桌面图标",
|
||||
"agreement_tip": "开始安装即表示接受许可协议。",
|
||||
"Accept and Install": "同意并安装",
|
||||
"End-user license agreement": "用户协议",
|
||||
"Generating ...": "正在产生 ...",
|
||||
"Your installation is lower version.": "你安装的版本比当前运行的低。",
|
||||
"not_close_tcp_tip": "请在使用隧道的时候,不要关闭本窗口",
|
||||
"Listening ...": "正在等待隧道连接 ...",
|
||||
"Remote Host": "远程主机",
|
||||
"Remote Port": "远程端口",
|
||||
"Action": "动作",
|
||||
"Add": "添加",
|
||||
"Local Port": "本地端口",
|
||||
"setup_server_tip": "如果需要更快连接速度,你可以选择自建服务器",
|
||||
"Too short, at least 6 characters.": "太短了,至少6个字符",
|
||||
"The confirmation is not identical.": "两次输入不匹配",
|
||||
"Permissions": "权限",
|
||||
"Accept": "接受",
|
||||
"Dismiss": "拒绝",
|
||||
"Disconnect": "断开连接",
|
||||
"Allow using keyboard and mouse": "允许使用键盘鼠标",
|
||||
"Allow using clipboard": "允许使用剪贴板",
|
||||
"Allow hearing sound": "允许听到声音",
|
||||
"Connected": "已经连接",
|
||||
"Direct and encrypted connection": "加密直连",
|
||||
"Relayed and encrypted connection": "加密中继连接",
|
||||
"Direct and unencrypted connection": "非加密直连",
|
||||
"Relayed and unencrypted connection": "非加密中继连接",
|
||||
"Enter Remote ID": "输入对方ID",
|
||||
"Enter your password": "输入密码",
|
||||
"Logging in...": "正在登录...",
|
||||
"Enable RDP session sharing": "允许RDP会话共享",
|
||||
"Auto Login": "自动登录(设置断开后锁定才有效)",
|
||||
"Enable Direct IP Access": "允许IP直接访问",
|
||||
"Rename": "改名",
|
||||
"Space": "空格",
|
||||
"Create Desktop Shortcut": "创建桌面快捷方式",
|
||||
"Change Path": "改变路径",
|
||||
"Create Folder": "创建文件夹",
|
||||
"Please enter the folder name": "请输入文件夹名称",
|
||||
"Fix it": "修复",
|
||||
"Warning": "警告",
|
||||
"Login screen using Wayland is not supported": "不支持使用 Wayland 登录界面",
|
||||
"Reboot required": "重启后才能生效",
|
||||
"Unsupported display server ": "不支持当前显示服务器",
|
||||
"x11 expected": "请切换到 x11",
|
||||
"Port": "端口",
|
||||
"Settings": "设置",
|
||||
"Username": " 用户名",
|
||||
"Invalid port": "无效端口",
|
||||
"Closed manually by the peer": "被对方手动关闭",
|
||||
"Enable remote configuration modification": "允许远程修改配置",
|
||||
"Run without install": "无安装运行",
|
||||
"Always connected via relay": "强制走中继连接",
|
||||
"Always connect via relay": "强制走中继连接",
|
||||
"whitelist_tip": "只有白名单里的ip才能访问我",
|
||||
"Login": "登录",
|
||||
"Logout": "登出",
|
||||
"Tags": "标签",
|
||||
"Search ID": "查找ID",
|
||||
"Current Wayland display server is not supported": "不支持 Wayland 显示服务器",
|
||||
"whitelist_sep": "可以使用逗号,分号,空格或者换行符作为分隔符",
|
||||
"Add ID": "增加ID",
|
||||
"Add Tag": "增加标签",
|
||||
"Unselect all tags": "取消选择所有标签",
|
||||
"Network error": "网络错误",
|
||||
"Username missed": "用户名没有填写",
|
||||
"Password missed": "密码没有填写",
|
||||
"Wrong credentials": "用户名或者密码错误",
|
||||
"Edit Tag": "修改标签",
|
||||
"Unremember Password": "忘掉密码",
|
||||
"Favorites": "收藏",
|
||||
"Add to Favorites": "加入到收藏",
|
||||
"Remove from Favorites": "从收藏中删除",
|
||||
"Empty": "空空如也",
|
||||
"Invalid folder name": "无效文件夹名称",
|
||||
"Socks5 Proxy": "Socks5 代理",
|
||||
"Hostname": "主机名",
|
||||
"Discovered": "已发现",
|
||||
"install_daemon_tip": "为了开机启动,请安装系统服务。",
|
||||
},
|
||||
it: {
|
||||
"Status": "Stato",
|
||||
"Your Desktop": "Il tuo desktop",
|
||||
"desk_tip": "Puoi accedere al tuo desktop usando l'ID e la password riportati qui.",
|
||||
"Password": "Password",
|
||||
"Ready": "Pronto",
|
||||
"connecting_status": "Connessione alla rete RustDesk in corso...",
|
||||
"Enable Service": "Abilita servizio",
|
||||
"Start Service": "Avvia servizio",
|
||||
"Service is not running": "Il servizio non è in esecuzione",
|
||||
"not_ready_status": "Non pronto. Verifica la tua connessione",
|
||||
"Control Remote Desktop": "Controlla una scrivania remota",
|
||||
"Transfer File": "Trasferisci file",
|
||||
"Connect": "Connetti",
|
||||
"Recent Sessions": "Sessioni recenti",
|
||||
"Address Book": "Rubrica",
|
||||
"Confirmation": "Conferma",
|
||||
"TCP Tunneling": "Tunnel TCP",
|
||||
"Remove": "Rimuovi",
|
||||
"Refresh random password": "Nuova password casuale",
|
||||
"Set your own password": "Imposta la tua password",
|
||||
"Enable Keyboard/Mouse": "Abilita tastiera/mouse",
|
||||
"Enable Clipboard": "Abilita appunti",
|
||||
"Enable File Transfer": "Abilita trasferimento file",
|
||||
"Enable TCP Tunneling": "Abilita tunnel TCP",
|
||||
"IP Whitelisting": "IP autorizzati",
|
||||
"ID/Relay Server": "Server ID/Relay",
|
||||
"Stop service": "Arresta servizio",
|
||||
"Change ID": "Cambia ID",
|
||||
"Website": "Sito web",
|
||||
"About": "Informazioni",
|
||||
"Mute": "Silenzia",
|
||||
"Audio Input": "Input audio",
|
||||
"ID Server": "ID server",
|
||||
"Relay Server": "Server relay",
|
||||
"API Server": "Server API",
|
||||
"invalid_http": "deve iniziare con http:// o https://",
|
||||
"Invalid IP": "Indirizzo IP non valido",
|
||||
"id_change_tip": "Puoi usare solo i caratteri a-z, A-Z, 0-9 e _ (underscore). Il primo carattere deve essere a-z o A-Z. La lunghezza deve essere fra 6 e 16 caratteri.",
|
||||
"Invalid format": "Formato non valido",
|
||||
"This function is turned off by the server": "Questa funzione è disabilitata sul server",
|
||||
"Not available": "Non disponibile",
|
||||
"Too frequent": "Troppo frequente",
|
||||
"Cancel": "Annulla",
|
||||
"Skip": "Ignora",
|
||||
"Close": "Chiudi",
|
||||
"Retry": "Riprova",
|
||||
"OK": "OK",
|
||||
"Password Required": "Password richiesta",
|
||||
"Please enter your password": "Inserisci la tua password",
|
||||
"Remember password": "Ricorda password",
|
||||
"Wrong Password": "Password errata",
|
||||
"Do you want to enter again?": "Vuoi riprovare?",
|
||||
"Connection Error": "Errore di connessione",
|
||||
"Error": "Errore",
|
||||
"Reset by the peer": "Reimpostata dal peer",
|
||||
"Connecting...": "Connessione...",
|
||||
"Connection in progress. Please wait.": "Connessione in corso. Attendi.",
|
||||
"Please try 1 minute later": "Per favore riprova fra 1 minuto",
|
||||
"Login Error": "Errore di login",
|
||||
"Successful": "Successo",
|
||||
"Connected, waiting for image...": "Connesso, in attesa dell'immagine...",
|
||||
"Name": "Nome",
|
||||
"Modified": "Modificato",
|
||||
"Size": "Dimensione",
|
||||
"Show Hidden Files": "Mostra file nascosti",
|
||||
"Receive": "Ricevi",
|
||||
"Send": "Invia",
|
||||
"Remote Computer": "Computer remoto",
|
||||
"Local Computer": "Computer locale",
|
||||
"Confirm Delete": "Conferma cancellazione",
|
||||
"Are you sure you want to delete this file?": "Vuoi davvero eliminare questo file?",
|
||||
"Do this for all conflicts": "Ricorca questa scelta per tutti i conflitti",
|
||||
"Deleting": "Cancellazione di",
|
||||
"files": "file",
|
||||
"Waiting": "In attesa",
|
||||
"Finished": "Terminato",
|
||||
"Custom Image Quality": "Qualità immagine personalizzata",
|
||||
"Privacy mode": "Modalità privacy",
|
||||
"Block user input": "Blocca l'input dell'utente",
|
||||
"Unblock user input": "Sbloccare l'input dell'utente",
|
||||
"Adjust Window": "Adatta la finestra",
|
||||
"Original": "Originale",
|
||||
"Shrink": "Restringi",
|
||||
"Stretch": "Allarga",
|
||||
"Good image quality": "Buona qualità immagine",
|
||||
"Balanced": "Bilanciato",
|
||||
"Optimize reaction time": "Ottimizza il tempo di reazione",
|
||||
"Custom": "Personalizzato",
|
||||
"Show remote cursor": "Mostra il cursore remoto",
|
||||
"Disable clipboard": "Disabilita appunti",
|
||||
"Lock after session end": "Blocca al termine della sessione",
|
||||
"Insert": "Inserisci",
|
||||
"Insert Lock": "Blocco inserimento",
|
||||
"Refresh": "Aggiorna",
|
||||
"ID does not exist": "L'ID non esiste",
|
||||
"Failed to connect to rendezvous server": "Errore di connessione al server rendezvous",
|
||||
"Please try later": "Riprova più tardi",
|
||||
"Remote desktop is offline": "Il desktop remoto è offline",
|
||||
"Key mismatch": "La chiave non corrisponde",
|
||||
"Timeout": "Timeout",
|
||||
"Failed to connect to relay server": "Errore di connessione al server relay",
|
||||
"Failed to connect via rendezvous server": "Errore di connessione tramite il server rendezvous",
|
||||
"Failed to connect via relay server": "Errore di connessione tramite il server relay",
|
||||
"Failed to make direct connection to remote desktop": "Impossibile connettersi direttamente al desktop remoto",
|
||||
"Set Password": "Imposta password",
|
||||
"OS Password": "Password del sistema operativo",
|
||||
"install_tip": "A causa del Controllo Account Utente, RustDesk potrebbe non funzionare correttamente come desktop remoto. Per evitare questo problema, fai click sul tasto qui sotto per installare RustDesk a livello di sistema.",
|
||||
"Click to upgrade": "Fai click per aggiornare",
|
||||
"Click to download": "Cliquez per scaricare",
|
||||
"Click to update": "Fare clic per aggiornare",
|
||||
"Configuration Permissions": "Permessi di configurazione",
|
||||
"Configure": "Configura",
|
||||
"config_acc": "Per controllare il tuo desktop dall'esterno, devi fornire a RustDesk il permesso \"Accessibilità\".",
|
||||
"config_screen": "Per controllare il tuo desktop dall'esterno, devi fornire a RustDesk il permesso \"Registrazione schermo\".",
|
||||
"Installing ...": "Installazione ...",
|
||||
"Install": "Installa",
|
||||
"Installation": "Installazione",
|
||||
"Installation Path": "Percorso di installazione",
|
||||
"Create start menu shortcuts": "Crea i collegamenti nel menu di avvio",
|
||||
"Create desktop icon": "Crea un'icona sul desktop",
|
||||
"agreement_tip": "Avviando l'installazione, accetti i termini del contratto di licenza.",
|
||||
"Accept and Install": "Accetta e installa",
|
||||
"End-user license agreement": "Contratto di licenza con l'utente finale",
|
||||
"Generating ...": "Generazione ...",
|
||||
"Your installation is lower version.": "La tua installazione non è aggiornata.",
|
||||
"not_close_tcp_tip": "Non chiudere questa finestra mentre stai usando il tunnel",
|
||||
"Listening ...": "In ascolto ...",
|
||||
"Remote Host": "Host remoto",
|
||||
"Remote Port": "Porta remota",
|
||||
"Action": "Azione",
|
||||
"Add": "Aggiungi",
|
||||
"Local Port": "Porta locale",
|
||||
"setup_server_tip": "Per una connessione più veloce, configura un tuo server",
|
||||
"Too short, at least 6 characters.": "Troppo breve, almeno 6 caratteri",
|
||||
"The confirmation is not identical.": "La conferma non corrisponde",
|
||||
"Permissions": "Permessi",
|
||||
"Accept": "Accetta",
|
||||
"Dismiss": "Rifiuta",
|
||||
"Disconnect": "Disconnetti",
|
||||
"Allow using keyboard and mouse": "Consenti l'uso di tastiera e mouse",
|
||||
"Allow using clipboard": "Consenti l'uso degli appunti",
|
||||
"Allow hearing sound": "Consenti la riproduzione dell'audio",
|
||||
"Connected": "Connesso",
|
||||
"Direct and encrypted connection": "Connessione diretta e cifrata",
|
||||
"Relayed and encrypted connection": "Connessione tramite relay e cifrata",
|
||||
"Direct and unencrypted connection": "Connessione diretta e non cifrata",
|
||||
"Relayed and unencrypted connection": "Connessione tramite relay e non cifrata",
|
||||
"Enter Remote ID": "Inserisci l'ID remoto",
|
||||
"Enter your password": "Inserisci la tua password",
|
||||
"Logging in...": "Autenticazione...",
|
||||
"Enable RDP session sharing": "Abilita la condivisione della sessione RDP",
|
||||
"Auto Login": "Login automatico",
|
||||
"Enable Direct IP Access": "Abilita l'accesso diretto tramite IP",
|
||||
"Rename": "Rinomina",
|
||||
"Space": "Spazio",
|
||||
"Create Desktop Shortcut": "Crea collegamento sul desktop",
|
||||
"Change Path": "Cambia percorso",
|
||||
"Create Folder": "Crea cartella",
|
||||
"Please enter the folder name": "Inserisci il nome della cartella",
|
||||
"Fix it": "Risolvi",
|
||||
"Warning": "Avviso",
|
||||
"Login screen using Wayland is not supported": "La schermata di login non è supportata utilizzando Wayland",
|
||||
"Reboot required": "Riavvio necessario",
|
||||
"Unsupported display server ": "Display server non supportato",
|
||||
"x11 expected": "x11 necessario",
|
||||
"Port": "Porta",
|
||||
"Settings": "Impostazioni",
|
||||
"Username": " Nome utente",
|
||||
"Invalid port": "Porta non valida",
|
||||
"Closed manually by the peer": "Chiuso manualmente dal peer",
|
||||
"Enable remote configuration modification": "Abilita la modifica remota della configurazione",
|
||||
"Run without install": "Avvia senza installare",
|
||||
"Always connected via relay": "Connesso sempre tramite relay",
|
||||
"Always connect via relay": "Connetti sempre tramite relay",
|
||||
"whitelist_tip": "Solo gli indirizzi IP autorizzati possono connettersi a questo desktop",
|
||||
"Login": "Accedi",
|
||||
"Logout": "Esci",
|
||||
"Tags": "Tag",
|
||||
"Search ID": "Cerca ID",
|
||||
"Current Wayland display server is not supported": "Questo display server Wayland non è supportato",
|
||||
"whitelist_sep": "Separati da virgola, punto e virgola, spazio o a capo",
|
||||
"Add ID": "Aggiungi ID",
|
||||
"Add Tag": "Aggiungi tag",
|
||||
"Unselect all tags": "Deseleziona tutti i tag",
|
||||
"Network error": "Errore di rete",
|
||||
"Username missed": "Nome utente dimenticato",
|
||||
"Password missed": "Password dimenticata",
|
||||
"Wrong credentials": "Credenziali errate",
|
||||
"Edit Tag": "Modifica tag",
|
||||
"Invalid folder name": "Nome della cartella non valido",
|
||||
"Hostname": "Nome host",
|
||||
"Discovered": "Scoperto",
|
||||
},
|
||||
en: {
|
||||
"desk_tip": "Your desktop can be accessed with this ID and password.",
|
||||
"connecting_status": "Connecting to the RustDesk network...",
|
||||
"not_ready_status": "Not ready. Please check your connection",
|
||||
"id_change_tip": "Only a-z, A-Z, 0-9 and _ (underscore) characters allowed. The first letter must be a-z, A-Z. Length between 6 and 16.",
|
||||
"install_tip": "Due to UAC, RustDesk can not work properly as the remote side in some cases. To avoid UAC, please click the button below to install RustDesk to the system.",
|
||||
"config_acc": "In order to control your Desktop remotely, you need to grant RustDesk \"Accessibility\" permissions.",
|
||||
"config_screen": "In order to access your Desktop remotely, you need to grant RustDesk \"Screen Recording\" permissions.",
|
||||
"agreement_tip": "By starting the installation, you accept the license agreement.",
|
||||
"not_close_tcp_tip": "Don't close this window while you are using the tunnel",
|
||||
"setup_server_tip": "For faster connection, please set up your own server",
|
||||
"Auto Login": "Auto Login (Only valid if you set \"Lock after session end\")",
|
||||
"whitelist_tip": "Only whitelisted IP can access me",
|
||||
"whitelist_sep": "Seperated by comma, semicolon, spaces or new line",
|
||||
"Wrong credentials": "Wrong username or password",
|
||||
"invalid_http": "must start with http:// or https://",
|
||||
"install_daemon_tip": "For starting on boot, you need to install system service.",
|
||||
},
|
||||
fr: {
|
||||
"Status": "Statut",
|
||||
"Your Desktop": "Votre bureau",
|
||||
"desk_tip": "Votre bureau est accessible via l'identifiant et le mot de passe ci-dessous.",
|
||||
"Password": "Mot de passe",
|
||||
"Ready": "Prêt",
|
||||
"connecting_status": "Connexion au réseau RustDesk...",
|
||||
"Enable Service": "Autoriser le service",
|
||||
"Start Service": "Démarrer le service",
|
||||
"Service is not running": "Le service ne fonctionne pas",
|
||||
"not_ready_status": "Pas prêt, veuillez vérifier la connexion réseau",
|
||||
"Control Remote Desktop": "Contrôler le bureau à distance",
|
||||
"Transfer File": "Transférer le fichier",
|
||||
"Connect": "Connecter",
|
||||
"Recent Sessions": "Sessions récentes",
|
||||
"Address Book": "Carnet d'adresses",
|
||||
"Confirmation": "Confirmation",
|
||||
"TCP Tunneling": "Tunneling TCP",
|
||||
"Remove": "Supprimer",
|
||||
"Refresh random password": "Actualiser le mot de passe aléatoire",
|
||||
"Set your own password": "Définir votre propre mot de passe",
|
||||
"Enable Keyboard/Mouse": "Activer le contrôle clavier/souris",
|
||||
"Enable Clipboard": "Activer la synchronisation du presse-papiers",
|
||||
"Enable File Transfer": "Activer le transfert de fichiers",
|
||||
"Enable TCP Tunneling": "Activer le tunneling TCP",
|
||||
"IP Whitelisting": "Liste blanche IP",
|
||||
"ID/Relay Server": "ID/Serveur Relais",
|
||||
"Stop service": "Arrêter service",
|
||||
"Change ID": "Changer d'ID",
|
||||
"Website": "Site Web",
|
||||
"About": "Sur",
|
||||
"Mute": "Muet",
|
||||
"Audio Input": "Entrée audio",
|
||||
"ID Server": "Serveur ID",
|
||||
"Relay Server": "Serveur Relais",
|
||||
"API Server": "Serveur API",
|
||||
"invalid_http": "Doit commencer par http:// ou https://",
|
||||
"Invalid IP": "IP invalide",
|
||||
"id_change_tip": "Seules les lettres a-z, A-Z, 0-9, _ (trait de soulignement) peuvent être utilisées. La première lettre doit être a-z, A-Z. La longueur est comprise entre 6 et 16.",
|
||||
"Invalid format": "Format invalide",
|
||||
"This function is turned off by the server": "Cette fonction est désactivée par le serveur",
|
||||
"Not available": "Indisponible",
|
||||
"Too frequent": "Modifier trop fréquemment, veuillez réessayer plus tard",
|
||||
"Cancel": "Annuler",
|
||||
"Skip": "Ignorer",
|
||||
"Close": "Fermer",
|
||||
"Retry": "Réessayer",
|
||||
"OK": "Confirmer",
|
||||
"Password Required": "Mot de passe requis",
|
||||
"Please enter your password": "Veuillez saisir votre mot de passe",
|
||||
"Remember password": "Mémoriser le mot de passe",
|
||||
"Wrong Password": "Mauvais mot de passe",
|
||||
"Do you want to enter again?": "Voulez-vous participer à nouveau?",
|
||||
"Connection Error": "Erreur de connexion",
|
||||
"Error": "Erreur",
|
||||
"Reset by the peer": "La connexion a été fermée par le pair",
|
||||
"Connecting...": "Connexion...",
|
||||
"Connection in progress. Please wait.": "Connexion en cours. Veuillez patienter.",
|
||||
"Please try 1 minute later": "Réessayez dans une minute",
|
||||
"Login Error": "Erreur de connexion",
|
||||
"Successful": "Succès",
|
||||
"Connected, waiting for image...": "Connecté, en attente de transmission d'image...",
|
||||
"Name": "Nom du fichier",
|
||||
"Modified": "Modifié",
|
||||
"Size": "Taille",
|
||||
"Show Hidden Files": "Afficher les fichiers cachés",
|
||||
"Receive": "Accepter",
|
||||
"Send": "Envoyer",
|
||||
"Remote Computer": "Ordinateur distant",
|
||||
"Local Computer": "Ordinateur local",
|
||||
"Confirm Delete": "Confirmer la suppression",
|
||||
"Are you sure you want to delete this file?": "Voulez-vous vraiment supprimer ce fichier?",
|
||||
"Do this for all conflicts": "Appliquer à d'autres conflits",
|
||||
"Deleting": "Suppression",
|
||||
"files": "fichier",
|
||||
"Waiting": "En attente en attente...",
|
||||
"Finished": "Terminé",
|
||||
"Custom Image Quality": "Définir la qualité d'image",
|
||||
"Privacy mode": "Mode privé",
|
||||
"Block user input": "Bloquer la saisie de l'utilisateur",
|
||||
"Unblock user input": "Débloquer l'entrée de l'utilisateur",
|
||||
"Adjust Window": "Ajuster la fenêtre",
|
||||
"Original": "Ratio d'origine",
|
||||
"Shrink": "Rétréci",
|
||||
"Stretch": "Étirer",
|
||||
"Good image quality": "Bonne qualité d'image",
|
||||
"Balanced": "Qualité d'image normale",
|
||||
"Optimize reaction time": "Optimiser le temps de réaction",
|
||||
"Custom": "Qualité d'image personnalisée",
|
||||
"Show remote cursor": "Afficher le curseur distant",
|
||||
"Disable clipboard": "Désactiver le presse-papiers",
|
||||
"Lock after session end": "Verrouiller l'ordinateur distant après la déconnexion",
|
||||
"Insert": "Insérer",
|
||||
"Insert Lock": "Verrouiller l'ordinateur distant",
|
||||
"Refresh": "Rafraîchir l'écran",
|
||||
"ID does not exist": "L'ID n'existe pas",
|
||||
"Failed to connect to rendezvous server": "Échec de la connexion au serveur de rendez-vous",
|
||||
"Please try later": "Veuillez essayer plus tard",
|
||||
"Remote desktop is offline": "Le bureau à distance est hors ligne",
|
||||
"Key mismatch": "Discordance de clé",
|
||||
"Timeout": "Connexion expirée",
|
||||
"Failed to connect to relay server": "Échec de la connexion au serveur relais",
|
||||
"Failed to connect via rendezvous server": "Échec de l'établissement d'une connexion via le serveur de rendez-vous",
|
||||
"Failed to connect via relay server": "Impossible d'établir une connexion via le serveur relais",
|
||||
"Failed to make direct connection to remote desktop": "Impossible d'établir une connexion directe",
|
||||
"Set Password": "Définir le mot de passe",
|
||||
"OS Password": "Mot de passe du système d'exploitation",
|
||||
"install_tip": "Vous utilisez une version désinstallée. En raison des restrictions UAC, en tant que terminal contrôlé, dans certains cas, il ne sera pas en mesure de contrôler la souris et le clavier ou d'enregistrer l'écran. Veuillez cliquer sur le bouton ci-dessous pour installer RustDesk au système pour éviter la question ci-dessus.",
|
||||
"Click to upgrade": "Cliquez pour mettre à niveau",
|
||||
"Click to download": "Cliquez pour télécharger",
|
||||
"Click to update": "Cliquez pour mettre à jour",
|
||||
"Configuration Permissions": "Autorisations de configuration",
|
||||
"Configure": "Configurer",
|
||||
"config_acc": "Afin de pouvoir contrôler votre bureau à distance, veuillez donner l'autorisation\"accessibilité\" à RustDesk.",
|
||||
"config_screen": "Afin de pouvoir accéder à votre bureau à distance, veuillez donner l'autorisation à RustDesk\"enregistrement d'écran\".",
|
||||
"Installing ...": "Installation ...",
|
||||
"Install": "Installer",
|
||||
"Installation": "Installation",
|
||||
"Installation Path": "Chemin d'installation",
|
||||
"Create start menu shortcuts": "Créer des raccourcis dans le menu démarrer",
|
||||
"Create desktop icon": "Créer une icône sur le bureau",
|
||||
"agreement_tip": "Démarrer l'installation signifie accepter le contrat de licence.",
|
||||
"Accept and Install": "Accepter et installer",
|
||||
"End-user license agreement": "Contrat d'utilisateur",
|
||||
"Generating ...": "Génération ...",
|
||||
"Your installation is lower version.": "La version que vous avez installée est inférieure à la version en cours d'exécution.",
|
||||
"not_close_tcp_tip": "Veuillez ne pas fermer cette fenêtre lors de l'utilisation du tunnel",
|
||||
"Listening ...": "En attente de connexion tunnel...",
|
||||
"Remote Host": "Hôte distant",
|
||||
"Remote Port": "Port distant",
|
||||
"Action": "Action",
|
||||
"Add": "Ajouter",
|
||||
"Local Port": "Port local",
|
||||
"setup_server_tip": "Si vous avez besoin d'une vitesse de connexion plus rapide, vous pouvez choisir de créer votre propre serveur",
|
||||
"Too short, at least 6 characters.": "Trop court, au moins 6 caractères.",
|
||||
"The confirmation is not identical.": "Les deux entrées ne correspondent pas",
|
||||
"Permissions": "Autorisations",
|
||||
"Accept": "Accepter",
|
||||
"Dismiss": "Rejeter",
|
||||
"Disconnect": "Déconnecter",
|
||||
"Allow using keyboard and mouse": "Autoriser l'utilisation du clavier et de la souris",
|
||||
"Allow using clipboard": "Autoriser l'utilisation du presse-papiers",
|
||||
"Allow hearing sound": "Autoriser l'audition du son",
|
||||
"Connected": "Connecté",
|
||||
"Direct and encrypted connection": "Connexion directe cryptée",
|
||||
"Relayed and encrypted connection": "Connexion relais cryptée",
|
||||
"Direct and unencrypted connection": "Connexion directe non cryptée",
|
||||
"Relayed and unencrypted connection": "Connexion relais non cryptée",
|
||||
"Enter Remote ID": "Entrez l'ID à distance",
|
||||
"Enter your password": "Entrez votre mot de passe",
|
||||
"Logging in...": "Se connecter...",
|
||||
"Enable RDP session sharing": "Activer le partage de session RDP",
|
||||
"Auto Login": "Connexion automatique (le verrouillage ne sera effectif qu'après la déconnexion du paramètre)",
|
||||
"Enable Direct IP Access": "Autoriser l'accès direct IP",
|
||||
"Rename": "Renommer",
|
||||
"Space": "Espace",
|
||||
"Create Desktop Shortcut": "Créer un raccourci sur le bureau",
|
||||
"Change Path": "Changer de chemin",
|
||||
"Create Folder": "Créer un dossier",
|
||||
"Please enter the folder name": "Veuillez saisir le nom du dossier",
|
||||
"Fix it": "Réparez-le",
|
||||
"Warning": "Avertissement",
|
||||
"Login screen using Wayland is not supported": "L'écran de connexion utilisant Wayland n'est pas pris en charge",
|
||||
"Reboot required": "Redémarrage pour prendre effet",
|
||||
"Unsupported display server ": "Le serveur d'affichage actuel n'est pas pris en charge",
|
||||
"x11 expected": "Veuillez passer à x11",
|
||||
"Port": "Port",
|
||||
"Settings": "Paramètres",
|
||||
"Username": " Nom d'utilisateur",
|
||||
"Invalid port": "Port invalide",
|
||||
"Closed manually by the peer": "Fermé manuellement par le pair",
|
||||
"Enable remote configuration modification": "Autoriser la modification de la configuration à distance",
|
||||
"Run without install": "Exécuter sans installer",
|
||||
"Always connected via relay": "Forcer la connexion relais",
|
||||
"Always connect via relay": "Forcer la connexion relais",
|
||||
"whitelist_tip": "Seul l'ip dans la liste blanche peut m'accéder",
|
||||
"Login": "Connexion",
|
||||
"Logout": "Déconnexion",
|
||||
"Tags": "Étiqueter",
|
||||
"Search ID": "Identifiant de recherche",
|
||||
"Current Wayland display server is not supported": "Le serveur d'affichage Wayland n'est pas pris en charge",
|
||||
"whitelist_sep": "Vous pouvez utiliser une virgule, un point-virgule, un espace ou une nouvelle ligne comme séparateur",
|
||||
"Add ID": "Ajouter ID",
|
||||
"Add Tag": "Ajouter une balise",
|
||||
"Unselect all tags": "Désélectionner toutes les balises",
|
||||
"Network error": "Erreur réseau",
|
||||
"Username missed": "Nom d'utilisateur manqué",
|
||||
"Password missed": "Mot de passe manqué",
|
||||
"Wrong credentials": "Identifiant ou mot de passe erroné",
|
||||
"Edit Tag": "Modifier la balise",
|
||||
"Invalid folder name": "Nom de dossier invalide",
|
||||
"Hostname": "nom d'hôte",
|
||||
"Discovered": "Découvert",
|
||||
},
|
||||
}
|
||||
|
||||
export function checkIfRetry(msgtype: string, title: string, text: string) {
|
||||
return msgtype == "error"
|
||||
&& title == "Connection Error"
|
||||
&& text.toLowerCase().indexOf("offline") < 0
|
||||
&& text.toLowerCase().indexOf("exist") < 0
|
||||
&& text.toLowerCase().indexOf("handshake") < 0
|
||||
&& text.toLowerCase().indexOf("failed") < 0
|
||||
&& text.toLowerCase().indexOf("resolve") < 0
|
||||
&& text.toLowerCase().indexOf("mismatch") < 0
|
||||
&& text.toLowerCase().indexOf("manually") < 0
|
||||
|
||||
;}
|
||||
|
||||
export const KEY_MAP: any = {
|
||||
"VK_A": "a",
|
||||
"VK_B": "b",
|
||||
"VK_C": "c",
|
||||
"VK_D": "d",
|
||||
"VK_E": "e",
|
||||
"VK_F": "f",
|
||||
"VK_G": "g",
|
||||
"VK_H": "h",
|
||||
"VK_I": "i",
|
||||
"VK_J": "j",
|
||||
"VK_K": "k",
|
||||
"VK_L": "l",
|
||||
"VK_M": "m",
|
||||
"VK_N": "n",
|
||||
"VK_O": "o",
|
||||
"VK_P": "p",
|
||||
"VK_Q": "q",
|
||||
"VK_R": "r",
|
||||
"VK_S": "s",
|
||||
"VK_T": "t",
|
||||
"VK_U": "u",
|
||||
"VK_V": "v",
|
||||
"VK_W": "w",
|
||||
"VK_X": "x",
|
||||
"VK_Y": "y",
|
||||
"VK_Z": "z",
|
||||
"VK_0": "0",
|
||||
"VK_1": "1",
|
||||
"VK_2": "2",
|
||||
"VK_3": "3",
|
||||
"VK_4": "4",
|
||||
"VK_5": "5",
|
||||
"VK_6": "6",
|
||||
"VK_7": "7",
|
||||
"VK_8": "8",
|
||||
"VK_9": "9",
|
||||
"VK_COMMA": ",",
|
||||
"VK_SLASH": "/",
|
||||
"VK_SEMICOLON": ";",
|
||||
"VK_QUOTE": "\'",
|
||||
"VK_LBRACKET": "[",
|
||||
"VK_RBRACKET": "]",
|
||||
"VK_BACKSLASH": "\\",
|
||||
"VK_MINUS": "-",
|
||||
"VK_PLUS": "= // it is =, but sciter return VK_PLUS",
|
||||
"VK_DIVIDE": "Divide // numpad",
|
||||
"VK_MULTIPLY": "Multiply // numpad",
|
||||
"VK_SUBTRACT": "Subtract // numpad",
|
||||
"VK_ADD": "Add // numpad",
|
||||
"VK_DECIMAL": "Decimal // numpad",
|
||||
"VK_F1": "F1",
|
||||
"VK_F2": "F2",
|
||||
"VK_F3": "F3",
|
||||
"VK_F4": "F4",
|
||||
"VK_F5": "F5",
|
||||
"VK_F6": "F6",
|
||||
"VK_F7": "F7",
|
||||
"VK_F8": "F8",
|
||||
"VK_F9": "F9",
|
||||
"VK_F10": "F10",
|
||||
"VK_F11": "F11",
|
||||
"VK_F12": "F12",
|
||||
"VK_ENTER": "Return",
|
||||
"VK_CANCEL": "Cancel",
|
||||
"VK_BACK": "Backspace",
|
||||
"VK_TAB": "Tab",
|
||||
"VK_CLEAR": "Clear",
|
||||
"VK_RETURN": "Return",
|
||||
"VK_SHIFT": "Shift",
|
||||
"VK_CONTROL": "Control",
|
||||
"VK_MENU": "Alt",
|
||||
"VK_PAUSE": "Pause",
|
||||
"VK_CAPITAL": "CapsLock",
|
||||
"VK_KANA": "Kana",
|
||||
"VK_HANGUL": "Hangul",
|
||||
"VK_JUNJA": "Junja",
|
||||
"VK_FINAL": "Final",
|
||||
"VK_HANJA": "Hanja",
|
||||
"VK_KANJI": "Kanji",
|
||||
"VK_ESCAPE": "Escape",
|
||||
"VK_CONVERT": "Convert",
|
||||
"VK_SPACE": "Space",
|
||||
"VK_PRIOR": "PageUp",
|
||||
"VK_NEXT": "PageDown",
|
||||
"VK_END": "End",
|
||||
"VK_HOME": "Home",
|
||||
"VK_LEFT": "LeftArrow",
|
||||
"VK_UP": "UpArrow",
|
||||
"VK_RIGHT": "RightArrow",
|
||||
"VK_DOWN": "DownArrow",
|
||||
"VK_SELECT": "Select",
|
||||
"VK_PRINT": "Print",
|
||||
"VK_EXECUTE": "Execute",
|
||||
"VK_SNAPSHOT": "Snapshot",
|
||||
"VK_INSERT": "Insert",
|
||||
"VK_DELETE": "Delete",
|
||||
"VK_HELP": "Help",
|
||||
"VK_SLEEP": "Sleep",
|
||||
"VK_SEPARATOR": "Separator",
|
||||
"VK_NUMPAD0": "Numpad0",
|
||||
"VK_NUMPAD1": "Numpad1",
|
||||
"VK_NUMPAD2": "Numpad2",
|
||||
"VK_NUMPAD3": "Numpad3",
|
||||
"VK_NUMPAD4": "Numpad4",
|
||||
"VK_NUMPAD5": "Numpad5",
|
||||
"VK_NUMPAD6": "Numpad6",
|
||||
"VK_NUMPAD7": "Numpad7",
|
||||
"VK_NUMPAD8": "Numpad8",
|
||||
"VK_NUMPAD9": "Numpad9",
|
||||
"Apps": "Apps",
|
||||
"Meta": "Meta",
|
||||
"RAlt": "RAlt",
|
||||
"RWin": "RWin",
|
||||
"RControl": "RControl",
|
||||
"RShift": "RShift",
|
||||
"CTRL_ALT_DEL": "CtrlAltDel",
|
||||
"LOCK_SCREEN": "LockScreen",
|
||||
|
||||
}
|
@ -1,10 +1,9 @@
|
||||
import Connection from "./connection";
|
||||
import _sodium from "libsodium-wrappers";
|
||||
import * as zstd from 'zstddec';
|
||||
import { CursorData } from "./message";
|
||||
import { loadOpus, loadVp9 } from "./codec";
|
||||
|
||||
var decompressor;
|
||||
import { checkIfRetry } from "./gen_js_from_hbb";
|
||||
import { initZstd, translate } from "./common";
|
||||
|
||||
var currentFrame = undefined;
|
||||
var events = [];
|
||||
@ -21,15 +20,7 @@ export function msgbox(type, title, text) {
|
||||
if (!events) return;
|
||||
if (!type || (type == 'error' && !text)) return;
|
||||
const text2 = text.toLowerCase();
|
||||
var hasRetry = type == "error"
|
||||
&& title == "Connection Error"
|
||||
&& text2.indexOf("offline") < 0
|
||||
&& text2.indexOf("exist") < 0
|
||||
&& text2.indexOf("handshake") < 0
|
||||
&& text2.indexOf("failed") < 0
|
||||
&& text2.indexOf("resolve") < 0
|
||||
&& text2.indexOf("mismatch") < 0
|
||||
&& text2.indexOf("manually") < 0;
|
||||
var hasRetry = checkIfRetry(type, title, text);
|
||||
events.push({ name: 'msgbox', type, title, text, hasRetry });
|
||||
}
|
||||
|
||||
@ -37,16 +28,7 @@ function jsonfyForDart(payload) {
|
||||
var tmp = {};
|
||||
for (const [key, value] of Object.entries(payload)) {
|
||||
if (!key) continue;
|
||||
var newName = '';
|
||||
for (var i = 0; i < key.length; ++i) {
|
||||
var ch = key[i];
|
||||
if (ch.toUpperCase() == ch) {
|
||||
newName += '_' + ch.toLowerCase();
|
||||
} else {
|
||||
newName += ch;
|
||||
}
|
||||
}
|
||||
tmp[newName] = value instanceof Uint8Array ? '[' + value.toString() + ']' : JSON.stringify(value);
|
||||
tmp[key] = value instanceof Uint8Array ? '[' + value.toString() + ']' : JSON.stringify(value);
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
@ -153,26 +135,6 @@ export function decrypt(signed, nonce, key) {
|
||||
return sodium.crypto_secretbox_open_easy(signed, makeOnce(nonce), key);
|
||||
}
|
||||
|
||||
export async function decompress(compressedArray) {
|
||||
const MAX = 1024 * 1024 * 64;
|
||||
const MIN = 1024 * 1024;
|
||||
let n = 30 * compressedArray.length;
|
||||
if (n > MAX) {
|
||||
n = MAX;
|
||||
}
|
||||
if (n < MIN) {
|
||||
n = MIN;
|
||||
}
|
||||
try {
|
||||
if (!decompressor) {
|
||||
await initZstd();
|
||||
}
|
||||
return decompressor.decode(compressedArray, n);
|
||||
} catch (e) {
|
||||
console.error('decompress failed: ' + e);
|
||||
}
|
||||
}
|
||||
|
||||
window.setByName = (name, value) => {
|
||||
try {
|
||||
value = JSON.parse(value);
|
||||
@ -204,7 +166,7 @@ window.setByName = (name, value) => {
|
||||
curConn.lockScreen();
|
||||
break;
|
||||
case 'ctrl_alt_del':
|
||||
curConn.ctrlAltDe();
|
||||
curConn.ctrlAltDel();
|
||||
break;
|
||||
case 'switch_display':
|
||||
curConn.switchDisplay(value);
|
||||
@ -252,7 +214,7 @@ window.setByName = (name, value) => {
|
||||
curConn.setOption(value.name, value.value);
|
||||
break;
|
||||
case 'input_os_password':
|
||||
curConn.inputOsPassword(value, true);
|
||||
curConn.inputOsPassword(value);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -266,13 +228,10 @@ window.getByName = (name, arg) => {
|
||||
switch (name) {
|
||||
case 'peers':
|
||||
return localStorage.getItem('peers') || '[]';
|
||||
break;
|
||||
case 'remote_id':
|
||||
return localStorage.getItem('remote-id') || '';
|
||||
break;
|
||||
case 'remember':
|
||||
return curConn.getRemember();
|
||||
break;
|
||||
case 'event':
|
||||
if (events && events.length) {
|
||||
const e = events[0];
|
||||
@ -282,19 +241,14 @@ window.getByName = (name, arg) => {
|
||||
break;
|
||||
case 'toggle_option':
|
||||
return curConn.getOption(arg);
|
||||
break;
|
||||
case 'option':
|
||||
return localStorage.getItem(arg);
|
||||
break;
|
||||
case 'image_quality':
|
||||
return curConn.getImageQuality();
|
||||
break;
|
||||
case 'translate':
|
||||
return arg.text;
|
||||
break;
|
||||
return translate(arg.locale, arg.text);
|
||||
case 'peer_option':
|
||||
return curConn.getOption(arg);
|
||||
break;
|
||||
case 'test_if_valid_server':
|
||||
break;
|
||||
}
|
||||
@ -302,14 +256,7 @@ window.getByName = (name, arg) => {
|
||||
}
|
||||
|
||||
window.init = async () => {
|
||||
await initZstd();
|
||||
}
|
||||
|
||||
async function initZstd() {
|
||||
loadOpus(() => { });
|
||||
loadVp9(() => { });
|
||||
const tmp = new zstd.ZSTDDecoder();
|
||||
await tmp.init();
|
||||
console.log('zstd ready');
|
||||
decompressor = tmp;
|
||||
}
|
||||
await initZstd();
|
||||
}
|
1274
src/message.ts
1274
src/message.ts
File diff suppressed because it is too large
Load Diff
1042
src/rendezvous.ts
1042
src/rendezvous.ts
File diff suppressed because it is too large
Load Diff
@ -37,7 +37,7 @@ export default class Websock {
|
||||
this._secretKey = [key, 0, 0];
|
||||
}
|
||||
|
||||
sendMessage(json: any) {
|
||||
sendMessage(json: message.DeepPartial<message.Message>) {
|
||||
let data = message.Message.encode(
|
||||
message.Message.fromPartial(json)
|
||||
).finish();
|
||||
@ -49,7 +49,7 @@ export default class Websock {
|
||||
this._websocket.send(data);
|
||||
}
|
||||
|
||||
sendRendezvous(data: any) {
|
||||
sendRendezvous(data: rendezvous.DeepPartial<rendezvous.RendezvousMessage>) {
|
||||
this._websocket.send(
|
||||
rendezvous.RendezvousMessage.encode(
|
||||
rendezvous.RendezvousMessage.fromPartial(data)
|
||||
@ -96,7 +96,7 @@ export default class Websock {
|
||||
resolve(this);
|
||||
};
|
||||
this._websocket.onclose = (e) => {
|
||||
if (this._status == 'open') {
|
||||
if (this._status == "open") {
|
||||
reject(e);
|
||||
}
|
||||
this._status = e;
|
||||
@ -105,7 +105,7 @@ export default class Websock {
|
||||
};
|
||||
this._websocket.onerror = (e) => {
|
||||
if (!this._status) {
|
||||
reject('Failed to connect to ' + this._uri);
|
||||
reject("Failed to connect to " + this._uri);
|
||||
return;
|
||||
}
|
||||
this._status = e;
|
||||
@ -143,7 +143,7 @@ export default class Websock {
|
||||
}
|
||||
|
||||
close() {
|
||||
this._status = '';
|
||||
this._status = "";
|
||||
if (this._websocket) {
|
||||
if (
|
||||
this._websocket.readyState === WebSocket.OPEN ||
|
||||
|
8
ts_proto.py
Normal file → Executable file
8
ts_proto.py
Normal file → Executable file
@ -5,16 +5,16 @@ import os
|
||||
path = os.path.abspath(os.path.join(os.getcwd(), '..', 'hbb', 'libs', 'hbb_common', 'protos'))
|
||||
|
||||
if os.name == 'nt':
|
||||
cmd = r'protoc --ts_proto_opt=esModuleInterop=true --plugin=protoc-gen-ts_proto=.\node_modules\.bin\protoc-gen-ts_proto.cmd -I "%s" --ts_proto_out=./src/ rendezvous.proto'%path
|
||||
cmd = r'protoc --ts_proto_opt=esModuleInterop=true --ts_proto_opt=snakeToCamel=false --plugin=protoc-gen-ts_proto=.\node_modules\.bin\protoc-gen-ts_proto.cmd -I "%s" --ts_proto_out=./src/ rendezvous.proto'%path
|
||||
print(cmd)
|
||||
os.system(cmd)
|
||||
cmd = r'protoc --ts_proto_opt=esModuleInterop=true --plugin=protoc-gen-ts_proto=.\node_modules\.bin\protoc-gen-ts_proto.cmd -I "%s" --ts_proto_out=./src/ message.proto'%path
|
||||
cmd = r'protoc --ts_proto_opt=esModuleInterop=true --ts_proto_opt=snakeToCamel=false --plugin=protoc-gen-ts_proto=.\node_modules\.bin\protoc-gen-ts_proto.cmd -I "%s" --ts_proto_out=./src/ message.proto'%path
|
||||
print(cmd)
|
||||
os.system(cmd)
|
||||
else:
|
||||
cmd = r'protoc --ts_proto_opt=esModuleInterop=true --plugin=./node_modules/.bin/protoc-gen-ts_proto -I "%s" --ts_proto_out=./src/ rendezvous.proto'%path
|
||||
cmd = r'protoc --ts_proto_opt=esModuleInterop=true --ts_proto_opt=snakeToCamel=false --plugin=./node_modules/.bin/protoc-gen-ts_proto -I "%s" --ts_proto_out=./src/ rendezvous.proto'%path
|
||||
print(cmd)
|
||||
os.system(cmd)
|
||||
cmd = r'protoc --ts_proto_opt=esModuleInterop=true --plugin=./node_modules/.bin/protoc-gen-ts_proto -I "%s" --ts_proto_out=./src/ message.proto'%path
|
||||
cmd = r'protoc --ts_proto_opt=esModuleInterop=true --ts_proto_opt=snakeToCamel=false --plugin=./node_modules/.bin/protoc-gen-ts_proto -I "%s" --ts_proto_out=./src/ message.proto'%path
|
||||
print(cmd)
|
||||
os.system(cmd)
|
||||
|
Loading…
Reference in New Issue
Block a user