From 11c8b3f637703801cc72283d085623d31a21a829 Mon Sep 17 00:00:00 2001 From: Evgenii Alekseev Date: Sat, 28 Jun 2025 23:32:55 +0300 Subject: [PATCH] feat: add ability to refresh databases on package addition through web interface --- .../templates/build-status/package-add-modal.jinja2 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/package/share/ahriman/templates/build-status/package-add-modal.jinja2 b/package/share/ahriman/templates/build-status/package-add-modal.jinja2 index 0e191e0c..4a7cba63 100644 --- a/package/share/ahriman/templates/build-status/package-add-modal.jinja2 +++ b/package/share/ahriman/templates/build-status/package-add-modal.jinja2 @@ -24,6 +24,13 @@ +
+ +
+ + +
+
@@ -50,6 +57,8 @@ const packageAddVariablesDiv = document.getElementById("package-add-variables-div"); + const packageAddRefreshInput = document.getElementById("package-add-refresh-input"); + function packageAddVariableInputCreate() { const variableInput = document.createElement("div"); variableInput.classList.add("input-group"); @@ -103,12 +112,13 @@ packages = packages ?? packageAddInput.value; patches = patches ?? patchesParse(); repository = repository ?? getRepositorySelector(packageAddRepositoryInput); + const parameters = Object.assign({}, {refresh: packageAddRefreshInput.checked}, patches); if (packages) { bootstrap.Modal.getOrCreateInstance(packageAddModal).hide(); const onSuccess = update => `Packages ${update} have been added`; const onFailure = error => `Package addition failed: ${error}`; - doPackageAction("/api/v1/service/add", [packages], repository, onSuccess, onFailure, patches); + doPackageAction("/api/v1/service/add", [packages], repository, onSuccess, onFailure, parameters); } }