This commit is contained in:
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "fonu-web",
|
||||
"version": "1.5.2",
|
||||
"version": "1.5.3",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "fonu-web",
|
||||
"version": "1.5.2",
|
||||
"version": "1.5.3",
|
||||
"dependencies": {
|
||||
"@codemirror/commands": "^6.11.1",
|
||||
"@codemirror/lang-javascript": "^6.2.5",
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "fonu-web",
|
||||
"private": true,
|
||||
"version": "1.5.2",
|
||||
"version": "1.5.3",
|
||||
"packageManager": "npm@10.9.4",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { agentVersionText } from './agent'
|
||||
|
||||
describe('agentVersionText', () => {
|
||||
it('有版本号时原样展示', () => {
|
||||
expect(agentVersionText('0.14.1')).toBe('0.14.1')
|
||||
})
|
||||
|
||||
it('旧 Agent 缺少版本字段时降级为占位符', () => {
|
||||
expect(agentVersionText()).toBe('—')
|
||||
expect(agentVersionText('')).toBe('—')
|
||||
expect(agentVersionText(' ')).toBe('—')
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,4 @@
|
||||
/** Agent 版本展示:旧 Agent 未返回 agent_version 时降级为占位符,避免页面出现空白。 */
|
||||
export function agentVersionText(version?: string): string {
|
||||
return version?.trim() || '—'
|
||||
}
|
||||
@@ -188,7 +188,7 @@
|
||||
<FonuCard class="section-card" title="Fonu Agent">
|
||||
<div class="section-body">
|
||||
<div class="field-grid">
|
||||
<div><label>Agent 版本</label><span class="mono">{{ agentStatus?.agent_version || '—' }}</span></div>
|
||||
<div><label>Agent 版本</label><span class="mono">{{ agentVersionText(agentStatus?.agent_version) }}</span></div>
|
||||
<div><label>凭据状态</label><span class="field-tags">
|
||||
<StatusBadge :kind="server.agent_configured ? 'success' : 'warning'" :text="server.agent_configured ? '已配置' : '未配置'" />
|
||||
</span></div>
|
||||
@@ -705,6 +705,7 @@ import type {
|
||||
import { formatBytes, formatDate, formatRelativeTime, formatUptime } from '../utils/format'
|
||||
import type { StatusKind } from '../utils/status'
|
||||
import { copyText } from '../utils/clipboard'
|
||||
import { agentVersionText } from '../utils/agent'
|
||||
import { useVisibilityPolling } from '../composables/useVisibilityPolling'
|
||||
|
||||
use([CanvasRenderer, LineChart, ScatterChart, GridComponent, TooltipComponent])
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
</template>
|
||||
</PageHeader>
|
||||
|
||||
<n-alert type="success" :bordered="false" class="example-alert" title="v1.5.2 示例页面验证标识已生效">
|
||||
<n-alert type="success" :bordered="false" class="example-alert" title="v1.5.3 示例页面验证标识已生效">
|
||||
当前页面由 v{{ version }} 提供,验证标识为 <span class="mono">{{ verificationMarker }}</span>。
|
||||
如果你是在升级后首次看到这行内容,说明前端构建、镜像重建和服务重启均已成功。
|
||||
</n-alert>
|
||||
@@ -19,7 +19,7 @@
|
||||
<strong class="example-proof__value">{{ verificationRound }}</strong>
|
||||
</div>
|
||||
<div class="example-proof__hint">
|
||||
看到这个新区块,说明前端资源已经从旧版本切换到 v1.5.2。
|
||||
看到这个新区块,说明前端资源已经从旧版本切换到 v1.5.3。
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -33,16 +33,16 @@
|
||||
<StatCard label="本次验证标识" :value="verificationMarker" sub="用于区分升级前后的前端资源" tone="blue" value-small>
|
||||
<template #icon><n-icon :component="FlashOutline" /></template>
|
||||
</StatCard>
|
||||
<StatCard label="页面状态" value="已更新" sub="v1.5.2 前端资源已加载" tone="teal">
|
||||
<StatCard label="页面状态" value="已更新" sub="v1.5.3 前端资源已加载" tone="teal">
|
||||
<template #icon><n-icon :component="CheckmarkCircleOutline" /></template>
|
||||
</StatCard>
|
||||
</div>
|
||||
|
||||
<FonuCard title="本次示例页变化" subtitle="用于确认升级后的页面内容确实发生变化">
|
||||
<ul class="example-changes">
|
||||
<li>页面版本提示更新为 v1.5.2。</li>
|
||||
<li>「本次升级验证」区块和页面状态同步更新为 v1.5.2。</li>
|
||||
<li>验证标识更新为 <span class="mono">v1.5.2-example-page</span>。</li>
|
||||
<li>页面版本提示更新为 v1.5.3。</li>
|
||||
<li>「本次升级验证」区块和页面状态同步更新为 v1.5.3。</li>
|
||||
<li>验证标识更新为 <span class="mono">v1.5.3-example-page</span>。</li>
|
||||
</ul>
|
||||
</FonuCard>
|
||||
|
||||
@@ -87,8 +87,8 @@ const message = useMessage()
|
||||
const version = ref(__APP_VERSION__)
|
||||
const checkedAt = ref('')
|
||||
const refreshing = ref(false)
|
||||
const verificationRound = 'v1.5.2'
|
||||
const verificationMarker = 'v1.5.2-example-page'
|
||||
const verificationRound = 'v1.5.3'
|
||||
const verificationMarker = 'v1.5.3-example-page'
|
||||
|
||||
async function refreshVersion() {
|
||||
refreshing.value = true
|
||||
|
||||
Reference in New Issue
Block a user