diff --git a/napcat.webui/src/pages/NetWork.vue b/napcat.webui/src/pages/NetWork.vue index 07ad85a4..d9c51114 100644 --- a/napcat.webui/src/pages/NetWork.vue +++ b/napcat.webui/src/pages/NetWork.vue @@ -183,6 +183,10 @@ const showAddTabDialog = () => { const addTab = async () => { const { name, type } = newTab.value; + if (clientPanelData.some(panel => panel.name === name)) { + MessagePlugin.error('选项卡名称已存在'); + return; + } const defaultConfig = structuredClone(defaultConfigs[type]); defaultConfig.name = name; clientPanelData.push({ name, data: defaultConfig, key: type }); @@ -192,9 +196,10 @@ const addTab = async () => { MessagePlugin.success('选项卡添加成功'); }; -const removeTab = (payload: { value: string; index: number; e: PointerEvent }) => { +const removeTab = async (payload: { value: string; index: number; e: PointerEvent }) => { clientPanelData.splice(payload.index, 1); activeTab.value = Math.max(0, activeTab.value - 1); + await saveConfig(); }; onMounted(() => { @@ -225,6 +230,35 @@ onMounted(() => { flex-direction: column; } +.button-container { + display: flex; + justify-content: center; + margin-top: 20px; +} + +