Skip to content

Commit 8b0a6cd

Browse files
soso
authored andcommitted
Release v0.2.2
1 parent 5681f68 commit 8b0a6cd

5 files changed

Lines changed: 95 additions & 66 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.2.1"
3+
version = "0.2.2"
44
edition = "2024"
55
license = "MIT"
66

docs/changelog.md

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

3+
## v0.2.2
4+
5+
发布时间:2026-06-15
6+
7+
### 新增
8+
9+
- 无。
10+
11+
### 优化
12+
13+
- 客户端 UA 拦截列表只保留单个记录时间字段,减少创建时间和更新时间并列展示造成的理解成本。
14+
- 客户端 UA 拦截列表改为单行展示关键词、描述、状态、记录时间和操作,长 UA 自动省略并可悬停查看完整内容。
15+
- 客户端 UA 拦截列表新增日期说明,明确记录时间表示首次出现或手动添加时间,后台更新时间不会因同 UA 重复请求而每次刷新。
16+
17+
### 修复
18+
19+
- 修复移动端客户端 UA 拦截记录被拆成多行卡片后,同一 UA 记录占用过高、关键词下方显示“其它”等客户端分类信息的问题。
20+
21+
### 验证
22+
23+
- `cargo fmt`
24+
- `cargo check`
25+
- `cd frontend && npx vue-tsc -b --noEmit`
26+
327
## v0.2.1
428

529
发布时间:2026-06-11

