feat: add configurable Status menu button (#851)

This commit is contained in:
Dream Hunter
2026-03-03 12:58:49 +08:00
committed by GitHub
parent 4ef4c0d938
commit f55e8c9818
8 changed files with 31 additions and 2 deletions
+1
View File
@@ -92,6 +92,7 @@ const getOpenSettings = async (message, notification) => {
enableWebhook: res["enableWebhook"] || false,
isS3Enabled: res["isS3Enabled"] || false,
enableAddressPassword: res["enableAddressPassword"] || false,
statusUrl: res["statusUrl"] || "",
});
if (openSettings.value.needAuth) {
showAuth.value = true;
+1
View File
@@ -38,6 +38,7 @@ export const useGlobalState = createGlobalState(
showGithub: true,
disableAdminPasswordCheck: false,
enableAddressPassword: false,
statusUrl: '',
})
const settings = ref({
fetched: false,
+22 -1
View File
@@ -6,7 +6,7 @@ import { useRoute, useRouter, RouterLink } from 'vue-router'
import { useIsMobile } from '../utils/composables'
import {
DarkModeFilled, LightModeFilled, MenuFilled,
AdminPanelSettingsFilled
AdminPanelSettingsFilled, MonitorHeartFilled
} from '@vicons/material'
import { GithubAlt, Language, User, Home } from '@vicons/fa'
@@ -59,6 +59,7 @@ const { locale, t } = useI18n({
home: 'Home',
menu: 'Menu',
user: 'User',
status: 'Status',
ok: 'OK',
},
zh: {
@@ -70,6 +71,7 @@ const { locale, t } = useI18n({
home: '主页',
menu: '菜单',
user: '用户',
status: '状态',
ok: '确定',
}
}
@@ -179,6 +181,25 @@ const menuOptions = computed(() => [
),
key: "lang"
},
{
label: () => h(
NButton,
{
text: true,
size: "small",
style: "width: 100%",
tag: "a",
target: "_blank",
href: openSettings.value?.statusUrl,
},
{
default: () => t('status'),
icon: () => h(NIcon, { component: MonitorHeartFilled })
}
),
show: !!openSettings.value?.statusUrl,
key: "status"
},
{
label: () => h(
NButton,