mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-02-17 14:07:28 +08:00
require login for note (#13775)
Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
@@ -566,6 +566,13 @@ class _GeneralState extends State<_General> {
|
|||||||
'note-at-conn-end-tip',
|
'note-at-conn-end-tip',
|
||||||
kOptionAllowAskForNoteAtEndOfConnection,
|
kOptionAllowAskForNoteAtEndOfConnection,
|
||||||
isServer: false,
|
isServer: false,
|
||||||
|
optSetter: (key, value) async {
|
||||||
|
if (value && !gFFI.userModel.isLogin) {
|
||||||
|
final res = await loginDialog();
|
||||||
|
if (res != true) return;
|
||||||
|
}
|
||||||
|
await mainSetLocalBoolOption(key, value);
|
||||||
|
},
|
||||||
));
|
));
|
||||||
return _Card(title: 'Other', children: children);
|
return _Card(title: 'Other', children: children);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -790,6 +790,10 @@ class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
|
|||||||
title: Text(translate('note-at-conn-end-tip')),
|
title: Text(translate('note-at-conn-end-tip')),
|
||||||
initialValue: _allowAskForNoteAtEndOfConnection,
|
initialValue: _allowAskForNoteAtEndOfConnection,
|
||||||
onToggle: (v) async {
|
onToggle: (v) async {
|
||||||
|
if (v && !gFFI.userModel.isLogin) {
|
||||||
|
final res = await loginDialog();
|
||||||
|
if (res != true) return;
|
||||||
|
}
|
||||||
await mainSetLocalBoolOption(
|
await mainSetLocalBoolOption(
|
||||||
kOptionAllowAskForNoteAtEndOfConnection, v);
|
kOptionAllowAskForNoteAtEndOfConnection, v);
|
||||||
final newValue = mainGetLocalBoolOptionSync(
|
final newValue = mainGetLocalBoolOptionSync(
|
||||||
|
|||||||
@@ -1081,7 +1081,8 @@ class FfiModel with ChangeNotifier {
|
|||||||
if (displays.length == 1) {
|
if (displays.length == 1) {
|
||||||
bind.sessionSetSize(
|
bind.sessionSetSize(
|
||||||
sessionId: sessionId,
|
sessionId: sessionId,
|
||||||
display: pi.currentDisplay == kAllDisplayValue ? 0 : pi.currentDisplay,
|
display:
|
||||||
|
pi.currentDisplay == kAllDisplayValue ? 0 : pi.currentDisplay,
|
||||||
width: displays[0].width,
|
width: displays[0].width,
|
||||||
height: displays[0].height,
|
height: displays[0].height,
|
||||||
);
|
);
|
||||||
@@ -1100,6 +1101,11 @@ class FfiModel with ChangeNotifier {
|
|||||||
|
|
||||||
void _queryAuditGuid(String peerId) async {
|
void _queryAuditGuid(String peerId) async {
|
||||||
try {
|
try {
|
||||||
|
if (bind
|
||||||
|
.sessionGetAuditServerSync(sessionId: sessionId, typ: "conn/active")
|
||||||
|
.isEmpty) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!mainGetLocalBoolOptionSync(
|
if (!mainGetLocalBoolOptionSync(
|
||||||
kOptionAllowAskForNoteAtEndOfConnection)) {
|
kOptionAllowAskForNoteAtEndOfConnection)) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -539,7 +539,31 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("Timeout in minutes", ""),
|
("Timeout in minutes", ""),
|
||||||
("auto_disconnect_option_tip", ""),
|
("auto_disconnect_option_tip", ""),
|
||||||
("Connection failed due to inactivity", ""),
|
("Connection failed due to inactivity", ""),
|
||||||
("Check for software update on startupmật", ""),
|
("Check for software update on startup", ""),
|
||||||
|
("upgrade_rustdesk_server_pro_to_{}_tip", ""),
|
||||||
|
("pull_group_failed_tip", ""),
|
||||||
|
("Filter by intersection", ""),
|
||||||
|
("Remove wallpaper during incoming sessions", ""),
|
||||||
|
("Test", ""),
|
||||||
|
("display_is_plugged_out_msg", ""),
|
||||||
|
("No displays", ""),
|
||||||
|
("Open in new window", ""),
|
||||||
|
("Show displays as individual windows", ""),
|
||||||
|
("Use all my displays for the remote session", ""),
|
||||||
|
("selinux_tip", ""),
|
||||||
|
("Change view", ""),
|
||||||
|
("Big tiles", ""),
|
||||||
|
("Small tiles", ""),
|
||||||
|
("List", ""),
|
||||||
|
("Virtual display", ""),
|
||||||
|
("Plug out all", ""),
|
||||||
|
("True color (4:4:4)", ""),
|
||||||
|
("Enable blocking user input", ""),
|
||||||
|
("id_input_tip", ""),
|
||||||
|
("privacy_mode_impl_mag_tip", ""),
|
||||||
|
("privacy_mode_impl_virtual_display_tip", ""),
|
||||||
|
("Enter privacy mode", ""),
|
||||||
|
("Exit privacy mode", ""),
|
||||||
("idd_not_support_under_win10_2004_tip", ""),
|
("idd_not_support_under_win10_2004_tip", ""),
|
||||||
("input_source_1_tip", ""),
|
("input_source_1_tip", ""),
|
||||||
("input_source_2_tip", ""),
|
("input_source_2_tip", ""),
|
||||||
|
|||||||
@@ -567,6 +567,9 @@ impl<T: InvokeUiSession> Session<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_audit_server(&self, typ: String) -> String {
|
pub fn get_audit_server(&self, typ: String) -> String {
|
||||||
|
if LocalConfig::get_option("access_token").is_empty() {
|
||||||
|
return "".to_owned();
|
||||||
|
}
|
||||||
crate::get_audit_server(
|
crate::get_audit_server(
|
||||||
Config::get_option("api-server"),
|
Config::get_option("api-server"),
|
||||||
Config::get_option("custom-rendezvous-server"),
|
Config::get_option("custom-rendezvous-server"),
|
||||||
|
|||||||
Reference in New Issue
Block a user