增加隐藏网络模式切换开关

This commit is contained in:
Sun 2024-01-24 14:54:37 +08:00
parent e0dcc49f5b
commit fceacf58b8
7 changed files with 31 additions and 19 deletions

View File

@ -237,6 +237,13 @@ function resetPanelConfig() {
</div>
<NGrid cols="2">
<NGridItem span="12 400:12">
<div class="flex items-center mt-[5px]">
<span class="mr-[10px]">{{ $t('apps.baseSettings.netModeChangeButtonShow') }}</span>
<NSwitch v-model:value="panelState.panelConfig.netModeChangeButtonShow" />
</div>
</NGridItem>
<NGridItem span="12 400:12">
<div class="flex items-center mt-[10px]">
<span class="mr-[10px]">{{ $t('apps.baseSettings.maxWidth') }}</span>

View File

@ -64,6 +64,7 @@
"leftRightMargin": "Left-right margin",
"mask": "Mask",
"maxWidth": "Max width",
"netModeChangeButtonShow": "Show network mode switch button",
"publicVisitModeShow": "Allow public mode display",
"resetWarnText": "Are you sure you want to reset these styles?",
"searchBar": "Search bar component",

View File

@ -64,6 +64,7 @@
"leftRightMargin": "左右边距",
"mask": "遮罩",
"maxWidth": "最大宽度",
"netModeChangeButtonShow": "显示网络模式切换按钮",
"publicVisitModeShow": "公开模式允许显示",
"resetWarnText": "确定要重置这些样式吗?",
"searchBar": "搜索栏组件",

View File

@ -28,6 +28,7 @@ export function defaultStatePanelConfig(): Panel.panelConfig {
systemMonitorShow: false,
systemMonitorShowTitle: true,
systemMonitorPublicVisitModeShow: false,
netModeChangeButtonShow: true,
}
}

View File

@ -26,7 +26,7 @@ export const usePanelState = defineStore('panel', {
this.recordState()
},
// 获取云端的面板配置
// 获取云端(搭建的服务器)的面板配置
updatePanelConfigByCloud() {
getUserConfig<Panel.userConfig>().then((res) => {
if (res.code === 0)

View File

@ -59,6 +59,7 @@ declare namespace Panel {
systemMonitorShow?:boolean
systemMonitorShowTitle?:boolean
systemMonitorPublicVisitModeShow?:boolean
netModeChangeButtonShow?:boolean
}
interface userConfig{

View File

@ -503,10 +503,11 @@ function handleAddItem(itemIconGroupId?: number) {
/>
<!-- 悬浮按钮 -->
<div class="fixed-element shadow-[0_0_10px_2px_rgba(0,0,0,0.2)]">
<div class="fixed-element shadow-[0_0_10px_2px_rgba(0,0,0,0.2)]">
<NButtonGroup vertical>
<!-- 网络模式切换按钮组 -->
<NButton
v-if="panelState.networkMode === PanelStateNetworkModeEnum.lan" color="#2a2a2a6b"
v-if="panelState.networkMode === PanelStateNetworkModeEnum.lan && panelState.panelConfig.netModeChangeButtonShow" color="#2a2a2a6b"
:title="t('panelHome.changeToWanModel')" @click="handleChangeNetwork(PanelStateNetworkModeEnum.wan)"
>
<template #icon>
@ -515,7 +516,7 @@ function handleAddItem(itemIconGroupId?: number) {
</NButton>
<NButton
v-if="panelState.networkMode === PanelStateNetworkModeEnum.wan" color="#2a2a2a6b"
v-if="panelState.networkMode === PanelStateNetworkModeEnum.wan && panelState.panelConfig.netModeChangeButtonShow" color="#2a2a2a6b"
:title="t('panelHome.changeToLanModel')" @click="handleChangeNetwork(PanelStateNetworkModeEnum.lan)"
>
<template #icon>
@ -536,25 +537,25 @@ function handleAddItem(itemIconGroupId?: number) {
</NButton>
</NButtonGroup>
<NBackTop
:listen-to="() => scrollContainerRef"
:right="10"
:bottom="10"
style="background-color:transparent;border: none;box-shadow: none;"
>
<div class="shadow-[0_0_10px_2px_rgba(0,0,0,0.2)]">
<NButton color="#2a2a2a6b">
<template #icon>
<SvgIcon class="text-white font-xl" icon="icon-park-outline:to-top" />
</template>
</NButton>
</div>
</NBackTop>
<AppStarter v-model:visible="settingModalShow" />
<!-- <Setting v-model:visible="settingModalShow" /> -->
</div>
<NBackTop
:listen-to="() => scrollContainerRef"
:right="10"
:bottom="10"
style="background-color:transparent;border: none;box-shadow: none;"
>
<div class="shadow-[0_0_10px_2px_rgba(0,0,0,0.2)]">
<NButton color="#2a2a2a6b">
<template #icon>
<SvgIcon class="text-white font-xl" icon="icon-park-outline:to-top" />
</template>
</NButton>
</div>
</NBackTop>
<EditItem v-model:visible="editItemInfoShow" :item-info="editItemInfoData" :item-group-id="currentAddItenIconGroupId" @done="handleEditSuccess" />
<!-- 弹窗 -->