CI / verify (push) Canceled after 0s
- 自动备份:每日一份(按最新备份是否在 24h 内判定,重启不重复)、保留份数可配、列表/下载/恢复/删除,恢复前先校验归档;顺手修 writeArchive 逐个检查 tar/gzip/文件 Close()(审查报告 §二) - 健康持续化:只存状态变更(up/down/unknown)并推导可用率与不可用区间;公开状态页默认关闭、访问码存 SHA-256、按 IP 限流、只暴露域名与可用率 - 隧道判定修复:RouteHealthCandidate 新增 tunnel_known,frps 管理接口不可用时不再把「判不出来」当成「不通」(此前会误报「隧道连续不通」);汇总与徽标同样区分「无法判定」 - 指标历史:metrics_samples 纵向点表(本机 CPU/内存/磁盘 + 每规则上下行,30 天保留、查询按桶平均、不做降采样表);仪表盘趋势卡支持 1h/24h/7d - 仪表盘布局:运行状态并入顶部统计区(运行时长补进「服务」卡);性能并入系统资源那一行,整行 4 列 - 测试:backup/metrics/frp/api/app 新增用例;gofmt、go build/vet/test、vue-tsc、vite build 全绿 - agent 无改动,AgentVersion 保持 0.12.2
98 lines
3.5 KiB
TypeScript
98 lines
3.5 KiB
TypeScript
import { createRouter, createWebHistory } from 'vue-router'
|
|
import { api } from '../api/client'
|
|
import AppLayout from '../layouts/AppLayout.vue'
|
|
import LoginView from '../views/LoginView.vue'
|
|
import ProxyView from '../views/ProxyView.vue'
|
|
import DashboardView from '../views/DashboardView.vue'
|
|
import DdnsView from '../views/DdnsView.vue'
|
|
import CertificatesView from '../views/CertificatesView.vue'
|
|
import LogsView from '../views/LogsView.vue'
|
|
import SettingsView from '../views/SettingsView.vue'
|
|
import FrpView from '../views/FrpView.vue'
|
|
import AgentView from '../views/AgentView.vue'
|
|
import ProxyRemoteView from '../views/ProxyRemoteView.vue'
|
|
import StatusPageView from '../views/StatusPageView.vue'
|
|
|
|
const router = createRouter({
|
|
history: createWebHistory(),
|
|
routes: [
|
|
{ path: '/setup', redirect: '/login' },
|
|
{ path: '/login', name: 'login', component: LoginView, meta: { public: true } },
|
|
// 公开状态页:挂到公网给别人看的,不经过登录守卫
|
|
{ path: '/status', name: 'status', component: StatusPageView, meta: { public: true } },
|
|
{
|
|
path: '/',
|
|
component: AppLayout,
|
|
meta: { requiresAuth: true },
|
|
children: [
|
|
{ path: '', redirect: '/dashboard' },
|
|
{
|
|
path: 'dashboard',
|
|
name: 'dashboard',
|
|
component: DashboardView,
|
|
meta: { title: '仪表盘', description: '查看 Fonu 运行状态与关键指标' },
|
|
},
|
|
{
|
|
path: 'ddns',
|
|
name: 'ddns',
|
|
component: DdnsView,
|
|
meta: { title: 'DDNS', description: '自动同步公网 IP 到 DNS 解析' },
|
|
},
|
|
{
|
|
path: 'certificates',
|
|
name: 'certificates',
|
|
component: CertificatesView,
|
|
meta: { title: '证书管理', description: '通过 ACME 自动申请和续签证书' },
|
|
},
|
|
{
|
|
path: 'proxies',
|
|
name: 'proxies',
|
|
component: ProxyView,
|
|
meta: { title: '反向代理', description: '管理通过域名访问的 NAS 服务' },
|
|
},
|
|
{
|
|
path: 'frp',
|
|
name: 'frp',
|
|
component: FrpView,
|
|
meta: { title: '内网穿透', description: '通过 FRP 将公网流量转发到 Fonu Nginx' },
|
|
},
|
|
{
|
|
path: 'frp-agent',
|
|
name: 'frp-agent',
|
|
component: AgentView,
|
|
meta: { title: '公网 Agent', description: '管理部署在公网 VPS 上的 fonu-agent 与 frps' },
|
|
},
|
|
{
|
|
path: 'public-proxy',
|
|
name: 'public-proxy',
|
|
component: ProxyRemoteView,
|
|
meta: { title: '公网反代', description: '管理 VPS 上 Nginx 反代的部署/移除与安全选项' },
|
|
},
|
|
{
|
|
path: 'logs',
|
|
name: 'logs',
|
|
component: LogsView,
|
|
meta: { title: '日志中心', description: '查看系统、访问与 Nginx 错误日志' },
|
|
},
|
|
{
|
|
path: 'settings',
|
|
name: 'settings',
|
|
component: SettingsView,
|
|
meta: { title: '系统设置', description: '配置系统参数与运行策略' },
|
|
},
|
|
],
|
|
},
|
|
],
|
|
})
|
|
|
|
router.beforeEach(async (to) => {
|
|
// 公开页(状态页)不登录也能打开,也不必为它去问一次登录状态
|
|
if (to.meta.public && to.name !== 'login') return true
|
|
const status = await api.authStatus()
|
|
if (to.meta.requiresAuth && !status.authenticated) return { name: 'login' }
|
|
if (to.name === 'login' && status.authenticated) return { name: 'dashboard' }
|
|
return true
|
|
})
|
|
|
|
export default router
|