LifeVta commited on
Commit
be4fe12
·
verified ·
1 Parent(s): 5fe6e37

Update app/statics/admin/account.html

Browse files
Files changed (1) hide show
  1. app/statics/admin/account.html +231 -229
app/statics/admin/account.html CHANGED
@@ -8,12 +8,12 @@
8
  <link href="https://cdn.jsdelivr.net/npm/geist@1.0.0/dist/fonts/geist-sans/style.css" rel="stylesheet">
9
  <link href="/static/css/app.css?v={{APP_VERSION}}" rel="stylesheet">
10
  <style>
11
- body { background: #FAF9F5 }
12
 
13
  /* Page header */
14
  .page-hd { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:20px }
15
- .page-title{ font-size:22px; font-weight:700; line-height:1.2 }
16
- .page-sub { font-size:13px; color:var(--fg-muted); margin-top:5px }
17
  .page-actions { display:flex; gap:8px; align-items:center; flex-shrink:0 }
18
  .section-head {
19
  display:flex;
@@ -25,7 +25,7 @@
25
  .section-title {
26
  font-size:13px;
27
  font-weight:600;
28
- color:#222;
29
  letter-spacing:.01em;
30
  }
31
  .section-title-row {
@@ -37,12 +37,12 @@
37
  min-width:20px;
38
  height:20px;
39
  padding:0 7px;
40
- border-radius999px;
41
  display:inline-flex;
42
  align-items:center;
43
  justify-content:center;
44
- background:#f1ece2;
45
- color:#6a6459;
46
  font-size:11px;
47
  font-weight:600;
48
  font-variant-numeric:tabular-nums;
@@ -58,22 +58,22 @@
58
  gap:6px;
59
  font-size:13px;
60
  font-weight:600;
61
- border:1px solid #e6e6e6;
62
- background:#fafafa;
63
- color:#444;
64
  }
65
  .page-action-btn:hover {
66
- background:#f3f3f3;
67
- border-color:#dcdcdc;
68
  }
69
  .page-action-btn-primary {
70
- background:#111;
71
- border-color:#111;
72
- color:#fff;
73
  }
74
  .page-action-btn-primary:hover {
75
- background:#222;
76
- border-color:#222;
77
  }
78
  /* Stats */
79
  .stat-grid {
@@ -95,7 +95,8 @@
95
  min-height:88px;
96
  padding:14px 16px;
97
  border-radius:12px;
98
- background:#fff;
 
99
  display:flex;
100
  flex-direction:column;
101
  gap:12px;
@@ -105,9 +106,9 @@
105
  transition:background-color .15s, transform .15s, box-shadow .15s;
106
  }
107
  .stat-cell.clickable:hover {
108
- background-color:#fafafa;
109
  transform:translateY(-1px);
110
- box-shadow:0 6px 16px rgba(0,0,0,0.03);
111
  }
112
  .stat-top {
113
  display:flex;
@@ -117,7 +118,7 @@
117
  }
118
  .stat-label {
119
  font-size:11px;
120
- color:#8a8a8a;
121
  letter-spacing:.01em;
122
  white-space:nowrap;
123
  }
@@ -127,7 +128,7 @@
127
  display:inline-flex;
128
  align-items:center;
129
  justify-content:center;
130
- color:#a3a3a3;
131
  flex:0 0 auto;
132
  }
133
  .stat-icon svg {
@@ -141,8 +142,9 @@
141
  line-height:1;
142
  letter-spacing:-.02em;
143
  margin-top:auto;
 
144
  }
145
- .stat-muted { color:#a1a1aa !important; }
146
  [data-random-only] { display:none }
147
  .stat-grid.mode-random [data-random-only] { display:flex }
148
  .stat-grid.mode-random [data-stat-card="active"] { order:1 }
@@ -174,7 +176,7 @@
174
  flex:0 0 52px;
175
  font-size:11px;
176
  font-weight:600;
177
- color:#9a9a9a;
178
  letter-spacing:.01em;
179
  text-align:right;
180
  white-space:nowrap;
@@ -186,8 +188,9 @@
186
  border-radius:999px;
187
  font-size:12px;
188
  font-weight:500;
189
- color:#8f8f8f;
190
- background:#f5f5f5;
 
191
  display:flex;
192
  align-items:center;
193
  justify-content:space-between;
@@ -196,17 +199,18 @@
196
  white-space:nowrap;
197
  flex:0 0 auto;
198
  }
199
- .filter-chip:hover { color:#555; background:#f1f1f1 }
200
  .filter-chip.active {
201
- background:#111;
202
- color:#fff;
 
203
  }
204
  .filter-chip-count {
205
  min-width:18px;
206
  height:18px;
207
  padding:0 5px;
208
  border-radius:999px;
209
- background:rgba(255,255,255,.72);
210
  font-size:11px;
211
  font-weight:600;
212
  color:inherit;
@@ -216,8 +220,8 @@
216
  font-variant-numeric:tabular-nums;
217
  }
218
  .filter-chip.active .filter-chip-count {
219
- background:rgba(255,255,255,.16);
220
- color:#fff;
221
  }
222
  .filter-chip-count.is-green,
223
  .filter-chip-count.is-orange,
@@ -231,7 +235,7 @@
231
  gap:8px;
232
  margin-bottom:8px;
233
  flex-wrap:wrap;
234
- color:#8f8f8f;
235
  font-size:12px;
236
  font-weight:500;
237
  font-family:inherit;
@@ -252,23 +256,18 @@
252
  color:inherit;
253
  flex:0 0 auto;
254
  font:inherit;
 
 
 
255
  }
256
  .toolbar-icon-btn:hover {
257
- color:#555;
258
- }
259
- .toolbar-icon-btn svg {
260
- width:14px;
261
- height:14px;
262
- stroke:currentColor;
263
- stroke-linecap:round;
264
- stroke-linejoin:round;
265
- fill:none;
266
  }
267
  .toolbar-icon-btn-danger { color:inherit; }
268
- .toolbar-icon-btn-danger:hover { color:#555; }
269
  .toolbar-icon-btn.is-active {
270
- color:#111;
271
- background:#f3f3f3;
272
  border-radius:999px;
273
  }
274
  .toolbar-page-size {
@@ -276,9 +275,9 @@
276
  height:28px;
277
  border-radius:999px;
278
  font:inherit;
279
- color:inherit;
280
- background:#fafafa;
281
- border-color:transparent;
282
  }
283
  .toolbar-dropdown {
284
  position:relative;
@@ -292,9 +291,9 @@
292
  width:min(416px, calc(100vw - 24px));
293
  padding:12px;
294
  border-radius:16px;
295
- background:#FAF9F5;
296
- border:1px solid #ece3d6;
297
- box-shadow:0 12px 28px rgba(22,20,18,.07);
298
  display:none;
299
  z-index:30;
300
  }
@@ -338,6 +337,7 @@
338
  padding:0 10px;
339
  font-size:11px;
340
  gap:5px;
 
341
  }
342
  .toolbar-dropdown-panel .filter-chip-count {
343
  min-width:16px;
@@ -358,8 +358,8 @@
358
 
359
  /* Table */
360
  .table-card {
361
- background:#fff;
362
- border:none;
363
  border-radius:14px;
364
  overflow-x:auto;
365
  overflow-y:hidden;
@@ -367,18 +367,18 @@
367
  }
368
  .table-card > table { width:max-content; min-width:100%; border-collapse:collapse }
369
  .table-freeze-last {
370
- --table-sticky-bg:#fff;
371
- --table-sticky-hover-bg:#fdfdfd;
372
  }
373
  table { width:100%; border-collapse:collapse }
374
  th {
375
- background:#fff;
376
  font-size:11px;
377
  font-weight:500;
378
- color:#9b9b9b;
379
  padding:11px 16px;
380
  text-align:left;
381
- border-bottom:none;
382
  letter-spacing:.01em;
383
  user-select:none;
384
  }
@@ -387,25 +387,25 @@
387
  transition:color .15s, background-color .15s;
388
  }
389
  th.sortable-th:hover {
390
- color:#444;
391
- background-color:#fafafa;
392
  }
393
  .sort-indicator {
394
  font-size:10px;
395
  display:inline-block;
396
  margin-left:4px;
397
- color:#111;
398
  font-weight:bold;
399
  }
400
  td {
401
  font-size:13px;
402
  padding:13px 16px;
403
- border-bottom:none;
404
  vertical-align:middle;
405
- color:#3f3f3f;
406
  }
407
  tr:last-child td { border-bottom:none }
408
- tr:hover td { background:#fdfdfd }
409
  .table-card .badge {
410
  display:inline-flex;
411
  align-items:center;
@@ -417,34 +417,34 @@
417
  border:none;
418
  }
419
  .table-card .badge-basic {
420
- color:#6d6d6d;
421
- background:#f7f7f7;
422
  }
423
  .table-card .badge-super {
424
- color:#4c76b2;
425
- background:#f1f6fc;
426
  }
427
  .table-card .badge-heavy {
428
- color:#b07a45;
429
- background:#fbf5ed;
430
  }
431
  .table-card .badge-active {
432
- color:#3e8f69;
433
- background:#f2f8f4;
434
  }
435
  .table-card .badge-cooling {
436
- color:#b47a3d;
437
- background:#fbf5ed;
438
  }
439
  .table-card .badge-expired,
440
  .table-card .badge-invalid,
441
  .table-card .badge-failed {
442
- color:#b66a63;
443
- background:#fbf3f2;
444
  }
445
  .table-card .badge-disabled {
446
- color:#6f675d;
447
- background:#f1ece4;
448
  }
449
  .table-center { text-align:center }
450
  .table-center .badge { margin:0 auto }
@@ -466,7 +466,10 @@
466
  display:inline-flex;
467
  align-items:center;
468
  justify-content:center;
469
- color:#9a9a9a;
 
 
 
470
  flex:0 0 auto;
471
  }
472
  .row-icon-btn svg {
@@ -481,35 +484,35 @@
481
  width:14.5px;
482
  height:14.5px;
483
  }
484
- .row-icon-btn:hover { color:#555 }
485
  .row-icon-btn.is-loading {
486
- color:#555;
487
  pointer-events:none;
488
  }
489
  .row-icon-btn.is-loading svg {
490
  animation:spin .85s linear infinite;
491
  }
492
  .row-action {
493
- color:#929292;
494
  font-size:11px;
495
  font-weight:500;
496
  display:inline-flex;
497
  align-items:center;
498
  justify-content:center;
499
  }
500
- .row-action:hover { color:#555 }
501
  .row-action:disabled {
502
  opacity:1;
503
  cursor:default;
504
  }
505
  .row-action-danger {
506
- color:#b7726a;
507
  }
508
- .row-action-danger:hover { color:#92514b }
509
- .row-icon-danger { color:#b7726a }
510
- .row-icon-danger:hover { color:#92514b }
511
  .row-action-static {
512
- color:#8b6bc7;
513
  }
514
  .admin-tooltip {
515
  position:fixed;
@@ -519,7 +522,8 @@
519
  max-width:220px;
520
  padding:6px 8px;
521
  border-radius:8px;
522
- background:rgba(17,17,17,.94);
 
523
  color:#fff;
524
  font-size:11px;
525
  line-height:1.35;
@@ -536,12 +540,15 @@
536
  display:inline-flex;
537
  align-items:center;
538
  justify-content:center;
539
- color:#9a9a9a;
 
 
 
540
  flex:0 0 auto;
541
  }
542
- .row-nsfw-btn:hover { color:#555 }
543
- .row-nsfw-btn.is-on { color:#b7726a }
544
- .row-nsfw-btn.is-on:hover { color:#92514b }
545
  .row-nsfw-btn svg {
546
  width:15px;
547
  height:15px;
@@ -565,7 +572,7 @@
565
  }
566
  .table-card .empty-state {
567
  padding:48px 16px;
568
- color:#8a8a8a;
569
  font-size:13px;
570
  }
571
  @keyframes spin {
@@ -593,19 +600,18 @@
593
  opacity:.85;
594
  transform:scale(1.05);
595
  }
596
- .q-a { background:#f1f6fd; color:#5d7fb2 }
597
- .q-f { background:#f2f8f4; color:#4c9168 }
598
- .q-e { background:#f7f3fb; color:#8d6bbd }
599
- .q-h { background:#fff4ed; color:#b0632a }
600
- .q-b { background:#fdf2f7; color:#be3f7f }
601
- .q-c { background:#f0faf4; color:#2e7d52 }
602
- .q-z { background:#f6f6f6; color:#a0a0a6 }
603
 
604
  /* Token monospace */
605
- .tok { font-family:ui-monospace,monospace; font-size:12px; color:#333 }
606
 
607
  /* Pagination */
608
- .pagi { display:flex; align-items:center; gap:6px; padding:12px 16px; border-top:none }
609
  .pagi-meta {
610
  display:flex;
611
  align-items:center;
@@ -633,142 +639,138 @@
633
  align-items:center;
634
  justify-content:center;
635
  color:inherit;
 
 
 
636
  transition:background .1s, color .1s;
637
  font:inherit;
638
  }
639
- .pagi-btn:hover { background:var(--border) }
640
- .pagi-btn.on { background:var(--fg); color:#fff }
641
- .pagi-btn:disabled { opacity:.35; pointer-events:none }
642
-
643
- /* Dialogs */
644
- #modal-import .modal,
645
- #modal-import-file .modal,
646
- #modal-audit .modal { width:min(440px,92vw) }
647
- #modal-audit .modal { width:min(720px,94vw) }
648
- #modal-export .modal {
649
- width:min(440px,92vw);
650
- padding-top:14px;
651
- }
652
- #modal-export .modal-title { margin-bottom:6px }
653
- #modal-export .dialog-help {
654
- margin-top:0;
655
- margin-bottom:12px;
656
- }
657
- #modal-export .dialog-body { gap:10px }
658
- .export-option-btn {
659
- width:100%;
660
- min-height:34px;
661
- height:auto;
662
- padding:6px 12px;
663
- display:flex;
664
- align-items:center;
665
- justify-content:center;
666
- text-align:center;
667
- white-space:normal;
668
- line-height:1.35;
669
  }
670
- .modal { box-shadow:none }
671
- .dialog-body { display:grid; gap:12px }
672
- .dialog-help {
673
- font-size:12px;
674
- color:var(--fg-muted);
675
- margin-top:6px;
676
- margin-bottom:2px;
677
  }
678
- .dialog-field { display:flex; align-items:center; gap:10px }
679
- .dialog-label {
680
- width:40px;
681
- font-size:13px;
682
- color:var(--fg-muted);
683
- white-space:nowrap;
684
- flex:0 0 auto;
685
  }
686
- .dialog-textarea {
687
- min-height:140px;
688
- padding:10px 12px;
689
- border-radius:12px;
690
- resize:vertical;
691
  }
692
- .dialog-actions {
693
- display:flex;
694
- justify-content:flex-end;
695
- gap:8px;
696
- margin-top:18px;
 
 
 
 
697
  }
698
  .dialog-btn {
699
  height:32px;
700
  padding:0 14px;
701
  border-radius:999px;
702
- background:#fafafa;
703
- color:#444;
 
704
  font-size:13px;
705
  font-weight:600;
 
706
  }
707
  .dialog-btn:hover {
708
- background:#f3f3f3;
709
  }
710
  .dialog-btn-primary {
711
- background:#111;
712
- color:#fff;
 
713
  }
714
  .dialog-btn-primary:hover {
715
- background:#222;
716
  }
717
  .dialog-btn-danger {
718
- color:#b42318;
719
- background:#fff5f4;
 
720
  }
721
  .dialog-btn-danger:hover {
722
- background:#feeceb;
 
 
 
 
 
 
 
 
 
 
 
 
723
  }
724
 
725
  /* Import modal */
726
- .import-file-input { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none }
727
  .import-file-shell {
728
  height:34px;
729
  display:flex;
730
  align-items:center;
731
  padding:0 10px;
732
  border-radius:8px;
733
- background:#f7f7f7;
 
734
  cursor:pointer;
735
  transition:background .15s;
736
  flex:1;
737
  min-width:0;
738
  }
739
  .import-file-shell:hover {
740
- background:#f2f2f2;
741
  }
742
  .import-file-name {
743
  font-size:12px;
744
- color:#666;
745
  white-space:nowrap;
746
  overflow:hidden;
747
  text-overflow:ellipsis;
748
  min-width:0;
749
  flex:1;
750
  }
751
- .import-file-name.empty { color:#999 }
752
 
753
  /* Audit log styles */
754
  .audit-table-wrap {
755
  width:100%;
756
  overflow-x:auto;
757
- border:1px solid #eee;
758
  border-radius:8px;
759
  max-height:360px;
 
760
  }
761
  .audit-table { width:100%; border-collapse:collapse; min-width:560px }
762
- .audit-table th { background:#f9f8f6; padding:8px 12px; font-size:11px; color:#8a8a8a; border-bottom:1px solid #eee }
763
- .audit-table td { padding:10px 12px; font-size:12px; border-bottom:1px solid #f5f5f5; color:#444 }
764
  </style>
765
  </head>
766
  <body>
767
 
 
768
  <div id="admin-header" data-active="/admin/account"></div>
769
 
 
770
  <main class="admin-main">
771
 
 
772
  <div class="page-hd">
773
  <div>
774
  <div class="page-title" data-i18n="account.pageHeading">账户列表</div>
@@ -790,6 +792,7 @@
790
  <div class="section-title" data-i18n="account.sectionOverview">账户概览</div>
791
  </div>
792
 
 
793
  <div class="stat-grid" id="overview-stats">
794
  <div class="stat-cell" data-stat-card="total">
795
  <div class="stat-top">
@@ -803,95 +806,96 @@
803
  <div class="stat-cell" data-stat-card="active">
804
  <div class="stat-top">
805
  <div class="stat-label" data-i18n="account.statActive">正常账户</div>
806
- <span class="stat-icon" style="color:#16a34a">
807
  <svg viewBox="0 0 24 24" fill="none" stroke-width="1.9"><circle cx="12" cy="12" r="8"/><path d="m8.5 12 2.4 2.4 4.8-4.8"/></svg>
808
  </span>
809
  </div>
810
- <div class="stat-num" id="s-active" style="color:#16a34a">0</div>
811
  </div>
812
  <div class="stat-cell" data-stat-card="cooling">
813
  <div class="stat-top">
814
  <div class="stat-label" data-i18n="account.statCooling">限流账户</div>
815
- <span class="stat-icon" style="color:#ea580c">
816
  <svg viewBox="0 0 24 24" fill="none" stroke-width="1.8"><path d="M12 6v6l4 2"/><circle cx="12" cy="12" r="8"/></svg>
817
  </span>
818
  </div>
819
- <div class="stat-num" id="s-cooling" style="color:#ea580c">0</div>
820
  </div>
821
  <div class="stat-cell" data-stat-card="invalid">
822
  <div class="stat-top">
823
  <div class="stat-label" data-i18n="account.statInvalid">异常账户</div>
824
- <span class="stat-icon" style="color:#dc2626">
825
  <svg viewBox="0 0 24 24" fill="none" stroke-width="1.8"><path d="m15 9-6 6m0-6 6 6"/><circle cx="12" cy="12" r="8"/></svg>
826
  </span>
827
  </div>
828
- <div class="stat-num" id="s-invalid" style="color:#dc2626">0</div>
829
  </div>
830
  <div class="stat-cell" data-stat-card="disabled">
831
  <div class="stat-top">
832
  <div class="stat-label" data-i18n="account.statDisabled">禁用账户</div>
833
- <span class="stat-icon" style="color:#6f675d">
834
  <svg viewBox="0 0 24 24" fill="none" stroke-width="1.8"><circle cx="12" cy="12" r="8"/><path d="M8.5 8.5 15.5 15.5"/></svg>
835
  </span>
836
  </div>
837
- <div class="stat-num" id="s-disabled" style="color:#6f675d">0</div>
838
  </div>
839
  </div>
840
 
 
841
  <div class="stat-grid-quota" id="overview-quota-stats">
842
  <div class="stat-cell clickable" data-stat-card="calls" onclick="openAuditModal('calls')">
843
  <div class="stat-top">
844
  <div class="stat-label" data-i18n="account.statCalls">调用总数</div>
845
- <span class="stat-icon" style="color:#111">
846
  <svg viewBox="0 0 24 24" fill="none" stroke-width="1.8"><path d="M5 19h14"/><path d="M8 16V10"/><path d="M12 16V6"/><path d="M16 16v-3"/></svg>
847
  </span>
848
  </div>
849
- <div class="stat-num" id="s-calls" style="color:#111">0</div>
850
  </div>
851
  <div class="stat-cell clickable" data-quota-only onclick="openAuditModal('auto')">
852
  <div class="stat-top">
853
  <div class="stat-label" data-i18n="account.statAuto">Auto 余额</div>
854
- <span class="stat-icon" style="color:#2563eb">
855
  <svg viewBox="0 0 24 24" fill="none" stroke-width="1.8"><path d="M6 19h12"/><path d="M12 16V9"/></svg>
856
  </span>
857
  </div>
858
- <div class="stat-num" id="s-qa" style="color:#2563eb">0</div>
859
  </div>
860
  <div class="stat-cell clickable" data-quota-only onclick="openAuditModal('fast')">
861
  <div class="stat-top">
862
  <div class="stat-label" data-i18n="account.statFast">Fast 余额</div>
863
- <span class="stat-icon" style="color:#16a34a">
864
  <svg viewBox="0 0 24 24" fill="none" stroke-width="1.8"><path d="M6 19h12"/><path d="M10 16v-4"/><path d="M14 16V8"/></svg>
865
  </span>
866
  </div>
867
- <div class="stat-num" id="s-qf" style="color:#16a34a">0</div>
868
  </div>
869
  <div class="stat-cell clickable" data-quota-only onclick="openAuditModal('expert')">
870
  <div class="stat-top">
871
  <div class="stat-label" data-i18n="account.statExpert">Expert 余额</div>
872
- <span class="stat-icon" style="color:#7c3aed">
873
  <svg viewBox="0 0 24 24" fill="none" stroke-width="1.8"><path d="M6 19h12"/><path d="M8 16v-2"/><path d="M12 16v-6"/><path d="M16 16V6"/></svg>
874
  </span>
875
  </div>
876
- <div class="stat-num" id="s-qe" style="color:#7c3aed">0</div>
877
  </div>
878
  <div class="stat-cell clickable" data-quota-only onclick="openAuditModal('heavy')">
879
  <div class="stat-top">
880
  <div class="stat-label" data-i18n="account.statHeavy">Heavy 余额</div>
881
- <span class="stat-icon" style="color:#b0632a">
882
  <svg viewBox="0 0 24 24" fill="none" stroke-width="1.8"><path d="M5 19h14"/><path d="M7 16v-1"/><path d="M10 16v-4"/><path d="M14 16V8"/><path d="M17 16V5"/></svg>
883
  </span>
884
  </div>
885
- <div class="stat-num" id="s-qh" style="color:#b0632a">0</div>
886
  </div>
887
  <div class="stat-cell clickable" data-quota-only onclick="openAuditModal('console')">
888
  <div class="stat-top">
889
  <div class="stat-label" data-i18n="account.statConsole">Console 余额</div>
890
- <span class="stat-icon" style="color:#2e7d52">
891
  <svg viewBox="0 0 24 24" fill="none" stroke-width="1.8"><path d="M4 19h16"/><path d="M6 16v-1"/><path d="M9 16v-3"/><path d="M12 16v-6"/><path d="M15 16V8"/><path d="M18 16V5"/></svg>
892
  </span>
893
  </div>
894
- <div class="stat-num" id="s-qc" style="color:#2e7d52">0</div>
895
  </div>
896
  </div>
897
 
@@ -902,6 +906,7 @@
902
  </div>
903
  </div>
904
 
 
905
  <div class="table-toolbar">
906
  <div class="table-toolbar-left" style="display:flex;align-items:center;gap:6px">
907
  <button onclick="prevPage()" class="pagi-btn" id="btn-prev">
@@ -1021,6 +1026,7 @@
1021
  </div>
1022
  </div>
1023
 
 
1024
  <div class="table-card table-freeze-last">
1025
  <table>
1026
  <thead>
@@ -1033,7 +1039,7 @@
1033
  <span data-i18n="account.colQuota">额度</span>
1034
  <span style="margin-left:6px;display:inline-flex;align-items:center;gap:3px;vertical-align:middle">
1035
  <span class="q-pill q-a sortable-pill" onclick="handleSort('quota_auto')" title="按 Auto 排序">A<span id="sort-quota_auto" class="sort-indicator"></span></span>
1036
- <span class="q-pill q-f_sort sortable-pill q-f" onclick="handleSort('quota_fast')" title="按 Fast 排序">F<span id="sort-quota_fast" class="sort-indicator"></span></span>
1037
  <span class="q-pill q-e sortable-pill" onclick="handleSort('quota_expert')" title="按 Expert 排序">E<span id="sort-quota_expert" class="sort-indicator"></span></span>
1038
  <span class="q-pill q-h sortable-pill" onclick="handleSort('quota_heavy')" title="按 Heavy 排序">H<span id="sort-quota_heavy" class="sort-indicator"></span></span>
1039
  <span class="q-pill q-c sortable-pill" onclick="handleSort('quota_console')" title="按 Console 排序">C<span id="sort-quota_console" class="sort-indicator"></span></span>
@@ -1052,6 +1058,7 @@
1052
 
1053
  </main>
1054
 
 
1055
  <div class="modal-overlay" id="modal-import">
1056
  <div class="modal">
1057
  <div class="modal-title" data-i18n="account.addTitle">添加账户</div>
@@ -1069,7 +1076,7 @@
1069
  <input type="checkbox" id="import-auto-nsfw" style="margin:0">
1070
  <span data-i18n="account.autoNsfwOnImport">导入后自动开启 NSFW</span>
1071
  </label>
1072
- <div style="font-size:12px;color:var(--fg-muted);margin-top:4px" data-i18n="account.autoNsfwHint">需要额外时间检测账户状态</div>
1073
  </div>
1074
  </div>
1075
  <div class="dialog-actions">
@@ -1079,6 +1086,7 @@
1079
  </div>
1080
  </div>
1081
 
 
1082
  <div class="modal-overlay" id="modal-import-file">
1083
  <div class="modal">
1084
  <div class="modal-title" data-i18n="account.importTitle">导入文件</div>
@@ -1100,7 +1108,7 @@
1100
  <input type="checkbox" id="import-file-auto-nsfw" style="margin:0">
1101
  <span data-i18n="account.autoNsfwOnImport">导入后自动开启 NSFW</span>
1102
  </label>
1103
- <div style="font-size:12px;color:var(--fg-muted);margin-top:4px" data-i18n="account.autoNsfwHint">需要额外时间检测账户状态</div>
1104
  </div>
1105
  </div>
1106
  <div class="dialog-actions">
@@ -1110,6 +1118,7 @@
1110
  </div>
1111
  </div>
1112
 
 
1113
  <div class="modal-overlay" id="modal-edit">
1114
  <div class="modal">
1115
  <div class="modal-title" data-i18n="account.editTitle">编辑账户</div>
@@ -1130,6 +1139,7 @@
1130
  </div>
1131
  </div>
1132
 
 
1133
  <div class="modal-overlay" id="modal-export">
1134
  <div class="modal" style="max-width:360px">
1135
  <div class="modal-title" data-i18n="account.exportTitle">导出格式</div>
@@ -1141,6 +1151,7 @@
1141
  </div>
1142
  </div>
1143
 
 
1144
  <div class="modal-overlay" id="modal-confirm">
1145
  <div class="modal" style="max-width:400px">
1146
  <div class="modal-title" id="confirm-title" data-i18n="account.confirmTitle">确认</div>
@@ -1152,6 +1163,7 @@
1152
  </div>
1153
  </div>
1154
 
 
1155
  <div class="modal-overlay" id="modal-audit">
1156
  <div class="modal">
1157
  <div class="modal-title" id="audit-title">调用审计明细</div>
@@ -1169,7 +1181,7 @@
1169
  </thead>
1170
  <tbody id="audit-tbody">
1171
  <tr>
1172
- <td colspan="5" style="text-align:center;color:#aaa;padding:24px;">暂无审计记录</td>
1173
  </tr>
1174
  </tbody>
1175
  </table>
@@ -1192,7 +1204,7 @@ const PAGE_SIZE_KEY = 'admin.account.page_size';
1192
  const PAGE_SIZE_OPTIONS = [50, 100, 200, 500, 1000, 2000];
1193
 
1194
  let allTokens = [], curStatus = 'all', curNsfw = 'all', curPool = 'all', curPage = 1, pageSize = loadSavedPageSize();
1195
- let sortKey = '', sortOrder = 'desc'; // Sorting state variables
1196
  const sel = new Set();
1197
  const refreshingTokens = new Set();
1198
  let _cb = null;
@@ -1275,8 +1287,6 @@ async function _api(method, path, body) {
1275
  return r.json();
1276
  }
1277
 
1278
- // Selection strategy reported by /status — "quota" | "random".
1279
- // Controls whether quota columns / stats are rendered (hidden in random mode).
1280
  let selectionStrategy = 'quota';
1281
 
1282
  // ── Load ───────────────────────────────────────────────────────────────────
@@ -1300,7 +1310,6 @@ async function load() {
1300
  }
1301
 
1302
  function applyStrategyUI() {
1303
- // Random strategy: hide quota-related stat cells and the table column.
1304
  const isRandom = selectionStrategy === 'random';
1305
  const statsGrid = document.getElementById('overview-stats');
1306
  if (statsGrid) statsGrid.classList.toggle('mode-random', isRandom);
@@ -1349,27 +1358,27 @@ async function openAuditModal(type) {
1349
  };
1350
  document.getElementById('audit-title').textContent = titleMap[type] || '调用审计明细';
1351
  const tbody = document.getElementById('audit-tbody');
1352
- tbody.innerHTML = `<tr><td colspan="5" style="text-align:center;padding:32px;color:#666;">正在从后台加载链路审计数据...</td></tr>`;
1353
  openModal('modal-audit');
1354
 
1355
  try {
1356
  const data = await _api('GET', `/audit/logs?type=${type}`).catch(() => ({ logs: [] }));
1357
  const logs = data.logs || [];
1358
  if (!logs.length) {
1359
- tbody.innerHTML = `<tr><td colspan="5" style="text-align:center;color:#999;padding:32px;">当前通道近期没有上游日志产生 (直连/历史日志为空)</td></tr>`;
1360
  return;
1361
  }
1362
  tbody.innerHTML = logs.map(log => `
1363
  <tr>
1364
  <td style="font-variant-numeric:tabular-nums;">${fmtDate(log.created_at || log.time)}</td>
1365
- <td style="font-family:ui-monospace,monospace;color:#111;">${log.client_ip || log.ip || '—'}</td>
1366
- <td style="max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;" title="${xe(log.user_agent || '')}">${log.user_agent || '—'}</td>
1367
- <td style="font-family:ui-monospace,monospace;font-size:11px;color:#666;">${log.conversation_id || '—'}</td>
1368
- <td style="font-family:ui-monospace,monospace;color:#444;">${mask(log.account_token || log.token || '—')}</td>
1369
  </tr>
1370
  `).join('');
1371
  } catch (e) {
1372
- tbody.innerHTML = `<tr><td colspan="5" style="text-align:center;color:#b66a63;padding:32px;">读取审计记录失败: ${e.message}</td></tr>`;
1373
  }
1374
  }
1375
 
@@ -1457,7 +1466,6 @@ function getTokenView() {
1457
  if (matchesPool && matchesStatus && matchesNsfw) filteredItems.push(token);
1458
  }
1459
 
1460
- // Frontend Sorting Logic Insertion
1461
  if (sortKey) {
1462
  filteredItems.sort((a, b) => {
1463
  let vA, vB;
@@ -1691,10 +1699,10 @@ function rowHtml(t) {
1691
  <td class="table-center"><span class="badge badge-${t.pool||'basic'}">${xe(poolLabel(t.pool || 'basic'))}</span></td>
1692
  <td class="table-center">${statusBadge(t.status)}</td>
1693
  <td data-quota-only><div class="quota-cell">${qpills(q)}</div></td>
1694
- <td class="table-center" style="font-variant-numeric:tabular-nums;color:#8f8f8f">${success}</td>
1695
- <td class="table-center" style="font-variant-numeric:tabular-nums;color:#9a9a9a">${fail}</td>
1696
- <td class="table-center" style="font-variant-numeric:tabular-nums;color:#9a9a9a">${fmtRate(success, fail)}</td>
1697
- <td style="font-size:12px;color:#9a9a9a">${fmtDate(t.last_used_at)}</td>
1698
  <td><div class="row-actions">
1699
  ${nsfwBtn}
1700
  <button onclick="${isDisabled ? `restoreOne('${xe(t.token)}')` : `disableOne('${xe(t.token)}')`}" class="row-icon-btn row-icon-btn-state" data-tip="${xe(isDisabled ? tr('account.actionRestore', null, '恢复账号') : tr('account.actionDisable', null, '禁用账号'))}" aria-label="${xe(isDisabled ? tr('account.actionRestore', null, '恢复账号') : tr('account.actionDisable', null, '禁用账号'))}">
@@ -1836,8 +1844,6 @@ async function copy(t) {
1836
  }
1837
 
1838
  // ── Add / Import ───────────────────────────────────────────────────────────
1839
-
1840
- // For import modals: includes "auto(自动检测)" as the first / default option.
1841
  function fillImportPoolOptions(id) {
1842
  const known = [...new Set(['basic', 'super', 'heavy', ...allTokens.map(t => t.pool || 'basic')])];
1843
  const opts = [
@@ -1847,7 +1853,6 @@ function fillImportPoolOptions(id) {
1847
  document.getElementById(id).innerHTML = opts.join('');
1848
  }
1849
 
1850
- // For edit modal: shows real pool names only (no "auto").
1851
  function fillPoolOptions(id) {
1852
  const pools = [...new Set(['basic', 'super', 'heavy', ...allTokens.map(t => t.pool || 'basic')])];
1853
  document.getElementById(id).innerHTML = pools.map(p => `<option value="${p}">${xe(poolLabel(p))}</option>`).join('');
@@ -1916,7 +1921,6 @@ async function doImport() {
1916
  load();
1917
  } catch (e) { showToast(`${tr('account.importFailed', null, '导入失败')}: ${e.message}`, 'error'); }
1918
  } else {
1919
- // TXT 格式: 每行一个 token
1920
  const pool = document.getElementById('import-file-pool').value;
1921
  const newToks = raw.split(/\r?\n/).map(s => s.trim()).filter(Boolean);
1922
  if (!newToks.length) return showToast(tr('account.fileEmpty', null, '文件中没有可导入的 Token'), 'error');
@@ -2009,8 +2013,8 @@ function doDelete(tokens) {
2009
  const n = tokens.length;
2010
  openConfirm(tr('account.deleteConfirmTitle', null, '确认删除'),
2011
  n === 1
2012
- ? tr('account.deleteConfirmOne', { token: `<code>${mask(tokens[0])}</code>` }, `确认删除 <code>${mask(tokens[0])}</code>?<br><small style="color:var(--error)">此操作不可撤销。</small>`)
2013
- : tr('account.deleteConfirmMany', { n }, `确认删除 <b>${n}</b> 个账户?<br><small style="color:var(--error)">此操作不可撤销。</small>`),
2014
  async () => {
2015
  try {
2016
  showToast(tr('account.deleting', { n }, `正在删除 ${n} 个账户…`), 'info');
@@ -2044,7 +2048,7 @@ function deleteAllInvalid() {
2044
  if (!total) return showToast(tr('account.noInvalidAccounts', null, '没有可删除的异常账户'), 'error');
2045
  openConfirm(
2046
  tr('account.deleteInvalidAllTitle', null, '删除全部异常账户'),
2047
- tr('account.deleteInvalidAllBody', { n: total }, `确认删除全部 <b>${total}</b> 个异常账户?<br><small style="color:var(--error)">此操作不可撤销。确认后还需要输入 DELETE。</small>`),
2048
  async () => {
2049
  const typed = window.prompt(tr('account.deleteInvalidTypeConfirm', null, '输入 DELETE 确认删除全部异常账户'));
2050
  if (typed !== 'DELETE') return showToast(tr('account.cancelled', null, '已取消'), 'error');
@@ -2131,14 +2135,12 @@ async function _runBatch(endpoint, tokens, label, onDone) {
2131
  };
2132
  es.onerror = function() {
2133
  if (_finalReceived) { _batchEs = null; return; }
2134
- // readyState CLOSED (2) = server rejected reconnect (e.g. 401/404), give up
2135
  if (this.readyState === EventSource.CLOSED) {
2136
  _batchEs = null;
2137
  _batchTaskId = null;
2138
  _cleanup();
2139
  progress.finish('连接中断', 'error');
2140
  }
2141
- // readyState CONNECTING (0) = browser is auto-reconnecting, let it
2142
  };
2143
  } catch (e) {
2144
  _cleanup();
@@ -2175,8 +2177,8 @@ async function setDisabled(token, disabled) {
2175
  ? tr('account.disableConfirmTitle', null, '禁用账号')
2176
  : tr('account.restoreConfirmTitle', null, '恢复账号');
2177
  const body = disabled
2178
- ? tr('account.disableConfirmBody', { token: `<code>${masked}</code>` }, `确认禁用 <code>${masked}</code>?<br><small style="color:var(--fg-muted)">禁用后该账号不会参与请求分配。</small>`)
2179
- : tr('account.restoreConfirmBody', { token: `<code>${masked}</code>` }, `确认恢复 <code>${masked}</code>?<br><small style="color:var(--fg-muted)">恢复后该账号将重新参与请求分配。</small>`);
2180
 
2181
  openConfirm(title, body, async () => {
2182
  try {
@@ -2211,8 +2213,8 @@ function batchSetDisabled(disabled) {
2211
  ? tr('account.batchDisableConfirmTitle', null, '批量禁用账号')
2212
  : tr('account.batchRestoreConfirmTitle', null, '批量恢复账号');
2213
  const body = disabled
2214
- ? tr('account.batchDisableConfirmBody', { n }, `确认禁用选中的 <b>${n}</b> 个账户?<br><small style="color:var(--fg-muted)">禁用后这些账号不会参与请求分配,但可随时恢复。</small>`)
2215
- : tr('account.batchRestoreConfirmBody', { n }, `确认恢复选中的 <b>${n}</b> 个账户?<br><small style="color:var(--fg-muted)">恢复后这些账号将重新参与请求分配。</small>`);
2216
 
2217
  openConfirm(title, body, async () => {
2218
  try {
@@ -2273,7 +2275,7 @@ function batchRefreshAllManageable() {
2273
  if (!n) return showToast(tr('account.noManageableAccounts', null, '没有可操作的可用账户'), 'error');
2274
  openConfirm(
2275
  tr('account.refreshAllConfirmTitle', null, '重新测试全部正常账户'),
2276
- tr('account.refreshAllConfirmBody', { n }, `重新测试全部 <b>${n}</b> 个正常/限流账户的运行状态?<br><small style="color:var(--fg-muted)">该操作会调用上游接口,并按后端并发上限 50 分批执行。</small>`),
2277
  async () => _runBatch('/batch/refresh?all_manageable=true', [],
2278
  tr('account.refreshAllRunning', { n }, `正在重新测试 ${n} 个账户…`),
2279
  (ok, fail, s) => {
@@ -2321,7 +2323,7 @@ function batchNSFWAll() {
2321
  if (!n) return showToast(tr('account.noManageableAccounts', null, '没有可操作的可用账户'), 'error');
2322
  openConfirm(
2323
  tr('account.nsfwAllConfirmTitle', null, '全部开启 NSFW'),
2324
- tr('account.nsfwAllConfirmBody', { n }, `为全部 <b>${n}</b> 个正常/限流账户开启 NSFW?<br><small style="color:var(--fg-muted)">该操作会按后端并发上限 50 分批执行。</small>`),
2325
  async () => _runBatch('/batch/nsfw?all_manageable=true', [],
2326
  tr('account.nsfwAllEnabling', { n }, `正在为 ${n} 个账户开启 NSFW…`),
2327
  (ok, fail) => showToast(tr('account.nsfwDone', { ok, fail }, `NSFW 完成:成功 ${ok},失败 ${fail}`), fail > 0 ? 'error' : 'success')
 
8
  <link href="https://cdn.jsdelivr.net/npm/geist@1.0.0/dist/fonts/geist-sans/style.css" rel="stylesheet">
9
  <link href="/static/css/app.css?v={{APP_VERSION}}" rel="stylesheet">
10
  <style>
11
+ body { background: #141416; color: #f4f4f5; }
12
 
13
  /* Page header */
14
  .page-hd { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:20px }
15
+ .page-title{ font-size:22px; font-weight:700; line-height:1.2; color: #f4f4f5; }
16
+ .page-sub { font-size:13px; color:#a1a1aa; margin-top:5px }
17
  .page-actions { display:flex; gap:8px; align-items:center; flex-shrink:0 }
18
  .section-head {
19
  display:flex;
 
25
  .section-title {
26
  font-size:13px;
27
  font-weight:600;
28
+ color:#e4e4e7;
29
  letter-spacing:.01em;
30
  }
31
  .section-title-row {
 
37
  min-width:20px;
38
  height:20px;
39
  padding:0 7px;
40
+ border-radius:999px;
41
  display:inline-flex;
42
  align-items:center;
43
  justify-content:center;
44
+ background:#2d2d34;
45
+ color:#a1a1aa;
46
  font-size:11px;
47
  font-weight:600;
48
  font-variant-numeric:tabular-nums;
 
58
  gap:6px;
59
  font-size:13px;
60
  font-weight:600;
61
+ border:1px solid #3f3f46;
62
+ background:#202024;
63
+ color:#e4e4e7;
64
  }
65
  .page-action-btn:hover {
66
+ background:#2d2d34;
67
+ border-color:#52525b;
68
  }
69
  .page-action-btn-primary {
70
+ background:#f4f4f5;
71
+ border-color:#f4f4f5;
72
+ color:#141416;
73
  }
74
  .page-action-btn-primary:hover {
75
+ background:#e4e4e7;
76
+ border-color:#e4e4e7;
77
  }
78
  /* Stats */
79
  .stat-grid {
 
95
  min-height:88px;
96
  padding:14px 16px;
97
  border-radius:12px;
98
+ background:#202024;
99
+ border:1px solid #2d2d34;
100
  display:flex;
101
  flex-direction:column;
102
  gap:12px;
 
106
  transition:background-color .15s, transform .15s, box-shadow .15s;
107
  }
108
  .stat-cell.clickable:hover {
109
+ background-color:#2d2d34;
110
  transform:translateY(-1px);
111
+ box-shadow:0 6px 16px rgba(0,0,0,0.2);
112
  }
113
  .stat-top {
114
  display:flex;
 
118
  }
119
  .stat-label {
120
  font-size:11px;
121
+ color:#a1a1aa;
122
  letter-spacing:.01em;
123
  white-space:nowrap;
124
  }
 
128
  display:inline-flex;
129
  align-items:center;
130
  justify-content:center;
131
+ color:#71717a;
132
  flex:0 0 auto;
133
  }
134
  .stat-icon svg {
 
142
  line-height:1;
143
  letter-spacing:-.02em;
144
  margin-top:auto;
145
+ color: #f4f4f5;
146
  }
147
+ .stat-muted { color:#52525b !important; }
148
  [data-random-only] { display:none }
149
  .stat-grid.mode-random [data-random-only] { display:flex }
150
  .stat-grid.mode-random [data-stat-card="active"] { order:1 }
 
176
  flex:0 0 52px;
177
  font-size:11px;
178
  font-weight:600;
179
+ color:#71717a;
180
  letter-spacing:.01em;
181
  text-align:right;
182
  white-space:nowrap;
 
188
  border-radius:999px;
189
  font-size:12px;
190
  font-weight:500;
191
+ color:#a1a1aa;
192
+ background:#202024;
193
+ border:1px solid #2d2d34;
194
  display:flex;
195
  align-items:center;
196
  justify-content:space-between;
 
199
  white-space:nowrap;
200
  flex:0 0 auto;
201
  }
202
+ .filter-chip:hover { color:#e4e4e7; background:#2d2d34 }
203
  .filter-chip.active {
204
+ background:#f4f4f5;
205
+ color:#141416;
206
+ border-color:#f4f4f5;
207
  }
208
  .filter-chip-count {
209
  min-width:18px;
210
  height:18px;
211
  padding:0 5px;
212
  border-radius:999px;
213
+ background:rgba(255,255,255,.1);
214
  font-size:11px;
215
  font-weight:600;
216
  color:inherit;
 
220
  font-variant-numeric:tabular-nums;
221
  }
222
  .filter-chip.active .filter-chip-count {
223
+ background:rgba(0,0,0,.1);
224
+ color:#141416;
225
  }
226
  .filter-chip-count.is-green,
227
  .filter-chip-count.is-orange,
 
235
  gap:8px;
236
  margin-bottom:8px;
237
  flex-wrap:wrap;
238
+ color:#a1a1aa;
239
  font-size:12px;
240
  font-weight:500;
241
  font-family:inherit;
 
256
  color:inherit;
257
  flex:0 0 auto;
258
  font:inherit;
259
+ background:transparent;
260
+ border:none;
261
+ cursor:pointer;
262
  }
263
  .toolbar-icon-btn:hover {
264
+ color:#f4f4f5;
 
 
 
 
 
 
 
 
265
  }
266
  .toolbar-icon-btn-danger { color:inherit; }
267
+ .toolbar-icon-btn-danger:hover { color:#ef4444; }
268
  .toolbar-icon-btn.is-active {
269
+ color:#141416;
270
+ background:#f4f4f5;
271
  border-radius:999px;
272
  }
273
  .toolbar-page-size {
 
275
  height:28px;
276
  border-radius:999px;
277
  font:inherit;
278
+ color:#e4e4e7 !important;
279
+ background:#202024 !important;
280
+ border:1px solid #3f3f46 !important;
281
  }
282
  .toolbar-dropdown {
283
  position:relative;
 
291
  width:min(416px, calc(100vw - 24px));
292
  padding:12px;
293
  border-radius:16px;
294
+ background:#1a1a1e;
295
+ border:1px solid #2d2d34;
296
+ box-shadow:0 12px 28px rgba(0,0,0,.4);
297
  display:none;
298
  z-index:30;
299
  }
 
337
  padding:0 10px;
338
  font-size:11px;
339
  gap:5px;
340
+ background:#202024;
341
  }
342
  .toolbar-dropdown-panel .filter-chip-count {
343
  min-width:16px;
 
358
 
359
  /* Table */
360
  .table-card {
361
+ background:#202024;
362
+ border:1px solid #2d2d34;
363
  border-radius:14px;
364
  overflow-x:auto;
365
  overflow-y:hidden;
 
367
  }
368
  .table-card > table { width:max-content; min-width:100%; border-collapse:collapse }
369
  .table-freeze-last {
370
+ --table-sticky-bg:#202024;
371
+ --table-sticky-hover-bg:#2d2d34;
372
  }
373
  table { width:100%; border-collapse:collapse }
374
  th {
375
+ background:#202024;
376
  font-size:11px;
377
  font-weight:500;
378
+ color:#a1a1aa;
379
  padding:11px 16px;
380
  text-align:left;
381
+ border-bottom:1px solid #2d2d34;
382
  letter-spacing:.01em;
383
  user-select:none;
384
  }
 
387
  transition:color .15s, background-color .15s;
388
  }
389
  th.sortable-th:hover {
390
+ color:#f4f4f5;
391
+ background-color:#2d2d34;
392
  }
393
  .sort-indicator {
394
  font-size:10px;
395
  display:inline-block;
396
  margin-left:4px;
397
+ color:#f4f4f5;
398
  font-weight:bold;
399
  }
400
  td {
401
  font-size:13px;
402
  padding:13px 16px;
403
+ border-bottom:1px solid #1a1a1e;
404
  vertical-align:middle;
405
+ color:#e4e4e7;
406
  }
407
  tr:last-child td { border-bottom:none }
408
+ tr:hover td { background:#2d2d34 }
409
  .table-card .badge {
410
  display:inline-flex;
411
  align-items:center;
 
417
  border:none;
418
  }
419
  .table-card .badge-basic {
420
+ color:#a1a1aa;
421
+ background:#2d2d34;
422
  }
423
  .table-card .badge-super {
424
+ color:#60a5fa;
425
+ background:rgba(96, 165, 250, 0.15);
426
  }
427
  .table-card .badge-heavy {
428
+ color:#fb923c;
429
+ background:rgba(251, 146, 60, 0.15);
430
  }
431
  .table-card .badge-active {
432
+ color:#4ade80;
433
+ background:rgba(74, 222, 128, 0.15);
434
  }
435
  .table-card .badge-cooling {
436
+ color:#fbbf24;
437
+ background:rgba(251, 191, 36, 0.15);
438
  }
439
  .table-card .badge-expired,
440
  .table-card .badge-invalid,
441
  .table-card .badge-failed {
442
+ color:#f87171;
443
+ background:rgba(248, 113, 113, 0.15);
444
  }
445
  .table-card .badge-disabled {
446
+ color:#71717a;
447
+ background:#2d2d34;
448
  }
449
  .table-center { text-align:center }
450
  .table-center .badge { margin:0 auto }
 
466
  display:inline-flex;
467
  align-items:center;
468
  justify-content:center;
469
+ color:#71717a;
470
+ background:transparent;
471
+ border:none;
472
+ cursor:pointer;
473
  flex:0 0 auto;
474
  }
475
  .row-icon-btn svg {
 
484
  width:14.5px;
485
  height:14.5px;
486
  }
487
+ .row-icon-btn:hover { color:#e4e4e7 }
488
  .row-icon-btn.is-loading {
489
+ color:#e4e4e7;
490
  pointer-events:none;
491
  }
492
  .row-icon-btn.is-loading svg {
493
  animation:spin .85s linear infinite;
494
  }
495
  .row-action {
496
+ color:#71717a;
497
  font-size:11px;
498
  font-weight:500;
499
  display:inline-flex;
500
  align-items:center;
501
  justify-content:center;
502
  }
503
+ .row-action:hover { color:#e4e4e7 }
504
  .row-action:disabled {
505
  opacity:1;
506
  cursor:default;
507
  }
508
  .row-action-danger {
509
+ color:#f87171;
510
  }
511
+ .row-action-danger:hover { color:#ef4444 }
512
+ .row-icon-danger { color:#f87171; }
513
+ .row-icon-danger:hover { color:#ef4444 }
514
  .row-action-static {
515
+ color:#c084fc;
516
  }
517
  .admin-tooltip {
518
  position:fixed;
 
522
  max-width:220px;
523
  padding:6px 8px;
524
  border-radius:8px;
525
+ background:rgba(32,32,36,.96);
526
+ border:1px solid #3f3f46;
527
  color:#fff;
528
  font-size:11px;
529
  line-height:1.35;
 
540
  display:inline-flex;
541
  align-items:center;
542
  justify-content:center;
543
+ color:#71717a;
544
+ background:transparent;
545
+ border:none;
546
+ cursor:pointer;
547
  flex:0 0 auto;
548
  }
549
+ .row-nsfw-btn:hover { color:#e4e4e7 }
550
+ .row-nsfw-btn.is-on { color:#f87171 }
551
+ .row-nsfw-btn.is-on:hover { color:#ef4444 }
552
  .row-nsfw-btn svg {
553
  width:15px;
554
  height:15px;
 
572
  }
573
  .table-card .empty-state {
574
  padding:48px 16px;
575
+ color:#71717a;
576
  font-size:13px;
577
  }
578
  @keyframes spin {
 
600
  opacity:.85;
601
  transform:scale(1.05);
602
  }
603
+ .q-a { background:rgba(96, 165, 250, 0.15); color:#60a5fa }
604
+ .q-f { background:rgba(74, 222, 128, 0.15); color:#4ade80 }
605
+ .q-e { background:rgba(168, 85, 247, 0.15); color:#c084fc }
606
+ .q-h { background:rgba(251, 146, 60, 0.15); color:#fb923c }
607
+ .q-b { background:rgba(244, 63, 94, 0.15); color:#fb7185 }
608
+ .q-c { background:rgba(45, 212, 191, 0.15); color:#2dd4bf }
609
+ .q-z { background:#2d2d34; color:#71717a }
610
 
611
  /* Token monospace */
612
+ .tok { font-family:ui-monospace,monospace; font-size:12px; color:#f4f4f5 }
613
 
614
  /* Pagination */
 
615
  .pagi-meta {
616
  display:flex;
617
  align-items:center;
 
639
  align-items:center;
640
  justify-content:center;
641
  color:inherit;
642
+ background:transparent;
643
+ border:none;
644
+ cursor:pointer;
645
  transition:background .1s, color .1s;
646
  font:inherit;
647
  }
648
+ .pagi-btn:hover { background:#2d2d34 }
649
+ .pagi-btn.on { background:#f4f4f5; color:#141416 }
650
+ .pagi-btn:disabled { opacity:.25; pointer-events:none }
651
+
652
+ /* Dialog框及输入控件大重构 */
653
+ .modal-overlay {
654
+ background: rgba(0,0,0,0.6) !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
655
  }
656
+ .modal {
657
+ background: #202024 !important;
658
+ border: 1px solid #3f3f46 !important;
659
+ color: #f4f4f5 !important;
660
+ box-shadow: 0 20px 25px -5px rgba(0,0,0,0.5) !important;
 
 
661
  }
662
+ .modal-title {
663
+ color: #f4f4f5 !important;
 
 
 
 
 
664
  }
665
+ .input, select, textarea {
666
+ background: #141416 !important;
667
+ border: 1px solid #3f3f46 !important;
668
+ color: #f4f4f5 !important;
 
669
  }
670
+ .input:focus, select:focus, textarea:focus {
671
+ border-color: #71717a !important;
672
+ outline: none;
673
+ }
674
+ .dialog-help {
675
+ color: #a1a1aa !important;
676
+ }
677
+ .dialog-label {
678
+ color: #a1a1aa !important;
679
  }
680
  .dialog-btn {
681
  height:32px;
682
  padding:0 14px;
683
  border-radius:999px;
684
+ background:#2d2d34;
685
+ border:1px solid #3f3f46;
686
+ color:#e4e4e7;
687
  font-size:13px;
688
  font-weight:600;
689
+ cursor:pointer;
690
  }
691
  .dialog-btn:hover {
692
+ background:#3f3f46;
693
  }
694
  .dialog-btn-primary {
695
+ background:#f4f4f5;
696
+ color:#141416;
697
+ border-color:#f4f4f5;
698
  }
699
  .dialog-btn-primary:hover {
700
+ background:#e4e4e7;
701
  }
702
  .dialog-btn-danger {
703
+ color:#f87171;
704
+ background:rgba(248,113,113,0.1);
705
+ border-color:rgba(248,113,113,0.2);
706
  }
707
  .dialog-btn-danger:hover {
708
+ background:rgba(248,113,113,0.2);
709
+ }
710
+ .export-option-btn {
711
+ width:100%;
712
+ min-height:34px;
713
+ height:auto;
714
+ padding:6px 12px;
715
+ display:flex;
716
+ align-items:center;
717
+ justify-content:center;
718
+ text-align:center;
719
+ white-space:normal;
720
+ line-height:1.35;
721
  }
722
 
723
  /* Import modal */
 
724
  .import-file-shell {
725
  height:34px;
726
  display:flex;
727
  align-items:center;
728
  padding:0 10px;
729
  border-radius:8px;
730
+ background:#141416;
731
+ border:1px solid #3f3f46;
732
  cursor:pointer;
733
  transition:background .15s;
734
  flex:1;
735
  min-width:0;
736
  }
737
  .import-file-shell:hover {
738
+ background:#2d2d34;
739
  }
740
  .import-file-name {
741
  font-size:12px;
742
+ color:#e4e4e7;
743
  white-space:nowrap;
744
  overflow:hidden;
745
  text-overflow:ellipsis;
746
  min-width:0;
747
  flex:1;
748
  }
749
+ .import-file-name.empty { color:#71717a }
750
 
751
  /* Audit log styles */
752
  .audit-table-wrap {
753
  width:100%;
754
  overflow-x:auto;
755
+ border:1px solid #3f3f46;
756
  border-radius:8px;
757
  max-height:360px;
758
+ background:#141416;
759
  }
760
  .audit-table { width:100%; border-collapse:collapse; min-width:560px }
761
+ .audit-table th { background:#202024; padding:8px 12px; font-size:11px; color:#a1a1aa; border-bottom:1px solid #3f3f46 }
762
+ .audit-table td { padding:10px 12px; font-size:12px; border-bottom:1px solid #2d2d34; color:#e4e4e7 }
763
  </style>
764
  </head>
765
  <body>
766
 
767
+ <!-- ── Header ─────────────────────────────────────────────────────────────── -->
768
  <div id="admin-header" data-active="/admin/account"></div>
769
 
770
+ <!-- ── Main ───────────────────────────────────────────────────────────────── -->
771
  <main class="admin-main">
772
 
773
+ <!-- Page heading -->
774
  <div class="page-hd">
775
  <div>
776
  <div class="page-title" data-i18n="account.pageHeading">账户列表</div>
 
792
  <div class="section-title" data-i18n="account.sectionOverview">账户概览</div>
793
  </div>
794
 
795
+ <!-- Stats -->
796
  <div class="stat-grid" id="overview-stats">
797
  <div class="stat-cell" data-stat-card="total">
798
  <div class="stat-top">
 
806
  <div class="stat-cell" data-stat-card="active">
807
  <div class="stat-top">
808
  <div class="stat-label" data-i18n="account.statActive">正常账户</div>
809
+ <span class="stat-icon" style="color:#4ade80">
810
  <svg viewBox="0 0 24 24" fill="none" stroke-width="1.9"><circle cx="12" cy="12" r="8"/><path d="m8.5 12 2.4 2.4 4.8-4.8"/></svg>
811
  </span>
812
  </div>
813
+ <div class="stat-num" id="s-active" style="color:#4ade80">0</div>
814
  </div>
815
  <div class="stat-cell" data-stat-card="cooling">
816
  <div class="stat-top">
817
  <div class="stat-label" data-i18n="account.statCooling">限流账户</div>
818
+ <span class="stat-icon" style="color:#fb923c">
819
  <svg viewBox="0 0 24 24" fill="none" stroke-width="1.8"><path d="M12 6v6l4 2"/><circle cx="12" cy="12" r="8"/></svg>
820
  </span>
821
  </div>
822
+ <div class="stat-num" id="s-cooling" style="color:#fb923c">0</div>
823
  </div>
824
  <div class="stat-cell" data-stat-card="invalid">
825
  <div class="stat-top">
826
  <div class="stat-label" data-i18n="account.statInvalid">异常账户</div>
827
+ <span class="stat-icon" style="color:#f87171">
828
  <svg viewBox="0 0 24 24" fill="none" stroke-width="1.8"><path d="m15 9-6 6m0-6 6 6"/><circle cx="12" cy="12" r="8"/></svg>
829
  </span>
830
  </div>
831
+ <div class="stat-num" id="s-invalid" style="color:#f87171">0</div>
832
  </div>
833
  <div class="stat-cell" data-stat-card="disabled">
834
  <div class="stat-top">
835
  <div class="stat-label" data-i18n="account.statDisabled">禁用账户</div>
836
+ <span class="stat-icon" style="color:#71717a">
837
  <svg viewBox="0 0 24 24" fill="none" stroke-width="1.8"><circle cx="12" cy="12" r="8"/><path d="M8.5 8.5 15.5 15.5"/></svg>
838
  </span>
839
  </div>
840
+ <div class="stat-num" id="s-disabled" style="color:#71717a">0</div>
841
  </div>
842
  </div>
843
 
844
+ <!-- Quota stats (6 columns) -->
845
  <div class="stat-grid-quota" id="overview-quota-stats">
846
  <div class="stat-cell clickable" data-stat-card="calls" onclick="openAuditModal('calls')">
847
  <div class="stat-top">
848
  <div class="stat-label" data-i18n="account.statCalls">调用总数</div>
849
+ <span class="stat-icon" style="color:#f4f4f5">
850
  <svg viewBox="0 0 24 24" fill="none" stroke-width="1.8"><path d="M5 19h14"/><path d="M8 16V10"/><path d="M12 16V6"/><path d="M16 16v-3"/></svg>
851
  </span>
852
  </div>
853
+ <div class="stat-num" id="s-calls" style="color:#f4f4f5">0</div>
854
  </div>
855
  <div class="stat-cell clickable" data-quota-only onclick="openAuditModal('auto')">
856
  <div class="stat-top">
857
  <div class="stat-label" data-i18n="account.statAuto">Auto 余额</div>
858
+ <span class="stat-icon" style="color:#60a5fa">
859
  <svg viewBox="0 0 24 24" fill="none" stroke-width="1.8"><path d="M6 19h12"/><path d="M12 16V9"/></svg>
860
  </span>
861
  </div>
862
+ <div class="stat-num" id="s-qa" style="color:#60a5fa">0</div>
863
  </div>
864
  <div class="stat-cell clickable" data-quota-only onclick="openAuditModal('fast')">
865
  <div class="stat-top">
866
  <div class="stat-label" data-i18n="account.statFast">Fast 余额</div>
867
+ <span class="stat-icon" style="color:#4ade80">
868
  <svg viewBox="0 0 24 24" fill="none" stroke-width="1.8"><path d="M6 19h12"/><path d="M10 16v-4"/><path d="M14 16V8"/></svg>
869
  </span>
870
  </div>
871
+ <div class="stat-num" id="s-qf" style="color:#4ade80">0</div>
872
  </div>
873
  <div class="stat-cell clickable" data-quota-only onclick="openAuditModal('expert')">
874
  <div class="stat-top">
875
  <div class="stat-label" data-i18n="account.statExpert">Expert 余额</div>
876
+ <span class="stat-icon" style="color:#c084fc">
877
  <svg viewBox="0 0 24 24" fill="none" stroke-width="1.8"><path d="M6 19h12"/><path d="M8 16v-2"/><path d="M12 16v-6"/><path d="M16 16V6"/></svg>
878
  </span>
879
  </div>
880
+ <div class="stat-num" id="s-qe" style="color:#c084fc">0</div>
881
  </div>
882
  <div class="stat-cell clickable" data-quota-only onclick="openAuditModal('heavy')">
883
  <div class="stat-top">
884
  <div class="stat-label" data-i18n="account.statHeavy">Heavy 余额</div>
885
+ <span class="stat-icon" style="color:#fb923c">
886
  <svg viewBox="0 0 24 24" fill="none" stroke-width="1.8"><path d="M5 19h14"/><path d="M7 16v-1"/><path d="M10 16v-4"/><path d="M14 16V8"/><path d="M17 16V5"/></svg>
887
  </span>
888
  </div>
889
+ <div class="stat-num" id="s-qh" style="color:#fb923c">0</div>
890
  </div>
891
  <div class="stat-cell clickable" data-quota-only onclick="openAuditModal('console')">
892
  <div class="stat-top">
893
  <div class="stat-label" data-i18n="account.statConsole">Console 余额</div>
894
+ <span class="stat-icon" style="color:#2dd4bf">
895
  <svg viewBox="0 0 24 24" fill="none" stroke-width="1.8"><path d="M4 19h16"/><path d="M6 16v-1"/><path d="M9 16v-3"/><path d="M12 16v-6"/><path d="M15 16V8"/><path d="M18 16V5"/></svg>
896
  </span>
897
  </div>
898
+ <div class="stat-num" id="s-qc" style="color:#2dd4bf">0</div>
899
  </div>
900
  </div>
901
 
 
906
  </div>
907
  </div>
908
 
909
+ <!-- Toolbar -->
910
  <div class="table-toolbar">
911
  <div class="table-toolbar-left" style="display:flex;align-items:center;gap:6px">
912
  <button onclick="prevPage()" class="pagi-btn" id="btn-prev">
 
1026
  </div>
1027
  </div>
1028
 
1029
+ <!-- Table -->
1030
  <div class="table-card table-freeze-last">
1031
  <table>
1032
  <thead>
 
1039
  <span data-i18n="account.colQuota">额度</span>
1040
  <span style="margin-left:6px;display:inline-flex;align-items:center;gap:3px;vertical-align:middle">
1041
  <span class="q-pill q-a sortable-pill" onclick="handleSort('quota_auto')" title="按 Auto 排序">A<span id="sort-quota_auto" class="sort-indicator"></span></span>
1042
+ <span class="q-pill q-f sortable-pill" onclick="handleSort('quota_fast')" title="按 Fast 排序">F<span id="sort-quota_fast" class="sort-indicator"></span></span>
1043
  <span class="q-pill q-e sortable-pill" onclick="handleSort('quota_expert')" title="按 Expert 排序">E<span id="sort-quota_expert" class="sort-indicator"></span></span>
1044
  <span class="q-pill q-h sortable-pill" onclick="handleSort('quota_heavy')" title="按 Heavy 排序">H<span id="sort-quota_heavy" class="sort-indicator"></span></span>
1045
  <span class="q-pill q-c sortable-pill" onclick="handleSort('quota_console')" title="按 Console 排序">C<span id="sort-quota_console" class="sort-indicator"></span></span>
 
1058
 
1059
  </main>
1060
 
1061
+ <!-- ── Add Modal ───────────────────────────────────────────────────────────── -->
1062
  <div class="modal-overlay" id="modal-import">
1063
  <div class="modal">
1064
  <div class="modal-title" data-i18n="account.addTitle">添加账户</div>
 
1076
  <input type="checkbox" id="import-auto-nsfw" style="margin:0">
1077
  <span data-i18n="account.autoNsfwOnImport">导入后自动开启 NSFW</span>
1078
  </label>
1079
+ <div style="font-size:12px;color:#a1a1aa;margin-top:4px" data-i18n="account.autoNsfwHint">需要额外时间检测账户状态</div>
1080
  </div>
1081
  </div>
1082
  <div class="dialog-actions">
 
1086
  </div>
1087
  </div>
1088
 
1089
+ <!-- ── Import Modal ────────────────────────────────────────────────────────── -->
1090
  <div class="modal-overlay" id="modal-import-file">
1091
  <div class="modal">
1092
  <div class="modal-title" data-i18n="account.importTitle">导入文件</div>
 
1108
  <input type="checkbox" id="import-file-auto-nsfw" style="margin:0">
1109
  <span data-i18n="account.autoNsfwOnImport">导入后自动开启 NSFW</span>
1110
  </label>
1111
+ <div style="font-size:12px;color:#a1a1aa;margin-top:4px" data-i18n="account.autoNsfwHint">需要额外时间检测账户状态</div>
1112
  </div>
1113
  </div>
1114
  <div class="dialog-actions">
 
1118
  </div>
1119
  </div>
1120
 
1121
+ <!-- ── Edit Modal ─────────────────────────────────────────────────────────── -->
1122
  <div class="modal-overlay" id="modal-edit">
1123
  <div class="modal">
1124
  <div class="modal-title" data-i18n="account.editTitle">编辑账户</div>
 
1139
  </div>
1140
  </div>
1141
 
1142
+ <!-- ── Export Modal ────────────────────────────────────────────────────────── -->
1143
  <div class="modal-overlay" id="modal-export">
1144
  <div class="modal" style="max-width:360px">
1145
  <div class="modal-title" data-i18n="account.exportTitle">导出格式</div>
 
1151
  </div>
1152
  </div>
1153
 
1154
+ <!-- ── Confirm Modal ───────────────────────────────────────────────────────── -->
1155
  <div class="modal-overlay" id="modal-confirm">
1156
  <div class="modal" style="max-width:400px">
1157
  <div class="modal-title" id="confirm-title" data-i18n="account.confirmTitle">确认</div>
 
1163
  </div>
1164
  </div>
1165
 
1166
+ <!-- ── Audit Log Modal ─────────────────────────────────────────────────────── -->
1167
  <div class="modal-overlay" id="modal-audit">
1168
  <div class="modal">
1169
  <div class="modal-title" id="audit-title">调用审计明细</div>
 
1181
  </thead>
1182
  <tbody id="audit-tbody">
1183
  <tr>
1184
+ <td colspan="5" style="text-align:center;color:#71717a;padding:24px;">暂无审计记录</td>
1185
  </tr>
1186
  </tbody>
1187
  </table>
 
1204
  const PAGE_SIZE_OPTIONS = [50, 100, 200, 500, 1000, 2000];
1205
 
1206
  let allTokens = [], curStatus = 'all', curNsfw = 'all', curPool = 'all', curPage = 1, pageSize = loadSavedPageSize();
1207
+ let sortKey = '', sortOrder = 'desc';
1208
  const sel = new Set();
1209
  const refreshingTokens = new Set();
1210
  let _cb = null;
 
1287
  return r.json();
1288
  }
1289
 
 
 
1290
  let selectionStrategy = 'quota';
1291
 
1292
  // ── Load ───────────────────────────────────────────────────────────────────
 
1310
  }
1311
 
1312
  function applyStrategyUI() {
 
1313
  const isRandom = selectionStrategy === 'random';
1314
  const statsGrid = document.getElementById('overview-stats');
1315
  if (statsGrid) statsGrid.classList.toggle('mode-random', isRandom);
 
1358
  };
1359
  document.getElementById('audit-title').textContent = titleMap[type] || '调用审计明细';
1360
  const tbody = document.getElementById('audit-tbody');
1361
+ tbody.innerHTML = `<tr><td colspan="5" style="text-align:center;padding:32px;color:#71717a;">正在从后台加载链路审计数据...</td></tr>`;
1362
  openModal('modal-audit');
1363
 
1364
  try {
1365
  const data = await _api('GET', `/audit/logs?type=${type}`).catch(() => ({ logs: [] }));
1366
  const logs = data.logs || [];
1367
  if (!logs.length) {
1368
+ tbody.innerHTML = `<tr><td colspan="5" style="text-align:center;color:#71717a;padding:32px;">当前通道近期没有上游日志产生 (直连/历史日志为空)</td></tr>`;
1369
  return;
1370
  }
1371
  tbody.innerHTML = logs.map(log => `
1372
  <tr>
1373
  <td style="font-variant-numeric:tabular-nums;">${fmtDate(log.created_at || log.time)}</td>
1374
+ <td style="font-family:ui-monospace,monospace;color:#f4f4f5;">${log.client_ip || log.ip || '—'}</td>
1375
+ <td style="max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#a1a1aa;" title="${xe(log.user_agent || '')}">${log.user_agent || '—'}</td>
1376
+ <td style="font-family:ui-monospace,monospace;font-size:11px;color:#a1a1aa;">${log.conversation_id || '—'}</td>
1377
+ <td style="font-family:ui-monospace,monospace;color:#e4e4e7;">${mask(log.account_token || log.token || '—')}</td>
1378
  </tr>
1379
  `).join('');
1380
  } catch (e) {
1381
+ tbody.innerHTML = `<tr><td colspan="5" style="text-align:center;color:#f87171;padding:32px;">读取审计记录失败: ${e.message}</td></tr>`;
1382
  }
1383
  }
1384
 
 
1466
  if (matchesPool && matchesStatus && matchesNsfw) filteredItems.push(token);
1467
  }
1468
 
 
1469
  if (sortKey) {
1470
  filteredItems.sort((a, b) => {
1471
  let vA, vB;
 
1699
  <td class="table-center"><span class="badge badge-${t.pool||'basic'}">${xe(poolLabel(t.pool || 'basic'))}</span></td>
1700
  <td class="table-center">${statusBadge(t.status)}</td>
1701
  <td data-quota-only><div class="quota-cell">${qpills(q)}</div></td>
1702
+ <td class="table-center" style="font-variant-numeric:tabular-nums;color:#a1a1aa">${success}</td>
1703
+ <td class="table-center" style="font-variant-numeric:tabular-nums;color:#71717a">${fail}</td>
1704
+ <td class="table-center" style="font-variant-numeric:tabular-nums;color:#71717a">${fmtRate(success, fail)}</td>
1705
+ <td style="font-size:12px;color:#71717a">${fmtDate(t.last_used_at)}</td>
1706
  <td><div class="row-actions">
1707
  ${nsfwBtn}
1708
  <button onclick="${isDisabled ? `restoreOne('${xe(t.token)}')` : `disableOne('${xe(t.token)}')`}" class="row-icon-btn row-icon-btn-state" data-tip="${xe(isDisabled ? tr('account.actionRestore', null, '恢复账号') : tr('account.actionDisable', null, '禁用账号'))}" aria-label="${xe(isDisabled ? tr('account.actionRestore', null, '恢复账号') : tr('account.actionDisable', null, '禁用账号'))}">
 
1844
  }
1845
 
1846
  // ── Add / Import ───────────────────────────────────────────────────────────
 
 
1847
  function fillImportPoolOptions(id) {
1848
  const known = [...new Set(['basic', 'super', 'heavy', ...allTokens.map(t => t.pool || 'basic')])];
1849
  const opts = [
 
1853
  document.getElementById(id).innerHTML = opts.join('');
1854
  }
1855
 
 
1856
  function fillPoolOptions(id) {
1857
  const pools = [...new Set(['basic', 'super', 'heavy', ...allTokens.map(t => t.pool || 'basic')])];
1858
  document.getElementById(id).innerHTML = pools.map(p => `<option value="${p}">${xe(poolLabel(p))}</option>`).join('');
 
1921
  load();
1922
  } catch (e) { showToast(`${tr('account.importFailed', null, '导入失败')}: ${e.message}`, 'error'); }
1923
  } else {
 
1924
  const pool = document.getElementById('import-file-pool').value;
1925
  const newToks = raw.split(/\r?\n/).map(s => s.trim()).filter(Boolean);
1926
  if (!newToks.length) return showToast(tr('account.fileEmpty', null, '文件中没有可导入的 Token'), 'error');
 
2013
  const n = tokens.length;
2014
  openConfirm(tr('account.deleteConfirmTitle', null, '确认删除'),
2015
  n === 1
2016
+ ? tr('account.deleteConfirmOne', { token: `<code>${mask(tokens[0])}</code>` }, `确认删除 <code>${mask(tokens[0])}</code>?<br><small style="color:#f87171">此操作不可撤销。</small>`)
2017
+ : tr('account.deleteConfirmMany', { n }, `确认删除 <b>${n}</b> 个账户?<br><small style="color:#f87171">此操作不可撤销。</small>`),
2018
  async () => {
2019
  try {
2020
  showToast(tr('account.deleting', { n }, `正在删除 ${n} 个账户…`), 'info');
 
2048
  if (!total) return showToast(tr('account.noInvalidAccounts', null, '没有可删除的异常账户'), 'error');
2049
  openConfirm(
2050
  tr('account.deleteInvalidAllTitle', null, '删除全部异常账户'),
2051
+ tr('account.deleteInvalidAllBody', { n: total }, `确认删除全部 <b>${total}</b> 个异常账户?<br><small style="color:#f87171">此操作不可撤销。确认后还需要输入 DELETE。</small>`),
2052
  async () => {
2053
  const typed = window.prompt(tr('account.deleteInvalidTypeConfirm', null, '输入 DELETE 确认删除全部异常账户'));
2054
  if (typed !== 'DELETE') return showToast(tr('account.cancelled', null, '已取消'), 'error');
 
2135
  };
2136
  es.onerror = function() {
2137
  if (_finalReceived) { _batchEs = null; return; }
 
2138
  if (this.readyState === EventSource.CLOSED) {
2139
  _batchEs = null;
2140
  _batchTaskId = null;
2141
  _cleanup();
2142
  progress.finish('连接中断', 'error');
2143
  }
 
2144
  };
2145
  } catch (e) {
2146
  _cleanup();
 
2177
  ? tr('account.disableConfirmTitle', null, '禁用账号')
2178
  : tr('account.restoreConfirmTitle', null, '恢复账号');
2179
  const body = disabled
2180
+ ? tr('account.disableConfirmBody', { token: `<code>${masked}</code>` }, `确认禁用 <code>${masked}</code>?<br><small style="color:#a1a1aa">禁用后该账号不会参与请求分配。</small>`)
2181
+ : tr('account.restoreConfirmBody', { token: `<code>${masked}</code>` }, `确认恢复 <code>${masked}</code>?<br><small style="color:#a1a1aa">恢复后该账号将重新参与请求分配。</small>`);
2182
 
2183
  openConfirm(title, body, async () => {
2184
  try {
 
2213
  ? tr('account.batchDisableConfirmTitle', null, '批量禁用账号')
2214
  : tr('account.batchRestoreConfirmTitle', null, '批量恢复账号');
2215
  const body = disabled
2216
+ ? tr('account.batchDisableConfirmBody', { n }, `确认禁用选中的 <b>${n}</b> 个账户?<br><small style="color:#a1a1aa">禁用后这些账号不会参与请求分配,但可随时恢复。</small>`)
2217
+ : tr('account.batchRestoreConfirmBody', { n }, `确认恢复选中的 <b>${n}</b> 个账户?<br><small style="color:#a1a1aa">恢复后这些账号将重新参与请求分配。</small>`);
2218
 
2219
  openConfirm(title, body, async () => {
2220
  try {
 
2275
  if (!n) return showToast(tr('account.noManageableAccounts', null, '没有可操作的可用账户'), 'error');
2276
  openConfirm(
2277
  tr('account.refreshAllConfirmTitle', null, '重新测试全部正常账户'),
2278
+ tr('account.refreshAllConfirmBody', { n }, `重新测试全部 <b>${n}</b> 个正常/限流账户的运行状态?<br><small style="color:#a1a1aa">该操作会调用上游接口,并按后端并发上限 50 分批执行。</small>`),
2279
  async () => _runBatch('/batch/refresh?all_manageable=true', [],
2280
  tr('account.refreshAllRunning', { n }, `正在重新测试 ${n} 个账户…`),
2281
  (ok, fail, s) => {
 
2323
  if (!n) return showToast(tr('account.noManageableAccounts', null, '没有可操作的可用账户'), 'error');
2324
  openConfirm(
2325
  tr('account.nsfwAllConfirmTitle', null, '全部开启 NSFW'),
2326
+ tr('account.nsfwAllConfirmBody', { n }, `为全部 <b>${n}</b> 个正常/限流账户开启 NSFW?<br><small style="color:#a1a1aa">该操作会按后端并发上限 50 分批执行。</small>`),
2327
  async () => _runBatch('/batch/nsfw?all_manageable=true', [],
2328
  tr('account.nsfwAllEnabling', { n }, `正在为 ${n} 个账户开启 NSFW…`),
2329
  (ok, fail) => showToast(tr('account.nsfwDone', { ok, fail }, `NSFW 完成:成功 ${ok},失败 ${fail}`), fail > 0 ? 'error' : 'success')