From 4ae2232f8ee27947fccf709ce58b0628769ede2f Mon Sep 17 00:00:00 2001 From: Martchus Date: Tue, 28 Jun 2022 16:07:36 +0200 Subject: [PATCH] Add architecture filter in the web UI's repo selections --- srv/static/css/specifics.css | 5 ++ srv/static/index.html | 94 ++++++++++++++++++------------- srv/static/js/globalstatuspage.js | 21 ++++++- 3 files changed, 79 insertions(+), 41 deletions(-) diff --git a/srv/static/css/specifics.css b/srv/static/css/specifics.css index 9ca8f7a..0c0bf4b 100644 --- a/srv/static/css/specifics.css +++ b/srv/static/css/specifics.css @@ -105,6 +105,11 @@ display: inline-block; box-sizing: border-box; width: 40%; + margin-right: 10px; + margin-block-end: 10px; +} +.form-split-50 select, .form-split-50 input { + width: 100%; } #build-actions-list-form fieldset input[type="button"], #package-results-form fieldset input[type="button"] { diff --git a/srv/static/index.html b/srv/static/index.html index 0f29656..d9edba5 100644 --- a/srv/static/index.html +++ b/srv/static/index.html @@ -67,6 +67,10 @@ Database: + +
@@ -160,43 +164,53 @@
Start new build action
-
-
- -
- +
+
+
+ +
+ +
+
+
-
+
+
+ +
+ +
+
+ +
+ +
-
-
-
- -
- -
-
- -
- -
-
-
-
- -
- -
-
- -
- +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
@@ -214,22 +228,22 @@
Settings:
-
+
Start condition: + checked="checked" onchange="this.form['start-after-id'].disabled = this.checked" /> + onchange="this.form['start-after-id'].disabled = this.checked" /> + onchange="this.form['start-after-id'].disabled = !this.checked" /> -
+
diff --git a/srv/static/js/globalstatuspage.js b/srv/static/js/globalstatuspage.js index 60267e3..cfcf2fa 100644 --- a/srv/static/js/globalstatuspage.js +++ b/srv/static/js/globalstatuspage.js @@ -90,9 +90,28 @@ function handleGlobalStatusUpdate(ajaxRequest) const repoName = Utils.makeRepoName(dbInfo.name, dbInfo.arch); status.repoNames.push(repoName); repoSelections.forEach(function (selection) { + const id = selection.id; const option = document.createElement('option'); - option.appendChild(document.createTextNode(repoName)); + option.text = repoName; + option.dataset.arch = dbInfo.arch; selection.appendChild(option); + const filterSel = document.getElementById(id + '-arch-filter'); + if (!filterSel) { + return; + } + const filterOptId = filterSel.id + dbInfo.arch; + if (!filterSel.options.namedItem(filterOptId)) { + const filterOpt = document.createElement('option'); + filterOpt.id = filterOptId; + filterOpt.text = dbInfo.arch; + filterSel.add(filterOpt); + filterSel.onchange = function() { + const filterVal = !filterSel.selectedIndex ? undefined : filterSel.value; + Array.from(selection.options).forEach(function(option) { + option.style.display = !filterVal || filterVal === option.dataset.arch ? 'block' : 'none'; + }); + }; + } }); });