Option LAN Discovery

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages 2022-09-24 09:58:57 +08:00
parent 98a84a577b
commit e8143255e9
25 changed files with 374 additions and 326 deletions

View File

@ -18,7 +18,7 @@ import '../../common/widgets/dialog.dart';
const double _kTabWidth = 235;
const double _kTabHeight = 42;
const double _kCardFixedWidth = 560;
const double _kCardFixedWidth = 540;
const double _kCardLeftMargin = 15;
const double _kContentHMargin = 15;
const double _kContentHSubMargin = _kContentHMargin + 33;
@ -516,6 +516,8 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
child: _OptionCheckBox(context, 'Enable RDP', 'enable-rdp',
enabled: enabled),
),
_OptionCheckBox(context, 'Deny LAN Discovery', 'enable-lan-discovery',
reverse: true, enabled: enabled),
...directIp(context),
whitelist(),
]);

View File

@ -30,7 +30,8 @@ pub(super) fn start_listening() -> ResultType<()> {
if let Ok(msg_in) = Message::parse_from_bytes(&buf[0..len]) {
match msg_in.union {
Some(rendezvous_message::Union::PeerDiscovery(p)) => {
if p.cmd == "ping" {
if p.cmd == "ping" && Config::get_option("enable-lan-discovery").is_empty()
{
if let Some(self_addr) = get_ipaddr_by_peer(&addr) {
let mut msg_out = Message::new();
let peer = PeerDiscovery {

View File

@ -346,5 +346,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Enable RDP", "允许RDP访问"),
("Pin menubar", "固定菜单栏"),
("Unpin menubar", "取消固定菜单栏"),
("Enable LAN Discovery", "允许局域网发现"),
("Deny LAN Discovery", "拒绝局域网发现"),
].iter().cloned().collect();
}

View File

@ -346,5 +346,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Enable RDP", ""),
("Pin menubar", "Připnout panel nabídek"),
("Unpin menubar", "Odepnout panel nabídek"),
("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""),
].iter().cloned().collect();
}

View File

@ -346,5 +346,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Enable RDP", ""),
("Pin menubar", "Fastgør menulinjen"),
("Unpin menubar", "Frigør menulinjen"),
("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""),
].iter().cloned().collect();
}

View File

@ -346,5 +346,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Enable RDP", ""),
("Pin menubar", "Pin-Menüleiste"),
("Unpin menubar", "Menüleiste lösen"),
("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""),
].iter().cloned().collect();
}

View File

@ -346,5 +346,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Enable RDP", ""),
("Pin menubar", "Alpingla menubreto"),
("Unpin menubar", "Malfiksi menubreton"),
("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""),
].iter().cloned().collect();
}

View File

@ -359,5 +359,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Enable RDP", ""),
("Pin menubar", "Pin barra de menú"),
("Unpin menubar", "Desbloquear barra de menú"),
("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""),
].iter().cloned().collect();
}

View File

@ -346,5 +346,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Enable RDP", ""),
("Pin menubar", "Épingler la barre de menus"),
("Unpin menubar", "Détacher la barre de menu"),
("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""),
].iter().cloned().collect();
}

View File

@ -346,5 +346,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Enable RDP", ""),
("Pin menubar", "Menüsor rögzítése"),
("Unpin menubar", "Menüsor rögzítésének feloldása"),
("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""),
].iter().cloned().collect();
}

View File

@ -359,5 +359,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Enable RDP", ""),
("Pin menubar", "Pin menubar"),
("Unpin menubar", "Unpin menubar"),
("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""),
].iter().cloned().collect();
}

View File

@ -345,5 +345,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Enable RDP", ""),
("Pin menubar", "Blocca la barra dei menu"),
("Unpin menubar", "Sblocca la barra dei menu"),
("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""),
].iter().cloned().collect();
}

View File

@ -343,5 +343,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Enable RDP", ""),
("Pin menubar", "メニューバーを固定する"),
("Unpin menubar", "メニューバーのピン留めを外す"),
("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""),
].iter().cloned().collect();
}

View File

@ -340,5 +340,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Enable RDP", ""),
("Pin menubar", "핀 메뉴 바"),
("Unpin menubar", "메뉴 모음 고정 해제"),
("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""),
].iter().cloned().collect();
}

View File

@ -321,5 +321,7 @@ lazy_static::lazy_static! {
("Scale adaptive", "Scale adaptive"),
("Pin menubar", "Мәзір жолағын бекіту"),
("Unpin menubar", "Мәзір жолағын босату"),
("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""),
].iter().cloned().collect();
}

View File

@ -344,5 +344,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Enable RDP", ""),
("Pin menubar", "Przypnij pasek menu"),
("Unpin menubar", "Odepnij pasek menu"),
("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""),
].iter().cloned().collect();
}

View File

@ -340,5 +340,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Enable RDP", ""),
("Pin menubar", "Fixar barra de menu"),
("Unpin menubar", "Desenganxa la barra de menús"),
("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""),
].iter().cloned().collect();
}

View File

@ -346,5 +346,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Enable RDP", ""),
("Pin menubar", ""),
("Unpin menubar", ""),
("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""),
].iter().cloned().collect();
}

View File

@ -346,5 +346,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Enable RDP", ""),
("Pin menubar", "Закрепить строку меню"),
("Unpin menubar", "Открепить строку меню"),
("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""),
].iter().cloned().collect();
}

View File

@ -346,5 +346,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Enable RDP", ""),
("Pin menubar", "Pripnúť panel s ponukami"),
("Unpin menubar", "Uvoľniť panel s ponukami"),
("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""),
].iter().cloned().collect();
}

View File

@ -346,5 +346,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Enable RDP", ""),
("Pin menubar", ""),
("Unpin menubar", ""),
("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""),
].iter().cloned().collect();
}

View File

@ -359,5 +359,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Enable RDP", ""),
("Pin menubar", "Menü çubuğunu sabitle"),
("Unpin menubar", "Menü çubuğunun sabitlemesini kaldır"),
("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""),
].iter().cloned().collect();
}

View File

@ -346,5 +346,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Enable RDP", "允許RDP訪問"),
("Pin menubar", "固定菜單欄"),
("Unpin menubar", "取消固定菜單欄"),
("Enable LAN Discovery", "允許局域網發現"),
("Deny LAN Discovery", "拒絕局域網發現"),
].iter().cloned().collect();
}

View File

@ -346,5 +346,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Enable RDP", ""),
("Pin menubar", "Ghim thanh menu"),
("Unpin menubar", "Bỏ ghim thanh menu"),
("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""),
].iter().cloned().collect();
}

View File

@ -276,6 +276,7 @@ class MyIdMenu: Reactor.Component {
<li #enable-file-transfer><span>{svg_checkmark}</span>{translate('Enable File Transfer')}</li>
<li #enable-remote-restart><span>{svg_checkmark}</span>{translate('Enable Remote Restart')}</li>
<li #enable-tunnel><span>{svg_checkmark}</span>{translate('Enable TCP Tunneling')}</li>
<li #enable-lan-discovery><span>{svg_checkmark}</span>{translate('Enable LAN Discovery')}</li>
<AudioInputs />
<Enhancements />
<li #allow-remote-config-modification><span>{svg_checkmark}</span>{translate('Enable remote configuration modification')}</li>