ZhaoShanGeng commited on
Commit
e0134ab
·
1 Parent(s): fd6aebe

禁用/启用Token时跳过入场动画

Browse files
Files changed (2) hide show
  1. public/js/tokens.js +6 -1
  2. public/style.css +4 -0
public/js/tokens.js CHANGED
@@ -2,6 +2,7 @@
2
 
3
  let cachedTokens = [];
4
  let currentFilter = 'all'; // 'all', 'enabled', 'disabled'
 
5
 
6
  // 筛选 Token
7
  function filterTokens(filter) {
@@ -102,7 +103,7 @@ function renderTokens(tokens) {
102
  const safeEmailJs = escapeJs(token.email || '');
103
 
104
  return `
105
- <div class="token-card ${!token.enable ? 'disabled' : ''} ${isExpired ? 'expired' : ''} ${isRefreshing ? 'refreshing' : ''}" id="card-${escapeHtml(cardId)}">
106
  <div class="token-header">
107
  <span class="status ${token.enable ? 'enabled' : 'disabled'}">
108
  ${token.enable ? '✅ 启用' : '❌ 禁用'}
@@ -156,6 +157,9 @@ function renderTokens(tokens) {
156
 
157
  updateSensitiveInfoDisplay();
158
 
 
 
 
159
  // 自动刷新过期的 Token
160
  if (expiredTokensToRefresh.length > 0) {
161
  expiredTokensToRefresh.forEach(refreshToken => {
@@ -457,6 +461,7 @@ async function toggleToken(refreshToken, enable) {
457
  hideLoading();
458
  if (data.success) {
459
  showToast(`已${action}`, 'success');
 
460
  loadTokens();
461
  } else {
462
  showToast(data.message || '操作失败', 'error');
 
2
 
3
  let cachedTokens = [];
4
  let currentFilter = 'all'; // 'all', 'enabled', 'disabled'
5
+ let skipAnimation = false; // 是否跳过动画
6
 
7
  // 筛选 Token
8
  function filterTokens(filter) {
 
103
  const safeEmailJs = escapeJs(token.email || '');
104
 
105
  return `
106
+ <div class="token-card ${!token.enable ? 'disabled' : ''} ${isExpired ? 'expired' : ''} ${isRefreshing ? 'refreshing' : ''} ${skipAnimation ? 'no-animation' : ''}" id="card-${escapeHtml(cardId)}">
107
  <div class="token-header">
108
  <span class="status ${token.enable ? 'enabled' : 'disabled'}">
109
  ${token.enable ? '✅ 启用' : '❌ 禁用'}
 
157
 
158
  updateSensitiveInfoDisplay();
159
 
160
+ // 重置动画跳过标志
161
+ skipAnimation = false;
162
+
163
  // 自动刷新过期的 Token
164
  if (expiredTokensToRefresh.length > 0) {
165
  expiredTokensToRefresh.forEach(refreshToken => {
 
461
  hideLoading();
462
  if (data.success) {
463
  showToast(`已${action}`, 'success');
464
+ skipAnimation = true; // 跳过动画
465
  loadTokens();
466
  } else {
467
  showToast(data.message || '操作失败', 'error');
public/style.css CHANGED
@@ -465,6 +465,10 @@ button.loading::after {
465
  .token-card:nth-child(9) { animation-delay: 0.18s; }
466
  .token-card:nth-child(10) { animation-delay: 0.2s; }
467
  .token-card:nth-child(n+11) { animation-delay: 0.22s; }
 
 
 
 
468
  @media (prefers-color-scheme: dark) {
469
  .token-card {
470
  background: rgba(30, 41, 59, 0.85);
 
465
  .token-card:nth-child(9) { animation-delay: 0.18s; }
466
  .token-card:nth-child(10) { animation-delay: 0.2s; }
467
  .token-card:nth-child(n+11) { animation-delay: 0.22s; }
468
+ /* 跳过动画 */
469
+ .token-card.no-animation {
470
+ animation: none !important;
471
+ }
472
  @media (prefers-color-scheme: dark) {
473
  .token-card {
474
  background: rgba(30, 41, 59, 0.85);