feat(desktop-client): add settings window and switch default API to production
- Open a dedicated settings BrowserWindow with general / login / diagnostics / about tabs - Persist openAtLogin and keepRunningInBackground via desktop-settings.json; hide main window instead of quitting when background mode is on - Default API base URL now points to api.shengxintui.com; LoginView and SettingsView share a single constant - Restore wangyihao session cookies on probe and silent refresh, and accept the legacy http://mp.163.com console origin - Drop the standalone diagnostics view in favor of the settings tab Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -6,8 +6,8 @@ import {
|
||||
SendOutlined,
|
||||
LinkOutlined,
|
||||
RobotOutlined,
|
||||
ToolOutlined,
|
||||
LogoutOutlined,
|
||||
SettingOutlined,
|
||||
} from "@ant-design/icons-vue";
|
||||
|
||||
import { useDesktopRuntime } from "../composables/useDesktopRuntime";
|
||||
@@ -61,13 +61,6 @@ const navItems = computed(() => {
|
||||
count: accounts.filter((item) => monitoringIDs.has(item.platform)).length,
|
||||
icon: RobotOutlined,
|
||||
},
|
||||
{
|
||||
to: "/diagnostics",
|
||||
title: "诊断",
|
||||
description: "vault、scheduler、transport 与原始快照",
|
||||
count: data?.clients.length ?? 0,
|
||||
icon: ToolOutlined,
|
||||
},
|
||||
];
|
||||
});
|
||||
|
||||
@@ -78,6 +71,10 @@ const liveClientLabel = computed(() => snapshot.value?.clients[0]?.deviceName ??
|
||||
const clientLabel = computed(
|
||||
() => liveClientLabel.value ?? session.value?.desktopClient?.device_name ?? "当前设备尚未注册 client",
|
||||
);
|
||||
|
||||
function openSettingsWindow() {
|
||||
void window.desktopBridge.app.openSettingsWindow();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -128,11 +125,18 @@ const clientLabel = computed(
|
||||
<span class="device-name-text">{{ clientLabel }}</span>
|
||||
</div>
|
||||
</a-tooltip>
|
||||
<a-tooltip title="退出登录" placement="top">
|
||||
<button type="button" class="logout-action-btn" @click="logout">
|
||||
<LogoutOutlined />
|
||||
</button>
|
||||
</a-tooltip>
|
||||
<div class="action-cluster">
|
||||
<a-tooltip title="设置" placement="top">
|
||||
<button type="button" class="footer-icon-btn" @click="openSettingsWindow">
|
||||
<SettingOutlined />
|
||||
</button>
|
||||
</a-tooltip>
|
||||
<a-tooltip title="退出登录" placement="top">
|
||||
<button type="button" class="footer-icon-btn footer-icon-btn--danger" @click="logout">
|
||||
<LogoutOutlined />
|
||||
</button>
|
||||
</a-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -428,7 +432,13 @@ h1 {
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.logout-action-btn {
|
||||
.action-cluster {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.footer-icon-btn {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 8px;
|
||||
@@ -441,9 +451,22 @@ h1 {
|
||||
border: 1px solid transparent;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.logout-action-btn:hover {
|
||||
.footer-icon-btn:hover {
|
||||
background: #f1f5f9;
|
||||
color: #1677ff;
|
||||
border-color: #e2e8f0;
|
||||
}
|
||||
|
||||
.footer-icon-btn.router-link-active {
|
||||
background: #e6f4ff;
|
||||
color: #1677ff;
|
||||
border-color: #e6f4ff;
|
||||
}
|
||||
|
||||
.footer-icon-btn--danger:hover {
|
||||
background: #fef2f2;
|
||||
color: #ef4444;
|
||||
border-color: #fee2e2;
|
||||
|
||||
Reference in New Issue
Block a user