mirror of
https://github.com/blw1138/cross-py-builder.git
synced 2026-09-07 21:41:09 -05:00
Replace the CROSS_PY_WORKERS env list with a DB-backed worker store so agents can be added/removed (and their online status verified) from the browser. - db.py: add workers table + list_workers/add_worker/remove_worker. - workers.py: configured_workers() reads the DB instead of settings. - app.py: POST /api/workers (add, probes reachability) and DELETE /api/workers/<port>/<host>; startup log uses DB worker count. - UI: Workers card with add form, per-worker live status + OS/CPU, remove. - settings.py: drop CROSS_PY_WORKERS/_get_json_list; DB is single source. - README/DESIGN updated to describe UI-managed workers.
78 lines
2.3 KiB
HTML
78 lines
2.3 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>Cross-Py-Builder</title>
|
|
<link rel="stylesheet" href="/style.css">
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<h1>Cross-Py-Builder</h1>
|
|
<p id="worker-summary"></p>
|
|
</header>
|
|
|
|
<main>
|
|
<section class="card">
|
|
<h2>Workers</h2>
|
|
<form id="worker-form" class="inline-form">
|
|
<input type="text" id="worker-spec" placeholder="host:port (e.g. 192.168.1.40:9001)">
|
|
<button type="submit">Add worker</button>
|
|
</form>
|
|
<div id="workers"></div>
|
|
</section>
|
|
|
|
<section class="card" id="submit-card">
|
|
<h2>New build</h2>
|
|
<form id="job-form">
|
|
<div class="field">
|
|
<label for="mode">Source</label>
|
|
<select id="mode">
|
|
<option value="upload">Upload zip</option>
|
|
<option value="git">Git repo</option>
|
|
</select>
|
|
</div>
|
|
<div class="field" id="upload-field">
|
|
<label for="file">Project zip</label>
|
|
<input type="file" id="file" accept=".zip">
|
|
</div>
|
|
<div class="field" id="url-field" hidden>
|
|
<label for="url">Git URL</label>
|
|
<input type="text" id="url" placeholder="https://…">
|
|
</div>
|
|
<div class="fields-row">
|
|
<div class="field">
|
|
<label for="os">OS</label>
|
|
<select id="os"><option value="">Any</option></select>
|
|
</div>
|
|
<div class="field">
|
|
<label for="cpu">CPU</label>
|
|
<select id="cpu"><option value="">Any</option></select>
|
|
</div>
|
|
</div>
|
|
<button type="submit">Submit build</button>
|
|
<p id="submit-msg" class="msg"></p>
|
|
</form>
|
|
</section>
|
|
|
|
<section class="card">
|
|
<h2>Jobs</h2>
|
|
<div id="jobs"><p class="muted">Loading…</p></div>
|
|
</section>
|
|
</main>
|
|
|
|
<div id="modal" class="modal" hidden>
|
|
<div class="modal-body">
|
|
<button id="modal-close" class="close" aria-label="Close">×</button>
|
|
<h3 id="modal-title"></h3>
|
|
<div class="job-meta"><code id="modal-meta"></code></div>
|
|
<div id="status-badge" class="badge"></div>
|
|
<div id="artifacts"></div>
|
|
<pre id="log"></pre>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="/app.js"></script>
|
|
</body>
|
|
</html>
|