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

View File

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

View File

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

View File

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