feat: add telegram proxy fallbacks and mobile dialog polish

This commit is contained in:
ngfchl
2026-07-07 10:51:29 +08:00
parent 32187eb9a6
commit 41b0bdf0d7
5 changed files with 62 additions and 15 deletions
+30 -9
View File
@@ -122,6 +122,11 @@
.el-card { border: none; border-radius: 12px; }
.el-button--mini, .el-button--small { border-radius: 8px; }
.confirm-dialog { border-radius: 14px; max-width: calc(100vw - 32px); }
.confirm-dialog .el-message-box__content { word-break: break-word; }
.chat-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chat-actions .el-button--text { padding: 0; }
.chat-id-pill { color: #94a3b8; font-size: 11px; }
.spam-tooltip { max-width: min(720px, calc(100vw - 48px)); word-break: break-word; line-height: 1.45; }
@media (max-width: 900px) { .spam-tooltip { max-width: calc(100vw - 32px); } }
@@ -151,8 +156,10 @@
.panel-actions { gap: 6px; }
.scroll-area { height: 40vh; min-height: 280px; flex: none; }
.chat-item { padding: 8px; }
.chat-item .meta { flex-direction: column; gap: 4px; }
.chat-item .meta-right { justify-content: flex-start; width: 100%; }
.chat-item .meta { flex-direction: column; gap: 5px; }
.chat-item .meta-right { justify-content: space-between; align-items: flex-start; width: 100%; gap: 6px; }
.chat-actions { justify-content: flex-end; }
.chat-item .text { margin-top: 2px; padding: 6px 8px; background: #f8fafc; border-radius: 8px; }
.chat-item .user { max-width: 100%; white-space: normal; word-break: break-all; }
.chat-item .time { white-space: normal; }
.log-window { height: 34vh; min-height: 250px; flex: none; font-size: 10px; }
@@ -174,6 +181,9 @@
.log-msg { white-space: normal; }
.log-line { align-items: start; }
.fixed-send-box { width: calc(100vw - 12px); }
.confirm-dialog { width: calc(100vw - 28px) !important; }
.confirm-dialog .el-message-box__btns { display: flex; gap: 8px; }
.confirm-dialog .el-message-box__btns button { flex: 1; margin-left: 0; }
}
</style>
</head>
@@ -217,10 +227,12 @@
<div class="meta">
<span class="user">@{{ item.username || item.first_name || 'unknown' }} <small>({{ item.user_id }})</small></span>
<span class="meta-right">
<span class="time">#{{ item.msg_id || '-' }} · {{ formatTime(item.time) }}</span>
<el-tag v-if="item.deleted" size="mini" type="info">手动删除</el-tag>
<el-button v-else type="text" size="mini" icon="el-icon-delete" :loading="item._deleting" @click="deleteChatMessage(item, false)">删除</el-button>
<el-button v-if="!item.deleted && item.user_id" type="text" size="mini" icon="el-icon-remove-outline" :loading="item._deleting" @click="deleteChatMessage(item, true)"></el-button>
<span class="time"><span class="chat-id-pill">#{{ item.msg_id || '-' }}</span> · {{ formatTime(item.time) }}</span>
<span class="chat-actions">
<el-tag v-if="item.deleted" size="mini" type="info">手动删除</el-tag>
<el-button v-else type="text" size="mini" icon="el-icon-delete" :loading="item._deleting" @click="deleteChatMessage(item, false)"></el-button>
<el-button v-if="!item.deleted && item.user_id" type="text" size="mini" icon="el-icon-remove-outline" :loading="item._deleting" @click="deleteChatMessage(item, true)">删封</el-button>
</span>
</span>
</div>
<div class="text">{{ item.text }}</div>
@@ -383,7 +395,10 @@ new Vue({
this.$confirm('确认只重启 Telegram BotWeb 管理页不会重启。', '重启 TG Bot', {
confirmButtonText: '确认重启',
cancelButtonText: '取消',
type: 'warning'
type: 'warning',
customClass: 'confirm-dialog',
dangerouslyUseHTMLString: false,
distinguishCancelAndClose: true
}).then(async () => {
this.restartingBot = true
try {
@@ -405,7 +420,10 @@ new Vue({
this.$confirm('确认重启 TG Spam Guard 服务?重启期间 Web 和 Bot 会短暂不可用。', '重启服务', {
confirmButtonText: '确认重启',
cancelButtonText: '取消',
type: 'warning'
type: 'warning',
customClass: 'confirm-dialog',
dangerouslyUseHTMLString: false,
distinguishCancelAndClose: true
}).then(async () => {
this.restarting = true
try {
@@ -455,7 +473,10 @@ new Vue({
this.$confirm(banUser ? '先删除 Telegram 群内消息,再封禁该用户,并标记数据库。继续吗?' : '先删除 Telegram 群内消息,再把数据库记录标记为手动删除。继续吗?', banUser ? '删除并封禁' : '删除聊天记录', {
confirmButtonText: banUser ? '删封' : '删除',
cancelButtonText: '取消',
type: 'warning'
type: 'warning',
customClass: 'confirm-dialog',
dangerouslyUseHTMLString: false,
distinguishCancelAndClose: true
}).then(async () => {
this.$set(item, '_deleting', true)
try {