|
241 | 241 | color: white; |
242 | 242 | } |
243 | 243 |
|
| 244 | + .badge-trial { |
| 245 | + background: #10b981; |
| 246 | + color: white; |
| 247 | + } |
| 248 | + |
| 249 | + .badge-banned { |
| 250 | + background: #dc2626; |
| 251 | + color: white; |
| 252 | + } |
| 253 | + |
| 254 | + .badge-suspended { |
| 255 | + background: #f59e0b; |
| 256 | + color: white; |
| 257 | + } |
| 258 | + |
244 | 259 | .modal { |
245 | 260 | display: none; |
246 | 261 | position: fixed; |
@@ -1062,6 +1077,9 @@ <h1 class="logo"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stro |
1062 | 1077 | 'accounts.expired': '已过期', |
1063 | 1078 | 'accounts.disabled': '已禁用', |
1064 | 1079 | 'accounts.normal': '正常', |
| 1080 | + 'accounts.enabled': '已启用', |
| 1081 | + 'accounts.banned': '已封禁', |
| 1082 | + 'accounts.suspended': '已暂停', |
1065 | 1083 | 'accounts.refreshFailed': '刷新失败', |
1066 | 1084 | 'accounts.confirmDelete': '确定删除?', |
1067 | 1085 | 'accounts.mainQuota': '主配额', |
@@ -1251,6 +1269,9 @@ <h1 class="logo"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stro |
1251 | 1269 | 'accounts.expired': 'Expired', |
1252 | 1270 | 'accounts.disabled': 'Disabled', |
1253 | 1271 | 'accounts.normal': 'Active', |
| 1272 | + 'accounts.enabled': 'Enabled', |
| 1273 | + 'accounts.banned': 'Banned', |
| 1274 | + 'accounts.suspended': 'Suspended', |
1254 | 1275 | 'accounts.refreshFailed': 'Refresh failed', |
1255 | 1276 | 'accounts.confirmDelete': 'Confirm delete?', |
1256 | 1277 | 'time.expired': 'Expired', |
@@ -1596,7 +1617,9 @@ <h1 class="logo"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stro |
1596 | 1617 | '<div class="account-actions">' + |
1597 | 1618 | '<button class="btn btn-sm btn-icon btn-secondary" onclick="refreshAccount(\'' + a.id + '\')" title="' + t('accounts.refresh') + '"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M23 4v6h-6M1 20v-6h6"/><path d="M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15"/></svg></button>' + |
1598 | 1619 | '<button class="btn btn-sm btn-icon btn-secondary" onclick="showDetail(\'' + a.id + '\')" title="' + t('accounts.detail') + '"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"/><circle cx="12" cy="7" r="4"/></svg></button>' + |
1599 | | - '<button class="btn btn-sm ' + (a.enabled ? 'btn-secondary' : 'btn-primary') + '" onclick="toggleAccount(\'' + a.id + '\',' + !a.enabled + ')">' + (a.enabled ? t('accounts.disable') : t('accounts.enable')) + '</button>' + |
| 1620 | + // 封禁账户不显示启用/禁用按钮 |
| 1621 | + (a.banStatus && a.banStatus !== 'ACTIVE' ? '' : |
| 1622 | + '<button class="btn btn-sm ' + (a.enabled ? 'btn-secondary' : 'btn-primary') + '" onclick="toggleAccount(\'' + a.id + '\',' + !a.enabled + ')">' + (a.enabled ? t('accounts.disable') : t('accounts.enable')) + '</button>') + |
1600 | 1623 | '<button class="btn btn-sm btn-danger" onclick="deleteAccount(\'' + a.id + '\')">' + t('accounts.delete') + '</button>' + |
1601 | 1624 | '</div>' + |
1602 | 1625 | '</div>' + |
@@ -1644,10 +1667,42 @@ <h1 class="logo"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stro |
1644 | 1667 | return method; |
1645 | 1668 | } |
1646 | 1669 | function getStatusBadge(a) { |
1647 | | - if (!a.hasToken) return '<span class="badge badge-error">' + t('accounts.noToken') + '</span>'; |
1648 | | - if (a.expiresAt && a.expiresAt < Date.now() / 1000) return '<span class="badge badge-warning">' + t('accounts.expired') + '</span>'; |
1649 | | - if (!a.enabled) return '<span class="badge badge-warning">' + t('accounts.disabled') + '</span>'; |
1650 | | - return '<span class="badge badge-success">' + t('accounts.normal') + '</span>'; |
| 1670 | + let badges = []; |
| 1671 | + |
| 1672 | + // 检查是否为封禁状态 |
| 1673 | + const isBanned = a.banStatus && a.banStatus !== 'ACTIVE'; |
| 1674 | + |
| 1675 | + if (isBanned) { |
| 1676 | + // 封禁账号:显示"封禁 + 禁用" |
| 1677 | + if (a.banStatus === 'BANNED') { |
| 1678 | + badges.push('<span class="badge badge-banned">' + t('accounts.banned') + '</span>'); |
| 1679 | + } else if (a.banStatus === 'SUSPENDED') { |
| 1680 | + badges.push('<span class="badge badge-suspended">' + t('accounts.suspended') + '</span>'); |
| 1681 | + } |
| 1682 | + // 封禁账号必定显示禁用状态 |
| 1683 | + badges.push('<span class="badge badge-warning">' + t('accounts.disabled') + '</span>'); |
| 1684 | + } else { |
| 1685 | + // 正常账号:显示"正常 + 启用/禁用" |
| 1686 | + |
| 1687 | + // 检查Token状态 |
| 1688 | + if (!a.hasToken) { |
| 1689 | + badges.push('<span class="badge badge-error">' + t('accounts.noToken') + '</span>'); |
| 1690 | + } else if (a.expiresAt && a.expiresAt < Date.now() / 1000) { |
| 1691 | + badges.push('<span class="badge badge-warning">' + t('accounts.expired') + '</span>'); |
| 1692 | + } else { |
| 1693 | + // 有效Token的正常账号显示"正常" |
| 1694 | + badges.push('<span class="badge badge-success">' + t('accounts.normal') + '</span>'); |
| 1695 | + } |
| 1696 | + |
| 1697 | + // 显示启用/禁用状态 |
| 1698 | + if (a.enabled) { |
| 1699 | + badges.push('<span class="badge badge-info">' + t('accounts.enabled') + '</span>'); |
| 1700 | + } else { |
| 1701 | + badges.push('<span class="badge badge-warning">' + t('accounts.disabled') + '</span>'); |
| 1702 | + } |
| 1703 | + } |
| 1704 | + |
| 1705 | + return badges.join(''); |
1651 | 1706 | } |
1652 | 1707 | function formatTokenExpiry(ts) { |
1653 | 1708 | if (!ts) return '-'; |
|
0 commit comments