diff --git a/static/download_results.js b/static/download_results.js
new file mode 100644
index 0000000..ac0901a
--- /dev/null
+++ b/static/download_results.js
@@ -0,0 +1,59 @@
+function deleteFiles(filePaths) {
+ fetch('/delete_files', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ },
+ body: new URLSearchParams({
+ 'file_paths': filePaths
+ })
+ })
+ .then(response => response.json())
+ .then(data => {
+ if (data.success) {
+ alert('Files deleted successfully');
+ location.reload();
+ } else {
+ alert('Error deleting files: ' + JSON.stringify(data.errors));
+ }
+ });
+}
+
+function deleteSelectedFiles() {
+ const selectedFiles = Array.from(document.querySelectorAll('input[name="fileCheckbox"]:checked'))
+ .map(checkbox => checkbox.value);
+ if (selectedFiles.length > 0) {
+ deleteFiles(selectedFiles);
+ } else {
+ alert('No files selected');
+ }
+}
+
+function downloadSelectedFiles() {
+ const selectedFiles = Array.from(document.querySelectorAll('input[name="fileCheckbox"]:checked'))
+ .map(checkbox => checkbox.value);
+ if (selectedFiles.length > 0) {
+ selectedFiles.forEach(file => {
+ const link = document.createElement('a');
+ link.href = file;
+ link.download = file.split('/').pop();
+ document.body.appendChild(link);
+ link.click();
+ document.body.removeChild(link);
+ });
+ } else {
+ alert('No files selected');
+ }
+}
+
+// Function to check or uncheck all checkboxes in a table by checking or unchecking the "CheckAll" checkbox
+function checkAllCheckboxes(tableId, checkAllCheckboxId) {
+ const table = document.getElementById(tableId);
+ const checkboxes = table.querySelectorAll('input[type="checkbox"][name="fileCheckbox"]');
+ const checkAllCheckbox = document.getElementById(checkAllCheckboxId);
+ const isChecked = checkAllCheckbox.checked;
+
+ checkboxes.forEach(checkbox => {
+ checkbox.checked = isChecked;
+ });
+}
\ No newline at end of file
diff --git a/templates/download_results.html b/templates/download_results.html
index 92b0795..9ac43db 100644
--- a/templates/download_results.html
+++ b/templates/download_results.html
@@ -1,88 +1,5 @@
-
-
-
-
- Your page title
-
-
-
- {{ bootstrap.load_css() }}
-
-
-
-
-
+{% include "header.html" %}
@@ -91,16 +8,18 @@
Data Files
-
-
-
+
+
+
+
+
- | Select |
+ Select |
File Name |
Last Modified |
Created |
@@ -117,7 +36,7 @@
{{ file.created | datetimeformat }} |
{{ file.size }} |
-
+
|
{% endfor %}
@@ -128,11 +47,12 @@
Log Files
-
-
-
+
+
+
+
+
-
@@ -153,7 +73,7 @@
| {{ file.created | datetimeformat }} |
{{ file.size }} |
-
+
|
{% endfor %}
@@ -162,5 +82,8 @@
-
-
\ No newline at end of file
+ {% block scripts %}
+ {{ bootstrap.load_js() }}
+
+ {% endblock %}
+ {% include "footer.html" %}
\ No newline at end of file
diff --git a/templates/footer.html b/templates/footer.html
new file mode 100644
index 0000000..691287b
--- /dev/null
+++ b/templates/footer.html
@@ -0,0 +1,2 @@
+