Files
tiennm99 616f133989 feat: add gated admin console for api_keys registry (list/search/filter/revoke/mint)
- env-allowlist authz via ADMIN_GITHUB_USER_IDS on numeric provider_id (no migration)
- server-side re-gated revoke + manual-mint actions
- parameterized search/filter/paginate queries
- shared mint-key extraction (DRY) from generate-key
- notFound() for non-admins (404 never leaks route existence)
- 3 unit-test suites (authz/queries/integration)
2026-06-13 21:16:57 +07:00

202 lines
3.0 KiB
CSS

:root {
--bg: #0b0d12;
--panel: #141821;
--border: #232a36;
--text: #e6e9ef;
--muted: #9aa4b2;
--accent: #6ea8fe;
--accent-strong: #3b82f6;
--warn: #f0b429;
--danger: #f87171;
--radius: 10px;
}
* {
box-sizing: border-box;
}
html,
body {
margin: 0;
padding: 0;
background: var(--bg);
color: var(--text);
font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
line-height: 1.55;
}
a {
color: var(--accent);
}
main {
max-width: 880px;
margin: 0 auto;
padding: 2rem 1.25rem 4rem;
}
header.site-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
max-width: 880px;
margin: 0 auto;
padding: 1rem 1.25rem;
border-bottom: 1px solid var(--border);
}
.brand {
font-weight: 700;
text-decoration: none;
color: var(--text);
}
.site-nav {
display: flex;
align-items: center;
gap: 1rem;
}
.panel {
background: var(--panel);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 1.25rem;
margin: 1rem 0;
}
.btn {
display: inline-block;
background: var(--accent-strong);
color: #fff;
border: none;
border-radius: var(--radius);
padding: 0.6rem 1.1rem;
font-size: 0.95rem;
font-weight: 600;
cursor: pointer;
text-decoration: none;
}
.btn:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.btn.secondary {
background: transparent;
border: 1px solid var(--border);
color: var(--text);
}
.muted {
color: var(--muted);
}
.warn {
color: var(--warn);
font-weight: 600;
}
.danger {
color: var(--danger);
}
code,
pre {
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
pre {
background: #0a0c10;
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 1rem;
overflow-x: auto;
font-size: 0.85rem;
}
.key-box {
display: flex;
gap: 0.5rem;
align-items: center;
flex-wrap: wrap;
}
.key-box code {
background: #0a0c10;
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 0.5rem 0.75rem;
word-break: break-all;
flex: 1;
min-width: 220px;
}
.steps {
display: grid;
gap: 0.75rem;
padding-left: 1.1rem;
}
.error {
color: var(--danger);
font-weight: 600;
}
/* Admin console */
.stats {
display: flex;
gap: 1.5rem;
flex-wrap: wrap;
}
.filters {
display: flex;
gap: 0.6rem;
align-items: center;
flex-wrap: wrap;
}
.filters input,
.filters select {
background: #0a0c10;
border: 1px solid var(--border);
border-radius: var(--radius);
color: var(--text);
padding: 0.5rem 0.6rem;
font-size: 0.9rem;
}
.filters input[type="text"] {
flex: 1;
min-width: 220px;
}
.table {
width: 100%;
border-collapse: collapse;
font-size: 0.9rem;
}
.table th,
.table td {
text-align: left;
padding: 0.5rem 0.6rem;
border-bottom: 1px solid var(--border);
}
.table th {
color: var(--muted);
font-weight: 600;
}
.pager {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
margin: 1rem 0;
}