forked from code/member-dashboard
dashboard: equal columns in the API key chart, and a dash where the chat key has no Revoke
Four equal columns (the name/meta, the bar, the value, the action) instead of a wider bar column, and the chat row shows ' - ' in the action column rather than rendering an empty cell that made the row look broken.
This commit is contained in:
1 parent
628e89fc99
commit
83b52f4675
1 file changed
+3
-2
+3
-2
@@ -628,7 +628,7 @@ PAGE_HTML = """<!DOCTYPE html>
|
||||
/* One row per key: label, bar, value. The chat key is a row like any other,
|
||||
so the built-in key's usage is comparable instead of a footnote. */
|
||||
.key-bar-row {
|
||||
display: grid; grid-template-columns: minmax(110px, 1.4fr) 2.6fr auto auto;
|
||||
display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border);
|
||||
}
|
||||
.key-bar-row:last-child { border-bottom: none; }
|
||||
@@ -636,6 +636,7 @@ PAGE_HTML = """<!DOCTYPE html>
|
||||
.key-bar-track { background: #eef0ea; border-radius: 6px; height: 14px; overflow: hidden; }
|
||||
.key-bar-fill { background: var(--green-mid); height: 100%; border-radius: 6px; }
|
||||
.key-bar-val { font-weight: 600; font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
|
||||
.key-bar-dash { font-size: 12px; opacity: .45; }
|
||||
.key-row {
|
||||
display: flex; align-items: center; justify-content: space-between; gap: 12px;
|
||||
padding: 14px 0; border-bottom: 1px solid var(--border);
|
||||
@@ -1731,7 +1732,7 @@ function renderKeys(keys, keySpend) {
|
||||
'<div class="key-bar-track" role="img" aria-label="' + escapeHtml(shown) + '">' +
|
||||
'<div class="key-bar-fill" style="width:' + pct + '%"></div></div>' +
|
||||
'<div class="key-bar-val">' + escapeHtml(shown) + '</div>' +
|
||||
(r.chat ? '<span></span>'
|
||||
(r.chat ? '<span class="key-bar-dash"> - </span>'
|
||||
: '<button class="ghost" data-name="' + escapeHtml(r.name) + '" onclick="revokeKey(this.dataset.name)">Revoke</button>') +
|
||||
'</div>';
|
||||
}).join('');
|
||||
|
||||
Reference in new issue
Block a user