From 5605e4d3bbd0189469ca205a27fc104a34983ed8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 14 Jan 2025 13:55:46 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20format=20everything=20with=20pre?= =?UTF-8?q?-commit=20by=20=20(#2685)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Auto-generated by [create-pull-request][1] [1]: https://github.com/peter-evans/create-pull-request --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Ludy --- ...r-compose-latest-fat-security-postgres.yml | 2 +- scripts/counter_translation.py | 7 +- .../SPDF/config/InstallationPathConfig.java | 8 +- .../security/database/DatabaseConfig.java | 2 +- src/main/resources/static/js/pipeline.js | 110 +++++++++--------- 5 files changed, 65 insertions(+), 64 deletions(-) diff --git a/exampleYmlFiles/docker-compose-latest-fat-security-postgres.yml b/exampleYmlFiles/docker-compose-latest-fat-security-postgres.yml index 2ad3d999..3deddab4 100644 --- a/exampleYmlFiles/docker-compose-latest-fat-security-postgres.yml +++ b/exampleYmlFiles/docker-compose-latest-fat-security-postgres.yml @@ -60,4 +60,4 @@ services: timeout: 5s retries: 10 volumes: - - ./stirling/latest/data:/pgdata \ No newline at end of file + - ./stirling/latest/data:/pgdata diff --git a/scripts/counter_translation.py b/scripts/counter_translation.py index 7f17d377..ba4ab67b 100644 --- a/scripts/counter_translation.py +++ b/scripts/counter_translation.py @@ -135,9 +135,10 @@ def compare_files( # elif "language.direction" in sort_ignore_translation[language]["missing"]: # sort_ignore_translation[language]["missing"].remove("language.direction") - with open(default_file_path, encoding="utf-8") as default_file, open( - file_path, encoding="utf-8" - ) as file: + with ( + open(default_file_path, encoding="utf-8") as default_file, + open(file_path, encoding="utf-8") as file, + ): for _ in range(5): next(default_file) try: diff --git a/src/main/java/stirling/software/SPDF/config/InstallationPathConfig.java b/src/main/java/stirling/software/SPDF/config/InstallationPathConfig.java index a1807375..757e9a13 100644 --- a/src/main/java/stirling/software/SPDF/config/InstallationPathConfig.java +++ b/src/main/java/stirling/software/SPDF/config/InstallationPathConfig.java @@ -23,12 +23,12 @@ public class InstallationPathConfig { private static final String PIPELINE_WATCHED_FOLDERS_PATH; private static final String PIPELINE_FINISHED_FOLDERS_PATH; private static final String PIPELINE_DEFAULT_WEB_UI_CONFIGS; - + // Custom file paths private static final String STATIC_PATH; private static final String TEMPLATES_PATH; private static final String SIGNATURES_PATH; - + static { BASE_PATH = initializeBasePath(); @@ -47,7 +47,7 @@ public class InstallationPathConfig { PIPELINE_WATCHED_FOLDERS_PATH = PIPELINE_PATH + "watchedFolders" + File.separator; PIPELINE_FINISHED_FOLDERS_PATH = PIPELINE_PATH + "finishedFolders" + File.separator; PIPELINE_DEFAULT_WEB_UI_CONFIGS = PIPELINE_PATH + "defaultWebUIConfigs" + File.separator; - + // Initialize custom file paths STATIC_PATH = CUSTOM_FILES_PATH + "static" + File.separator; TEMPLATES_PATH = CUSTOM_FILES_PATH + "templates" + File.separator; @@ -123,7 +123,7 @@ public class InstallationPathConfig { public static String getPipelineDefaultWebUIConfigsDir() { return PIPELINE_DEFAULT_WEB_UI_CONFIGS; } - + public static String getStaticPath() { return STATIC_PATH; } diff --git a/src/main/java/stirling/software/SPDF/config/security/database/DatabaseConfig.java b/src/main/java/stirling/software/SPDF/config/security/database/DatabaseConfig.java index 81a4b220..262ef994 100644 --- a/src/main/java/stirling/software/SPDF/config/security/database/DatabaseConfig.java +++ b/src/main/java/stirling/software/SPDF/config/security/database/DatabaseConfig.java @@ -21,7 +21,7 @@ import stirling.software.SPDF.model.provider.UnsupportedProviderException; public class DatabaseConfig { public final String DATASOURCE_DEFAULT_URL; - + public static final String DATASOURCE_URL_TEMPLATE = "jdbc:%s://%s:%4d/%s"; public static final String DEFAULT_DRIVER = "org.h2.Driver"; public static final String DEFAULT_USERNAME = "sa"; diff --git a/src/main/resources/static/js/pipeline.js b/src/main/resources/static/js/pipeline.js index a1542b41..1d6e61a1 100644 --- a/src/main/resources/static/js/pipeline.js +++ b/src/main/resources/static/js/pipeline.js @@ -222,30 +222,30 @@ document.getElementById('deletePipelineBtn').addEventListener('click', function( event.preventDefault(); let pipelineName = document.getElementById('pipelineName').value; - if (confirm(deletePipelineText + pipelineName)) { - removePipelineFromUI(pipelineName); - let key = "#Pipeline-" + pipelineName; - if (localStorage.getItem(key)) { - localStorage.removeItem(key); - } - let pipelineSelect = document.getElementById("pipelineSelect"); - let modal = document.getElementById('pipelineSettingsModal'); - if (modal.style.display !== 'none') { - $('#pipelineSettingsModal').modal('hide'); - } + if (confirm(deletePipelineText + pipelineName)) { + removePipelineFromUI(pipelineName); + let key = "#Pipeline-" + pipelineName; + if (localStorage.getItem(key)) { + localStorage.removeItem(key); + } + let pipelineSelect = document.getElementById("pipelineSelect"); + let modal = document.getElementById('pipelineSettingsModal'); + if (modal.style.display !== 'none') { + $('#pipelineSettingsModal').modal('hide'); + } - if (pipelineSelect.options.length > 0) { - pipelineSelect.selectedIndex = 0; - pipelineSelect.dispatchEvent(new Event('change')); - } + if (pipelineSelect.options.length > 0) { + pipelineSelect.selectedIndex = 0; + pipelineSelect.dispatchEvent(new Event('change')); + } } }); function removePipelineFromUI(pipelineName) { let pipelineSelect = document.getElementById("pipelineSelect"); for (let i = 0; i < pipelineSelect.options.length; i++) { - console.log(pipelineSelect.options[i]) - console.log("list " + pipelineSelect.options[i].innerText + " vs " + pipelineName) + console.log(pipelineSelect.options[i]) + console.log("list " + pipelineSelect.options[i].innerText + " vs " + pipelineName) if (pipelineSelect.options[i].innerText === pipelineName) { pipelineSelect.remove(i); break; @@ -414,22 +414,22 @@ document.getElementById("addOperationBtn").addEventListener("click", function () parameterInput.type = "checkbox"; if (defaultValue === true) parameterInput.checked = true; break; - case "array": - // If parameter.schema.format === 'binary' is to be checked, it should be checked here - parameterInput = document.createElement("textarea"); - parameterInput.placeholder = 'Enter a JSON formatted array, e.g., ["item1", "item2", "item3"]'; - parameterInput.className = "form-control"; - break; - case "object": - parameterInput = document.createElement("textarea"); - parameterInput.placeholder = 'Enter a JSON formatted object, e.g., {"key": "value"} If this is a fileInput, it is not currently supported'; - parameterInput.className = "form-control"; - break; - default: - parameterInput = document.createElement("input"); - parameterInput.type = "text"; - parameterInput.className = "form-control"; - if (defaultValue !== undefined) parameterInput.value = defaultValue; + case "array": + // If parameter.schema.format === 'binary' is to be checked, it should be checked here + parameterInput = document.createElement("textarea"); + parameterInput.placeholder = 'Enter a JSON formatted array, e.g., ["item1", "item2", "item3"]'; + parameterInput.className = "form-control"; + break; + case "object": + parameterInput = document.createElement("textarea"); + parameterInput.placeholder = 'Enter a JSON formatted object, e.g., {"key": "value"} If this is a fileInput, it is not currently supported'; + parameterInput.className = "form-control"; + break; + default: + parameterInput = document.createElement("input"); + parameterInput.type = "text"; + parameterInput.className = "form-control"; + if (defaultValue !== undefined) parameterInput.value = defaultValue; } } parameterInput.id = parameter.name; @@ -481,21 +481,21 @@ document.getElementById("addOperationBtn").addEventListener("click", function () break; case "array": case "object": - if (value === null || value === "") { - settings[parameter.name] = ""; - } else { - try { - const parsedValue = JSON.parse(value); - if (Array.isArray(parsedValue)) { - settings[parameter.name] = parsedValue; - } else { - settings[parameter.name] = value; - } - } catch (e) { - settings[parameter.name] = value; - } - } - break; + if (value === null || value === "") { + settings[parameter.name] = ""; + } else { + try { + const parsedValue = JSON.parse(value); + if (Array.isArray(parsedValue)) { + settings[parameter.name] = parsedValue; + } else { + settings[parameter.name] = value; + } + } catch (e) { + settings[parameter.name] = value; + } + } + break; default: settings[parameter.name] = value; } @@ -686,13 +686,13 @@ async function processPipelineConfig(configString) { case "text": case "textarea": default: - var value = operationConfig.parameters[parameterName] - if (typeof value !== 'string') { - input.value = JSON.stringify(value) ; - } else { - input.value = value; - } - + var value = operationConfig.parameters[parameterName] + if (typeof value !== 'string') { + input.value = JSON.stringify(value) ; + } else { + input.value = value; + } + } } });