Initial: JSONL→SQLite Exporter + Cost Analytics Web UI
This commit is contained in:
commit
9803f8c727
14 files changed
+1449
No files matched your search
@@ -0,0 +1,279 @@
|
||||
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
|
||||
:root {
|
||||
--bg: #0f1117;
|
||||
--surface: #1a1d27;
|
||||
--border: #2a2d3a;
|
||||
--accent: #6c8ef5;
|
||||
--text: #e2e4f0;
|
||||
--muted: #6b7280;
|
||||
--green: #4ade80;
|
||||
--orange: #fb923c;
|
||||
--red: #f87171;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Segoe UI', system-ui, sans-serif;
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
header {
|
||||
padding: 14px 24px;
|
||||
background: var(--surface);
|
||||
border-bottom: 1px solid var(--border);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 24px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
header h1 { font-size: 1.1rem; font-weight: 600; color: var(--accent); }
|
||||
|
||||
#btn-sync {
|
||||
background: var(--border);
|
||||
color: var(--text);
|
||||
border: none;
|
||||
padding: 5px 14px;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
font-size: 0.85rem;
|
||||
margin-left: auto;
|
||||
transition: background 0.15s;
|
||||
}
|
||||
#btn-sync:hover { background: var(--accent); }
|
||||
#btn-sync.syncing { opacity: 0.5; pointer-events: none; }
|
||||
|
||||
#summary {
|
||||
font-size: 0.85rem;
|
||||
color: var(--muted);
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
#summary .val { color: var(--text); font-weight: 600; }
|
||||
#summary .cost { color: var(--green); font-weight: 700; font-size: 1rem; }
|
||||
|
||||
#toolbar {
|
||||
padding: 10px 24px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
background: var(--surface);
|
||||
border-bottom: 1px solid var(--border);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
#btn-zoom-out {
|
||||
background: var(--border);
|
||||
color: var(--text);
|
||||
border: none;
|
||||
padding: 5px 14px;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
#btn-zoom-out:hover:not(:disabled) { background: var(--accent); }
|
||||
#btn-zoom-out:disabled { opacity: 0.3; cursor: default; }
|
||||
|
||||
#range-label {
|
||||
font-size: 0.85rem;
|
||||
color: var(--muted);
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
/* Chart */
|
||||
#chart-area {
|
||||
padding: 16px 24px 4px;
|
||||
flex-shrink: 0;
|
||||
background: var(--surface);
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
#chart {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
gap: 2px;
|
||||
height: 140px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.bar-wrapper {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.bar {
|
||||
width: 100%;
|
||||
min-width: 4px;
|
||||
background: var(--green);
|
||||
border-radius: 3px 3px 0 0;
|
||||
opacity: 0.7;
|
||||
transition: opacity 0.15s, background 0.15s;
|
||||
}
|
||||
|
||||
.bar-wrapper:hover .bar {
|
||||
opacity: 1;
|
||||
background: #6ee7b7;
|
||||
}
|
||||
|
||||
.bar-tooltip {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: -32px;
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
padding: 3px 8px;
|
||||
border-radius: 4px;
|
||||
font-size: 0.7rem;
|
||||
white-space: nowrap;
|
||||
z-index: 10;
|
||||
color: var(--green);
|
||||
font-weight: 600;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.bar-wrapper:hover .bar-tooltip { display: block; }
|
||||
|
||||
#chart-labels {
|
||||
display: flex;
|
||||
gap: 2px;
|
||||
padding: 4px 0 8px;
|
||||
}
|
||||
|
||||
.chart-label {
|
||||
flex: 1;
|
||||
font-size: 0.55rem;
|
||||
color: var(--muted);
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Content - blocks below chart */
|
||||
#content {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 12px 24px;
|
||||
}
|
||||
|
||||
.block {
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 10px;
|
||||
margin-bottom: 8px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.block-header {
|
||||
padding: 12px 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
cursor: pointer;
|
||||
transition: background 0.15s;
|
||||
}
|
||||
|
||||
.block-header:hover { background: #22263a; }
|
||||
|
||||
.block-label {
|
||||
font-family: monospace;
|
||||
font-size: 0.85rem;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.block-stats {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
.block-cost { color: var(--green); font-weight: 700; }
|
||||
.block-count { color: var(--muted); }
|
||||
|
||||
.block-entries {
|
||||
display: none;
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.block-entries.open { display: block; }
|
||||
|
||||
.entry {
|
||||
padding: 8px 16px 8px 28px;
|
||||
display: grid;
|
||||
grid-template-columns: 90px 1fr 80px 70px 60px;
|
||||
gap: 10px;
|
||||
align-items: center;
|
||||
font-size: 0.78rem;
|
||||
border-bottom: 1px solid var(--border);
|
||||
cursor: pointer;
|
||||
transition: background 0.1s;
|
||||
}
|
||||
|
||||
.entry:last-child { border-bottom: none; }
|
||||
.entry:hover { background: #1e2d5a; }
|
||||
|
||||
.entry-flat {
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
margin-bottom: 4px;
|
||||
padding: 10px 16px;
|
||||
}
|
||||
|
||||
.entry-time { font-family: monospace; color: var(--muted); }
|
||||
.entry-model { color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.entry-tokens { color: var(--muted); text-align: right; }
|
||||
.entry-cost { color: var(--green); font-weight: 600; text-align: right; }
|
||||
.entry-type { font-size: 0.65rem; color: var(--muted); text-transform: uppercase; text-align: right; }
|
||||
|
||||
/* Modal */
|
||||
.modal {
|
||||
position: fixed; inset: 0;
|
||||
background: rgba(0,0,0,0.7);
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.modal.hidden { display: none; }
|
||||
|
||||
.modal-box {
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 12px;
|
||||
padding: 20px;
|
||||
max-width: 850px; width: 90%; max-height: 80vh;
|
||||
overflow-y: auto;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#modal-close {
|
||||
position: absolute; top: 12px; right: 14px;
|
||||
background: none; border: none;
|
||||
color: var(--muted); font-size: 1.2rem; cursor: pointer;
|
||||
}
|
||||
|
||||
#modal-content {
|
||||
font-family: monospace;
|
||||
font-size: 0.78rem;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
color: var(--text);
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar { width: 6px; }
|
||||
::-webkit-scrollbar-track { background: transparent; }
|
||||
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
|
||||
Reference in new issue
Block a user