frontend/src/App.vue

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ const clientRuleRows = computed(() =>
604604
if (!keyword) return true
605605
return record.user_agent.toLowerCase().includes(keyword)
606606
})
607-
.sort((left, right) => Number(right.updated_at) - Number(left.updated_at)),
607+
.sort((left, right) => Number(right.created_at) - Number(left.created_at)),
608608
)
609609
const blockedClientCount = computed(() => clientControl.records.filter((record) => record.enabled).length)
610610
const allowedClientCount = computed(() => clientControl.records.length - blockedClientCount.value)
@@ -1972,9 +1972,15 @@ function formatUptime(seconds: number | undefined) {
19721972
}
19731973
19741974
function formatTimestamp(value: string) {
1975+
const date = parseUnixTimestamp(value)
1976+
if (!date) return '--'
1977+
return date.toLocaleString()
1978+
}
1979+
1980+
function parseUnixTimestamp(value: string) {
19751981
const timestamp = Number(value)
1976-
if (!Number.isFinite(timestamp) || timestamp <= 0) return '--'
1977-
return new Date(timestamp * 1000).toLocaleString()
1982+
if (!Number.isFinite(timestamp) || timestamp <= 0) return null
1983+
return new Date(timestamp * 1000)
19781984
}
19791985
19801986
function formatLogTime(value: number) {
@@ -2059,13 +2065,6 @@ function clientKeyword(record: ClientRuleRecord) {
20592065
return record.user_agent || record.client_name || '--'
20602066
}
20612067
2062-
function clientSubtext(record: ClientRuleRecord) {
2063-
const keyword = clientKeyword(record).trim().toLowerCase()
2064-
const client = record.client_name.trim()
2065-
if (!client || client.toLowerCase() === keyword) return ''
2066-
return client
2067-
}
2068-
20692068
onMounted(bootstrap)
20702069
onBeforeUnmount(stopDashboardPolling)
20712070
</script>
@@ -2864,34 +2863,39 @@ onBeforeUnmount(stopDashboardPolling)
28642863
</section>
28652864

28662865
<section class="panel client-table-panel">
2866+
<div class="client-date-note">
2867+
<strong>日期说明</strong>
2868+
<span>时间为该 UA 第一次出现或手动添加的时间;后台更新时间只在规则状态、备注或客户端信息变化时刷新,同一 UA 重复请求不会每次刷新。</span>
2869+
</div>
28672870
<div class="client-table-wrap">
28682871
<table class="client-table">
28692872
<thead>
28702873
<tr>
28712874
<th>关键字</th>
28722875
<th>描述</th>
28732876
<th>状态</th>
2874-
<th>创建时间</th>
2875-
<th>更新时间</th>
2877+
<th>记录时间</th>
28762878
<th>操作</th>
28772879
</tr>
28782880
</thead>
28792881
<tbody>
28802882
<tr v-for="record in clientRuleRows" :key="record.id">
28812883
<td>
2882-
<strong>{{ clientKeyword(record) }}</strong>
2883-
<small v-if="clientSubtext(record)">{{ clientSubtext(record) }}</small>
2884+
<strong :title="clientKeyword(record)">{{ clientKeyword(record) }}</strong>
28842885
</td>
28852886
<td>
2886-
<span>{{ record.note || (record.source === 'auto' ? '自动记录播放设备' : '手动 UA 拦截') }}</span>
2887+
<span :title="record.note || (record.source === 'auto' ? '自动记录播放设备' : '手动 UA 拦截')">
2888+
{{ record.note || (record.source === 'auto' ? '自动记录播放设备' : '手动 UA 拦截') }}
2889+
</span>
28872890
</td>
28882891
<td>
28892892
<span :class="['client-badge', record.enabled ? 'blocked' : 'allowed']">
28902893
{{ record.enabled ? '已禁用' : '允许播放' }}
28912894
</span>
28922895
</td>
2893-
<td>{{ formatTimestamp(record.created_at) }}</td>
2894-
<td>{{ formatTimestamp(record.updated_at) }}</td>
2896+
<td class="client-time-cell">
2897+
{{ formatTimestamp(record.created_at) }}
2898+
</td>
28952899
<td>
28962900
<div class="rule-actions">
28972901
<button

frontend/src/style.css

Lines changed: 48 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,14 +1680,32 @@ label span {
16801680
overflow: hidden;
16811681
}
16821682

1683+
.client-date-note {
1684+
display: flex;
1685+
flex-wrap: wrap;
1686+
gap: 6px 10px;
1687+
align-items: center;
1688+
padding: 12px 14px;
1689+
border-bottom: 1px solid var(--track-bg);
1690+
background: var(--panel-soft);
1691+
color: var(--muted);
1692+
font-size: 12px;
1693+
line-height: 1.5;
1694+
}
1695+
1696+
.client-date-note strong {
1697+
color: var(--text-soft);
1698+
}
1699+
16831700
.client-table-wrap {
16841701
overflow-x: auto;
16851702
}
16861703

16871704
.client-table {
16881705
width: 100%;
1689-
min-width: 900px;
1706+
min-width: 820px;
16901707
border-collapse: collapse;
1708+
table-layout: fixed;
16911709
}
16921710

16931711
.client-table th,
@@ -1713,28 +1731,49 @@ label span {
17131731
.client-table td {
17141732
color: var(--button-text);
17151733
font-size: 13px;
1734+
overflow: hidden;
1735+
text-overflow: ellipsis;
1736+
white-space: nowrap;
17161737
}
17171738

17181739
.client-table td strong {
17191740
display: block;
1720-
max-width: 380px;
1721-
overflow-wrap: anywhere;
1741+
overflow: hidden;
1742+
text-overflow: ellipsis;
1743+
white-space: nowrap;
17221744
color: var(--text);
17231745
font-size: 13px;
17241746
}
17251747

1726-
.client-table td small {
1727-
display: block;
1728-
max-width: 380px;
1729-
margin-top: 4px;
1730-
color: var(--muted);
1731-
overflow-wrap: anywhere;
1748+
.client-table th:nth-child(1) {
1749+
width: 28%;
1750+
}
1751+
1752+
.client-table th:nth-child(2) {
1753+
width: 24%;
1754+
}
1755+
1756+
.client-table th:nth-child(3) {
1757+
width: 96px;
1758+
}
1759+
1760+
.client-table th:nth-child(4) {
1761+
width: 170px;
1762+
}
1763+
1764+
.client-table th:nth-child(5) {
1765+
width: 150px;
1766+
}
1767+
1768+
.client-time-cell {
1769+
white-space: nowrap;
17321770
}
17331771

17341772
.rule-actions {
17351773
display: flex;
17361774
align-items: center;
17371775
gap: 10px;
1776+
white-space: nowrap;
17381777
}
17391778

17401779
.client-badge {
@@ -2290,44 +2329,6 @@ textarea:focus {
22902329
margin-left: 0;
22912330
}
22922331

2293-
.client-table {
2294-
min-width: 0;
2295-
}
2296-
2297-
.client-table thead {
2298-
display: none;
2299-
}
2300-
2301-
.client-table,
2302-
.client-table tbody,
2303-
.client-table tr,
2304-
.client-table td {
2305-
display: block;
2306-
width: 100%;
2307-
}
2308-
2309-
.client-table tr {
2310-
border-bottom: 1px solid var(--track-bg);
2311-
padding: 10px 12px;
2312-
}
2313-
2314-
.client-table td {
2315-
border-bottom: 0;
2316-
padding: 7px 0;
2317-
}
2318-
2319-
.client-table td:nth-child(3),
2320-
.client-table td:nth-child(4),
2321-
.client-table td:nth-child(5) {
2322-
display: inline-block;
2323-
width: auto;
2324-
margin-right: 10px;
2325-
}
2326-
2327-
.client-table td:last-child {
2328-
width: 100%;
2329-
}
2330-
23312332
.rule-actions {
23322333
justify-content: space-between;
23332334
}

0 commit comments

Comments
 (0)