Update app/statics/admin/cache.html
Browse files- app/statics/admin/cache.html +756 -44
app/statics/admin/cache.html
CHANGED
|
@@ -8,7 +8,8 @@
|
|
| 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: #
|
|
|
|
| 12 |
|
| 13 |
/* Page header */
|
| 14 |
.page-hd { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:20px }
|
|
@@ -25,31 +26,31 @@
|
|
| 25 |
.section-title {
|
| 26 |
font-size:13px;
|
| 27 |
font-weight:600;
|
| 28 |
-
color:#
|
| 29 |
letter-spacing:.01em;
|
| 30 |
}
|
| 31 |
.page-action-btn {
|
| 32 |
height:32px; padding:0 14px; border-radius:999px;
|
| 33 |
display:inline-flex; align-items:center; justify-content:center; gap:6px;
|
| 34 |
font-size:13px; font-weight:600;
|
| 35 |
-
border:1px solid #
|
| 36 |
}
|
| 37 |
-
.page-action-btn:hover { background:#
|
| 38 |
-
.page-action-btn-primary { background:#
|
| 39 |
-
.page-action-btn-primary:hover { background:#
|
| 40 |
|
| 41 |
/* Stats */
|
| 42 |
.stat-grid { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:12px; margin-bottom:30px }
|
| 43 |
-
.stat-cell { min-height:96px; padding:14px 16px; border-radius:12px; background:#
|
| 44 |
.stat-top { display:flex; align-items:center; justify-content:space-between; gap:10px }
|
| 45 |
-
.stat-label{ font-size:11px; color:#
|
| 46 |
-
.stat-icon { width:22px; height:22px; display:inline-flex; align-items:center; justify-content:center; color:#
|
| 47 |
.stat-icon svg { width:14px; height:14px; stroke:currentColor }
|
| 48 |
.stat-num { font-size:22px; font-weight:600; line-height:1; letter-spacing:-.02em; margin-top:auto }
|
| 49 |
.stat-sub {
|
| 50 |
margin-top:-4px;
|
| 51 |
font-size:11px;
|
| 52 |
-
color:#
|
| 53 |
font-variant-numeric:tabular-nums;
|
| 54 |
min-height:14px;
|
| 55 |
}
|
|
@@ -57,7 +58,7 @@
|
|
| 57 |
height:5px;
|
| 58 |
margin-top:-2px;
|
| 59 |
border-radius:999px;
|
| 60 |
-
background:#
|
| 61 |
overflow:hidden;
|
| 62 |
}
|
| 63 |
.stat-progress-fill {
|
|
@@ -65,12 +66,12 @@
|
|
| 65 |
height:100%;
|
| 66 |
width:0;
|
| 67 |
border-radius:999px;
|
| 68 |
-
background:#
|
| 69 |
transition:width .2s ease, background-color .2s ease;
|
| 70 |
}
|
| 71 |
-
.stat-progress-fill.image { background:#
|
| 72 |
-
.stat-progress-fill.video { background:#
|
| 73 |
-
.stat-progress-fill.over { background:#
|
| 74 |
|
| 75 |
/* Section tabs */
|
| 76 |
.sec-tabs {
|
|
@@ -83,12 +84,12 @@
|
|
| 83 |
}
|
| 84 |
.sec-tab {
|
| 85 |
height:30px; padding:0 12px; border-radius:999px;
|
| 86 |
-
font-size:12px; font-weight:500; color:#
|
| 87 |
-
background:#
|
| 88 |
transition:background .15s, color .15s;
|
| 89 |
}
|
| 90 |
-
.sec-tab:hover { color:#
|
| 91 |
-
.sec-tab.active { background:#
|
| 92 |
.sec-panel { display:none }
|
| 93 |
.sec-panel.active { display:block }
|
| 94 |
|
|
@@ -99,7 +100,7 @@
|
|
| 99 |
gap:8px;
|
| 100 |
margin-bottom:8px;
|
| 101 |
flex-wrap:wrap;
|
| 102 |
-
color:#
|
| 103 |
font-size:12px;
|
| 104 |
font-weight:500;
|
| 105 |
font-family:inherit;
|
|
@@ -116,7 +117,7 @@
|
|
| 116 |
flex:0 0 auto;
|
| 117 |
font:inherit;
|
| 118 |
}
|
| 119 |
-
.toolbar-icon-btn:hover { color:#
|
| 120 |
.toolbar-icon-btn svg {
|
| 121 |
width:14px;
|
| 122 |
height:14px;
|
|
@@ -126,14 +127,14 @@
|
|
| 126 |
fill:none;
|
| 127 |
}
|
| 128 |
.toolbar-icon-btn-danger { color:inherit }
|
| 129 |
-
.toolbar-icon-btn-danger:hover { color:#
|
| 130 |
.toolbar-page-size {
|
| 131 |
width:96px !important;
|
| 132 |
height:28px;
|
| 133 |
border-radius:999px;
|
| 134 |
font:inherit;
|
| 135 |
color:inherit;
|
| 136 |
-
background:#
|
| 137 |
border-color:transparent;
|
| 138 |
flex:0 0 auto;
|
| 139 |
}
|
|
@@ -163,14 +164,14 @@
|
|
| 163 |
}
|
| 164 |
|
| 165 |
/* Table */
|
| 166 |
-
.table-card { background:#
|
| 167 |
.table-card > table { width:max-content; min-width:100%; border-collapse:collapse }
|
| 168 |
-
.table-freeze-last { --table-sticky-bg:#
|
| 169 |
table { width:100%; border-collapse:collapse }
|
| 170 |
-
th { background:#
|
| 171 |
-
td { font-size:13px; padding:13px 16px; border-bottom:none; vertical-align:middle; color:#
|
| 172 |
tr:last-child td { border-bottom:none }
|
| 173 |
-
tr:hover td { background:#
|
| 174 |
.table-empty { text-align:center; color:#bbb; font-size:13px; padding:40px 16px }
|
| 175 |
.row-name {
|
| 176 |
display:flex;
|
|
@@ -184,7 +185,7 @@
|
|
| 184 |
display:inline-flex;
|
| 185 |
align-items:center;
|
| 186 |
justify-content:center;
|
| 187 |
-
color:#
|
| 188 |
flex:0 0 auto;
|
| 189 |
}
|
| 190 |
.row-icon svg {
|
|
@@ -209,7 +210,7 @@
|
|
| 209 |
white-space:nowrap;
|
| 210 |
}
|
| 211 |
.row-action {
|
| 212 |
-
color:#
|
| 213 |
width:22px;
|
| 214 |
height:22px;
|
| 215 |
display:inline-flex;
|
|
@@ -217,8 +218,8 @@
|
|
| 217 |
justify-content:center;
|
| 218 |
flex:0 0 auto;
|
| 219 |
}
|
| 220 |
-
.row-action:hover { color:#
|
| 221 |
-
.row-action-danger { color:#
|
| 222 |
.row-action svg {
|
| 223 |
width:13px;
|
| 224 |
height:13px;
|
|
@@ -235,23 +236,734 @@
|
|
| 235 |
border-radius:999px;
|
| 236 |
font-size:11px;
|
| 237 |
font-weight:500;
|
| 238 |
-
color:#
|
| 239 |
-
background:#
|
| 240 |
}
|
| 241 |
|
| 242 |
/* Online asset panel */
|
| 243 |
/* asset sub-rows */
|
| 244 |
-
.sub-row td { background:#
|
| 245 |
-
.sub-row:hover td { background:#
|
| 246 |
-
.expand-btn { width:22px; height:22px; display:inline-flex; align-items:center; justify-content:center; background:none; color:#
|
| 247 |
-
.expand-btn:hover { color:#
|
| 248 |
.expand-btn.open { transform:rotate(90deg) }
|
| 249 |
-
.asset-count-badge { display:inline-flex; align-items:center; height:20px; padding:0 8px; border-radius:999px; font-size:11px; font-weight:500; background:#
|
| 250 |
-
.asset-count-badge.has-items { background:#
|
| 251 |
-
.asset-err { font-size:11px; color:#
|
| 252 |
@keyframes spin { to { transform:rotate(360deg) } }
|
| 253 |
-
.progress-bar-outer { height:6px; background:#
|
| 254 |
-
.progress-bar-inner { height:100%; background:#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 255 |
|
| 256 |
@media (max-width: 840px) {
|
| 257 |
.page-hd,
|
|
@@ -1262,4 +1974,4 @@ function _esc(value) {
|
|
| 1262 |
})();
|
| 1263 |
</script>
|
| 1264 |
</body>
|
| 1265 |
-
</html>
|
|
|
|
| 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: #1a1a1a } /* 修改背景颜色为深灰色 */
|
| 12 |
+
body { color: #fdfdfd } /* 修改文字颜色为浅灰色 */
|
| 13 |
|
| 14 |
/* Page header */
|
| 15 |
.page-hd { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:20px }
|
|
|
|
| 26 |
.section-title {
|
| 27 |
font-size:13px;
|
| 28 |
font-weight:600;
|
| 29 |
+
color:#fff;
|
| 30 |
letter-spacing:.01em;
|
| 31 |
}
|
| 32 |
.page-action-btn {
|
| 33 |
height:32px; padding:0 14px; border-radius:999px;
|
| 34 |
display:inline-flex; align-items:center; justify-content:center; gap:6px;
|
| 35 |
font-size:13px; font-weight:600;
|
| 36 |
+
border:1px solid #444; background:#333; color:#fdfdfd;
|
| 37 |
}
|
| 38 |
+
.page-action-btn:hover { background:#444; border-color:#555 }
|
| 39 |
+
.page-action-btn-primary { background:#fff; border-color:#fff; color:#111 }
|
| 40 |
+
.page-action-btn-primary:hover { background:#fdfdfd; border-color:#fdfdfd }
|
| 41 |
|
| 42 |
/* Stats */
|
| 43 |
.stat-grid { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:12px; margin-bottom:30px }
|
| 44 |
+
.stat-cell { min-height:96px; padding:14px 16px; border-radius:12px; background:#333; display:flex; flex-direction:column; gap:12px }
|
| 45 |
.stat-top { display:flex; align-items:center; justify-content:space-between; gap:10px }
|
| 46 |
+
.stat-label{ font-size:11px; color:#aaa; letter-spacing:.01em; white-space:nowrap }
|
| 47 |
+
.stat-icon { width:22px; height:22px; display:inline-flex; align-items:center; justify-content:center; color:#ccc; flex:0 0 auto }
|
| 48 |
.stat-icon svg { width:14px; height:14px; stroke:currentColor }
|
| 49 |
.stat-num { font-size:22px; font-weight:600; line-height:1; letter-spacing:-.02em; margin-top:auto }
|
| 50 |
.stat-sub {
|
| 51 |
margin-top:-4px;
|
| 52 |
font-size:11px;
|
| 53 |
+
color:#aaa;
|
| 54 |
font-variant-numeric:tabular-nums;
|
| 55 |
min-height:14px;
|
| 56 |
}
|
|
|
|
| 58 |
height:5px;
|
| 59 |
margin-top:-2px;
|
| 60 |
border-radius:999px;
|
| 61 |
+
background:#444;
|
| 62 |
overflow:hidden;
|
| 63 |
}
|
| 64 |
.stat-progress-fill {
|
|
|
|
| 66 |
height:100%;
|
| 67 |
width:0;
|
| 68 |
border-radius:999px;
|
| 69 |
+
background:#666;
|
| 70 |
transition:width .2s ease, background-color .2s ease;
|
| 71 |
}
|
| 72 |
+
.stat-progress-fill.image { background:#4f46e5 }
|
| 73 |
+
.stat-progress-fill.video { background:#8b5cf6 }
|
| 74 |
+
.stat-progress-fill.over { background:#ef4444 }
|
| 75 |
|
| 76 |
/* Section tabs */
|
| 77 |
.sec-tabs {
|
|
|
|
| 84 |
}
|
| 85 |
.sec-tab {
|
| 86 |
height:30px; padding:0 12px; border-radius:999px;
|
| 87 |
+
font-size:12px; font-weight:500; color:#aaa;
|
| 88 |
+
background:#333; cursor:pointer;
|
| 89 |
transition:background .15s, color .15s;
|
| 90 |
}
|
| 91 |
+
.sec-tab:hover { color:#fff; background:#444 }
|
| 92 |
+
.sec-tab.active { background:#fff; color:#111; font-weight:600 }
|
| 93 |
.sec-panel { display:none }
|
| 94 |
.sec-panel.active { display:block }
|
| 95 |
|
|
|
|
| 100 |
gap:8px;
|
| 101 |
margin-bottom:8px;
|
| 102 |
flex-wrap:wrap;
|
| 103 |
+
color:#aaa;
|
| 104 |
font-size:12px;
|
| 105 |
font-weight:500;
|
| 106 |
font-family:inherit;
|
|
|
|
| 117 |
flex:0 0 auto;
|
| 118 |
font:inherit;
|
| 119 |
}
|
| 120 |
+
.toolbar-icon-btn:hover { color:#fff }
|
| 121 |
.toolbar-icon-btn svg {
|
| 122 |
width:14px;
|
| 123 |
height:14px;
|
|
|
|
| 127 |
fill:none;
|
| 128 |
}
|
| 129 |
.toolbar-icon-btn-danger { color:inherit }
|
| 130 |
+
.toolbar-icon-btn-danger:hover { color:#fff }
|
| 131 |
.toolbar-page-size {
|
| 132 |
width:96px !important;
|
| 133 |
height:28px;
|
| 134 |
border-radius:999px;
|
| 135 |
font:inherit;
|
| 136 |
color:inherit;
|
| 137 |
+
background:#333;
|
| 138 |
border-color:transparent;
|
| 139 |
flex:0 0 auto;
|
| 140 |
}
|
|
|
|
| 164 |
}
|
| 165 |
|
| 166 |
/* Table */
|
| 167 |
+
.table-card { background:#333; border:none; border-radius:14px; overflow-x:auto; overflow-y:hidden; -webkit-overflow-scrolling:touch }
|
| 168 |
.table-card > table { width:max-content; min-width:100%; border-collapse:collapse }
|
| 169 |
+
.table-freeze-last { --table-sticky-bg:#333; --table-sticky-hover-bg:#444 }
|
| 170 |
table { width:100%; border-collapse:collapse }
|
| 171 |
+
th { background:#333; font-size:11px; font-weight:500; color:#ccc; padding:11px 16px; text-align:left; letter-spacing:.01em }
|
| 172 |
+
td { font-size:13px; padding:13px 16px; border-bottom:none; vertical-align:middle; color:#fdfdfd }
|
| 173 |
tr:last-child td { border-bottom:none }
|
| 174 |
+
tr:hover td { background:#444 }
|
| 175 |
.table-empty { text-align:center; color:#bbb; font-size:13px; padding:40px 16px }
|
| 176 |
.row-name {
|
| 177 |
display:flex;
|
|
|
|
| 185 |
display:inline-flex;
|
| 186 |
align-items:center;
|
| 187 |
justify-content:center;
|
| 188 |
+
color:#aaa;
|
| 189 |
flex:0 0 auto;
|
| 190 |
}
|
| 191 |
.row-icon svg {
|
|
|
|
| 210 |
white-space:nowrap;
|
| 211 |
}
|
| 212 |
.row-action {
|
| 213 |
+
color:#aaa;
|
| 214 |
width:22px;
|
| 215 |
height:22px;
|
| 216 |
display:inline-flex;
|
|
|
|
| 218 |
justify-content:center;
|
| 219 |
flex:0 0 auto;
|
| 220 |
}
|
| 221 |
+
.row-action:hover { color:#fff }
|
| 222 |
+
.row-action-danger { color:#c77d75 }
|
| 223 |
.row-action svg {
|
| 224 |
width:13px;
|
| 225 |
height:13px;
|
|
|
|
| 236 |
border-radius:999px;
|
| 237 |
font-size:11px;
|
| 238 |
font-weight:500;
|
| 239 |
+
color:#ccc;
|
| 240 |
+
background:#444;
|
| 241 |
}
|
| 242 |
|
| 243 |
/* Online asset panel */
|
| 244 |
/* asset sub-rows */
|
| 245 |
+
.sub-row td { background:#2a2a2a; padding:9px 16px 9px 36px; font-size:12px; color:#aaa; border-top:1px solid #333 }
|
| 246 |
+
.sub-row:hover td { background:#333 }
|
| 247 |
+
.expand-btn { width:22px; height:22px; display:inline-flex; align-items:center; justify-content:center; background:none; color:#aaa; transition:transform .15s, color .15s }
|
| 248 |
+
.expand-btn:hover { color:#fff }
|
| 249 |
.expand-btn.open { transform:rotate(90deg) }
|
| 250 |
+
.asset-count-badge { display:inline-flex; align-items:center; height:20px; padding:0 8px; border-radius:999px; font-size:11px; font-weight:500; background:#444; color:#ccc }
|
| 251 |
+
.asset-count-badge.has-items { background:#444; color:#ccc }
|
| 252 |
+
.asset-err { font-size:11px; color:#ef4444 }
|
| 253 |
@keyframes spin { to { transform:rotate(360deg) } }
|
| 254 |
+
.progress-bar-outer { height:6px; background:#444; border-radius:999px; overflow:hidden }
|
| 255 |
+
.progress-bar-inner { height:100%; background:#fff; border-radius:999px; transition:width .3s }
|
| 256 |
+
|
| 257 |
+
@media (max-width: 840px) {
|
| 258 |
+
.page-hd,
|
| 259 |
+
.section-head {
|
| 260 |
+
flex-direction:column;
|
| 261 |
+
align-items:flex-start;
|
| 262 |
+
}
|
| 263 |
+
.table-toolbar {
|
| 264 |
+
flex-wrap:nowrap;
|
| 265 |
+
overflow-x:auto;
|
| 266 |
+
overflow-y:hidden;
|
| 267 |
+
-webkit-overflow-scrolling:touch;
|
| 268 |
+
}
|
| 269 |
+
.table-toolbar-left,
|
| 270 |
+
.table-toolbar-actions {
|
| 271 |
+
flex-wrap:nowrap;
|
| 272 |
+
flex-shrink:0;
|
| 273 |
+
}
|
| 274 |
+
.stat-grid {
|
| 275 |
+
grid-template-columns:repeat(2, minmax(0, 1fr));
|
| 276 |
+
}
|
| 277 |
+
}
|
| 278 |
+
</style>
|
| 279 |
+
</head>
|
| 280 |
+
<body>
|
| 281 |
+
|
| 282 |
+
<!-- ── Header (rendered by admin-header.js) ─────────────────────────────── -->
|
| 283 |
+
<div id="admin-header" data-active="/admin/cache"></div>
|
| 284 |
+
|
| 285 |
+
<main class="admin-main" style="padding-bottom:60px">
|
| 286 |
+
|
| 287 |
+
<!-- Page header -->
|
| 288 |
+
<div class="page-hd">
|
| 289 |
+
<div>
|
| 290 |
+
<div class="page-title" data-i18n="cache.pageHeading">缓存管理</div>
|
| 291 |
+
<div class="page-sub" data-i18n="cache.pageSubtitle">统一查看本地缓存文件、容量上限与账户在线资产。</div>
|
| 292 |
+
</div>
|
| 293 |
+
</div>
|
| 294 |
+
|
| 295 |
+
<div class="section-head">
|
| 296 |
+
<div class="section-title" data-i18n="cache.sectionOverview">缓存概览</div>
|
| 297 |
+
</div>
|
| 298 |
+
|
| 299 |
+
<!-- Stats -->
|
| 300 |
+
<div class="stat-grid">
|
| 301 |
+
<div class="stat-cell">
|
| 302 |
+
<div class="stat-top">
|
| 303 |
+
<div class="stat-label" data-i18n="cache.statImageCount">图片缓存数量</div>
|
| 304 |
+
<span class="stat-icon" style="color:#2563eb">
|
| 305 |
+
<svg viewBox="0 0 24 24" fill="none" stroke-width="1.8"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg>
|
| 306 |
+
</span>
|
| 307 |
+
</div>
|
| 308 |
+
<div class="stat-num" id="s-img-count" style="color:#2563eb">—</div>
|
| 309 |
+
</div>
|
| 310 |
+
<div class="stat-cell">
|
| 311 |
+
<div class="stat-top">
|
| 312 |
+
<div class="stat-label" data-i18n="cache.statVideoCount">视频缓存数量</div>
|
| 313 |
+
<span class="stat-icon" style="color:#7c3aed">
|
| 314 |
+
<svg viewBox="0 0 24 24" fill="none" stroke-width="1.8"><polygon points="23 7 16 12 23 17 23 7"/><rect x="1" y="5" width="15" height="14" rx="2"/></svg>
|
| 315 |
+
</span>
|
| 316 |
+
</div>
|
| 317 |
+
<div class="stat-num" id="s-vid-count" style="color:#7c3aed">—</div>
|
| 318 |
+
</div>
|
| 319 |
+
<div class="stat-cell">
|
| 320 |
+
<div class="stat-top">
|
| 321 |
+
<div class="stat-label" data-i18n="cache.statImageSize">图片缓存大小</div>
|
| 322 |
+
<span class="stat-icon" style="color:#2563eb">
|
| 323 |
+
<svg viewBox="0 0 24 24" fill="none" stroke-width="1.8"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="17 8 12 3 7 8"/><line x1="12" y1="3" x2="12" y2="15"/></svg>
|
| 324 |
+
</span>
|
| 325 |
+
</div>
|
| 326 |
+
<div class="stat-num" id="s-img-size" style="color:#2563eb">—</div>
|
| 327 |
+
<div class="stat-sub" id="s-img-usage">—</div>
|
| 328 |
+
<div class="stat-progress" aria-hidden="true">
|
| 329 |
+
<span class="stat-progress-fill image" id="s-img-progress"></span>
|
| 330 |
+
</div>
|
| 331 |
+
</div>
|
| 332 |
+
<div class="stat-cell">
|
| 333 |
+
<div class="stat-top">
|
| 334 |
+
<div class="stat-label" data-i18n="cache.statVideoSize">视频缓存大小</div>
|
| 335 |
+
<span class="stat-icon" style="color:#7c3aed">
|
| 336 |
+
<svg viewBox="0 0 24 24" fill="none" stroke-width="1.8"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="17 8 12 3 7 8"/><line x1="12" y1="3" x2="12" y2="15"/></svg>
|
| 337 |
+
</span>
|
| 338 |
+
</div>
|
| 339 |
+
<div class="stat-num" id="s-vid-size" style="color:#7c3aed">—</div>
|
| 340 |
+
<div class="stat-sub" id="s-vid-usage">—</div>
|
| 341 |
+
<div class="stat-progress" aria-hidden="true">
|
| 342 |
+
<span class="stat-progress-fill video" id="s-vid-progress"></span>
|
| 343 |
+
</div>
|
| 344 |
+
</div>
|
| 345 |
+
</div>
|
| 346 |
+
|
| 347 |
+
<div class="section-head">
|
| 348 |
+
<div class="section-title" data-i18n="cache.sectionDetails">缓存明细</div>
|
| 349 |
+
</div>
|
| 350 |
+
<div class="sec-tabs" style="margin:-2px 0 14px">
|
| 351 |
+
<button class="sec-tab active" onclick="switchView('image')" data-cache-view="image" data-i18n="cache.tabLocalImage">本地图片</button>
|
| 352 |
+
<button class="sec-tab" onclick="switchView('video')" data-cache-view="video" data-i18n="cache.tabLocalVideo">本地视频</button>
|
| 353 |
+
<button class="sec-tab" onclick="switchView('online')" data-cache-view="online" data-i18n="cache.tabOnline">在线资产</button>
|
| 354 |
+
</div>
|
| 355 |
+
|
| 356 |
+
<!-- ── 本地缓存 panel ─────────────────────────────────────────── -->
|
| 357 |
+
<div class="sec-panel active" id="panel-local">
|
| 358 |
+
<div class="table-toolbar">
|
| 359 |
+
<div class="table-toolbar-left" style="display:flex;align-items:center;gap:6px">
|
| 360 |
+
<button class="pagi-btn" onclick="prevPage()" id="btn-prev" disabled>
|
| 361 |
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="15 18 9 12 15 6"/></svg>
|
| 362 |
+
</button>
|
| 363 |
+
<div class="pagi-meta">
|
| 364 |
+
<span class="pagi-page" id="pagi-page">第 0 / 0 页</span>
|
| 365 |
+
</div>
|
| 366 |
+
<button class="pagi-btn" onclick="nextPage()" id="btn-next" disabled>
|
| 367 |
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="9 18 15 12 9 6"/></svg>
|
| 368 |
+
</button>
|
| 369 |
+
</div>
|
| 370 |
+
<div class="table-toolbar-actions">
|
| 371 |
+
<button class="toolbar-icon-btn toolbar-icon-btn-danger" onclick="clearLocal()" id="btn-clear">
|
| 372 |
+
<svg viewBox="0 0 24 24" stroke-width="1.8"><path d="M5 7h14"/><path d="M9 7V4h6v3"/><path d="M8 10v7"/><path d="M12 10v7"/><path d="M16 10v7"/><path d="M7 7l1 13h8l1-13"/></svg>
|
| 373 |
+
</button>
|
| 374 |
+
<button class="toolbar-icon-btn toolbar-icon-btn-danger" onclick="deleteSelectedLocal()" id="btn-local-delete-selected" style="display:none">
|
| 375 |
+
<svg viewBox="0 0 24 24" stroke-width="1.8"><path d="M5 7h14"/><path d="M9 7V4h6v3"/><path d="M8 10v7"/><path d="M12 10v7"/><path d="M16 10v7"/><path d="M7 7l1 13h8l1-13"/></svg>
|
| 376 |
+
</button>
|
| 377 |
+
<select class="input toolbar-page-size" id="page-size-sel" onchange="changePageSize(this.value)">
|
| 378 |
+
<option value="50">50 / 页</option>
|
| 379 |
+
<option value="100">100 / 页</option>
|
| 380 |
+
<option value="200">200 / 页</option>
|
| 381 |
+
<option value="500">500 / 页</option>
|
| 382 |
+
<option value="1000">1000 / 页</option>
|
| 383 |
+
<option value="2000">2000 / 页</option>
|
| 384 |
+
</select>
|
| 385 |
+
</div>
|
| 386 |
+
</div>
|
| 387 |
+
|
| 388 |
+
<div class="table-card table-freeze-last">
|
| 389 |
+
<table>
|
| 390 |
+
<thead>
|
| 391 |
+
<tr>
|
| 392 |
+
<th style="width:36px"><input type="checkbox" class="cb" id="cb-local-all" onchange="toggleAllLocal(this.checked)"></th>
|
| 393 |
+
<th data-i18n="cache.colFileName">文件名</th>
|
| 394 |
+
<th style="width:100px" data-i18n="cache.colSize">大小</th>
|
| 395 |
+
<th style="width:160px" data-i18n="cache.colModified">修改时间</th>
|
| 396 |
+
<th style="width:56px" data-i18n="cache.colActions">操作</th>
|
| 397 |
+
</tr>
|
| 398 |
+
</thead>
|
| 399 |
+
<tbody id="cache-tbody"></tbody>
|
| 400 |
+
</table>
|
| 401 |
+
</div>
|
| 402 |
+
</div>
|
| 403 |
+
|
| 404 |
+
<!-- ── 在线资产 panel ──────────────────────────────────────────── -->
|
| 405 |
+
<div class="sec-panel" id="panel-online">
|
| 406 |
+
<div class="table-toolbar" style="margin-bottom:14px">
|
| 407 |
+
<div class="table-toolbar-left">
|
| 408 |
+
<span id="asset-summary" class="asset-summary"></span>
|
| 409 |
+
</div>
|
| 410 |
+
<div class="table-toolbar-actions">
|
| 411 |
+
<button class="toolbar-icon-btn" onclick="loadAssets()" id="btn-load-assets">
|
| 412 |
+
<svg viewBox="0 0 24 24" stroke-width="1.8"><polyline points="23 4 23 10 17 10"/><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/></svg>
|
| 413 |
+
</button>
|
| 414 |
+
<button class="toolbar-icon-btn toolbar-icon-btn-danger" onclick="clearAllAssets()" id="btn-clear-all-assets" style="display:none">
|
| 415 |
+
<svg viewBox="0 0 24 24" stroke-width="1.8"><path d="M5 7h14"/><path d="M9 7V4h6v3"/><path d="M8 10v7"/><path d="M12 10v7"/><path d="M16 10v7"/><path d="M7 7l1 13h8l1-13"/></svg>
|
| 416 |
+
</button>
|
| 417 |
+
<button class="toolbar-icon-btn toolbar-icon-btn-danger" onclick="clearSelectedAssets()" id="btn-clear-selected-assets" style="display:none">
|
| 418 |
+
<svg viewBox="0 0 24 24" stroke-width="1.8"><path d="M5 7h14"/><path d="M9 7V4h6v3"/><path d="M8 10v7"/><path d="M12 10v7"/><path d="M16 10v7"/><path d="M7 7l1 13h8l1-13"/></svg>
|
| 419 |
+
</button>
|
| 420 |
+
<button class="toolbar-icon-btn toolbar-icon-btn-danger" onclick="cancelAssetClear()" id="btn-asset-cancel" style="display:none">
|
| 421 |
+
<svg viewBox="0 0 24 24" stroke-width="1.8"><path d="M6 6 18 18"/><path d="M18 6 6 18"/></svg>
|
| 422 |
+
</button>
|
| 423 |
+
</div>
|
| 424 |
+
</div>
|
| 425 |
+
|
| 426 |
+
|
| 427 |
+
<div class="table-card table-freeze-last" id="assets-table-wrap">
|
| 428 |
+
<table>
|
| 429 |
+
<thead>
|
| 430 |
+
<tr>
|
| 431 |
+
<th style="width:36px"><input type="checkbox" class="cb" id="cb-asset-all" onchange="toggleAllAssets(this.checked)"></th>
|
| 432 |
+
<th style="width:32px"></th>
|
| 433 |
+
<th data-i18n="cache.colToken">Token</th>
|
| 434 |
+
<th style="width:72px" data-i18n="cache.colFileCount">文件数</th>
|
| 435 |
+
<th style="width:56px" data-i18n="cache.colActions">操作</th>
|
| 436 |
+
</tr>
|
| 437 |
+
</thead>
|
| 438 |
+
<tbody id="assets-tbody"></tbody>
|
| 439 |
+
</table>
|
| 440 |
+
</div>
|
| 441 |
+
</div>
|
| 442 |
+
|
| 443 |
+
</main>
|
| 444 |
+
|
| 445 |
+
<script src="/static/js/i18n.js?v={{APP_VERSION}}"></script>
|
| 446 |
+
<script src="/static/js/auth.js?v={{APP_VERSION}}"></script>
|
| 447 |
+
<script src="/static/js/admin-header.js?v={{APP_VERSION}}"></script>
|
| 448 |
+
<script src="/static/js/toast.js?v={{APP_VERSION}}"></script>
|
| 449 |
+
<script src="/static/js/footer.js?v={{APP_VERSION}}"></script>
|
| 450 |
+
<script>
|
| 451 |
+
const PAGE_SIZE_KEY = 'admin.cache.page_size';
|
| 452 |
+
const PAGE_SIZE_OPTIONS = [50, 100, 200, 500, 1000, 2000];
|
| 453 |
+
const REFRESH_ICON = '<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2"><polyline points="23 4 23 10 17 10"/><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/></svg>';
|
| 454 |
+
const SPINNER_ICON = '<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" style="animation:spin .8s linear infinite"><polyline points="23 4 23 10 17 10"/><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/></svg>';
|
| 455 |
+
|
| 456 |
+
let _type = 'image';
|
| 457 |
+
let _view = 'image';
|
| 458 |
+
let _page = 1;
|
| 459 |
+
let _pageSize = loadSavedPageSize();
|
| 460 |
+
let _total = 0;
|
| 461 |
+
let _localItems = [];
|
| 462 |
+
const _localSel = new Set();
|
| 463 |
+
let _assetData = [];
|
| 464 |
+
let _assetTotal = 0;
|
| 465 |
+
let _expanded = {};
|
| 466 |
+
const _assetSel = new Set();
|
| 467 |
+
let _assetTaskId = null;
|
| 468 |
+
let _assetEs = null;
|
| 469 |
+
let _assetLoaded = false;
|
| 470 |
+
let _localViewVersion = 0;
|
| 471 |
+
let _localViewCacheVersion = -1;
|
| 472 |
+
let _localViewCache = null;
|
| 473 |
+
let _assetViewVersion = 0;
|
| 474 |
+
let _assetViewCacheVersion = -1;
|
| 475 |
+
let _assetViewCache = null;
|
| 476 |
+
|
| 477 |
+
function tr(key, params, fallback) {
|
| 478 |
+
const value = t(key, params);
|
| 479 |
+
return value === key ? (fallback ?? key) : value;
|
| 480 |
+
}
|
| 481 |
+
|
| 482 |
+
function waitI18n() {
|
| 483 |
+
return new Promise((resolve) => I18n.onReady(resolve));
|
| 484 |
+
}
|
| 485 |
+
|
| 486 |
+
function getLocale() {
|
| 487 |
+
return I18n.getLang() === 'en' ? 'en-US' : 'zh-CN';
|
| 488 |
+
}
|
| 489 |
+
|
| 490 |
+
function getTypeNoun(type = _type) {
|
| 491 |
+
return tr(type === 'image' ? 'cache.typeImageNoun' : 'cache.typeVideoNoun', null, type === 'image' ? '图片' : '视频');
|
| 492 |
+
}
|
| 493 |
+
|
| 494 |
+
function loadSavedPageSize() {
|
| 495 |
+
const raw = Number(localStorage.getItem(PAGE_SIZE_KEY));
|
| 496 |
+
return PAGE_SIZE_OPTIONS.includes(raw) ? raw : 100;
|
| 497 |
+
}
|
| 498 |
+
|
| 499 |
+
function _fmtRatio(value) {
|
| 500 |
+
const num = Number(value);
|
| 501 |
+
if (!Number.isFinite(num)) return tr('cache.na', null, '—');
|
| 502 |
+
return `${num.toFixed(1)}%`;
|
| 503 |
+
}
|
| 504 |
+
|
| 505 |
+
function _usageSummary(stats) {
|
| 506 |
+
const used = _fmtBytes(stats.size_bytes ?? 0);
|
| 507 |
+
if (!stats?.limited || !stats?.limit_bytes) {
|
| 508 |
+
return tr('cache.usageSummaryUnlimited', { used }, `${used} · 未限制`);
|
| 509 |
+
}
|
| 510 |
+
const limit = _fmtBytes(stats.limit_bytes);
|
| 511 |
+
const percent = _fmtRatio(stats.usage_percent);
|
| 512 |
+
return tr(
|
| 513 |
+
'cache.usageSummaryLimited',
|
| 514 |
+
{ used, limit, percent },
|
| 515 |
+
`${used} / ${limit} · ${percent}`
|
| 516 |
+
);
|
| 517 |
+
}
|
| 518 |
+
|
| 519 |
+
function _applyUsageBar(id, type, stats) {
|
| 520 |
+
const el = document.getElementById(id);
|
| 521 |
+
if (!el) return;
|
| 522 |
+
const limited = !!stats?.limited && Number(stats.limit_bytes) > 0;
|
| 523 |
+
const percent = limited ? Number(stats.usage_percent ?? 0) : 0;
|
| 524 |
+
const safe = Number.isFinite(percent) ? percent : 0;
|
| 525 |
+
el.style.width = `${Math.max(0, Math.min(safe, 100))}%`;
|
| 526 |
+
el.classList.toggle('over', limited && safe > 100);
|
| 527 |
+
el.classList.toggle('image', type === 'image');
|
| 528 |
+
el.classList.toggle('video', type === 'video');
|
| 529 |
+
}
|
| 530 |
+
|
| 531 |
+
function invalidateLocalView() {
|
| 532 |
+
_localViewVersion += 1;
|
| 533 |
+
}
|
| 534 |
+
|
| 535 |
+
function invalidateAssetView() {
|
| 536 |
+
_assetViewVersion += 1;
|
| 537 |
+
}
|
| 538 |
+
|
| 539 |
+
function getLocalView() {
|
| 540 |
+
if (_localViewCache && _localViewCacheVersion === _localViewVersion) return _localViewCache;
|
| 541 |
+
|
| 542 |
+
const selectedNames = [];
|
| 543 |
+
for (const item of _localItems) {
|
| 544 |
+
if (_localSel.has(item.name)) selectedNames.push(item.name);
|
| 545 |
+
}
|
| 546 |
+
const selectedCount = selectedNames.length;
|
| 547 |
+
|
| 548 |
+
_localViewCacheVersion = _localViewVersion;
|
| 549 |
+
_localViewCache = {
|
| 550 |
+
items: _localItems,
|
| 551 |
+
selectedNames,
|
| 552 |
+
totalItems: _localItems.length,
|
| 553 |
+
selectedCount,
|
| 554 |
+
hasSelection: selectedCount > 0,
|
| 555 |
+
allSelected: _localItems.length > 0 && selectedCount === _localItems.length,
|
| 556 |
+
someSelected: selectedCount > 0 && selectedCount < _localItems.length,
|
| 557 |
+
};
|
| 558 |
+
return _localViewCache;
|
| 559 |
+
}
|
| 560 |
+
|
| 561 |
+
function getAssetView() {
|
| 562 |
+
if (_assetViewCache && _assetViewCacheVersion === _assetViewVersion) return _assetViewCache;
|
| 563 |
+
|
| 564 |
+
const rows = [];
|
| 565 |
+
const clearableTokens = [];
|
| 566 |
+
const selectedClearableTokens = [];
|
| 567 |
+
let countedAssets = 0;
|
| 568 |
+
let selectedCount = 0;
|
| 569 |
+
|
| 570 |
+
for (const row of _assetData) {
|
| 571 |
+
const masked = row.masked || _maskToken(row.token || '');
|
| 572 |
+
const count = row.count || 0;
|
| 573 |
+
const hasItems = count > 0;
|
| 574 |
+
const isSelected = _assetSel.has(row.token);
|
| 575 |
+
const assets = Array.isArray(row.assets) ? row.assets : [];
|
| 576 |
+
|
| 577 |
+
countedAssets += count;
|
| 578 |
+
if (isSelected) selectedCount += 1;
|
| 579 |
+
if (hasItems) clearableTokens.push(row.token);
|
| 580 |
+
if (isSelected && hasItems) selectedClearableTokens.push(row.token);
|
| 581 |
+
|
| 582 |
+
rows.push({
|
| 583 |
+
row,
|
| 584 |
+
masked,
|
| 585 |
+
assets,
|
| 586 |
+
hasItems,
|
| 587 |
+
isOpen: !!_expanded[masked],
|
| 588 |
+
isSelected,
|
| 589 |
+
});
|
| 590 |
+
}
|
| 591 |
+
|
| 592 |
+
const totalRows = rows.length;
|
| 593 |
+
const selectedClearableCount = selectedClearableTokens.length;
|
| 594 |
+
|
| 595 |
+
_assetViewCacheVersion = _assetViewVersion;
|
| 596 |
+
_assetViewCache = {
|
| 597 |
+
loaded: _assetLoaded,
|
| 598 |
+
rows,
|
| 599 |
+
totalRows,
|
| 600 |
+
totalAccounts: totalRows,
|
| 601 |
+
totalAssets: _assetTotal || countedAssets,
|
| 602 |
+
selectedCount,
|
| 603 |
+
hasSelection: selectedCount > 0,
|
| 604 |
+
allSelected: totalRows > 0 && selectedCount === totalRows,
|
| 605 |
+
someSelected: selectedCount > 0 && selectedCount < totalRows,
|
| 606 |
+
clearableTokens,
|
| 607 |
+
hasClearable: clearableTokens.length > 0,
|
| 608 |
+
selectedClearableTokens,
|
| 609 |
+
selectedClearableCount,
|
| 610 |
+
};
|
| 611 |
+
return _assetViewCache;
|
| 612 |
+
}
|
| 613 |
+
|
| 614 |
+
function setLoadAssetsButton(labelKey, fallback, spinning = false) {
|
| 615 |
+
const btn = document.getElementById('btn-load-assets');
|
| 616 |
+
if (!btn) return;
|
| 617 |
+
btn.innerHTML = spinning ? SPINNER_ICON : REFRESH_ICON;
|
| 618 |
+
const label = tr(labelKey, null, fallback);
|
| 619 |
+
btn.setAttribute('data-tip', label);
|
| 620 |
+
btn.setAttribute('aria-label', label);
|
| 621 |
+
btn.setAttribute('title', label);
|
| 622 |
+
}
|
| 623 |
+
|
| 624 |
+
function applyToolbarI18n() {
|
| 625 |
+
const tips = [
|
| 626 |
+
['btn-clear', 'cache.clearCurrent', '清空当前缓存'],
|
| 627 |
+
['btn-local-delete-selected', 'cache.deleteSelected', '删除选中'],
|
| 628 |
+
['btn-load-assets', 'cache.loadAssets', '加载资产列表'],
|
| 629 |
+
['btn-clear-all-assets', 'cache.clearAll', '清理全部'],
|
| 630 |
+
['btn-clear-selected-assets', 'cache.clearSelected', '清理选中'],
|
| 631 |
+
['btn-asset-cancel', 'cache.cancel', '取消'],
|
| 632 |
+
];
|
| 633 |
+
tips.forEach(([id, key, fallback]) => {
|
| 634 |
+
const el = document.getElementById(id);
|
| 635 |
+
if (!el) return;
|
| 636 |
+
const label = tr(key, null, fallback);
|
| 637 |
+
el.setAttribute('data-tip', label);
|
| 638 |
+
el.setAttribute('aria-label', label);
|
| 639 |
+
el.setAttribute('title', label);
|
| 640 |
+
});
|
| 641 |
+
}
|
| 642 |
+
|
| 643 |
+
function updateAssetSummary(view = getAssetView()) {
|
| 644 |
+
if (!view.loaded) {
|
| 645 |
+
document.getElementById('asset-summary').textContent = tr('cache.assetSummaryIdle', null, '点击右侧获取在线资产');
|
| 646 |
+
updateAssetBatchButtons(view);
|
| 647 |
+
return;
|
| 648 |
+
}
|
| 649 |
+
document.getElementById('asset-summary').textContent = tr(
|
| 650 |
+
'cache.assetSummary',
|
| 651 |
+
{ accounts: view.totalAccounts, files: view.totalAssets },
|
| 652 |
+
`共 ${view.totalAccounts} 个账户 · ${view.totalAssets} 个文件`
|
| 653 |
+
);
|
| 654 |
+
updateAssetBatchButtons(view);
|
| 655 |
+
}
|
| 656 |
+
|
| 657 |
+
function applyCacheI18n() {
|
| 658 |
+
document.title = tr('cache.pageTitle', null, 'Grok2API - 缓存管理');
|
| 659 |
+
document.querySelectorAll('#page-size-sel option').forEach((opt) => {
|
| 660 |
+
opt.textContent = tr('cache.pageSizeOption', { n: opt.value }, `${opt.value} / 页`);
|
| 661 |
+
});
|
| 662 |
+
const pageSizeSel = document.getElementById('page-size-sel');
|
| 663 |
+
if (pageSizeSel) pageSizeSel.value = String(_pageSize);
|
| 664 |
+
applyToolbarI18n();
|
| 665 |
+
setLoadAssetsButton('cache.loadAssets', '加载资产列表');
|
| 666 |
+
_renderPagi();
|
| 667 |
+
if (_assetLoaded) {
|
| 668 |
+
_renderAssets();
|
| 669 |
+
}
|
| 670 |
+
updateAssetSummary();
|
| 671 |
+
}
|
| 672 |
+
|
| 673 |
+
async function _api(method, path, body) {
|
| 674 |
+
const key = await adminKey.get();
|
| 675 |
+
const r = await fetch(ADMIN_API + path, {
|
| 676 |
+
method,
|
| 677 |
+
headers: { ...(body != null && { 'Content-Type': 'application/json' }), Authorization: `Bearer ${key}` },
|
| 678 |
+
...(body != null && { body: JSON.stringify(body) }),
|
| 679 |
+
});
|
| 680 |
+
if (!r.ok) {
|
| 681 |
+
const d = await r.json().catch(() => ({}));
|
| 682 |
+
throw new Error(d.detail || r.status);
|
| 683 |
+
}
|
| 684 |
+
return r.json();
|
| 685 |
+
}
|
| 686 |
+
|
| 687 |
+
async function loadStats() {
|
| 688 |
+
try {
|
| 689 |
+
const d = await _api('GET', '/cache');
|
| 690 |
+
const img = d.local_image || {};
|
| 691 |
+
const vid = d.local_video || {};
|
| 692 |
+
document.getElementById('s-img-count').textContent = img.count ?? 0;
|
| 693 |
+
document.getElementById('s-img-size').textContent = _fmtMb(img.size_mb);
|
| 694 |
+
document.getElementById('s-img-usage').textContent = _usageSummary(img);
|
| 695 |
+
_applyUsageBar('s-img-progress', 'image', img);
|
| 696 |
+
document.getElementById('s-vid-count').textContent = vid.count ?? 0;
|
| 697 |
+
document.getElementById('s-vid-size').textContent = _fmtMb(vid.size_mb);
|
| 698 |
+
document.getElementById('s-vid-usage').textContent = _usageSummary(vid);
|
| 699 |
+
_applyUsageBar('s-vid-progress', 'video', vid);
|
| 700 |
+
} catch (e) {
|
| 701 |
+
console.warn('stats error', e);
|
| 702 |
+
}
|
| 703 |
+
}
|
| 704 |
+
|
| 705 |
+
async function loadList() {
|
| 706 |
+
try {
|
| 707 |
+
const d = await _api('GET', `/cache/list?type=${_type}&page=${_page}&page_size=${_pageSize}`);
|
| 708 |
+
把整体背景改为深灰色的代码如下,你可以把这段代码复制到你的 html 文件中。
|
| 709 |
+
|
| 710 |
+
```html
|
| 711 |
+
<!DOCTYPE html>
|
| 712 |
+
<html lang="zh-CN">
|
| 713 |
+
<head>
|
| 714 |
+
<meta charset="UTF-8">
|
| 715 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 716 |
+
<title data-i18n="cache.pageTitle">Grok2API - 缓存管理</title>
|
| 717 |
+
<link rel="icon" href="/favicon.ico?v={{APP_VERSION}}">
|
| 718 |
+
<link href="[https://cdn.jsdelivr.net/npm/geist@1.0.0/dist/fonts/geist-sans/style.css](https://cdn.jsdelivr.net/npm/geist@1.0.0/dist/fonts/geist-sans/style.css)" rel="stylesheet">
|
| 719 |
+
<link href="/static/css/app.css?v={{APP_VERSION}}" rel="stylesheet">
|
| 720 |
+
<style>
|
| 721 |
+
body { background: #1a1a1a } /* 修改背景颜色为深灰色 */
|
| 722 |
+
body { color: #fdfdfd } /* 修改文字颜色为浅灰色 */
|
| 723 |
+
|
| 724 |
+
/* Page header */
|
| 725 |
+
.page-hd { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:20px }
|
| 726 |
+
.page-title{ font-size:22px; font-weight:700; line-height:1.2 }
|
| 727 |
+
.page-sub { font-size:13px; color:var(--fg-muted); margin-top:5px }
|
| 728 |
+
.page-actions { display:flex; gap:8px; align-items:center; flex-shrink:0 }
|
| 729 |
+
.section-head {
|
| 730 |
+
display:flex;
|
| 731 |
+
align-items:baseline;
|
| 732 |
+
justify-content:space-between;
|
| 733 |
+
gap:12px;
|
| 734 |
+
margin:28px 0 14px;
|
| 735 |
+
}
|
| 736 |
+
.section-title {
|
| 737 |
+
font-size:13px;
|
| 738 |
+
font-weight:600;
|
| 739 |
+
color:#fff;
|
| 740 |
+
letter-spacing:.01em;
|
| 741 |
+
}
|
| 742 |
+
.page-action-btn {
|
| 743 |
+
height:32px; padding:0 14px; border-radius:999px;
|
| 744 |
+
display:inline-flex; align-items:center; justify-content:center; gap:6px;
|
| 745 |
+
font-size:13px; font-weight:600;
|
| 746 |
+
border:1px solid #444; background:#333; color:#fdfdfd;
|
| 747 |
+
}
|
| 748 |
+
.page-action-btn:hover { background:#444; border-color:#555 }
|
| 749 |
+
.page-action-btn-primary { background:#fff; border-color:#fff; color:#111 }
|
| 750 |
+
.page-action-btn-primary:hover { background:#fdfdfd; border-color:#fdfdfd }
|
| 751 |
+
|
| 752 |
+
/* Stats */
|
| 753 |
+
.stat-grid { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:12px; margin-bottom:30px }
|
| 754 |
+
.stat-cell { min-height:96px; padding:14px 16px; border-radius:12px; background:#333; display:flex; flex-direction:column; gap:12px }
|
| 755 |
+
.stat-top { display:flex; align-items:center; justify-content:space-between; gap:10px }
|
| 756 |
+
.stat-label{ font-size:11px; color:#aaa; letter-spacing:.01em; white-space:nowrap }
|
| 757 |
+
.stat-icon { width:22px; height:22px; display:inline-flex; align-items:center; justify-content:center; color:#ccc; flex:0 0 auto }
|
| 758 |
+
.stat-icon svg { width:14px; height:14px; stroke:currentColor }
|
| 759 |
+
.stat-num { font-size:22px; font-weight:600; line-height:1; letter-spacing:-.02em; margin-top:auto }
|
| 760 |
+
.stat-sub {
|
| 761 |
+
margin-top:-4px;
|
| 762 |
+
font-size:11px;
|
| 763 |
+
color:#aaa;
|
| 764 |
+
font-variant-numeric:tabular-nums;
|
| 765 |
+
min-height:14px;
|
| 766 |
+
}
|
| 767 |
+
.stat-progress {
|
| 768 |
+
height:5px;
|
| 769 |
+
margin-top:-2px;
|
| 770 |
+
border-radius:999px;
|
| 771 |
+
background:#444;
|
| 772 |
+
overflow:hidden;
|
| 773 |
+
}
|
| 774 |
+
.stat-progress-fill {
|
| 775 |
+
display:block;
|
| 776 |
+
height:100%;
|
| 777 |
+
width:0;
|
| 778 |
+
border-radius:999px;
|
| 779 |
+
background:#666;
|
| 780 |
+
transition:width .2s ease, background-color .2s ease;
|
| 781 |
+
}
|
| 782 |
+
.stat-progress-fill.image { background:#4f46e5 }
|
| 783 |
+
.stat-progress-fill.video { background:#8b5cf6 }
|
| 784 |
+
.stat-progress-fill.over { background:#ef4444 }
|
| 785 |
+
|
| 786 |
+
/* Section tabs */
|
| 787 |
+
.sec-tabs {
|
| 788 |
+
display:flex;
|
| 789 |
+
align-items:center;
|
| 790 |
+
gap:6px;
|
| 791 |
+
align-self:flex-start;
|
| 792 |
+
flex-wrap:wrap;
|
| 793 |
+
padding:0;
|
| 794 |
+
}
|
| 795 |
+
.sec-tab {
|
| 796 |
+
height:30px; padding:0 12px; border-radius:999px;
|
| 797 |
+
font-size:12px; font-weight:500; color:#aaa;
|
| 798 |
+
background:#333; cursor:pointer;
|
| 799 |
+
transition:background .15s, color .15s;
|
| 800 |
+
}
|
| 801 |
+
.sec-tab:hover { color:#fff; background:#444 }
|
| 802 |
+
.sec-tab.active { background:#fff; color:#111; font-weight:600 }
|
| 803 |
+
.sec-panel { display:none }
|
| 804 |
+
.sec-panel.active { display:block }
|
| 805 |
+
|
| 806 |
+
/* Toolbar */
|
| 807 |
+
.table-toolbar {
|
| 808 |
+
display:flex;
|
| 809 |
+
align-items:center;
|
| 810 |
+
gap:8px;
|
| 811 |
+
margin-bottom:8px;
|
| 812 |
+
flex-wrap:wrap;
|
| 813 |
+
color:#aaa;
|
| 814 |
+
font-size:12px;
|
| 815 |
+
font-weight:500;
|
| 816 |
+
font-family:inherit;
|
| 817 |
+
}
|
| 818 |
+
.table-toolbar-left { flex:1 }
|
| 819 |
+
.table-toolbar-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap }
|
| 820 |
+
.toolbar-icon-btn {
|
| 821 |
+
width:28px;
|
| 822 |
+
height:28px;
|
| 823 |
+
display:inline-flex;
|
| 824 |
+
align-items:center;
|
| 825 |
+
justify-content:center;
|
| 826 |
+
color:inherit;
|
| 827 |
+
flex:0 0 auto;
|
| 828 |
+
font:inherit;
|
| 829 |
+
}
|
| 830 |
+
.toolbar-icon-btn:hover { color:#fff }
|
| 831 |
+
.toolbar-icon-btn svg {
|
| 832 |
+
width:14px;
|
| 833 |
+
height:14px;
|
| 834 |
+
stroke:currentColor;
|
| 835 |
+
stroke-linecap:round;
|
| 836 |
+
stroke-linejoin:round;
|
| 837 |
+
fill:none;
|
| 838 |
+
}
|
| 839 |
+
.toolbar-icon-btn-danger { color:inherit }
|
| 840 |
+
.toolbar-icon-btn-danger:hover { color:#fff }
|
| 841 |
+
.toolbar-page-size {
|
| 842 |
+
width:96px !important;
|
| 843 |
+
height:28px;
|
| 844 |
+
border-radius:999px;
|
| 845 |
+
font:inherit;
|
| 846 |
+
color:inherit;
|
| 847 |
+
background:#333;
|
| 848 |
+
border-color:transparent;
|
| 849 |
+
flex:0 0 auto;
|
| 850 |
+
}
|
| 851 |
+
.pagi-btn {
|
| 852 |
+
width:28px;
|
| 853 |
+
height:28px;
|
| 854 |
+
border-radius:6px;
|
| 855 |
+
display:inline-flex;
|
| 856 |
+
align-items:center;
|
| 857 |
+
justify-content:center;
|
| 858 |
+
color:inherit;
|
| 859 |
+
transition:background .1s, color .1s;
|
| 860 |
+
font:inherit;
|
| 861 |
+
}
|
| 862 |
+
.pagi-btn:hover { background:var(--border) }
|
| 863 |
+
.pagi-btn:disabled { opacity:.35; pointer-events:none }
|
| 864 |
+
.pagi-meta { display:flex; align-items:center; gap:0; min-height:28px; min-width:0; color:inherit; font:inherit; flex-wrap:nowrap }
|
| 865 |
+
.pagi-page { min-width:0; padding:0 4px; font:inherit; color:inherit; font-variant-numeric:tabular-nums; white-space:nowrap }
|
| 866 |
+
.pagi-dot { width:4px; height:4px; border-radius:50%; background:#d4d4d4; flex:0 0 auto }
|
| 867 |
+
.pagi-dot { background:#666 }
|
| 868 |
+
.pagi-info { font-size:11px; color:#a3a3a3 }
|
| 869 |
+
.asset-summary { font-size:12px; color:#a3a3a3 }
|
| 870 |
+
.cb {
|
| 871 |
+
width:14px;
|
| 872 |
+
height:14px;
|
| 873 |
+
accent-color:#111;
|
| 874 |
+
vertical-align:middle;
|
| 875 |
+
}
|
| 876 |
+
|
| 877 |
+
/* Table */
|
| 878 |
+
.table-card { background:#333; border:none; border-radius:14px; overflow-x:auto; overflow-y:hidden; -webkit-overflow-scrolling:touch }
|
| 879 |
+
.table-card > table { width:max-content; min-width:100%; border-collapse:collapse }
|
| 880 |
+
.table-freeze-last { --table-sticky-bg:#333; --table-sticky-hover-bg:#444 }
|
| 881 |
+
table { width:100%; border-collapse:collapse }
|
| 882 |
+
th { background:#333; font-size:11px; font-weight:500; color:#ccc; padding:11px 16px; text-align:left; letter-spacing:.01em }
|
| 883 |
+
td { font-size:13px; padding:13px 16px; border-bottom:none; vertical-align:middle; color:#fdfdfd }
|
| 884 |
+
tr:last-child td { border-bottom:none }
|
| 885 |
+
tr:hover td { background:#444 }
|
| 886 |
+
.table-empty { text-align:center; color:#bbb; font-size:13px; padding:40px 16px }
|
| 887 |
+
.row-name {
|
| 888 |
+
display:flex;
|
| 889 |
+
align-items:center;
|
| 890 |
+
gap:10px;
|
| 891 |
+
min-width:0;
|
| 892 |
+
}
|
| 893 |
+
.row-icon {
|
| 894 |
+
width:18px;
|
| 895 |
+
height:18px;
|
| 896 |
+
display:inline-flex;
|
| 897 |
+
align-items:center;
|
| 898 |
+
justify-content:center;
|
| 899 |
+
color:#aaa;
|
| 900 |
+
flex:0 0 auto;
|
| 901 |
+
}
|
| 902 |
+
.row-icon svg {
|
| 903 |
+
width:13px;
|
| 904 |
+
height:13px;
|
| 905 |
+
stroke:currentColor;
|
| 906 |
+
stroke-linecap:round;
|
| 907 |
+
stroke-linejoin:round;
|
| 908 |
+
fill:none;
|
| 909 |
+
}
|
| 910 |
+
.row-value {
|
| 911 |
+
min-width:0;
|
| 912 |
+
font-family:'Geist Mono','Courier New',monospace;
|
| 913 |
+
font-size:12px;
|
| 914 |
+
word-break:break-all;
|
| 915 |
+
}
|
| 916 |
+
.row-actions {
|
| 917 |
+
display:flex;
|
| 918 |
+
align-items:center;
|
| 919 |
+
gap:8px;
|
| 920 |
+
flex-wrap:nowrap;
|
| 921 |
+
white-space:nowrap;
|
| 922 |
+
}
|
| 923 |
+
.row-action {
|
| 924 |
+
color:#aaa;
|
| 925 |
+
width:22px;
|
| 926 |
+
height:22px;
|
| 927 |
+
display:inline-flex;
|
| 928 |
+
align-items:center;
|
| 929 |
+
justify-content:center;
|
| 930 |
+
flex:0 0 auto;
|
| 931 |
+
}
|
| 932 |
+
.row-action:hover { color:#fff }
|
| 933 |
+
.row-action-danger { color:#c77d75 }
|
| 934 |
+
.row-action svg {
|
| 935 |
+
width:13px;
|
| 936 |
+
height:13px;
|
| 937 |
+
stroke:currentColor;
|
| 938 |
+
stroke-linecap:round;
|
| 939 |
+
stroke-linejoin:round;
|
| 940 |
+
fill:none;
|
| 941 |
+
}
|
| 942 |
+
.meta-badge {
|
| 943 |
+
display:inline-flex;
|
| 944 |
+
align-items:center;
|
| 945 |
+
height:20px;
|
| 946 |
+
padding:0 8px;
|
| 947 |
+
border-radius:999px;
|
| 948 |
+
font-size:11px;
|
| 949 |
+
font-weight:500;
|
| 950 |
+
color:#ccc;
|
| 951 |
+
background:#444;
|
| 952 |
+
}
|
| 953 |
+
|
| 954 |
+
/* Online asset panel */
|
| 955 |
+
/* asset sub-rows */
|
| 956 |
+
.sub-row td { background:#2a2a2a; padding:9px 16px 9px 36px; font-size:12px; color:#aaa; border-top:1px solid #333 }
|
| 957 |
+
.sub-row:hover td { background:#333 }
|
| 958 |
+
.expand-btn { width:22px; height:22px; display:inline-flex; align-items:center; justify-content:center; background:none; color:#aaa; transition:transform .15s, color .15s }
|
| 959 |
+
.expand-btn:hover { color:#fff }
|
| 960 |
+
.expand-btn.open { transform:rotate(90deg) }
|
| 961 |
+
.asset-count-badge { display:inline-flex; align-items:center; height:20px; padding:0 8px; border-radius:999px; font-size:11px; font-weight:500; background:#444; color:#ccc }
|
| 962 |
+
.asset-count-badge.has-items { background:#444; color:#ccc }
|
| 963 |
+
.asset-err { font-size:11px; color:#ef4444 }
|
| 964 |
+
@keyframes spin { to { transform:rotate(360deg) } }
|
| 965 |
+
.progress-bar-outer { height:6px; background:#444; border-radius:999px; overflow:hidden }
|
| 966 |
+
.progress-bar-inner { height:100%; background:#fff; border-radius:999px; transition:width .3s }
|
| 967 |
|
| 968 |
@media (max-width: 840px) {
|
| 969 |
.page-hd,
|
|
|
|
| 1974 |
})();
|
| 1975 |
</script>
|
| 1976 |
</body>
|
| 1977 |
+
</html>
|