fix(push): 移除点击复制服务器名称
名称点击恢复为与卡片/行一致的勾选行为。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,33 @@
|
|||||||
|
# 审计 — 推送页移除点击复制名称
|
||||||
|
|
||||||
|
**Changelog**: `docs/changelog/2026-06-12-push-remove-name-copy.md`
|
||||||
|
|
||||||
|
## 范围(文件清单)
|
||||||
|
|
||||||
|
| 文件 | 变更 |
|
||||||
|
|------|------|
|
||||||
|
| `frontend/src/components/push/PushServerGrid.vue` | 移除名称点击复制 |
|
||||||
|
|
||||||
|
## Step 3 规则扫描
|
||||||
|
|
||||||
|
| H | 规则 | 结论 |
|
||||||
|
|---|------|------|
|
||||||
|
| H1 | 安全 | PASS — 无新 API |
|
||||||
|
| H2 | 无静默吞错 | PASS |
|
||||||
|
| H3 | 无新密钥 | PASS |
|
||||||
|
| H4 | CUD | N/A |
|
||||||
|
|
||||||
|
## Closure
|
||||||
|
|
||||||
|
| H | 判定 | 依据 |
|
||||||
|
|---|------|------|
|
||||||
|
| H1–H4 | PASS | 纯前端交互回退 |
|
||||||
|
|
||||||
|
## DoD
|
||||||
|
|
||||||
|
- [x] type-check
|
||||||
|
- [ ] 生产 `#/push` 验证
|
||||||
|
|
||||||
|
## 验证
|
||||||
|
|
||||||
|
点击名称仅勾选服务器,无复制 toast。
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
# 推送页移除点击复制名称
|
||||||
|
|
||||||
|
**日期**:2026-06-12
|
||||||
|
|
||||||
|
## 动机
|
||||||
|
|
||||||
|
用户不需要点击服务器名称复制到剪贴板;点击应仅用于勾选服务器。
|
||||||
|
|
||||||
|
## 变更
|
||||||
|
|
||||||
|
- 移除卡片/列表视图中名称的 `@click.stop` 与剪贴板写入
|
||||||
|
- 移除 `push-server-copy-name` 样式(copy 光标、虚线下划线)
|
||||||
|
- 保留悬停 `title` 展示完整名称(卡片含域名)
|
||||||
|
|
||||||
|
## 涉及文件
|
||||||
|
|
||||||
|
- `frontend/src/components/push/PushServerGrid.vue`
|
||||||
|
|
||||||
|
## 验证
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd frontend && npm run type-check
|
||||||
|
```
|
||||||
|
|
||||||
|
推送页:点击名称与卡片其他区域一样切换勾选;无复制 toast。
|
||||||
|
|
||||||
|
## 迁移
|
||||||
|
|
||||||
|
无。仅前端构建部署。
|
||||||
@@ -78,9 +78,8 @@
|
|||||||
<div class="d-flex align-center ga-2 min-w-0">
|
<div class="d-flex align-center ga-2 min-w-0">
|
||||||
<v-icon :color="serverOnlineColor(s.is_online)" size="12" class="flex-shrink-0">mdi-circle</v-icon>
|
<v-icon :color="serverOnlineColor(s.is_online)" size="12" class="flex-shrink-0">mdi-circle</v-icon>
|
||||||
<span
|
<span
|
||||||
class="text-body-2 font-weight-medium push-server-card__name push-server-copy-name"
|
class="text-body-2 font-weight-medium push-server-card__name"
|
||||||
:title="`${serverLabelTitle(s)}\n点击复制名称`"
|
:title="serverLabelTitle(s)"
|
||||||
@click.stop="copyServerName(s.name)"
|
|
||||||
>{{ s.name }}</span>
|
>{{ s.name }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
@@ -140,11 +139,7 @@
|
|||||||
<v-icon :color="serverOnlineColor(s.is_online)" size="12">mdi-circle</v-icon>
|
<v-icon :color="serverOnlineColor(s.is_online)" size="12">mdi-circle</v-icon>
|
||||||
</td>
|
</td>
|
||||||
<td class="push-server-list__name-cell">
|
<td class="push-server-list__name-cell">
|
||||||
<span
|
<span :title="s.name">{{ s.name }}</span>
|
||||||
class="push-server-copy-name"
|
|
||||||
:title="`${s.name}\n点击复制名称`"
|
|
||||||
@click.stop="copyServerName(s.name)"
|
|
||||||
>{{ s.name }}</span>
|
|
||||||
</td>
|
</td>
|
||||||
<td class="text-caption text-medium-emphasis push-server-list__ellipsis" :title="s.domain || ''">
|
<td class="text-caption text-medium-emphasis push-server-list__ellipsis" :title="s.domain || ''">
|
||||||
{{ s.domain || '—' }}
|
{{ s.domain || '—' }}
|
||||||
@@ -177,7 +172,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { pushStatusChipColor, serverOnlineColor } from '@/composables/push/labels'
|
import { pushStatusChipColor, serverOnlineColor } from '@/composables/push/labels'
|
||||||
import { usePushServerViewMode } from '@/composables/push/usePushServerViewMode'
|
import { usePushServerViewMode } from '@/composables/push/usePushServerViewMode'
|
||||||
import { useSnackbar } from '@/composables/useSnackbar'
|
|
||||||
import type { PushServerItem } from '@/composables/push/types'
|
import type { PushServerItem } from '@/composables/push/types'
|
||||||
|
|
||||||
defineProps<{
|
defineProps<{
|
||||||
@@ -199,24 +193,12 @@ defineEmits<{
|
|||||||
}>()
|
}>()
|
||||||
|
|
||||||
const { viewMode } = usePushServerViewMode()
|
const { viewMode } = usePushServerViewMode()
|
||||||
const snackbar = useSnackbar()
|
|
||||||
|
|
||||||
function serverLabelTitle(s: PushServerItem): string {
|
function serverLabelTitle(s: PushServerItem): string {
|
||||||
const parts = [s.name]
|
const parts = [s.name]
|
||||||
if (s.domain?.trim()) parts.push(s.domain.trim())
|
if (s.domain?.trim()) parts.push(s.domain.trim())
|
||||||
return parts.join('\n')
|
return parts.join('\n')
|
||||||
}
|
}
|
||||||
|
|
||||||
async function copyServerName(name: string) {
|
|
||||||
const text = name.trim()
|
|
||||||
if (!text) return
|
|
||||||
try {
|
|
||||||
await navigator.clipboard.writeText(text)
|
|
||||||
snackbar('名称已复制')
|
|
||||||
} catch {
|
|
||||||
snackbar('复制失败', 'error')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@@ -235,13 +217,6 @@ async function copyServerName(name: string) {
|
|||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
.push-server-copy-name {
|
|
||||||
cursor: copy;
|
|
||||||
}
|
|
||||||
.push-server-copy-name:hover {
|
|
||||||
text-decoration: underline;
|
|
||||||
text-decoration-style: dotted;
|
|
||||||
}
|
|
||||||
.push-server-list__col-check {
|
.push-server-list__col-check {
|
||||||
width: 44px;
|
width: 44px;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user