Skip to content

Commit b62d9f8

Browse files
committed
Filter based on different things
1 parent 11410b6 commit b62d9f8

File tree

2 files changed

+42
-3
lines changed

2 files changed

+42
-3
lines changed

dashboard/assets/scripts/dashboard.js

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,8 +655,11 @@ class JobsRenderer {
655655
this.firstFilterMatch = null;
656656
for (const job of this.jobs.sorted) {
657657
const w = this.renderInfo[job.ident].logWindow;
658-
const show = query.test(job.url) ||
659-
(this.showNicks && query.test(job.started_by));
658+
const show =
659+
(byId("filter-job-id").checked && query.test(job.ident)) ||
660+
(byId("filter-job-url").checked && query.test(job.url)) ||
661+
(byId("filter-job-note").checked && query.test(job.note)) ||
662+
(this.showNicks && byId("filter-job-nick").checked && query.test(job.started_by));
660663
if (!show) {
661664
w.classList.add("log-window-hidden");
662665

@@ -1106,6 +1109,22 @@ class Dashboard {
11061109

11071110
if (!showNicks) {
11081111
addPageStyles(".job-nick-aligned { width: 0; }");
1112+
} else {
1113+
byId("filter-types").lastChild.after(
1114+
h("input", {
1115+
type: "checkbox",
1116+
id: "filter-job-nick",
1117+
onclick: () => { ds.jobsRenderer.applyFilter(); },
1118+
checked: true,
1119+
})
1120+
);
1121+
byId("filter-types").lastChild.after("\n");
1122+
byId("filter-types").lastChild.after("\t\t\t");
1123+
byId("filter-types").lastChild.after(
1124+
h("label", { className: "filter-job", htmlFor: "filter-job-nick", textContent: "Nick" }),
1125+
);
1126+
byId("filter-types").lastChild.after(h("br"));
1127+
byId("filter-types").lastChild.after("\n");
11091128
}
11101129

11111130
if (args.initialFilter != null) {

dashboard/dashboard.html

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@
6565
float: inline-start;
6666
}
6767

68+
#filter-details {
69+
display: inline flex;
70+
}
71+
72+
#filter-types {
73+
float: inline-start;
74+
}
75+
6876
.padded-page {
6977
padding: 20px 27px 20px 27px;
7078
}
@@ -451,7 +459,19 @@
451459
<a href="https://wiki.archiveteam.org/index.php?title=ArchiveBot" class="underlined-a">ArchiveBot</a>
452460
tracking <span id="num-crawls">0</span> crawls.
453461
See also <a href="pipelines" class="underlined-a">pipeline</a> or <a href="logs/recent" class="underlined-a">job</a> reports.
454-
Logs <input id="filter-box" type="text" size="21" title="Show logs for jobs matching this regular expression. For example ^https?://.*">
462+
<details id="filter-details">
463+
<summary>Logs</summary>
464+
<div id="filter-types">
465+
Search:<br>
466+
<input type="checkbox" id="filter-job-id" onclick="ds.jobsRenderer.applyFilter();" accesskey="i">
467+
<label class="filter-job" for="filter-job-id">IDs</label><br>
468+
<input type="checkbox" id="filter-job-url" onclick="ds.jobsRenderer.applyFilter();" accesskey="u" checked>
469+
<label class="filter-job" for="filter-job-url">URLs</label><br>
470+
<input type="checkbox" id="filter-job-note" onclick="ds.jobsRenderer.applyFilter();" accesskey="e">
471+
<label class="filter-job" for="filter-job-note">Note</label><br>
472+
</div>
473+
</details>
474+
<input id="filter-box" type="text" size="21" title="Show logs for jobs matching this regular expression. For example ^https?://.*">
455475
<input id="set-filter-all" onclick="ds.setFilter('');" type="button" value="All" class="button">
456476
<input id="set-filter-none" onclick="ds.setFilter('^$');" type="button" value="None" class="button">
457477
<input type="checkbox" id="show-all-headers" onclick="ds.showAllHeaders(this.checked);">

0 commit comments

Comments
 (0)