mirror of
https://github.com/thegeneralist01/archivr
synced 2026-07-21 18:55:36 +02:00
- Add archivr-core/src/capture.rs: Source enum, all capture helpers,
fail_run (replaces process::exit fail_archive_and_exit), and
perform_capture() as the public entry point
- Slim archivr-cli/src/main.rs to 103 lines: thin adapter over
archivr_core::capture::perform_capture
- Move all source-classification and tweet-entry tests from CLI to
archivr-core/src/capture.rs (they test core logic, belong in core)
- Add POST /api/archives/:archive_id/captures route in archivr-server:
validates non-empty locator (400), resolves archive (404), delegates
to perform_capture, returns {run_uid, status}
- Add capture dialog to browser UI: dialog markup in index.html,
showModal/submit/cancel/loading/error wiring in app.js, dialog
styles in styles.css
- 77 tests pass, clean build (0 warnings)
103 lines
3.7 KiB
HTML
103 lines
3.7 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>Archivr</title>
|
|
<link rel="stylesheet" href="/assets/styles.css">
|
|
</head>
|
|
<body>
|
|
<header class="topbar">
|
|
<div class="brand">Archivr</div>
|
|
<select id="archive-switcher" class="archive-switcher" aria-label="Select archive"></select>
|
|
<nav class="nav" aria-label="Primary">
|
|
<button class="nav-link is-active" data-view="archive">Archive</button>
|
|
<button class="nav-link" data-view="runs">Runs</button>
|
|
<button class="nav-link" data-view="admin">Admin</button>
|
|
<button class="nav-link" data-view="tags">Tags</button>
|
|
</nav>
|
|
<button class="capture-button">+ Capture</button>
|
|
</header>
|
|
|
|
<main class="app-shell">
|
|
<section class="workspace">
|
|
<div class="search-row">
|
|
<input id="search" class="search-input" type="search" aria-label="Search archive" autocomplete="off">
|
|
<div id="result-count" class="result-count"></div>
|
|
</div>
|
|
|
|
<section id="archive-view" class="view is-active">
|
|
<table class="entry-table">
|
|
<colgroup>
|
|
<col class="col-added">
|
|
<col class="col-title">
|
|
<col class="col-type">
|
|
<col class="col-size">
|
|
<col class="col-url">
|
|
</colgroup>
|
|
<thead>
|
|
<tr>
|
|
<th>Added</th>
|
|
<th>Title</th>
|
|
<th>Type</th>
|
|
<th>Size</th>
|
|
<th>Original URL</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="entries-body"></tbody>
|
|
</table>
|
|
</section>
|
|
|
|
<section id="runs-view" class="view">
|
|
<table class="entry-table">
|
|
<thead>
|
|
<tr>
|
|
<th>Started</th>
|
|
<th>Status</th>
|
|
<th>Requested</th>
|
|
<th>Completed</th>
|
|
<th>Failed</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="runs-body"></tbody>
|
|
</table>
|
|
</section>
|
|
|
|
<section id="admin-view" class="view admin-view">
|
|
<h1>Mounted Archives</h1>
|
|
<div id="admin-archives" class="admin-list"></div>
|
|
</section>
|
|
|
|
<section id="tags-view" class="view">
|
|
<div id="tag-tree" class="tag-tree"></div>
|
|
</section>
|
|
</section>
|
|
|
|
<aside class="context-rail">
|
|
<div class="rail-title">Context</div>
|
|
<div id="context-body" class="rail-body">Select an entry.</div>
|
|
<div id="entry-tags" class="entry-tags" hidden></div>
|
|
<div id="assign-tag-form" class="assign-tag-form" hidden>
|
|
<input id="assign-tag-input" class="assign-tag-input" type="text" placeholder="/science/cs" autocomplete="off">
|
|
<button id="assign-tag-btn" class="assign-tag-btn">Add tag</button>
|
|
</div>
|
|
</aside>
|
|
</main>
|
|
|
|
<dialog id="capture-dialog" class="capture-dialog">
|
|
<div class="capture-dialog-inner">
|
|
<h2 class="capture-dialog-title">Capture</h2>
|
|
<label for="capture-locator" class="capture-label">Locator</label>
|
|
<input id="capture-locator" class="capture-input" type="text"
|
|
placeholder="tweet:1234567890 or https://..." autocomplete="off">
|
|
<div id="capture-error" class="capture-error" hidden></div>
|
|
<div class="capture-actions">
|
|
<button type="button" id="capture-cancel-btn" class="capture-cancel">Cancel</button>
|
|
<button type="button" id="capture-submit-btn" class="capture-submit">Capture</button>
|
|
</div>
|
|
</div>
|
|
</dialog>
|
|
|
|
<script type="module" src="/assets/app.js"></script>
|
|
</body>
|
|
</html>
|