input-kanban 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/public/index.html
CHANGED
|
@@ -4,11 +4,15 @@
|
|
|
4
4
|
<meta charset="utf-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
6
|
<title>Input 看板</title>
|
|
7
|
+
<link rel="icon" type="image/png" sizes="32x32" href="/assets/input-kanban-favicon-32.png" />
|
|
8
|
+
<link rel="apple-touch-icon" sizes="180x180" href="/assets/input-kanban-apple-touch-icon.png" />
|
|
7
9
|
<style>
|
|
8
10
|
:root { --bg:#0b1220; --panel:#111827; --panel-2:#0f172a; --line:#334155; --line-strong:#64748b; --text:#e2e8f0; --muted:#94a3b8; --blue:#2563eb; --green:#166534; --red:#991b1b; --gray:#475569; --orange:#b45309; }
|
|
9
11
|
body { font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; margin: 0; background: var(--bg); color: var(--text); }
|
|
10
12
|
header { padding: 18px 24px; background: #0a1020; border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(255,255,255,.03); }
|
|
11
13
|
h1 { margin: 0; font-size: 22px; letter-spacing: .2px; }
|
|
14
|
+
.brand { display: inline-flex; align-items: center; gap: 10px; }
|
|
15
|
+
.brand-icon { width: 30px; height: 30px; border-radius: 9px; object-fit: cover; border: 1px solid rgba(148,163,184,.35); box-shadow: 0 1px 0 rgba(255,255,255,.08); }
|
|
12
16
|
h2 { margin: 0 0 12px; font-size: 24px; }
|
|
13
17
|
h3 { margin: 18px 0 8px; font-size: 15px; color: #cbd5e1; }
|
|
14
18
|
main { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 18px; padding: 18px; align-items: start; min-height: calc(100vh - 59px); }
|
|
@@ -43,6 +47,10 @@
|
|
|
43
47
|
.plan_empty { background: var(--orange); }
|
|
44
48
|
.pending, .created { background: var(--gray); }
|
|
45
49
|
.batch-row td { border-top: 3px solid var(--line-strong); background: #101827; font-weight: 800; font-size: 14px; padding-top: 13px; }
|
|
50
|
+
.batch-row-content { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
|
|
51
|
+
.batch-row-title { font-size: 15px; }
|
|
52
|
+
.batch-row-meta { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
|
|
53
|
+
.batch-row-meta .meta-chip { padding: 4px 7px; font-size: 11px; }
|
|
46
54
|
.job-row.selected { background: rgba(37,99,235,.16); box-shadow: inset 3px 0 0 #60a5fa; }
|
|
47
55
|
.task-name { min-width: 0; overflow: hidden; overflow-wrap: anywhere; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
|
|
48
56
|
.task-role { display: block; margin-top: 2px; }
|
|
@@ -61,8 +69,9 @@
|
|
|
61
69
|
.run-card-name { min-width: 0; overflow: hidden; overflow-wrap: anywhere; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
|
|
62
70
|
.run-card-title .pill { flex: 0 0 auto; }
|
|
63
71
|
.run-card-id { margin-top: 5px; word-break: break-all; }
|
|
64
|
-
.run-card-
|
|
65
|
-
.run-card-
|
|
72
|
+
.run-card-meta { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
|
|
73
|
+
.run-card-meta .meta-chip { padding: 4px 7px; font-size: 11px; }
|
|
74
|
+
.run-card-meta .meta-chip.long .meta-value { max-width: 248px; }
|
|
66
75
|
.build-header { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--panel-2); margin-bottom: 14px; }
|
|
67
76
|
.build-title { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 900; }
|
|
68
77
|
.build-meta { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
|
|
@@ -91,7 +100,7 @@
|
|
|
91
100
|
</style>
|
|
92
101
|
</head>
|
|
93
102
|
<body>
|
|
94
|
-
<header><h1
|
|
103
|
+
<header><h1 class="brand"><img class="brand-icon" src="/assets/input-kanban-icon.png" alt="" aria-hidden="true" />Input 看板</h1></header>
|
|
95
104
|
<main>
|
|
96
105
|
<div class="sidebar">
|
|
97
106
|
<section>
|
|
@@ -284,9 +293,13 @@ function renderRunList() {
|
|
|
284
293
|
const cards = visibleRuns.map(r => `
|
|
285
294
|
<div class="run-card ${selectedRun === r.runId ? 'active' : ''}" onclick="selectRun('${r.runId}')">
|
|
286
295
|
<div class="run-card-title"><span class="run-card-name" title="${esc(r.label)}">${esc(r.label)}</span><span>${pill(r.status)}</span></div>
|
|
287
|
-
<div class="run-card-
|
|
288
|
-
|
|
289
|
-
|
|
296
|
+
<div class="run-card-meta">
|
|
297
|
+
${metaChip('Run ID', r.runId, { long: true })}
|
|
298
|
+
${metaChip('创建', formatDateTime(r.createdAt))}
|
|
299
|
+
${metaChip('进度', `${r.completed}/${r.total}`)}
|
|
300
|
+
${metaChip('执行中', r.running)}
|
|
301
|
+
${metaChip('失败', r.failed, { danger: Number(r.failed) > 0 })}
|
|
302
|
+
</div>
|
|
290
303
|
</div>`);
|
|
291
304
|
if (latestRuns.length > runListVisibleCount) {
|
|
292
305
|
cards.push(`<button class="secondary run-list-more" onclick="showMoreRuns()">查看更多(${runListVisibleCount}/${latestRuns.length})</button>`);
|
|
@@ -414,7 +427,7 @@ function renderTasks() {
|
|
|
414
427
|
if (Array.isArray(s.batches) && s.batches.length) {
|
|
415
428
|
for (const b of s.batches) {
|
|
416
429
|
const done = (b.tasks || []).filter(t => t.status === 'completed').length;
|
|
417
|
-
rows.push(`<tr class="batch-row"><td colspan="${columnCount}">${esc(b.name || b.id)}
|
|
430
|
+
rows.push(`<tr class="batch-row"><td colspan="${columnCount}"><div class="batch-row-content"><span class="batch-row-title">${esc(b.name || b.id)}</span>${pill(b.status)}<span class="batch-row-meta">${metaChip('Batch ID', b.id)}${metaChip('最大并发', b.maxParallel || '-')}${metaChip('进度', `${done}/${(b.tasks || []).length}`)}</span></div></td></tr>`);
|
|
418
431
|
for (const t of b.tasks || []) rows.push(taskRow(t.id, t.name, t));
|
|
419
432
|
}
|
|
420
433
|
} else rows.push(...(s.tasks||[]).map(t => taskRow(t.id, t.name, t)));
|
package/src/server.js
CHANGED
|
@@ -32,7 +32,7 @@ async function serveStatic(req, res, pathname) {
|
|
|
32
32
|
try {
|
|
33
33
|
const data = await fsp.readFile(file);
|
|
34
34
|
const ext = path.extname(file);
|
|
35
|
-
const type = ext === '.html' ? 'text/html' : ext === '.js' ? 'text/javascript' : ext === '.css' ? 'text/css' : 'text/plain';
|
|
35
|
+
const type = ext === '.html' ? 'text/html' : ext === '.js' ? 'text/javascript' : ext === '.css' ? 'text/css' : ext === '.png' ? 'image/png' : ext === '.svg' ? 'image/svg+xml' : 'text/plain';
|
|
36
36
|
res.writeHead(200, { 'Content-Type': `${type}; charset=utf-8` });
|
|
37
37
|
res.end(data);
|
|
38
38
|
} catch { notFound(res); }
|