Skip to content

Commit 224037e

Browse files
soso
authored andcommitted
Release v0.0.8 update check cleanup
1 parent 484ffe5 commit 224037e

5 files changed

Lines changed: 119 additions & 23 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "emby302gateway-rs"
3-
version = "0.0.7"
3+
version = "0.0.8"
44
edition = "2024"
55
license = "MIT"
66

docs/changelog.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# 版本更新日志
22

3+
## v0.0.8
4+
5+
发布时间:2026-05-24
6+
7+
### 调整
8+
9+
- 版本检查入口调整为左侧品牌区版本号点击触发。
10+
- 移除本地更新检查测试开关,恢复正常 GitHub Release 检查流程。
11+
- 右上角不再显示版本检查按钮,避免重复展示。
12+
13+
### 验证
14+
15+
- `cargo fmt --check`
16+
- `cargo clippy --all-targets -- -D warnings`
17+
- `cargo test`
18+
- `cd frontend && npm run build`
19+
- `cargo build --release --offline`
20+
321
## v0.0.7
422

523
发布时间:2026-05-24

frontend/src/App.vue

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,8 @@ const proxyStatuses = ref<ProxyStatus[]>([])
321321
const connectivityStatuses = ref<ConnectivityCheckStatus[]>([])
322322
const requestStats = ref<RequestStatsDaily[]>([])
323323
const updateCheck = ref<UpdateCheck | null>(null)
324+
const updateChecking = ref(false)
325+
const updateCheckError = ref('')
324326
const validationResults = ref<ValidationResult[]>([])
325327
const rateLimitWindows = ref<PlaybackRateWindowStatus[]>([])
326328
const auditLogs = ref<AuditLogEntry[]>([])
@@ -665,10 +667,15 @@ async function refreshOperationalData() {
665667
}
666668
667669
async function refreshUpdateCheck() {
670+
updateChecking.value = true
671+
updateCheckError.value = ''
668672
try {
669673
updateCheck.value = await api<UpdateCheck>('/api/app-info/update-check')
670-
} catch {
674+
} catch (err) {
671675
updateCheck.value = null
676+
updateCheckError.value = err instanceof Error ? err.message : String(err)
677+
} finally {
678+
updateChecking.value = false
672679
}
673680
}
674681
@@ -1738,10 +1745,28 @@ onBeforeUnmount(stopDashboardPolling)
17381745
<aside class="sidebar">
17391746
<div class="brand-row compact">
17401747
<div class="logo-mark">E</div>
1741-
<div>
1748+
<button
1749+
class="brand-version"
1750+
:class="{ update: updateCheck?.has_update, error: Boolean(updateCheckError) }"
1751+
:title="
1752+
updateChecking
1753+
? '正在检查更新'
1754+
: updateCheck?.has_update
1755+
? `有新版本:${updateCheck.latest_version}`
1756+
: updateCheckError
1757+
? `检查失败:${updateCheckError}`
1758+
: '点击检查更新'
1759+
"
1760+
@click="refreshUpdateCheck"
1761+
>
17421762
<strong>{{ appInfo.name }}</strong>
1743-
<small>{{ appInfo.version || '版本读取中' }}</small>
1744-
</div>
1763+
<small>
1764+
{{ appInfo.version || '版本读取中' }}
1765+
<span v-if="updateChecking" class="brand-version-badge">检查中</span>
1766+
<span v-else-if="updateCheck?.has_update" class="brand-version-badge update">有更新</span>
1767+
<span v-else-if="updateCheckError" class="brand-version-badge error">失败</span>
1768+
</small>
1769+
</button>
17451770
</div>
17461771

17471772
<nav>
@@ -1892,10 +1917,6 @@ onBeforeUnmount(stopDashboardPolling)
18921917
<small>今日累计</small>
18931918
</div>
18941919
</div>
1895-
<div v-if="updateCheck?.has_update" class="notice warn update-notice">
1896-
发现新版本 {{ updateCheck.latest_version }},当前 {{ updateCheck.current_version }}。
1897-
<a :href="updateCheck.release_url" target="_blank" rel="noreferrer">查看 Release</a>
1898-
</div>
18991920
<div class="connectivity-list">
19001921
<div
19011922
v-for="row in operationalServerRows"

frontend/src/style.css

Lines changed: 70 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,66 @@ button:disabled {
173173
padding: 0 8px;
174174
}
175175

176+
.brand-version {
177+
min-width: 0;
178+
display: grid;
179+
justify-items: start;
180+
gap: 1px;
181+
padding: 0;
182+
border: 0;
183+
background: transparent;
184+
text-align: left;
185+
}
186+
187+
.brand-version strong {
188+
color: var(--text);
189+
font-size: 14px;
190+
line-height: 1.1;
191+
}
192+
193+
.brand-version small {
194+
display: flex;
195+
align-items: center;
196+
gap: 6px;
197+
color: var(--muted);
198+
font-size: 12px;
199+
line-height: 1.1;
200+
}
201+
202+
.brand-version:hover strong,
203+
.brand-version:hover small {
204+
color: var(--text);
205+
}
206+
207+
.brand-version.update strong,
208+
.brand-version.update small {
209+
color: var(--active-text);
210+
}
211+
212+
.brand-version.error strong,
213+
.brand-version.error small {
214+
color: var(--danger-text);
215+
}
216+
217+
.brand-version-badge {
218+
border-radius: 999px;
219+
padding: 1px 6px;
220+
background: var(--chip-bg);
221+
color: var(--chip-text);
222+
font-size: 11px;
223+
font-weight: 800;
224+
}
225+
226+
.brand-version-badge.update {
227+
background: var(--warn-bg);
228+
color: var(--warn-text);
229+
}
230+
231+
.brand-version-badge.error {
232+
background: var(--danger-bg);
233+
color: var(--danger-text);
234+
}
235+
176236
.brand-row h1 {
177237
margin: 0;
178238
font-size: 24px;
@@ -502,15 +562,6 @@ label span {
502562
grid-column: 1 / -1;
503563
}
504564

505-
.update-notice {
506-
margin: 12px 0 0;
507-
}
508-
509-
.update-notice a {
510-
color: inherit;
511-
font-weight: 800;
512-
}
513-
514565
.connectivity-list {
515566
display: grid;
516567
gap: 8px;
@@ -1794,6 +1845,16 @@ textarea:focus {
17941845
grid-template-columns: 1fr 1fr;
17951846
}
17961847

1848+
.update-card {
1849+
align-items: flex-start;
1850+
flex-direction: column;
1851+
}
1852+
1853+
.update-actions {
1854+
width: 100%;
1855+
justify-content: flex-start;
1856+
}
1857+
17971858
.log-toolbar {
17981859
grid-template-columns: repeat(2, minmax(0, 1fr));
17991860
}
@@ -1817,10 +1878,6 @@ textarea:focus {
18171878
padding: 0 12px;
18181879
}
18191880

1820-
.content {
1821-
padding: 12px;
1822-
}
1823-
18241881
.panel {
18251882
padding: 12px;
18261883
}

0 commit comments

Comments
 (0)