forked from golutra/golutra
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
306 lines (306 loc) · 10.7 KB
/
index.html
File metadata and controls
306 lines (306 loc) · 10.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Golutra Codex Catalog</title>
<style>
:root {
--bg: #0c111b;
--bg-soft: #141b27;
--panel: rgba(17, 24, 39, 0.86);
--panel-strong: rgba(11, 16, 26, 0.96);
--line: rgba(148, 163, 184, 0.18);
--text: #f8fafc;
--muted: #94a3b8;
--accent: #38bdf8;
--accent-2: #22c55e;
--warn: #f59e0b;
--shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; }
body {
margin: 0;
min-height: 100vh;
font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
color: var(--text);
background:
radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 28%),
radial-gradient(circle at top right, rgba(34, 197, 94, 0.14), transparent 26%),
linear-gradient(180deg, #09111d 0%, #0c111b 48%, #0f1724 100%);
}
.shell {
width: min(1380px, calc(100vw - 32px));
margin: 20px auto;
padding: 24px;
border: 1px solid var(--line);
border-radius: 28px;
background: linear-gradient(180deg, rgba(15, 23, 36, 0.96), rgba(10, 16, 27, 0.9));
box-shadow: var(--shadow);
backdrop-filter: blur(18px);
}
.topbar {
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 16px;
margin-bottom: 22px;
flex-wrap: wrap;
}
h1 {
margin: 0;
font-size: clamp(28px, 4vw, 42px);
line-height: 1;
letter-spacing: -0.03em;
}
.subtitle, .meta, .path { color: var(--muted); }
.meta { font-size: 13px; text-align: right; }
.cards {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 14px;
margin-bottom: 22px;
}
.card {
padding: 18px;
border-radius: 22px;
border: 1px solid var(--line);
background: linear-gradient(180deg, rgba(19, 28, 44, 0.96), rgba(13, 18, 29, 0.94));
min-height: 132px;
}
.card .label {
color: var(--muted);
font-size: 13px;
margin-bottom: 12px;
text-transform: uppercase;
letter-spacing: 0.08em;
}
.card .value {
font-size: clamp(34px, 5vw, 56px);
font-weight: 700;
line-height: 1;
margin-bottom: 10px;
}
.card.plugins .value { color: var(--accent); }
.card.apps .value { color: var(--accent-2); }
.card.mcps .value { color: #f472b6; }
.card.skills .value { color: var(--warn); }
.grid {
display: grid;
grid-template-columns: 1.1fr 1.1fr 0.8fr;
gap: 14px;
}
.panel {
border: 1px solid var(--line);
border-radius: 22px;
background: linear-gradient(180deg, rgba(16, 22, 34, 0.94), rgba(10, 14, 24, 0.96));
padding: 18px;
min-height: 340px;
}
.panel h2 {
margin: 0 0 6px;
font-size: 19px;
}
.panel .path {
font-size: 12px;
margin-bottom: 16px;
word-break: break-all;
}
.list {
display: flex;
flex-direction: column;
gap: 10px;
max-height: 540px;
overflow: auto;
padding-right: 4px;
}
.item {
padding: 12px 14px;
border-radius: 16px;
border: 1px solid rgba(148, 163, 184, 0.12);
background: rgba(15, 23, 36, 0.9);
}
.item strong {
display: block;
font-size: 15px;
margin-bottom: 6px;
}
.item span {
display: block;
font-size: 12px;
color: var(--muted);
word-break: break-all;
}
.footer {
margin-top: 18px;
padding-top: 14px;
border-top: 1px solid var(--line);
font-size: 12px;
color: var(--muted);
display: flex;
justify-content: space-between;
gap: 12px;
flex-wrap: wrap;
}
.empty {
padding: 18px;
border: 1px dashed rgba(148, 163, 184, 0.22);
border-radius: 18px;
color: var(--muted);
text-align: center;
background: rgba(15, 23, 36, 0.55);
}
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
button {
border: 1px solid rgba(56, 189, 248, 0.24);
background: rgba(56, 189, 248, 0.14);
color: var(--text);
border-radius: 999px;
padding: 10px 16px;
cursor: pointer;
font-weight: 600;
}
button.secondary {
background: rgba(148, 163, 184, 0.08);
border-color: rgba(148, 163, 184, 0.16);
}
@media (max-width: 1100px) {
.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
.shell { width: min(100vw - 16px, 100%); padding: 16px; margin: 8px auto; border-radius: 20px; }
.cards { grid-template-columns: 1fr; }
.card { min-height: 110px; }
.meta { text-align: left; }
}
</style>
</head>
<body>
<main class="shell">
<section class="topbar">
<div>
<h1>Codex Local Catalog</h1>
<p class="subtitle">Real disk counts from Atramenti-Console codex roots.</p>
</div>
<div class="meta" id="meta">Loading...</div>
</section>
<section class="cards">
<article class="card plugins"><div class="label">Plugins</div><div class="value" id="plugins-count">-</div><div class="subtitle" id="plugins-root">-</div></article>
<article class="card apps"><div class="label">Apps</div><div class="value" id="apps-count">-</div><div class="subtitle" id="apps-root">-</div></article>
<article class="card mcps"><div class="label">MCPs</div><div class="value" id="mcps-count">-</div><div class="subtitle" id="mcps-root">-</div></article>
<article class="card skills"><div class="label">Skills</div><div class="value" id="skills-count">-</div><div class="subtitle" id="skills-root">-</div></article>
</section>
<section class="grid">
<article class="panel">
<h2>Plugins</h2>
<div class="path" id="plugins-path"></div>
<div class="list" id="plugins-list"></div>
</article>
<article class="panel">
<h2>Apps</h2>
<div class="path" id="apps-path"></div>
<div class="list" id="apps-list"></div>
</article>
<article class="panel">
<h2>Skills Snapshot</h2>
<div class="path" id="skills-path"></div>
<div class="list" id="skills-list"></div>
<div class="actions">
<button id="refresh-button">Refresh</button>
<button class="secondary" id="reload-button">Reload Page</button>
</div>
</article>
</section>
<section class="footer">
<span id="status">Ready.</span>
<span>Source of truth: local filesystem + C:\Users\ASUS-KL\.codex\config.toml.</span>
</section>
</main>
<script>
const endpoints = { catalog: './codex-catalog.json' };
const ids = {
meta: document.getElementById('meta'),
status: document.getElementById('status'),
pluginsCount: document.getElementById('plugins-count'),
appsCount: document.getElementById('apps-count'),
mcpsCount: document.getElementById('mcps-count'),
skillsCount: document.getElementById('skills-count'),
pluginsRoot: document.getElementById('plugins-root'),
appsRoot: document.getElementById('apps-root'),
mcpsRoot: document.getElementById('mcps-root'),
skillsRoot: document.getElementById('skills-root'),
pluginsPath: document.getElementById('plugins-path'),
appsPath: document.getElementById('apps-path'),
skillsPath: document.getElementById('skills-path'),
pluginsList: document.getElementById('plugins-list'),
appsList: document.getElementById('apps-list'),
skillsList: document.getElementById('skills-list'),
refreshButton: document.getElementById('refresh-button'),
reloadButton: document.getElementById('reload-button')
};
function renderList(target, items, emptyLabel) {
target.innerHTML = '';
if (!Array.isArray(items) || items.length === 0) {
const empty = document.createElement('div');
empty.className = 'empty';
empty.textContent = emptyLabel;
target.appendChild(empty);
return;
}
items.forEach((item) => {
const row = document.createElement('div');
row.className = 'item';
const title = document.createElement('strong');
title.textContent = item.name || '(unnamed)';
row.appendChild(title);
const path = document.createElement('span');
path.textContent = item.path || '';
row.appendChild(path);
const time = document.createElement('span');
time.textContent = item.lastWriteTime ? `Updated: ${item.lastWriteTime}` : '';
row.appendChild(time);
target.appendChild(row);
});
}
async function loadCatalog(cacheBust = false) {
ids.status.textContent = 'Loading local catalog...';
const url = cacheBust ? `${endpoints.catalog}?t=${Date.now()}` : endpoints.catalog;
const response = await fetch(url, { cache: 'no-store' });
if (!response.ok) {
throw new Error(`Failed to load catalog: ${response.status}`);
}
const data = await response.json();
ids.meta.textContent = `Generated: ${data.generatedAt}`;
ids.status.textContent = 'Catalog loaded from local filesystem snapshot.';
ids.pluginsCount.textContent = data.counts.plugins;
ids.appsCount.textContent = data.counts.apps;
ids.mcpsCount.textContent = data.counts.mcps;
ids.skillsCount.textContent = data.counts.skills;
ids.pluginsRoot.textContent = data.roots.plugins;
ids.appsRoot.textContent = data.roots.apps;
ids.mcpsRoot.textContent = data.roots.config;
ids.skillsRoot.textContent = data.roots.skills;
ids.pluginsPath.textContent = data.roots.plugins;
ids.appsPath.textContent = data.roots.apps;
ids.skillsPath.textContent = data.roots.skills;
renderList(ids.pluginsList, data.plugins, 'No plugin directories found.');
renderList(ids.appsList, data.apps, 'No app directories found.');
renderList(ids.skillsList, data.skills.slice(0, 24), 'No skill directories found.');
}
ids.refreshButton.addEventListener('click', async () => {
try {
ids.status.textContent = 'Regenerate codex-catalog.json, then click Refresh again if needed.';
await loadCatalog(true);
} catch (error) {
ids.status.textContent = error instanceof Error ? error.message : String(error);
}
});
ids.reloadButton.addEventListener('click', () => window.location.reload());
loadCatalog(true).catch((error) => {
ids.status.textContent = error instanceof Error ? error.message : String(error);
ids.meta.textContent = 'Catalog load failed';
});
</script>
</body>
</html>