chore: add wechat official account entrance

This commit is contained in:
Lykin 2024-01-10 18:10:32 +08:00
parent 115aa9d079
commit d989cdd85b
5 changed files with 35 additions and 7 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { computed } from 'vue' import { computed, ref } from 'vue'
import { NIcon, useThemeVars } from 'naive-ui' import { NIcon, useThemeVars } from 'naive-ui'
import Database from '@/components/icons/Database.vue' import Database from '@/components/icons/Database.vue'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
@ -14,6 +14,7 @@ import Record from '@/components/icons/Record.vue'
import { extraTheme } from '@/utils/extra_theme.js' import { extraTheme } from '@/utils/extra_theme.js'
import useBrowserStore from 'stores/browser.js' import useBrowserStore from 'stores/browser.js'
import { useRender } from '@/utils/render.js' import { useRender } from '@/utils/render.js'
import wechatUrl from '@/assets/images/wechat_official.png'
const themeVars = useThemeVars() const themeVars = useThemeVars()
const render = useRender() const render = useRender()
@ -35,6 +36,7 @@ const iconSize = computed(() => Math.floor(props.width * 0.45))
const browserStore = useBrowserStore() const browserStore = useBrowserStore()
const i18n = useI18n() const i18n = useI18n()
const showWechat = ref(false)
const menuOptions = computed(() => { const menuOptions = computed(() => {
return [ return [
{ {
@ -80,6 +82,10 @@ const preferencesOptions = computed(() => {
type: 'divider', type: 'divider',
key: 'd1', key: 'd1',
}, },
{
label: 'menu.wechat_official',
key: 'wechat_official',
},
{ {
label: 'menu.about', label: 'menu.about',
key: 'about', key: 'about',
@ -100,6 +106,9 @@ const onSelectPreferenceMenu = (key) => {
case 'report': case 'report':
BrowserOpenURL('https://github.com/tiny-craft/tiny-rdm/issues') BrowserOpenURL('https://github.com/tiny-craft/tiny-rdm/issues')
break break
case 'wechat_official':
showWechat.value = true
break
case 'about': case 'about':
dialogStore.openAboutDialog() dialogStore.openAboutDialog()
break break
@ -149,8 +158,22 @@ const exThemeVars = computed(() => {
@select="onSelectPreferenceMenu"> @select="onSelectPreferenceMenu">
<icon-button :icon="Config" :size="iconSize" :stroke-width="3" class="nav-menu-button" /> <icon-button :icon="Config" :size="iconSize" :stroke-width="3" class="nav-menu-button" />
</n-dropdown> </n-dropdown>
<icon-button :icon="Github" :size="iconSize" class="nav-menu-button" @click="openGithub" /> <icon-button
:icon="Github"
:size="iconSize"
:tooltip="$t('ribbon.github')"
class="nav-menu-button"
@click="openGithub" />
</div> </div>
<!-- wechat official modal -->
<n-modal
:show="showWechat"
transform-origin="center"
@close="showWechat = false"
@mask-click="showWechat = false">
<n-image :src="wechatUrl" :width="400" preview-disabled />
</n-modal>
</div> </div>
</template> </template>
@ -224,7 +247,7 @@ const exThemeVars = computed(() => {
.nav-menu-item { .nav-menu-item {
align-items: center; align-items: center;
padding: 10px 0; padding: 10px 0;
gap: 15px; gap: 18px;
--wails-draggable: none; --wails-draggable: none;
.nav-menu-button { .nav-menu-button {

View File

@ -70,7 +70,7 @@
"disconnect": "Disconnect", "disconnect": "Disconnect",
"dup_conn": "Duplicate Connection", "dup_conn": "Duplicate Connection",
"remove_conn": "Delete Connection", "remove_conn": "Delete Connection",
"edit_conn": "Edit Connection Config", "edit_conn": "Edit Connection",
"edit_conn_group": "Edit Group", "edit_conn_group": "Edit Group",
"rename_conn_group": "Rename Group", "rename_conn_group": "Rename Group",
"remove_conn_group": "Delete Group", "remove_conn_group": "Delete Group",
@ -142,7 +142,8 @@
"ribbon": { "ribbon": {
"server": "Server", "server": "Server",
"browser": "Data Browser", "browser": "Data Browser",
"log": "Log" "log": "Log",
"github": "Github"
}, },
"dialogue": { "dialogue": {
"close_confirm": "Confirm close this tab and connection ({name})", "close_confirm": "Confirm close this tab and connection ({name})",
@ -335,6 +336,7 @@
"help": "Help", "help": "Help",
"check_update": "Check for Updates...", "check_update": "Check for Updates...",
"report_bug": "Report a Bug", "report_bug": "Report a Bug",
"wechat_official": "Wechat Official Account",
"about": "About" "about": "About"
}, },
"log": { "log": {

View File

@ -114,7 +114,8 @@
"ribbon": { "ribbon": {
"server": "Servidor", "server": "Servidor",
"browser": "Navegador de Dados", "browser": "Navegador de Dados",
"log": "Log" "log": "Log",
"github": "Github"
}, },
"dialogue": { "dialogue": {
"close_confirm": "Confirmar o fechamento desta guia e conexão ({name})", "close_confirm": "Confirmar o fechamento desta guia e conexão ({name})",

View File

@ -142,7 +142,8 @@
"ribbon": { "ribbon": {
"server": "服务器", "server": "服务器",
"browser": "数据浏览", "browser": "数据浏览",
"log": "日志" "log": "日志",
"github": "Github"
}, },
"dialogue": { "dialogue": {
"close_confirm": "是否关闭此连接({name}", "close_confirm": "是否关闭此连接({name}",
@ -335,6 +336,7 @@
"help": "帮助", "help": "帮助",
"check_update": "检查更新...", "check_update": "检查更新...",
"report_bug": "报告错误", "report_bug": "报告错误",
"wechat_official": "微信公众号",
"about": "关于" "about": "关于"
}, },
"log": { "log": {