mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-09-19 02:41:10 +03:00
fix: handle ID copying separately and remove whitelist logs
Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
@@ -3124,6 +3124,15 @@ void onCopyFingerprint(String value) {
|
||||
}
|
||||
}
|
||||
|
||||
void onCopyId(String value) {
|
||||
if (value.isNotEmpty) {
|
||||
Clipboard.setData(ClipboardData(text: value));
|
||||
showToast('$value\n${translate("Copied")}');
|
||||
} else {
|
||||
showToast(translate("Invalid ID"));
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> callMainCheckSuperUserPermission() async {
|
||||
bool checked = await bind.mainCheckSuperUserPermission();
|
||||
if (isMacOS) {
|
||||
|
||||
@@ -352,9 +352,6 @@ void changeIdWhiteList({Function()? callback}) async {
|
||||
msg = "";
|
||||
isInProgress = true;
|
||||
});
|
||||
debugPrint(
|
||||
'[id-whitelist] raw=${controller.text.replaceAll(' ', '␠').replaceAll('\n', r'\n')}',
|
||||
);
|
||||
newIdWhiteListField = controller.text.trim();
|
||||
var newIdWhiteList = "";
|
||||
if (newIdWhiteListField.isEmpty) {
|
||||
@@ -365,7 +362,6 @@ void changeIdWhiteList({Function()? callback}) async {
|
||||
.split(RegExp(r"[\s,;\n]+"))
|
||||
.where((e) => e.isNotEmpty)
|
||||
.toList();
|
||||
debugPrint('[id-whitelist] ids=$ids');
|
||||
// test id, wildcards '*' and '?' are allowed;
|
||||
// '@' '.' ':' '/' '[' ']' occur in cross-server IDs and WebSocket URIs
|
||||
final idMatch = RegExp(r"^[a-zA-Z0-9_*?@.:/\[\]-]+$");
|
||||
@@ -383,7 +379,6 @@ void changeIdWhiteList({Function()? callback}) async {
|
||||
if (newIdWhiteList.trim().isEmpty) {
|
||||
newIdWhiteList = defaultOptionWhitelist;
|
||||
}
|
||||
debugPrint('[id-whitelist] normalized=$newIdWhiteList');
|
||||
await bind.mainSetOption(
|
||||
key: kOptionIdWhitelist, value: newIdWhiteList);
|
||||
callback?.call();
|
||||
|
||||
@@ -1015,7 +1015,7 @@ class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
|
||||
),
|
||||
leading: Icon(Icons.fingerprint)),
|
||||
SettingsTile(
|
||||
onPressed: (context) => onCopyFingerprint(_myId),
|
||||
onPressed: (context) => onCopyId(_myId),
|
||||
title: Text(translate("ID")),
|
||||
value: Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 8),
|
||||
|
||||
Reference in New Issue
Block a user