Multi-edit ✏ #571

This commit is contained in:
Jokob-sk
2024-02-24 13:30:18 +11:00
parent 7d715493a6
commit 4f5fbb1316
17 changed files with 612 additions and 141 deletions

View File

@@ -472,7 +472,37 @@ function getQueryString(key){
});
tmp = params[key]
if(emptyArr.includes(tmp))
{
var queryParams = {};
fullUrl = window.location.toString();
// console.log(fullUrl);
if (fullUrl.includes('?')) {
var queryString = fullUrl.split('?')[1];
// Split the query string into individual parameters
var paramsArray = queryString.split('&');
// Loop through the parameters array
paramsArray.forEach(function(param) {
// Split each parameter into key and value
var keyValue = param.split('=');
var keyTmp = decodeURIComponent(keyValue[0]);
var value = decodeURIComponent(keyValue[1] || '');
// Store key-value pair in the queryParams object
queryParams[keyTmp] = value;
});
}
// console.log(queryParams);
tmp = queryParams[key]
}
result = emptyArr.includes(tmp) ? "" : tmp;
return result
@@ -722,9 +752,9 @@ function getGuid() {
// UI
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Genrate work-in-progress icons
// Generate work-in-progress icons
function workInProgress() {
console.log()
if($(".work-in-progress").html().trim() == "")
{
$(".work-in-progress").append(`
@@ -768,6 +798,25 @@ function hideSpinner()
$("#loadingSpinner").hide()
}
// --------------------------------------------------------
// Calls a backend function to add a front-end event to an execution queue
function updateApi()
{
// value has to be in format event|param. e.g. run|ARPSCAN
action = `update_api|devices,appevents`
$.ajax({
method: "POST",
url: "php/server/util.php",
data: { function: "addToExecutionQueue", action: action },
success: function(data, textStatus) {
console.log(data)
}
})
}
// -----------------------------------------------------------------------------
// initialize
// -----------------------------------------------------------------------------