Skip to content

Commit

Permalink
Merge branch 'main' into template-new-theme
Browse files Browse the repository at this point in the history
  • Loading branch information
nasbench authored Nov 10, 2023
2 parents 54fe1e5 + 2eb2dfc commit fd6f945
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion static/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,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
Expand Down Expand Up @@ -110,11 +119,12 @@ 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()));
let template = encodeURIComponent(btoa(templateJar.toString()));

// generate link with parameters
let shareParams = "#backend=" + backend + "&format=" + format + "&rule=" + rule + "&template=" + template;
let shareParams = "#backend=" + backend + "&format=" + format + "&pipeline=" + pipelines.join(";") + "&rule=" + rule + "&template=" + template;;
let shareUrl = location.protocol + "//" + location.host + "/" + shareParams;
window.history.pushState({}, null, shareParams);

Expand Down

0 comments on commit fd6f945

Please sign in to comment.