From a7b5c936913bdf671b83ca0697cdbd3630163e9c Mon Sep 17 00:00:00 2001 From: Yukino Song Date: Tue, 10 Sep 2024 18:13:44 +0800 Subject: [PATCH] Jump to PIN directly from tray pairing message --- src/system_tray.cpp | 2 +- src_assets/common/assets/web/pin.html | 27 ++++++++++++++------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/system_tray.cpp b/src/system_tray.cpp index fd6bfcb9..fff08267 100644 --- a/src/system_tray.cpp +++ b/src/system_tray.cpp @@ -376,7 +376,7 @@ namespace system_tray { tray.notification_icon = TRAY_ICON_LOCKED; tray.tooltip = PROJECT_NAME; tray.notification_cb = []() { - launch_ui_with_path("/pin"); + launch_ui_with_path("/pin#PIN"); }; tray_update(&tray); } diff --git a/src_assets/common/assets/web/pin.html b/src_assets/common/assets/web/pin.html index 4d046219..5f5b576b 100644 --- a/src_assets/common/assets/web/pin.html +++ b/src_assets/common/assets/web/pin.html @@ -21,13 +21,21 @@
-
+ +
+ + + +
+
+
+

art://{{ hostAddr }}:{{ hostPort }}

@@ -46,14 +54,6 @@
{{ otpMessage }}
{{ $t('pin.otp_msg') }}
-
-
- - - -
-
-
{{ $t('_common.warning') }} {{ $t('pin.warning_msg') }}
@@ -94,7 +94,7 @@ const data = () => { return { editingHost: false, - currentTab: 'OTP', + currentTab: location.hash || '#OTP', otp: '', passphrase: '', otpMessage: '', @@ -122,7 +122,8 @@ }, methods: { switchTab(currentTab) { - Object.assign(this, data(), {currentTab}); + location.hash = currentTab; + Object.assign(this, data()); hostInfoCache = null; clearTimeout(resetOTPTimeout); },