From 6f93f63ba8790e1d62b28589321d279b5693c95f Mon Sep 17 00:00:00 2001 From: M3NIX Date: Fri, 10 Nov 2023 17:40:30 +0100 Subject: [PATCH] added pipeline parameter to the url sharing feature --- static/js/index.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/static/js/index.js b/static/js/index.js index 80bc6e8..037c02f 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -69,6 +69,15 @@ window.onload = function () { // only show pipelines available for selected backend filterPipelineOptions(); + + let pipelineSelect = document.getElementById("select-pipeline"); + if(urlParameter.has('pipeline')) { + const pipelineValues = urlParameter.get('pipeline').split(';'); + pipelineValues.forEach(function(value) { + pipelineSelect.tomselect.addItem(value); + }); + } + // load cli command generateCli(); // inital conversion of example rule @@ -104,10 +113,11 @@ document.getElementById("rule-share-btn").onclick = function () { function generateShareLink() { let backend = getSelectValue("select-backend"); let format = getSelectValue("select-format"); + let pipelines = getSelectValue("select-pipeline"); let rule = encodeURIComponent(btoa(sigmaJar.toString())); // generate link with parameters - let shareParams = "#backend=" + backend + "&format=" + format + "&rule=" + rule; + let shareParams = "#backend=" + backend + "&format=" + format + "&pipeline=" + pipelines.join(";") + "&rule=" + rule; let shareUrl = location.protocol + "//" + location.host + "/" + shareParams; window.history.pushState({}, null, shareParams);