mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 01:26:11 -08:00
UNIFIAPI v0.2, not ofund mac handling #1132
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
require 'php/templates/header.php';
|
require 'php/templates/header.php';
|
||||||
require 'php/templates/notification.php';
|
require 'php/templates/modals.php';
|
||||||
?>
|
?>
|
||||||
<!-- ----------------------------------------------------------------------- -->
|
<!-- ----------------------------------------------------------------------- -->
|
||||||
|
|
||||||
|
|||||||
@@ -1726,6 +1726,16 @@ input[readonly] {
|
|||||||
width: 92%;
|
width: 92%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#modal-ok
|
||||||
|
{
|
||||||
|
z-index: 1051; /*highest priority*/
|
||||||
|
}
|
||||||
|
|
||||||
|
#modal-form-plc
|
||||||
|
{
|
||||||
|
display: grid;
|
||||||
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------- */
|
/* ----------------------------------------------------------------- */
|
||||||
/* NETWORK page */
|
/* NETWORK page */
|
||||||
/* ----------------------------------------------------------------- */
|
/* ----------------------------------------------------------------- */
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
<!-- Content header--------------------------------------------------------- -->
|
<!-- Content header--------------------------------------------------------- -->
|
||||||
<section class="content-header">
|
<section class="content-header">
|
||||||
<?php require 'php/templates/notification.php'; ?>
|
<?php require 'php/templates/modals.php'; ?>
|
||||||
|
|
||||||
<h1 id="pageTitle">
|
<h1 id="pageTitle">
|
||||||
 <small>Quering device info...</small>
|
 <small>Quering device info...</small>
|
||||||
|
|||||||
@@ -290,18 +290,6 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ----------------------------------------
|
|
||||||
// Show the description of a setting
|
|
||||||
function showDescriptionPopup(e) {
|
|
||||||
|
|
||||||
console.log($(e).attr("my-set-key"));
|
|
||||||
|
|
||||||
showModalOK("Info", getString($(e).attr("my-set-key") + '_description'))
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// Save device data to DB
|
// Save device data to DB
|
||||||
function setDeviceData(direction = '', refreshCallback = '') {
|
function setDeviceData(direction = '', refreshCallback = '') {
|
||||||
|
|||||||
@@ -1005,8 +1005,6 @@ function initializeDatatable (status) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1032,6 +1032,7 @@ function getDevDataByMac(macAddress, dbColumn) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.error("⚠ Device with MAC not found:" + macAddress)
|
||||||
return "Unknown"; // Return a default value if MAC address is not found
|
return "Unknown"; // Return a default value if MAC address is not found
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -161,6 +161,91 @@ function showModalFieldInput(
|
|||||||
$(`#${prefix}`).modal("show");
|
$(`#${prefix}`).modal("show");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
function showModalPopupForm(
|
||||||
|
title,
|
||||||
|
message,
|
||||||
|
btnCancel = getString("Gen_Cancel"),
|
||||||
|
btnOK = getString("Gen_Okay"),
|
||||||
|
curValue = "",
|
||||||
|
callbackFunction = null,
|
||||||
|
triggeredBy = null,
|
||||||
|
popupFormJson = null,
|
||||||
|
parentSettingKey = null
|
||||||
|
) {
|
||||||
|
// set captions
|
||||||
|
prefix = "modal-form";
|
||||||
|
console.log(popupFormJson);
|
||||||
|
|
||||||
|
$(`#${prefix}-title`).html(title);
|
||||||
|
$(`#${prefix}-message`).html(message);
|
||||||
|
$(`#${prefix}-cancel`).html(btnCancel);
|
||||||
|
$(`#${prefix}-OK`).html(btnOK);
|
||||||
|
|
||||||
|
if (callbackFunction != null) {
|
||||||
|
modalCallbackFunction = callbackFunction;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (triggeredBy != null) {
|
||||||
|
$('#'+prefix).attr("data-myparam-triggered-by", triggeredBy)
|
||||||
|
}
|
||||||
|
|
||||||
|
outputHtml = "";
|
||||||
|
|
||||||
|
if (Array.isArray(popupFormJson)) {
|
||||||
|
popupFormJson.forEach((field, index) => {
|
||||||
|
// You'll need to define these or map them from `field`
|
||||||
|
const setName = field.name?.find(n => n.language_code === "en_us")?.string || setKey;
|
||||||
|
const labelClasses = "col-sm-2"; // example, or from your obj.labelClasses
|
||||||
|
const inputClasses = "col-sm-10"; // example, or from your obj.inputClasses
|
||||||
|
const fieldData = field.default_value ?? "";
|
||||||
|
const fieldOptionsOverride = field.type?.elements[0]?.elementOptions || [];
|
||||||
|
|
||||||
|
const setKey = field.function || `field_${index}`;
|
||||||
|
const setValue = field.default_value ?? "";
|
||||||
|
const setType = JSON.stringify(field.type);
|
||||||
|
const setEvents = field.events || []; // default to empty array if missing
|
||||||
|
|
||||||
|
const setObj = { setKey, setValue, setType, setEvents };
|
||||||
|
|
||||||
|
// Generate the input field HTML
|
||||||
|
const inputFormHtml = `
|
||||||
|
<div class="form-group col-xs-12">
|
||||||
|
<label id="${setKey}_label" class="${labelClasses}"> ${setName}
|
||||||
|
<i my-set-key="${parentSettingKey}_popupform_${setKey}"
|
||||||
|
title="${getString("Settings_Show_Description")}"
|
||||||
|
class="fa fa-circle-info pointer helpIconSmallTopRight"
|
||||||
|
onclick="showDescriptionPopup(this)">
|
||||||
|
</i>
|
||||||
|
</label>
|
||||||
|
<div class="${inputClasses}">
|
||||||
|
${generateFormHtml(
|
||||||
|
null, // settingsData only required for datatables
|
||||||
|
setObj,
|
||||||
|
fieldData.toString(),
|
||||||
|
fieldOptionsOverride,
|
||||||
|
null
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
// Append to result
|
||||||
|
outputHtml += inputFormHtml;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$(`#modal-form-plc`).html(outputHtml);
|
||||||
|
|
||||||
|
// $(`#${prefix}-field`).val(curValue);
|
||||||
|
// setTimeout(function () {
|
||||||
|
// $(`#${prefix}-field`).focus();
|
||||||
|
// }, 500);
|
||||||
|
|
||||||
|
// Show modal
|
||||||
|
$(`#${prefix}`).modal("show");
|
||||||
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
function modalDefaultOK() {
|
function modalDefaultOK() {
|
||||||
// Hide modal
|
// Hide modal
|
||||||
|
|||||||
@@ -67,6 +67,15 @@ function getPluginConfig(pluginsData, prefix) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------
|
||||||
|
// Show the description of a setting
|
||||||
|
function showDescriptionPopup(e) {
|
||||||
|
|
||||||
|
console.log($(e).attr("my-set-key"));
|
||||||
|
|
||||||
|
showModalOK("Info", getString($(e).attr("my-set-key") + '_description'))
|
||||||
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
// Generate plugin HTML card based on prefixes in an array
|
// Generate plugin HTML card based on prefixes in an array
|
||||||
function pluginCards(prefixesOfEnabledPlugins, includeSettings) {
|
function pluginCards(prefixesOfEnabledPlugins, includeSettings) {
|
||||||
@@ -299,6 +308,45 @@ function removeDataTableRow(el) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
// Add item via pop up form dialog
|
||||||
|
function addViaPopupForm(element) {
|
||||||
|
console.log(element)
|
||||||
|
|
||||||
|
const fromId = $(element).attr("my-input-from");
|
||||||
|
const toId = $(element).attr("my-input-to");
|
||||||
|
const curValue = $(`#${fromId}`).val();
|
||||||
|
const triggeredBy = $(element).attr("id");
|
||||||
|
const parsed = JSON.parse(atob($(element).data("elementoptionsbase64")));
|
||||||
|
const popupFormJson = parsed.find(obj => "popupForm" in obj)?.popupForm ?? null;
|
||||||
|
|
||||||
|
console.log(`fromId | toId | triggeredBy | curValue: ${fromId} | ${toId} | ${triggeredBy} | ${curValue}`);
|
||||||
|
|
||||||
|
showModalPopupForm(
|
||||||
|
`<i class="fa fa-pen-to-square"></i> ${getString(
|
||||||
|
"Gen_Update_Value"
|
||||||
|
)}`, // title
|
||||||
|
getString("settings_update_item_warning"), // message
|
||||||
|
getString("Gen_Cancel"), // btnCancel
|
||||||
|
getString("Gen_Add"), // btnOK
|
||||||
|
curValue, // curValue
|
||||||
|
null, // callbackFunction
|
||||||
|
triggeredBy, // triggeredBy
|
||||||
|
popupFormJson, // popupform
|
||||||
|
toId // parentSettingKey
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
// Add item to list via popup form
|
||||||
|
function addViaPopupFormToList(element, clearInput = true) {
|
||||||
|
|
||||||
|
|
||||||
|
// flag something changes to prevent navigating from page
|
||||||
|
settingsChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------
|
// ---------------------------------------------------------
|
||||||
// Add item to list
|
// Add item to list
|
||||||
function addList(element, clearInput = true) {
|
function addList(element, clearInput = true) {
|
||||||
@@ -622,8 +670,6 @@ function generateOptionsOrSetOptions(
|
|||||||
// obj.push({ id: item, name: item })
|
// obj.push({ id: item, name: item })
|
||||||
options = arrayToObject(createArray(overrideOptions ? overrideOptions : getSettingOptions(setKey)))
|
options = arrayToObject(createArray(overrideOptions ? overrideOptions : getSettingOptions(setKey)))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Call to render lists
|
// Call to render lists
|
||||||
renderList(
|
renderList(
|
||||||
options,
|
options,
|
||||||
@@ -633,8 +679,6 @@ function generateOptionsOrSetOptions(
|
|||||||
targetField,
|
targetField,
|
||||||
transformers
|
transformers
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -655,6 +699,13 @@ function applyTransformers(val, transformers) {
|
|||||||
val = btoa(val);
|
val = btoa(val);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case "name|base64":
|
||||||
|
// // Implement base64 logic
|
||||||
|
// if (!isBase64(val)) {
|
||||||
|
// val = btoa(val);
|
||||||
|
// }
|
||||||
|
val = val; // probably TODO ⚠
|
||||||
|
break;
|
||||||
case "getString":
|
case "getString":
|
||||||
// no change
|
// no change
|
||||||
val = val;
|
val = val;
|
||||||
@@ -681,6 +732,13 @@ function reverseTransformers(val, transformers) {
|
|||||||
val = atob(val);
|
val = atob(val);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case "name|base64":
|
||||||
|
// // Implement base64 decoding logic
|
||||||
|
// if (isBase64(val)) {
|
||||||
|
// val = atob(val);
|
||||||
|
// }
|
||||||
|
val = val; // probably TODO ⚠
|
||||||
|
break;
|
||||||
case "getString":
|
case "getString":
|
||||||
// retrieve string
|
// retrieve string
|
||||||
val = getString(val);
|
val = getString(val);
|
||||||
@@ -721,7 +779,7 @@ const handleElementOptions = (setKey, elementOptions, transformers, val) => {
|
|||||||
let customId = "";
|
let customId = "";
|
||||||
let columns = [];
|
let columns = [];
|
||||||
let base64Regex = "";
|
let base64Regex = "";
|
||||||
|
let elementOptionsBase64 = btoa(JSON.stringify(elementOptions));
|
||||||
|
|
||||||
elementOptions.forEach((option) => {
|
elementOptions.forEach((option) => {
|
||||||
if (option.prefillValue) {
|
if (option.prefillValue) {
|
||||||
@@ -804,7 +862,8 @@ const handleElementOptions = (setKey, elementOptions, transformers, val) => {
|
|||||||
customParams,
|
customParams,
|
||||||
customId,
|
customId,
|
||||||
columns,
|
columns,
|
||||||
base64Regex
|
base64Regex,
|
||||||
|
elementOptionsBase64
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -955,6 +1014,8 @@ function generateFormHtml(settingsData, set, overrideValue, overrideOptions, ori
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
// Parse the setType JSON string
|
// Parse the setType JSON string
|
||||||
|
console.log(processQuotes(setType));
|
||||||
|
|
||||||
const setTypeObject = JSON.parse(processQuotes(setType))
|
const setTypeObject = JSON.parse(processQuotes(setType))
|
||||||
const dataType = setTypeObject.dataType;
|
const dataType = setTypeObject.dataType;
|
||||||
const elements = setTypeObject.elements || [];
|
const elements = setTypeObject.elements || [];
|
||||||
@@ -982,7 +1043,8 @@ function generateFormHtml(settingsData, set, overrideValue, overrideOptions, ori
|
|||||||
customParams,
|
customParams,
|
||||||
customId,
|
customId,
|
||||||
columns,
|
columns,
|
||||||
base64Regex
|
base64Regex,
|
||||||
|
elementOptionsBase64
|
||||||
} = handleElementOptions(setKey, elementOptions, transformers, inVal);
|
} = handleElementOptions(setKey, elementOptions, transformers, inVal);
|
||||||
|
|
||||||
// Override value
|
// Override value
|
||||||
@@ -1051,6 +1113,7 @@ function generateFormHtml(settingsData, set, overrideValue, overrideOptions, ori
|
|||||||
my-originalSetKey="${originalSetKey}"
|
my-originalSetKey="${originalSetKey}"
|
||||||
my-input-from="${sourceIds}"
|
my-input-from="${sourceIds}"
|
||||||
my-input-to="${setKey}"
|
my-input-to="${setKey}"
|
||||||
|
data-elementoptionsbase64="${elementOptionsBase64}"
|
||||||
onclick="${onClick}">
|
onclick="${onClick}">
|
||||||
${getString(getStringKey)}
|
${getString(getStringKey)}
|
||||||
</button>`;
|
</button>`;
|
||||||
|
|||||||
@@ -782,25 +782,17 @@ function initSelect2() {
|
|||||||
// ------------------------------------------
|
// ------------------------------------------
|
||||||
// Render a device link with hover-over functionality
|
// Render a device link with hover-over functionality
|
||||||
function renderDeviceLink(data, container, useName = false) {
|
function renderDeviceLink(data, container, useName = false) {
|
||||||
if (!data.id) return data.text; // default placeholder etc.
|
if (!data.id || !isValidMac(data.id)) return data.text; // default placeholder etc.
|
||||||
|
|
||||||
const device = getDevDataByMac(data.id);
|
const device = getDevDataByMac(data.id);
|
||||||
|
|
||||||
console.log('mac 🔽');
|
|
||||||
console.log(data.id);
|
|
||||||
console.log('mac 🔼');
|
|
||||||
|
|
||||||
console.log('device 🔽');
|
|
||||||
console.log(device);
|
|
||||||
console.log('device 🔼');
|
|
||||||
|
|
||||||
const badge = getStatusBadgeParts(
|
const badge = getStatusBadgeParts(
|
||||||
device.devPresentLastScan,
|
device.devPresentLastScan,
|
||||||
device.devAlertDown,
|
device.devAlertDown,
|
||||||
device.devMac
|
device.devMac
|
||||||
);
|
);
|
||||||
|
|
||||||
// Add badge class and hover-info class to container
|
// badge class and hover-info class to container
|
||||||
$(container)
|
$(container)
|
||||||
.addClass(`${badge.cssClass} hover-node-info`)
|
.addClass(`${badge.cssClass} hover-node-info`)
|
||||||
.attr({
|
.attr({
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
require 'php/templates/header.php';
|
require 'php/templates/header.php';
|
||||||
require 'php/templates/notification.php';
|
require 'php/templates/modals.php';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- Page ------------------------------------------------------------------ -->
|
<!-- Page ------------------------------------------------------------------ -->
|
||||||
|
|||||||
@@ -136,7 +136,8 @@
|
|||||||
customParams,
|
customParams,
|
||||||
customId,
|
customId,
|
||||||
columns,
|
columns,
|
||||||
base64Regex
|
base64Regex,
|
||||||
|
elementOptionsBase64
|
||||||
} = handleElementOptions('none', elementOptions, transformers, val = "");
|
} = handleElementOptions('none', elementOptions, transformers, val = "");
|
||||||
|
|
||||||
// render based on element type
|
// render based on element type
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
require 'php/templates/header.php';
|
require 'php/templates/header.php';
|
||||||
require 'php/templates/notification.php';
|
require 'php/templates/modals.php';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
require 'php/templates/notification.php';
|
require 'php/templates/modals.php';
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// check if authenticated
|
// check if authenticated
|
||||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/php/templates/security.php';
|
require_once $_SERVER['DOCUMENT_ROOT'] . '/php/templates/security.php';
|
||||||
|
|||||||
@@ -117,6 +117,29 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Modal form input -->
|
||||||
|
<div class="modal fade" id="modal-form" data-myparam-triggered-by="" style="display: none;">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
|
<h4 id="modal-form-title" class="modal-title"> Modal Title </h4>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="modal-form-message" class="modal-body"> Modal message </div>
|
||||||
|
|
||||||
|
<div id="modal-form-plc"></div>
|
||||||
|
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button id="modal-form-cancel" type="button" class="btn btn-outline pull-left" style="min-width: 80px;" data-dismiss="modal"> Cancel </button>
|
||||||
|
<button id="modal-form-OK" type="button" class="btn btn-outline btn-modal-submit" style="min-width: 80px;" onclick="modalDefaultForm()"> OK </button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-- Modal field input -->
|
<!-- Modal field input -->
|
||||||
<div class="modal modal-warning fade" id="modal-field-input" data-myparam-triggered-by="" style="display: none;">
|
<div class="modal modal-warning fade" id="modal-field-input" data-myparam-triggered-by="" style="display: none;">
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
require 'php/templates/header.php';
|
require 'php/templates/header.php';
|
||||||
require 'php/templates/notification.php';
|
require 'php/templates/modals.php';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- Page ------------------------------------------------------------------ -->
|
<!-- Page ------------------------------------------------------------------ -->
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"code_name": "unifi_api_import",
|
"code_name": "unifi_api_import",
|
||||||
"unique_prefix": "UNIFIAPI",
|
"unique_prefix": "UNIFIAPI",
|
||||||
"plugin_type": "device_scanner",
|
"plugin_type": "device_scanner",
|
||||||
"execution_order" : "Layer_0",
|
"execution_order": "Layer_0",
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"data_source": "script",
|
"data_source": "script",
|
||||||
"mapped_to_table": "CurrentScan",
|
"mapped_to_table": "CurrentScan",
|
||||||
@@ -16,17 +16,21 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"show_ui": true,
|
"show_ui": true,
|
||||||
"localized": ["display_name", "description", "icon"],
|
"localized": [
|
||||||
|
"display_name",
|
||||||
|
"description",
|
||||||
|
"icon"
|
||||||
|
],
|
||||||
"display_name": [
|
"display_name": [
|
||||||
{
|
{
|
||||||
"language_code": "en_us",
|
"language_code": "en_us",
|
||||||
"string": "Display Name"
|
"string": "UniFi import (API)"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": [
|
"description": [
|
||||||
{
|
{
|
||||||
"language_code": "en_us",
|
"language_code": "en_us",
|
||||||
"string": "Plugin to ..."
|
"string": "This plugin is used to import devices from an UNIFI controller via the Site Manager API."
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": [
|
"icon": [
|
||||||
@@ -39,21 +43,29 @@
|
|||||||
"settings": [
|
"settings": [
|
||||||
{
|
{
|
||||||
"function": "RUN",
|
"function": "RUN",
|
||||||
"events": ["run"],
|
"events": [
|
||||||
|
"run"
|
||||||
|
],
|
||||||
"type": {
|
"type": {
|
||||||
"dataType": "string",
|
"dataType": "string",
|
||||||
"elements": [
|
"elements": [
|
||||||
{ "elementType": "select", "elementOptions": [], "transformers": [] }
|
{
|
||||||
|
"elementType": "select",
|
||||||
|
"elementOptions": [],
|
||||||
|
"transformers": []
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
"default_value": "disabled",
|
"default_value": "disabled",
|
||||||
"options": [
|
"options": [
|
||||||
"disabled",
|
"disabled",
|
||||||
"once",
|
"once",
|
||||||
"schedule"
|
"schedule"
|
||||||
],
|
],
|
||||||
"localized": ["name", "description"],
|
"localized": [
|
||||||
|
"name",
|
||||||
|
"description"
|
||||||
|
],
|
||||||
"name": [
|
"name": [
|
||||||
{
|
{
|
||||||
"language_code": "en_us",
|
"language_code": "en_us",
|
||||||
@@ -63,7 +75,7 @@
|
|||||||
"description": [
|
"description": [
|
||||||
{
|
{
|
||||||
"language_code": "en_us",
|
"language_code": "en_us",
|
||||||
"string": "When the plugin should run. Good options are <code>always_after_scan</code>, <code>on_new_device</code>, <code>on_notification</code>"
|
"string": "When the plugin should run. Good options are <code>schedule</code>, <code>once</code>."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -100,7 +112,10 @@
|
|||||||
},
|
},
|
||||||
"default_value": "*/5 * * * *",
|
"default_value": "*/5 * * * *",
|
||||||
"options": [],
|
"options": [],
|
||||||
"localized": ["name", "description"],
|
"localized": [
|
||||||
|
"name",
|
||||||
|
"description"
|
||||||
|
],
|
||||||
"name": [
|
"name": [
|
||||||
{
|
{
|
||||||
"language_code": "en_us",
|
"language_code": "en_us",
|
||||||
@@ -110,7 +125,7 @@
|
|||||||
"description": [
|
"description": [
|
||||||
{
|
{
|
||||||
"language_code": "en_us",
|
"language_code": "en_us",
|
||||||
"string": "Only enabled if you select <code>schedule</code> in the <a href=\"#SYNC_RUN\"><code>SYNC_RUN</code> setting</a>. Make sure you enter the schedule in the correct cron-like format (e.g. validate at <a href=\"https://crontab.guru/\" target=\"_blank\">crontab.guru</a>). For example entering <code>0 4 * * *</code> will run the scan after 4 am in the <a onclick=\"toggleAllSettings()\" href=\"#TIMEZONE\"><code>TIMEZONE</code> you set above</a>. Will be run NEXT time the time passes."
|
"string": "Only enabled if you select <code>schedule</code> in the <a href=\"#UNIFIAPI_RUN\"><code>UNIFIAPI_RUN</code> setting</a>. Make sure you enter the schedule in the correct cron-like format (e.g. validate at <a href=\"https://crontab.guru/\" target=\"_blank\">crontab.guru</a>). For example entering <code>0 4 * * *</code> will run the scan after 4 am in the <a onclick=\"toggleAllSettings()\" href=\"#TIMEZONE\"><code>TIMEZONE</code> you set above</a>. Will be run NEXT time the time passes."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -121,14 +136,21 @@
|
|||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [{ "readonly": "true" }],
|
"elementOptions": [
|
||||||
|
{
|
||||||
|
"readonly": "true"
|
||||||
|
}
|
||||||
|
],
|
||||||
"transformers": []
|
"transformers": []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"default_value": "python3 /app/front/plugins/unifi_api_import/unifi_api_import.py",
|
"default_value": "python3 /app/front/plugins/unifi_api_import/unifi_api_import.py",
|
||||||
"options": [],
|
"options": [],
|
||||||
"localized": ["name", "description"],
|
"localized": [
|
||||||
|
"name",
|
||||||
|
"description"
|
||||||
|
],
|
||||||
"name": [
|
"name": [
|
||||||
{
|
{
|
||||||
"language_code": "en_us",
|
"language_code": "en_us",
|
||||||
@@ -149,14 +171,21 @@
|
|||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [{ "type": "number" }],
|
"elementOptions": [
|
||||||
|
{
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
],
|
||||||
"transformers": []
|
"transformers": []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"default_value": 10,
|
"default_value": 10,
|
||||||
"options": [],
|
"options": [],
|
||||||
"localized": ["name", "description"],
|
"localized": [
|
||||||
|
"name",
|
||||||
|
"description"
|
||||||
|
],
|
||||||
"name": [
|
"name": [
|
||||||
{
|
{
|
||||||
"language_code": "en_us",
|
"language_code": "en_us",
|
||||||
@@ -171,28 +200,52 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"function": "devCustomProps",
|
"function": "sites",
|
||||||
"type": {
|
"type": {
|
||||||
"dataType": "array",
|
"dataType": "array",
|
||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
"elementType": "popupform",
|
"elementType": "button",
|
||||||
"elementHasInputValue": 1,
|
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"fields": [
|
"sourceSuffixes": [
|
||||||
|
"_in"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"function": "hide.site.name",
|
"separator": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cssClasses": "col-xs-12"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"onClick": "addViaPopupForm(this)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"getStringKey": "Gen_Add"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"popupForm": [
|
||||||
|
{
|
||||||
|
"function": "name",
|
||||||
"type": {
|
"type": {
|
||||||
"dataType": "string",
|
"dataType": "string",
|
||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{ "placeholder": "Enter value" },
|
{
|
||||||
{ "suffix": "_in" },
|
"placeholder": "Enter value"
|
||||||
{ "cssClasses": "col-sm-10" },
|
},
|
||||||
{ "prefillValue": "null" }
|
{
|
||||||
|
"suffix": "_in"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cssClasses": "col-sm-10"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"prefillValue": "null"
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"transformers": []
|
"transformers": []
|
||||||
}
|
}
|
||||||
@@ -200,7 +253,10 @@
|
|||||||
},
|
},
|
||||||
"default_value": "default",
|
"default_value": "default",
|
||||||
"options": [],
|
"options": [],
|
||||||
"localized": ["name", "description"],
|
"localized": [
|
||||||
|
"name",
|
||||||
|
"description"
|
||||||
|
],
|
||||||
"name": [
|
"name": [
|
||||||
{
|
{
|
||||||
"language_code": "en_us",
|
"language_code": "en_us",
|
||||||
@@ -210,27 +266,179 @@
|
|||||||
"description": [
|
"description": [
|
||||||
{
|
{
|
||||||
"language_code": "en_us",
|
"language_code": "en_us",
|
||||||
"string": "The name of your site. Not used in code and only for.... "
|
"string": "The name of your site. Use a descriptive name."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"settingKey": "hide.site.name",
|
"function": "base_url",
|
||||||
"typeOverride": {
|
"type": {
|
||||||
"dataType": "string",
|
"dataType": "string",
|
||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
"elementType": "span",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"cssClasses": "input-group-addon iconPreview"
|
"placeholder": "https://host_ip/proxy/network/integration/"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"getStringKey": "Gen_SelectIcon"
|
"suffix": "_in"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"customId": "CUSTPROP_icon_preview"
|
"cssClasses": "col-sm-10"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"prefillValue": "null"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"transformers": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"default_value": "default",
|
||||||
|
"options": [],
|
||||||
|
"localized": [
|
||||||
|
"name",
|
||||||
|
"description"
|
||||||
|
],
|
||||||
|
"name": [
|
||||||
|
{
|
||||||
|
"language_code": "en_us",
|
||||||
|
"string": "Base URL"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": [
|
||||||
|
{
|
||||||
|
"language_code": "en_us",
|
||||||
|
"string": "You can find your base url in the UniFi Site Manager in <i>Settings -> Control Plane -> Integrations</i> in the <i>API Request Format</i> section, (e.g. <code>https://host_ip/proxy/network/integration/</code>)."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"function": "version",
|
||||||
|
"type": {
|
||||||
|
"dataType": "string",
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"elementType": "input",
|
||||||
|
"elementOptions": [
|
||||||
|
{
|
||||||
|
"placeholder": "v1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"suffix": "_in"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cssClasses": "col-sm-10"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"prefillValue": "null"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"transformers": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"default_value": "default",
|
||||||
|
"options": [],
|
||||||
|
"localized": [
|
||||||
|
"name",
|
||||||
|
"description"
|
||||||
|
],
|
||||||
|
"name": [
|
||||||
|
{
|
||||||
|
"language_code": "en_us",
|
||||||
|
"string": "API version"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": [
|
||||||
|
{
|
||||||
|
"language_code": "en_us",
|
||||||
|
"string": "The version of the API (e.g.: <code>v1</code>)."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"function": "api_key",
|
||||||
|
"type": {
|
||||||
|
"dataType": "string",
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"elementType": "input",
|
||||||
|
"elementOptions": [
|
||||||
|
{
|
||||||
|
"placeholder": "Enter value"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"suffix": "_in"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cssClasses": "col-sm-10"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"prefillValue": "null"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"transformers": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"default_value": "default",
|
||||||
|
"options": [],
|
||||||
|
"localized": [
|
||||||
|
"name",
|
||||||
|
"description"
|
||||||
|
],
|
||||||
|
"name": [
|
||||||
|
{
|
||||||
|
"language_code": "en_us",
|
||||||
|
"string": "API key"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": [
|
||||||
|
{
|
||||||
|
"language_code": "en_us",
|
||||||
|
"string": "You can get an API key in your UniFi Site Manager in <i>Settings -> Control Plane -> Integrations</i>."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"function": "hide.site.verify_ssl",
|
||||||
|
"type": {
|
||||||
|
"dataType": "boolean",
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"elementType": "input",
|
||||||
|
"elementOptions": [
|
||||||
|
{
|
||||||
|
"type": "checkbox"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"transformers": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"default_value": 1,
|
||||||
|
"options": [],
|
||||||
|
"localized": [
|
||||||
|
"name",
|
||||||
|
"description"
|
||||||
|
],
|
||||||
|
"name": [
|
||||||
|
{
|
||||||
|
"language_code": "en_us",
|
||||||
|
"string": "Verify SSL"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": [
|
||||||
|
{
|
||||||
|
"language_code": "en_us",
|
||||||
|
"string": "Disable if you do not have an SSL certificate set up."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"transformers": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"transformers": []
|
"transformers": []
|
||||||
@@ -240,44 +448,57 @@
|
|||||||
"elementHasInputValue": 1,
|
"elementHasInputValue": 1,
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"cssClasses": "iconInputVal myhidden"
|
"multiple": "true"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"onChange": "updateIconPreview(this)"
|
"readonly": "true"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"customParams": "CUSTPROP_icon,CUSTPROP_icon_preview"
|
"editable": "true"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"transformers": [
|
||||||
|
"name|base64"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"elementType": "button",
|
||||||
|
"elementOptions": [
|
||||||
|
{
|
||||||
|
"sourceSuffixes": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"separator": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cssClasses": "col-xs-6"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"onClick": "removeFromList(this)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"getStringKey": "Gen_Remove_Last"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"transformers": []
|
"transformers": []
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"settingKey": "hide.site.base_url",
|
"elementType": "button",
|
||||||
"optionsOverride": "setting.CUSTPROP_type",
|
"elementOptions": [
|
||||||
"typeOverride": {
|
|
||||||
"dataType": "string",
|
|
||||||
"elements": [
|
|
||||||
{
|
{
|
||||||
"elementType": "select",
|
"sourceSuffixes": []
|
||||||
"elementOptions": [],
|
|
||||||
"transformers": []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"settingKey": "hide.site.version"
|
"separator": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"settingKey": "hide.site.api_key"
|
"cssClasses": "col-xs-6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"settingKey": "hide.site.verify_ssl"
|
"onClick": "removeAllOptions(this)"
|
||||||
}
|
},
|
||||||
]
|
{
|
||||||
|
"getStringKey": "Gen_Remove_All"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"transformers": []
|
"transformers": []
|
||||||
@@ -299,92 +520,7 @@
|
|||||||
"description": [
|
"description": [
|
||||||
{
|
{
|
||||||
"language_code": "en_us",
|
"language_code": "en_us",
|
||||||
"string": "Unifi sites"
|
"string": "UniFi sites"
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"function": "sites",
|
|
||||||
"type": {
|
|
||||||
"dataType": "array",
|
|
||||||
"elements": [
|
|
||||||
{
|
|
||||||
"elementType": "input",
|
|
||||||
"elementOptions": [
|
|
||||||
{ "placeholder": "Enter value" },
|
|
||||||
{ "suffix": "_in" },
|
|
||||||
{ "cssClasses": "col-sm-10" },
|
|
||||||
{ "prefillValue": "null" }
|
|
||||||
],
|
|
||||||
"transformers": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"elementType": "button",
|
|
||||||
"elementOptions": [
|
|
||||||
{ "sourceSuffixes": ["_in"] },
|
|
||||||
{ "separator": "" },
|
|
||||||
{ "cssClasses": "col-xs-12" },
|
|
||||||
{ "onClick": "addList(this,false)" },
|
|
||||||
{ "getStringKey": "Gen_Add" }
|
|
||||||
],
|
|
||||||
"transformers": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"elementType": "select",
|
|
||||||
"elementHasInputValue": 1,
|
|
||||||
"elementOptions": [
|
|
||||||
{ "multiple": "true" },
|
|
||||||
{ "readonly": "true" },
|
|
||||||
{ "editable": "true" }
|
|
||||||
],
|
|
||||||
"transformers": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"elementType": "button",
|
|
||||||
"elementOptions": [
|
|
||||||
{ "sourceSuffixes": [] },
|
|
||||||
{ "separator": "" },
|
|
||||||
{ "cssClasses": "col-xs-6" },
|
|
||||||
{ "onClick": "removeAllOptions(this)" },
|
|
||||||
{ "getStringKey": "Gen_Remove_All" }
|
|
||||||
],
|
|
||||||
"transformers": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"elementType": "button",
|
|
||||||
"elementOptions": [
|
|
||||||
{ "sourceSuffixes": [] },
|
|
||||||
{ "separator": "" },
|
|
||||||
{ "cssClasses": "col-xs-6" },
|
|
||||||
{ "onClick": "removeFromList(this)" },
|
|
||||||
{ "getStringKey": "Gen_Remove_Last" }
|
|
||||||
],
|
|
||||||
"transformers": []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"maxLength": 50,
|
|
||||||
"default_value": [
|
|
||||||
"none",
|
|
||||||
"data",
|
|
||||||
"link",
|
|
||||||
"link_new_tab",
|
|
||||||
"show_notes",
|
|
||||||
"delete_dev",
|
|
||||||
"run_plugin"
|
|
||||||
],
|
|
||||||
"options": [],
|
|
||||||
"localized": ["name","description"],
|
|
||||||
"name": [
|
|
||||||
{
|
|
||||||
"language_code": "en_us",
|
|
||||||
"string": "Type"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": [
|
|
||||||
{
|
|
||||||
"language_code": "en_us",
|
|
||||||
"string": "List of property types. The default ones have specific functionality associated with it."
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -397,7 +533,9 @@
|
|||||||
"type": "none",
|
"type": "none",
|
||||||
"default_value": "",
|
"default_value": "",
|
||||||
"options": [],
|
"options": [],
|
||||||
"localized": ["name"],
|
"localized": [
|
||||||
|
"name"
|
||||||
|
],
|
||||||
"name": [
|
"name": [
|
||||||
{
|
{
|
||||||
"language_code": "en_us",
|
"language_code": "en_us",
|
||||||
@@ -413,7 +551,9 @@
|
|||||||
"type": "device_name_mac",
|
"type": "device_name_mac",
|
||||||
"default_value": "",
|
"default_value": "",
|
||||||
"options": [],
|
"options": [],
|
||||||
"localized": ["name"],
|
"localized": [
|
||||||
|
"name"
|
||||||
|
],
|
||||||
"name": [
|
"name": [
|
||||||
{
|
{
|
||||||
"language_code": "en_us",
|
"language_code": "en_us",
|
||||||
@@ -429,7 +569,9 @@
|
|||||||
"type": "device_ip",
|
"type": "device_ip",
|
||||||
"default_value": "",
|
"default_value": "",
|
||||||
"options": [],
|
"options": [],
|
||||||
"localized": ["name"],
|
"localized": [
|
||||||
|
"name"
|
||||||
|
],
|
||||||
"name": [
|
"name": [
|
||||||
{
|
{
|
||||||
"language_code": "en_us",
|
"language_code": "en_us",
|
||||||
@@ -445,7 +587,9 @@
|
|||||||
"type": "label",
|
"type": "label",
|
||||||
"default_value": "",
|
"default_value": "",
|
||||||
"options": [],
|
"options": [],
|
||||||
"localized": ["name"],
|
"localized": [
|
||||||
|
"name"
|
||||||
|
],
|
||||||
"name": [
|
"name": [
|
||||||
{
|
{
|
||||||
"language_code": "en_us",
|
"language_code": "en_us",
|
||||||
@@ -461,7 +605,9 @@
|
|||||||
"type": "label",
|
"type": "label",
|
||||||
"default_value": "",
|
"default_value": "",
|
||||||
"options": [],
|
"options": [],
|
||||||
"localized": ["name"],
|
"localized": [
|
||||||
|
"name"
|
||||||
|
],
|
||||||
"name": [
|
"name": [
|
||||||
{
|
{
|
||||||
"language_code": "en_us",
|
"language_code": "en_us",
|
||||||
@@ -477,7 +623,9 @@
|
|||||||
"type": "label",
|
"type": "label",
|
||||||
"default_value": "",
|
"default_value": "",
|
||||||
"options": [],
|
"options": [],
|
||||||
"localized": ["name"],
|
"localized": [
|
||||||
|
"name"
|
||||||
|
],
|
||||||
"name": [
|
"name": [
|
||||||
{
|
{
|
||||||
"language_code": "en_us",
|
"language_code": "en_us",
|
||||||
@@ -492,7 +640,9 @@
|
|||||||
"type": "label",
|
"type": "label",
|
||||||
"default_value": "",
|
"default_value": "",
|
||||||
"options": [],
|
"options": [],
|
||||||
"localized": ["name"],
|
"localized": [
|
||||||
|
"name"
|
||||||
|
],
|
||||||
"name": [
|
"name": [
|
||||||
{
|
{
|
||||||
"language_code": "en_us",
|
"language_code": "en_us",
|
||||||
@@ -511,7 +661,9 @@
|
|||||||
"type": "label",
|
"type": "label",
|
||||||
"default_value": "",
|
"default_value": "",
|
||||||
"options": [],
|
"options": [],
|
||||||
"localized": ["name"],
|
"localized": [
|
||||||
|
"name"
|
||||||
|
],
|
||||||
"name": [
|
"name": [
|
||||||
{
|
{
|
||||||
"language_code": "en_us",
|
"language_code": "en_us",
|
||||||
@@ -526,7 +678,9 @@
|
|||||||
"type": "label",
|
"type": "label",
|
||||||
"default_value": "",
|
"default_value": "",
|
||||||
"options": [],
|
"options": [],
|
||||||
"localized": ["name"],
|
"localized": [
|
||||||
|
"name"
|
||||||
|
],
|
||||||
"name": [
|
"name": [
|
||||||
{
|
{
|
||||||
"language_code": "en_us",
|
"language_code": "en_us",
|
||||||
@@ -541,7 +695,9 @@
|
|||||||
"type": "label",
|
"type": "label",
|
||||||
"default_value": "",
|
"default_value": "",
|
||||||
"options": [],
|
"options": [],
|
||||||
"localized": ["name"],
|
"localized": [
|
||||||
|
"name"
|
||||||
|
],
|
||||||
"name": [
|
"name": [
|
||||||
{
|
{
|
||||||
"language_code": "en_us",
|
"language_code": "en_us",
|
||||||
@@ -573,7 +729,9 @@
|
|||||||
"replacement": "<div style='text-align:center'><i class='fa-solid fa-question'></i></div>"
|
"replacement": "<div style='text-align:center'><i class='fa-solid fa-question'></i></div>"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"localized": ["name"],
|
"localized": [
|
||||||
|
"name"
|
||||||
|
],
|
||||||
"name": [
|
"name": [
|
||||||
{
|
{
|
||||||
"language_code": "en_us",
|
"language_code": "en_us",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
require 'php/templates/header.php';
|
require 'php/templates/header.php';
|
||||||
require 'php/templates/notification.php';
|
require 'php/templates/modals.php';
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@@ -58,6 +58,12 @@ $settingsJSON_DB = json_encode($settings, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX
|
|||||||
|
|
||||||
<div id="settingsPage" class="content-wrapper">
|
<div id="settingsPage" class="content-wrapper">
|
||||||
|
|
||||||
|
<a style="cursor:pointer">
|
||||||
|
<span>
|
||||||
|
<i id='toggleSettings' onclick="toggleAllSettings()" class="settings-expand-icon fa fa-angle-double-down"></i>
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
|
||||||
<!-- Content header--------------------------------------------------------- -->
|
<!-- Content header--------------------------------------------------------- -->
|
||||||
|
|
||||||
<section class="content-header">
|
<section class="content-header">
|
||||||
@@ -597,7 +603,8 @@ $settingsJSON_DB = json_encode($settings, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX
|
|||||||
customParams,
|
customParams,
|
||||||
customId,
|
customId,
|
||||||
columns,
|
columns,
|
||||||
base64Regex
|
base64Regex,
|
||||||
|
elementOptionsBase64
|
||||||
} = handleElementOptions('none', elementOptions, transformers, val = "");
|
} = handleElementOptions('none', elementOptions, transformers, val = "");
|
||||||
|
|
||||||
let value;
|
let value;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
require 'php/templates/header.php';
|
require 'php/templates/header.php';
|
||||||
?>
|
?>
|
||||||
<?php require 'php/templates/notification.php'; ?>
|
<?php require 'php/templates/modals.php'; ?>
|
||||||
<!-- ----------------------------------------------------------------------- -->
|
<!-- ----------------------------------------------------------------------- -->
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
require 'php/templates/header.php';
|
require 'php/templates/header.php';
|
||||||
require 'php/templates/notification.php';
|
require 'php/templates/modals.php';
|
||||||
?>
|
?>
|
||||||
<!-- ----------------------------------------------------------------------- -->
|
<!-- ----------------------------------------------------------------------- -->
|
||||||
|
|
||||||
|
|||||||
@@ -275,6 +275,15 @@ def importConfigs (db, all_plugins):
|
|||||||
# Save the user defined value into the object
|
# Save the user defined value into the object
|
||||||
set["value"] = v
|
set["value"] = v
|
||||||
|
|
||||||
|
# Now check for popupForm inside elements → elementOptions
|
||||||
|
elements = set.get("type", {}).get("elements", [])
|
||||||
|
for element in elements:
|
||||||
|
for option in element.get("elementOptions", []):
|
||||||
|
if "popupForm" in option:
|
||||||
|
for popup_entry in option["popupForm"]:
|
||||||
|
popup_pref = key + "_popupform_" + popup_entry.get("function", "")
|
||||||
|
stringSqlParams = collect_lang_strings(popup_entry, popup_pref, stringSqlParams)
|
||||||
|
|
||||||
# Collect settings related language strings
|
# Collect settings related language strings
|
||||||
# Creates an entry with key, for example ARPSCAN_CMD_name
|
# Creates an entry with key, for example ARPSCAN_CMD_name
|
||||||
stringSqlParams = collect_lang_strings(set, pref + "_" + set["function"], stringSqlParams)
|
stringSqlParams = collect_lang_strings(set, pref + "_" + set["function"], stringSqlParams)
|
||||||
|
|||||||
Reference in New Issue
Block a user