Skip to content

Commit

Permalink
refact: web desktop, web_id_input_tip (rustdesk#9490)
Browse files Browse the repository at this point in the history
* refact: web desktop, web_id_input_tip

Signed-off-by: fufesou <[email protected]>

* Update en.rs

* Update cn.rs

* Update en.rs

---------

Signed-off-by: fufesou <[email protected]>
Co-authored-by: RustDesk <[email protected]>
  • Loading branch information
fufesou and rustdesk authored Sep 27, 2024
1 parent 4459406 commit 3e6938b
Show file tree
Hide file tree
Showing 47 changed files with 91 additions and 32 deletions.
38 changes: 38 additions & 0 deletions flutter/lib/common/widgets/connection_page_title.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../../common.dart';

Widget getConnectionPageTitle(BuildContext context, bool isWeb) {
return Row(
children: [
Expanded(
child: Row(
children: [
AutoSizeText(
translate('Control Remote Desktop'),
maxLines: 1,
style: Theme.of(context)
.textTheme
.titleLarge
?.merge(TextStyle(height: 1)),
).marginOnly(right: 4),
Tooltip(
waitDuration: Duration(milliseconds: 300),
message: translate(isWeb ? "web_id_input_tip" : "id_input_tip"),
child: Icon(
Icons.help_outline_outlined,
size: 16,
color: Theme.of(context)
.textTheme
.titleLarge
?.color
?.withOpacity(0.5),
),
),
],
)),
],
);
}
33 changes: 2 additions & 31 deletions flutter/lib/desktop/pages/connection_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import 'dart:async';
import 'dart:convert';

import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hbb/common/widgets/connection_page_title.dart';
import 'package:flutter_hbb/consts.dart';
import 'package:flutter_hbb/models/state_model.dart';
import 'package:get/get.dart';
Expand Down Expand Up @@ -323,36 +323,7 @@ class _ConnectionPageState extends State<ConnectionPage>
child: Ink(
child: Column(
children: [
Row(
children: [
Expanded(
child: Row(
children: [
AutoSizeText(
translate('Control Remote Desktop'),
maxLines: 1,
style: Theme.of(context)
.textTheme
.titleLarge
?.merge(TextStyle(height: 1)),
).marginOnly(right: 4),
Tooltip(
waitDuration: Duration(milliseconds: 300),
message: translate("id_input_tip"),
child: Icon(
Icons.help_outline_outlined,
size: 16,
color: Theme.of(context)
.textTheme
.titleLarge
?.color
?.withOpacity(0.5),
),
),
],
)),
],
).marginOnly(bottom: 15),
getConnectionPageTitle(context, false).marginOnly(bottom: 15),
Row(
children: [
Expanded(
Expand Down
8 changes: 7 additions & 1 deletion flutter/lib/mobile/pages/connection_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'dart:async';
import 'package:auto_size_text_field/auto_size_text_field.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hbb/common/formatter/id_formatter.dart';
import 'package:flutter_hbb/common/widgets/connection_page_title.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
Expand Down Expand Up @@ -349,9 +350,14 @@ class _ConnectionPageState extends State<ConnectionPage> {
),
),
);
final child = Column(children: [
if (isWebDesktop)
getConnectionPageTitle(context, true).marginOnly(bottom: 10, top: 15, left: 12),
w
]);
return Align(
alignment: Alignment.topCenter,
child: Container(constraints: kMobilePageConstraints, child: w));
child: Container(constraints: kMobilePageConstraints, child: child));
}

@override
Expand Down
1 change: 1 addition & 0 deletions src/lang/ar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/be.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/bg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/ca.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/cn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", "被控端启用了单向文件传输"),
("Authentication Required", "需要身份验证"),
("Authenticate", "认证"),
("web_id_input_tip", "可以输入同一个服务器内的 ID, web 客户端不支持直接 IP 访问。\n要访问另一台服务器上的设备,请附加服务器地址(<ID>@<服务器地址>?key=<密钥>)。比如,\n[email protected]:21117?key=5Qbwsde3unUcJBtrx9ZkvUmwFNoExHzpryHuPUdqlWM=。\n要访问公共服务器上的设备,请输入 \"<ID>@public\", 无需密钥。"),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/cs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/da.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", "Die einseitige Dateiübertragung ist auf der kontrollierten Seite aktiviert."),
("Authentication Required", "Authentifizierung erforderlich"),
("Authenticate", "Authentifizieren"),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/el.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/en.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,5 +235,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("network_error_tip", "Please check your network connection, then click retry."),
("enable-trusted-devices-tip", "Skip 2FA verification on trusted devices"),
("one-way-file-transfer-tip", "One-way file transfer is enabled on the controlled side."),
("web_id_input_tip", "You can input an ID in the same server, direct IP access is not supported in web client.\nIf you want to access a device on another server, please append the server address (<id>@<server_address>?key=<key_value>), for example,\n[email protected]:21117?key=5Qbwsde3unUcJBtrx9ZkvUmwFNoExHzpryHuPUdqlWM=.\nIf you want to access a device on a public server, please input \"<id>@public\", the key is not needed for public server."),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/eo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/es.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", "La transferencia en un sentido está habilitada en el lado controlado."),
("Authentication Required", "Se requiere autenticación"),
("Authenticate", "Autenticar"),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/et.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/eu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/fa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/fr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/he.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/hr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/hu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/it.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", "Sul lato controllato è abilitato il trasferimento file unidirezionale."),
("Authentication Required", "Richiesta autenticazione"),
("Authenticate", "Autentica"),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/ja.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/ko.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", "단방향 파일 전송은 제어되는 쪽에서 활성화됩니다."),
("Authentication Required", "인증 필요함"),
("Authenticate", "인증"),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/kz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/lt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/lv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", "Kontrolējamajā pusē ir iespējota vienvirziena failu pārsūtīšana."),
("Authentication Required", "Nepieciešama autentifikācija"),
("Authenticate", "Autentificēt"),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/nb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/nl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", "Eenzijdige bestandsoverdracht is ingeschakeld aan de gecontroleerde kant."),
("Authentication Required", "Verificatie vereist"),
("Authenticate", "Verificatie"),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/pl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/pt_PT.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/ptbr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/ro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/ru.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", "На управляемой стороне включена односторонняя передача файлов."),
("Authentication Required", "Требуется аутентификация"),
("Authenticate", "Аутентификация"),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/sk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/sl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/sq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/sr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/sv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/th.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
1 change: 1 addition & 0 deletions src/lang/tr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", ""),
("Authentication Required", ""),
("Authenticate", ""),
("web_id_input_tip", ""),
].iter().cloned().collect();
}
Loading

0 comments on commit 3e6938b

Please sign in to comment.