diff --git a/frontend/src/components/dialogs/PreferencesDialog.vue b/frontend/src/components/dialogs/PreferencesDialog.vue index d015fab..dc22964 100644 --- a/frontend/src/components/dialogs/PreferencesDialog.vue +++ b/frontend/src/components/dialogs/PreferencesDialog.vue @@ -13,6 +13,7 @@ import Edit from '@/components/icons/Edit.vue' import { joinCommand } from '@/utils/decoder_cmd.js' import AddLink from '@/components/icons/AddLink.vue' import Checked from '@/components/icons/Checked.vue' +import { BrowserOpenURL } from 'wailsjs/runtime/runtime.js' const prefStore = usePreferencesStore() @@ -145,6 +146,19 @@ const decoderColumns = computed(() => { ] }) +const openDecodeHelp = () => { + let helpUrl = '' + switch (prefStore.currentLanguage) { + case 'zh': + helpUrl = 'https://redis.tinycraft.cc/zh/guide/custom-decoder.html' + break + default: + helpUrl = 'https://redis.tinycraft.cc/guide/custom-decoder.html' + break + } + BrowserOpenURL(helpUrl) +} + const onSavePreferences = async () => { const success = await prefStore.savePreferences() if (success) { @@ -354,13 +368,21 @@ const onClose = () => { - - - - {{ $t('preferences.decoder.new') }} - + + + + + {{ $t('preferences.decoder.new') }} + + + + {{ $t('preferences.decoder.help') }} + + { label: 'menu.report_bug', key: 'report', }, + { + label: 'menu.user_guide', + key: 'help', + }, { label: 'menu.check_update', key: 'update', @@ -104,6 +108,13 @@ const onSelectPreferenceMenu = (key) => { case 'report': BrowserOpenURL('https://github.com/tiny-craft/tiny-rdm/issues') break + case 'help': + if (prefStore.currentLanguage === 'zh') { + BrowserOpenURL('https://redis.tinycraft.cc/zh/guide/intro.html') + } else { + BrowserOpenURL('https://redis.tinycraft.cc/guide/intro.html') + } + break case 'about': dialogStore.openAboutDialog() break diff --git a/frontend/src/langs/en-us.json b/frontend/src/langs/en-us.json index fdea643..6c31229 100644 --- a/frontend/src/langs/en-us.json +++ b/frontend/src/langs/en-us.json @@ -71,7 +71,8 @@ "decoder_name": "Name", "cmd_preview": "Preview", "status": "Status", - "path": "Decoder Execution Path" + "auto_enabled": "Automatic Decoding Enabled", + "help": "Help" } }, "interface": { @@ -395,6 +396,7 @@ "close": "Close", "preferences": "Preferences", "help": "Help", + "user_guide": "User Guide", "check_update": "Check for Updates...", "report_bug": "Report a Bug", "about": "About" diff --git a/frontend/src/langs/zh-cn.json b/frontend/src/langs/zh-cn.json index 6af5ae9..4b504b9 100644 --- a/frontend/src/langs/zh-cn.json +++ b/frontend/src/langs/zh-cn.json @@ -71,7 +71,8 @@ "decoder_name": "解码器名称", "cmd_preview": "命令预览", "status": "状态", - "auto_enabled": "已加入自动解码" + "auto_enabled": "已加入自动解码", + "help": "帮助" } }, "interface": { @@ -395,6 +396,7 @@ "close": "关闭", "preferences": "偏好设置", "help": "帮助", + "user_guide": "使用指南", "check_update": "检查更新...", "report_bug": "报告错误", "about": "关于"