${input}
-
+
diff --git a/front/php/server/devices.php b/front/php/server/devices.php
index aec85214..5d81f6d0 100755
--- a/front/php/server/devices.php
+++ b/front/php/server/devices.php
@@ -37,6 +37,7 @@
case 'deleteEvents30': deleteEvents30(); break;
case 'deleteActHistory': deleteActHistory(); break;
case 'deleteDeviceEvents': deleteDeviceEvents(); break;
+ case 'resetDeviceProps': resetDeviceProps(); break;
case 'PiaBackupDBtoArchive': PiaBackupDBtoArchive(); break;
case 'PiaRestoreDBfromArchive': PiaRestoreDBfromArchive(); break;
case 'PiaPurgeDBBackups': PiaPurgeDBBackups(); break;
@@ -105,6 +106,7 @@ function getServerDeviceData() {
"devSSID" => "",
"devSyncHubNode" => "",
"devSourcePlugin" => "",
+ "devCustomProps" => "",
"devStatus" => "Unknown",
"devIsRandomMAC" => false,
"devSessions" => 0,
@@ -190,129 +192,131 @@ function setDeviceData() {
global $db;
// Sanitize input
- $mac = quotes($_REQUEST['mac']);
- $name = quotes($_REQUEST['name']);
- $owner = quotes($_REQUEST['owner']);
- $type = quotes($_REQUEST['type']);
- $vendor = quotes($_REQUEST['vendor']);
- $icon = quotes($_REQUEST['icon']);
- $favorite = quotes($_REQUEST['favorite']);
- $group = quotes($_REQUEST['group']);
- $location = quotes($_REQUEST['location']);
- $comments = quotes($_REQUEST['comments']);
- $parentMac = quotes($_REQUEST['networknode']);
- $parentPort = quotes($_REQUEST['networknodeport']);
- $ssid = quotes($_REQUEST['ssid']);
- $site = quotes($_REQUEST['networksite']);
- $staticIP = quotes($_REQUEST['staticIP']);
- $scancycle = quotes($_REQUEST['scancycle']);
- $alertevents = quotes($_REQUEST['alertevents']);
- $alertdown = quotes($_REQUEST['alertdown']);
- $skiprepeated = quotes($_REQUEST['skiprepeated']);
- $newdevice = quotes($_REQUEST['newdevice']);
- $archived = quotes($_REQUEST['archived']);
- $devFirstConnection = quotes($_REQUEST['devFirstConnection']);
- $devLastConnection = quotes($_REQUEST['devLastConnection']);
- $ip = quotes($_REQUEST['ip']);
- $createNew = quotes($_REQUEST['createNew']);
+ $mac = quotes($_POST['mac']);
+ $name = urldecode(quotes($_POST['name']));
+ $owner = urldecode(quotes($_POST['owner']));
+ $type = urldecode(quotes($_POST['type']));
+ $vendor = urldecode(quotes($_POST['vendor']));
+ $icon = urldecode(quotes($_POST['icon']));
+ $favorite = quotes($_POST['favorite']);
+ $group = urldecode(quotes($_POST['group']));
+ $location = urldecode(quotes($_POST['location']));
+ $comments = urldecode(quotes($_POST['comments']));
+ $parentMac = quotes($_POST['networknode']);
+ $parentPort = quotes($_POST['networknodeport']);
+ $ssid = urldecode(quotes($_POST['ssid']));
+ $site = quotes($_POST['networksite']);
+ $staticIP = quotes($_POST['staticIP']);
+ $scancycle = quotes($_POST['scancycle']);
+ $alertevents = quotes($_POST['alertevents']);
+ $alertdown = quotes($_POST['alertdown']);
+ $skiprepeated = quotes($_POST['skiprepeated']);
+ $newdevice = quotes($_POST['newdevice']);
+ $archived = quotes($_POST['archived']);
+ $devFirstConnection = quotes($_POST['devFirstConnection']);
+ $devLastConnection = quotes($_POST['devLastConnection']);
+ $ip = quotes($_POST['ip']);
+ $devCustomProps = quotes($_POST['devCustomProps']);
+ $createNew = quotes($_POST['createNew']);
$devNewGuid = generateGUID();
- // an update
- if ($_REQUEST['createNew'] == 0)
- {
- // UPDATE SQL query
- $sql = "UPDATE Devices SET
- devName = '$name',
- devOwner = '$owner',
- devType = '$type',
- devVendor = '$vendor',
- devIcon = '$icon',
- devFavorite = '$favorite',
- devGroup = '$group',
- devLocation = '$location',
- devComments = '$comments',
- devParentMAC = '$parentMac',
- devParentPort = '$parentPort',
- devSSID = '$ssid',
- devSite = '$site',
- devStaticIP = '$staticIP',
- devScan = '$scancycle',
- devAlertEvents = '$alertevents',
- devAlertDown = '$alertdown',
- devSkipRepeated = '$skiprepeated',
- devIsNew = '$newdevice',
- devIsArchived = '$archived'
- WHERE devMac = '$mac'";
- } else // an INSERT
- {
- $sql = "INSERT INTO Devices (
- devMac,
- devName,
- devOwner,
- devType,
- devVendor,
- devIcon,
- devFavorite,
- devGroup,
- devLocation,
- devComments,
- devParentMAC,
- devParentPort,
- devSSID,
- devSite,
- devStaticIP,
- devScan,
- devAlertEvents,
- devAlertDown,
- devSkipRepeated,
- devIsNew,
- devIsArchived,
- devLastConnection,
- devFirstConnection,
- devLastIP,
- devGUID
- ) VALUES (
- '$mac',
- '$name',
- '$owner',
- '$type',
- '$vendor',
- '$icon',
- '$favorite',
- '$group',
- '$location',
- '$comments',
- '$parentMac',
- '$parentPort',
- '$ssid',
- '$site',
- '$staticIP',
- '$scancycle',
- '$alertevents',
- '$alertdown',
- '$skiprepeated',
- '$newdevice',
- '$archived',
- '$devLastConnection',
- '$devFirstConnection',
- '$ip',
- '$devNewGuid'
- )
- ";
+ // An update
+ if ($_POST['createNew'] == 0) {
+ // UPDATE SQL query
+ $sql = "UPDATE Devices SET
+ devName = '$name',
+ devOwner = '$owner',
+ devType = '$type',
+ devVendor = '$vendor',
+ devIcon = '$icon',
+ devFavorite = '$favorite',
+ devGroup = '$group',
+ devLocation = '$location',
+ devComments = '$comments',
+ devParentMAC = '$parentMac',
+ devParentPort = '$parentPort',
+ devSSID = '$ssid',
+ devSite = '$site',
+ devStaticIP = '$staticIP',
+ devScan = '$scancycle',
+ devAlertEvents = '$alertevents',
+ devAlertDown = '$alertdown',
+ devSkipRepeated = '$skiprepeated',
+ devIsNew = '$newdevice',
+ devIsArchived = '$archived',
+ devCustomProps = '$devCustomProps'
+ WHERE devMac = '$mac'";
+ } else { // An INSERT
+ $sql = "INSERT INTO Devices (
+ devMac,
+ devName,
+ devOwner,
+ devType,
+ devVendor,
+ devIcon,
+ devFavorite,
+ devGroup,
+ devLocation,
+ devComments,
+ devParentMAC,
+ devParentPort,
+ devSSID,
+ devSite,
+ devStaticIP,
+ devScan,
+ devAlertEvents,
+ devAlertDown,
+ devSkipRepeated,
+ devIsNew,
+ devIsArchived,
+ devLastConnection,
+ devFirstConnection,
+ devLastIP,
+ devGUID,
+ devCustomProps
+ ) VALUES (
+ '$mac',
+ '$name',
+ '$owner',
+ '$type',
+ '$vendor',
+ '$icon',
+ '$favorite',
+ '$group',
+ '$location',
+ '$comments',
+ '$parentMac',
+ '$parentPort',
+ '$ssid',
+ '$site',
+ '$staticIP',
+ '$scancycle',
+ '$alertevents',
+ '$alertdown',
+ '$skiprepeated',
+ '$newdevice',
+ '$archived',
+ '$devLastConnection',
+ '$devFirstConnection',
+ '$ip',
+ '$devNewGuid',
+ '$devCustomProps'
+ )";
}
- // update Data
+ // Execute the query
$result = $db->query($sql);
- // check result
+ // Check the result
if ($result == TRUE) {
- echo lang('BackDevices_DBTools_UpdDev');
+ echo lang('BackDevices_DBTools_UpdDev');
} else {
- echo lang('BackDevices_DBTools_UpdDevError')."\n\n$sql \n\n". $db->lastErrorMsg();
+ echo lang('BackDevices_DBTools_UpdDevError')."\n\n$sql \n\n". $db->lastErrorMsg();
}
}
+
//------------------------------------------------------------------------------
// Delete Device
//------------------------------------------------------------------------------
@@ -389,6 +393,26 @@ function deleteDeviceEvents() {
}
}
+//------------------------------------------------------------------------------
+// Delete Device Properties
+//------------------------------------------------------------------------------
+function resetDeviceProps() {
+ global $db;
+
+ // sql
+ $sql = 'UPDATE Devices set devCustomProps = "'.getSettingValue("NEWDEV_devCustomProps").'" WHERE devMac="' . $_REQUEST['mac'] .'"';
+
+ // execute sql
+ $result = $db->query($sql);
+
+ // check result
+ if ($result == TRUE) {
+ echo lang('Gen_Okay');
+ } else {
+ echo lang('Gen_Error')."\n\n$sql \n\n". $db->lastErrorMsg();
+ }
+}
+
//------------------------------------------------------------------------------
// Delete all devices
//------------------------------------------------------------------------------
diff --git a/front/php/server/util.php b/front/php/server/util.php
index 9b17c818..0adc7538 100755
--- a/front/php/server/util.php
+++ b/front/php/server/util.php
@@ -356,6 +356,8 @@ function saveSettings()
$txt .= $setKey . "='" . $val . "'\n";
} elseif ($dataType == 'integer') {
$txt .= $setKey . "=" . $settingValue . "\n";
+ } elseif ($dataType == 'none') {
+ $txt .= $setKey . "=''\n";
} elseif ($dataType == 'json') {
$txt .= $setKey . "=" . $settingValue . "\n";
} elseif ($dataType == 'boolean') {
@@ -551,6 +553,7 @@ function decodeSpecialChars($str) {
// -------------------------------------------------------------------------------------------
+// used in Export CSV
function getDevicesColumns(){
$columns = ["devMac",
@@ -582,7 +585,8 @@ function getDevicesColumns(){
"devSyncHubNode",
"devSite",
"devSSID",
- "devSourcePlugin"
+ "devSourcePlugin",
+ "devCustomProps"
];
return $columns;
diff --git a/front/php/templates/header.php b/front/php/templates/header.php
index ba5f18fa..98b13d49 100755
--- a/front/php/templates/header.php
+++ b/front/php/templates/header.php
@@ -48,6 +48,7 @@
+
diff --git a/front/php/templates/language/ar_ar.json b/front/php/templates/language/ar_ar.json
index c1c6c0c3..d6afdbd8 100755
--- a/front/php/templates/language/ar_ar.json
+++ b/front/php/templates/language/ar_ar.json
@@ -60,12 +60,15 @@
"BackDevices_darkmode_enabled": "",
"CLEAR_NEW_FLAG_description": "",
"CLEAR_NEW_FLAG_name": "",
+ "CustProps_cant_remove": "",
"DAYS_TO_KEEP_EVENTS_description": "",
"DAYS_TO_KEEP_EVENTS_name": "",
"DISCOVER_PLUGINS_description": "",
"DISCOVER_PLUGINS_name": "",
"DevDetail_Copy_Device_Title": "",
"DevDetail_Copy_Device_Tooltip": "",
+ "DevDetail_CustomProperties_Title": "",
+ "DevDetail_CustomProps_reset_info": "",
"DevDetail_DisplayFields_Title": "",
"DevDetail_EveandAl_AlertAllEvents": "",
"DevDetail_EveandAl_AlertDown": "",
@@ -205,6 +208,7 @@
"Device_Shortcut_OnlineChart": "",
"Device_TableHead_AlertDown": "",
"Device_TableHead_Connected_Devices": "",
+ "Device_TableHead_CustomProps": "",
"Device_TableHead_Favorite": "",
"Device_TableHead_FirstSession": "",
"Device_TableHead_GUID": "",
@@ -305,6 +309,7 @@
"Gen_ReadDocs": "",
"Gen_Remove_All": "",
"Gen_Remove_Last": "",
+ "Gen_Reset": "",
"Gen_Restore": "",
"Gen_Run": "",
"Gen_Save": "",
diff --git a/front/php/templates/language/ca_ca.json b/front/php/templates/language/ca_ca.json
index 264d615e..eabd88ab 100755
--- a/front/php/templates/language/ca_ca.json
+++ b/front/php/templates/language/ca_ca.json
@@ -60,12 +60,15 @@
"BackDevices_darkmode_enabled": "Mode fosc Activat",
"CLEAR_NEW_FLAG_description": "Si està habilitat (
0 està desactivat), els dispositius marcats com
Nou dispositiu es desmarcaran si el temps límit (especificat en hores) supera
Primera sessió.",
"CLEAR_NEW_FLAG_name": "Netejar indicador de nou",
+ "CustProps_cant_remove": "",
"DAYS_TO_KEEP_EVENTS_description": "Això és una configuració de manteniment. Especifica el nombre de dies que es conservaran els esdeveniments. Els esdeveniments antics s'esborraran periòdicament. També aplica als esdeveniments dels Connectors (Plugins).",
"DAYS_TO_KEEP_EVENTS_name": "Esborrar esdeveniments més vells de",
"DISCOVER_PLUGINS_description": "Desactiva aquesta opció per accelerar la inicialització i l'estalvi de configuració. Quan està desactivat, els connectors no es descobreixen, i no podeu afegir nous connectors a la configuració
LOADED_PLUGINS.",
"DISCOVER_PLUGINS_name": "Descobreix els plugins",
"DevDetail_Copy_Device_Title": "
Copiar detalls des del dispositiu",
"DevDetail_Copy_Device_Tooltip": "Copiar detalls del dispositius des de la llista desplegable. Tot el d'aquesta pàgina es sobre-escriurà",
+ "DevDetail_CustomProperties_Title": "",
+ "DevDetail_CustomProps_reset_info": "",
"DevDetail_DisplayFields_Title": "Pantalla",
"DevDetail_EveandAl_AlertAllEvents": "Alertes",
"DevDetail_EveandAl_AlertDown": "Cancel·lar alerta",
@@ -205,6 +208,7 @@
"Device_Shortcut_OnlineChart": "Presència de dispositius",
"Device_TableHead_AlertDown": "Cancel·lar alerta",
"Device_TableHead_Connected_Devices": "Connexions",
+ "Device_TableHead_CustomProps": "",
"Device_TableHead_Favorite": "Favorit",
"Device_TableHead_FirstSession": "Primera Sessió",
"Device_TableHead_GUID": "GUID",
@@ -305,6 +309,7 @@
"Gen_ReadDocs": "Llegit més dins el docs.",
"Gen_Remove_All": "Esborra tot",
"Gen_Remove_Last": "Esborra el darrer",
+ "Gen_Reset": "",
"Gen_Restore": "Executar Restaurar",
"Gen_Run": "Executar",
"Gen_Save": "Guardar",
diff --git a/front/php/templates/language/cs_cz.json b/front/php/templates/language/cs_cz.json
index c1c6c0c3..d6afdbd8 100755
--- a/front/php/templates/language/cs_cz.json
+++ b/front/php/templates/language/cs_cz.json
@@ -60,12 +60,15 @@
"BackDevices_darkmode_enabled": "",
"CLEAR_NEW_FLAG_description": "",
"CLEAR_NEW_FLAG_name": "",
+ "CustProps_cant_remove": "",
"DAYS_TO_KEEP_EVENTS_description": "",
"DAYS_TO_KEEP_EVENTS_name": "",
"DISCOVER_PLUGINS_description": "",
"DISCOVER_PLUGINS_name": "",
"DevDetail_Copy_Device_Title": "",
"DevDetail_Copy_Device_Tooltip": "",
+ "DevDetail_CustomProperties_Title": "",
+ "DevDetail_CustomProps_reset_info": "",
"DevDetail_DisplayFields_Title": "",
"DevDetail_EveandAl_AlertAllEvents": "",
"DevDetail_EveandAl_AlertDown": "",
@@ -205,6 +208,7 @@
"Device_Shortcut_OnlineChart": "",
"Device_TableHead_AlertDown": "",
"Device_TableHead_Connected_Devices": "",
+ "Device_TableHead_CustomProps": "",
"Device_TableHead_Favorite": "",
"Device_TableHead_FirstSession": "",
"Device_TableHead_GUID": "",
@@ -305,6 +309,7 @@
"Gen_ReadDocs": "",
"Gen_Remove_All": "",
"Gen_Remove_Last": "",
+ "Gen_Reset": "",
"Gen_Restore": "",
"Gen_Run": "",
"Gen_Save": "",
diff --git a/front/php/templates/language/de_de.json b/front/php/templates/language/de_de.json
index 56154e3a..9ff1b97c 100755
--- a/front/php/templates/language/de_de.json
+++ b/front/php/templates/language/de_de.json
@@ -72,12 +72,15 @@
"BackDevices_darkmode_enabled": "Dunkler Modus aktiviert",
"CLEAR_NEW_FLAG_description": "Wenn aktiviert (
0 bedeutet deaktiviert), werden Geräte, die als
Neues Gerät gekennzeichnet sind, wieder freigegeben, wenn das Zeitlimit (in Stunden) die Zeit ihrer
Ersten Sitzung überschreitet.",
"CLEAR_NEW_FLAG_name": "Neues Flag löschen",
+ "CustProps_cant_remove": "",
"DAYS_TO_KEEP_EVENTS_description": "Dies ist eine Wartungseinstellung. Spezifiziert wie viele Tage Events gespeichert bleiben. Alle älteren Events werden periodisch gelöscht. Wird auch auf die Plugins History angewendet.",
"DAYS_TO_KEEP_EVENTS_name": "Ereignisse löschen, die älter sind als",
"DISCOVER_PLUGINS_description": "",
"DISCOVER_PLUGINS_name": "",
"DevDetail_Copy_Device_Title": "Details von Gerät kopieren",
"DevDetail_Copy_Device_Tooltip": "Details vom Gerät aus der Dropdown-Liste kopieren. Alles auf dieser Seite wird überschrieben",
+ "DevDetail_CustomProperties_Title": "",
+ "DevDetail_CustomProps_reset_info": "",
"DevDetail_DisplayFields_Title": "Anzeige",
"DevDetail_EveandAl_AlertAllEvents": "Alarmereignisse",
"DevDetail_EveandAl_AlertDown": "Melde Down",
@@ -217,6 +220,7 @@
"Device_Shortcut_OnlineChart": "Gerätepräsenz im Laufe der Zeit",
"Device_TableHead_AlertDown": "",
"Device_TableHead_Connected_Devices": "Verbindungen",
+ "Device_TableHead_CustomProps": "",
"Device_TableHead_Favorite": "Favorit",
"Device_TableHead_FirstSession": "Erste Sitzung",
"Device_TableHead_GUID": "GUID",
@@ -317,6 +321,7 @@
"Gen_ReadDocs": "Mehr in der Dokumentation.",
"Gen_Remove_All": "Alle entfernen",
"Gen_Remove_Last": "Letzte entfernen",
+ "Gen_Reset": "",
"Gen_Restore": "Wiederherstellen",
"Gen_Run": "Ausführen",
"Gen_Save": "Speichern",
diff --git a/front/php/templates/language/en_us.json b/front/php/templates/language/en_us.json
index 34ef7988..9245b248 100755
--- a/front/php/templates/language/en_us.json
+++ b/front/php/templates/language/en_us.json
@@ -60,12 +60,15 @@
"BackDevices_darkmode_enabled": "Darkmode Enabled",
"CLEAR_NEW_FLAG_description": "If enabled (
0 is disabled), devices flagged as
New Device will be unflagged if the time limit (specified in hours) exceeds their
First Session time.",
"CLEAR_NEW_FLAG_name": "Clear new flag",
+ "CustProps_cant_remove": "Can't remove, at least one property is needed.",
"DAYS_TO_KEEP_EVENTS_description": "This is a maintenance setting. This specifies the number of days worth of event entries that will be kept. All older events will be deleted periodically. Also applies on Plugin Events History.",
"DAYS_TO_KEEP_EVENTS_name": "Delete events older than",
"DISCOVER_PLUGINS_description": "Disable this option to speed up initialization and settings saving. When disabled, plugins are not discovered, and you cannot add new plugins to the
LOADED_PLUGINS setting.",
"DISCOVER_PLUGINS_name": "Discover plugins",
"DevDetail_Copy_Device_Title": "Copy details from device",
"DevDetail_Copy_Device_Tooltip": "Copy details from device from the dropdown list. Everything on this page will be overwritten",
+ "DevDetail_CustomProperties_Title": "Custom Properties",
+ "DevDetail_CustomProps_reset_info": "This will remove your custom properties on this device and reset them to the default value.",
"DevDetail_DisplayFields_Title": "Display",
"DevDetail_EveandAl_AlertAllEvents": "Alert Events",
"DevDetail_EveandAl_AlertDown": "Alert Down",
@@ -205,6 +208,7 @@
"Device_Shortcut_OnlineChart": "Device presence",
"Device_TableHead_AlertDown": "Alert Down",
"Device_TableHead_Connected_Devices": "Connections",
+ "Device_TableHead_CustomProps": "Props / Actions",
"Device_TableHead_Favorite": "Favorite",
"Device_TableHead_FirstSession": "First Session",
"Device_TableHead_GUID": "GUID",
@@ -305,6 +309,7 @@
"Gen_ReadDocs": "Read more in the docs.",
"Gen_Remove_All": "Remove all",
"Gen_Remove_Last": "Remove last",
+ "Gen_Reset": "Reset",
"Gen_Restore": "Run Restore",
"Gen_Run": "Run",
"Gen_Save": "Save",
diff --git a/front/php/templates/language/es_es.json b/front/php/templates/language/es_es.json
index 9e1e5ced..ac434464 100755
--- a/front/php/templates/language/es_es.json
+++ b/front/php/templates/language/es_es.json
@@ -70,12 +70,15 @@
"BackDevices_darkmode_enabled": "Darkmode Activado",
"CLEAR_NEW_FLAG_description": "Si está habilitado (
0 está desactivado), los dispositivos marcados como
Nuevo dispositivo se desmarcarán si el límite de tiempo (especificado en horas) excede su tiempo de
primera sesión.",
"CLEAR_NEW_FLAG_name": "Eliminar la nueva bandera",
+ "CustProps_cant_remove": "",
"DAYS_TO_KEEP_EVENTS_description": "Esta es una configuración de mantenimiento. Esto especifica el número de días de entradas de eventos que se guardarán. Todos los eventos anteriores se eliminarán periódicamente.",
"DAYS_TO_KEEP_EVENTS_name": "Eliminar eventos anteriores a",
"DISCOVER_PLUGINS_description": "",
"DISCOVER_PLUGINS_name": "",
"DevDetail_Copy_Device_Title": "Copiar detalles del dispositivo",
"DevDetail_Copy_Device_Tooltip": "Copiar detalles del dispositivo de la lista desplegable. Todo en esta página se sobrescribirá",
+ "DevDetail_CustomProperties_Title": "",
+ "DevDetail_CustomProps_reset_info": "",
"DevDetail_DisplayFields_Title": "Mostrar",
"DevDetail_EveandAl_AlertAllEvents": "Notificaciones de eventos",
"DevDetail_EveandAl_AlertDown": "Alerta de caída",
@@ -215,6 +218,7 @@
"Device_Shortcut_OnlineChart": "Presencia del dispositivo a lo largo del tiempo",
"Device_TableHead_AlertDown": "Alerta desactivada",
"Device_TableHead_Connected_Devices": "Conexiones",
+ "Device_TableHead_CustomProps": "",
"Device_TableHead_Favorite": "Favorito",
"Device_TableHead_FirstSession": "1ra. sesión",
"Device_TableHead_GUID": "GUID",
@@ -315,6 +319,7 @@
"Gen_ReadDocs": "Lee más en los documentos.",
"Gen_Remove_All": "Quitar todo",
"Gen_Remove_Last": "Quitar el último",
+ "Gen_Reset": "",
"Gen_Restore": "Ejecutar restauración",
"Gen_Run": "Ejecutar",
"Gen_Save": "Guardar",
diff --git a/front/php/templates/language/fr_fr.json b/front/php/templates/language/fr_fr.json
index 776520f7..e0d08a7c 100755
--- a/front/php/templates/language/fr_fr.json
+++ b/front/php/templates/language/fr_fr.json
@@ -60,12 +60,15 @@
"BackDevices_darkmode_enabled": "Mode sombre activé",
"CLEAR_NEW_FLAG_description": "Si activé (
0 est désactivé), les appareils marqués comme
Nouvel appareil seront démarqués si la limite de temps (spécifiée en heures) dépasse la durée de
Première Session.",
"CLEAR_NEW_FLAG_name": "Supprime le nouveau drapeau",
+ "CustProps_cant_remove": "",
"DAYS_TO_KEEP_EVENTS_description": "Il s'agit d'un paramètre de maintenance. Il indique le nombre de jours pendant lesquels les entrées d'événements seront conservées. Tous les événements plus anciens seront supprimés périodiquement. S'applique également à l'historique des événements du plugin.",
"DAYS_TO_KEEP_EVENTS_name": "Supprimer les événements plus anciens que",
"DISCOVER_PLUGINS_description": "",
"DISCOVER_PLUGINS_name": "",
"DevDetail_Copy_Device_Title": "Copier les détails de l'appareil",
"DevDetail_Copy_Device_Tooltip": "Copier les détails de l'appareil dans la liste déroulante. Tout ce qui se trouve sur cette page sera remplacé",
+ "DevDetail_CustomProperties_Title": "",
+ "DevDetail_CustomProps_reset_info": "",
"DevDetail_DisplayFields_Title": "Afficher",
"DevDetail_EveandAl_AlertAllEvents": "Alerter les événements",
"DevDetail_EveandAl_AlertDown": "Alerte de panne",
@@ -205,6 +208,7 @@
"Device_Shortcut_OnlineChart": "Présence de l'appareil",
"Device_TableHead_AlertDown": "Alerter si En panne",
"Device_TableHead_Connected_Devices": "Connexions",
+ "Device_TableHead_CustomProps": "",
"Device_TableHead_Favorite": "Favori",
"Device_TableHead_FirstSession": "Première session",
"Device_TableHead_GUID": "GUID",
@@ -305,6 +309,7 @@
"Gen_ReadDocs": "Plus d'infos dans la documentation.",
"Gen_Remove_All": "Enlever tous",
"Gen_Remove_Last": "Enlever le dernier",
+ "Gen_Reset": "",
"Gen_Restore": "Lancer une restauration",
"Gen_Run": "Lancer",
"Gen_Save": "Enregistrer",
diff --git a/front/php/templates/language/it_it.json b/front/php/templates/language/it_it.json
index d7dae5e6..37f78f9a 100755
--- a/front/php/templates/language/it_it.json
+++ b/front/php/templates/language/it_it.json
@@ -60,12 +60,15 @@
"BackDevices_darkmode_enabled": "Modalità scura abilitata",
"CLEAR_NEW_FLAG_description": "Se abilitato (
0 è disabilitato), i dispositivi contrassegnati come
Nuovo dispositivo verranno deselezionati se il limite di tempo (specificato in ore) supera il tempo della
Prima sessione.",
"CLEAR_NEW_FLAG_name": "Cancella nuova bandiera",
+ "CustProps_cant_remove": "",
"DAYS_TO_KEEP_EVENTS_description": "Questa è un'impostazione di manutenzione. Specifica il numero di giorni delle voci degli eventi che verranno conservati. Tutti gli eventi più vecchi verranno eliminati periodicamente. Si applica anche alla cronologia degli eventi del plugin (Plugin Events History).",
"DAYS_TO_KEEP_EVENTS_name": "Elimina eventi più vecchi di",
"DISCOVER_PLUGINS_description": "Disattiva questa opzione per velocizzare l'inizializzazione e il salvataggio delle impostazioni. Quando è disattivata, i plugin non vengono scoperti e non puoi aggiungere nuovi plugin all'impostazione
LOADED_PLUGINS.",
"DISCOVER_PLUGINS_name": "Scopri i plugin",
"DevDetail_Copy_Device_Title": "Copia dettagli dal dispositivo",
"DevDetail_Copy_Device_Tooltip": "Copia i dettagli dal dispositivo dall'elenco a discesa. Tutto in questa pagina verrà sovrascritto",
+ "DevDetail_CustomProperties_Title": "",
+ "DevDetail_CustomProps_reset_info": "",
"DevDetail_DisplayFields_Title": "Visualizza",
"DevDetail_EveandAl_AlertAllEvents": "Notifica eventi",
"DevDetail_EveandAl_AlertDown": "Avviso disconnessione",
@@ -205,6 +208,7 @@
"Device_Shortcut_OnlineChart": "Presenza dispositivo",
"Device_TableHead_AlertDown": "Avviso disconnessione",
"Device_TableHead_Connected_Devices": "Connessioni",
+ "Device_TableHead_CustomProps": "",
"Device_TableHead_Favorite": "Preferito",
"Device_TableHead_FirstSession": "Prima sessione",
"Device_TableHead_GUID": "GUID",
@@ -305,6 +309,7 @@
"Gen_ReadDocs": "Maggiori informazioni nella documentazione.",
"Gen_Remove_All": "Rimuovi tutti",
"Gen_Remove_Last": "Rimuovi ultimo",
+ "Gen_Reset": "",
"Gen_Restore": "Esegui ripristino",
"Gen_Run": "Esegui",
"Gen_Save": "Salva",
diff --git a/front/php/templates/language/nb_no.json b/front/php/templates/language/nb_no.json
index 2623e1bb..fdb0049d 100755
--- a/front/php/templates/language/nb_no.json
+++ b/front/php/templates/language/nb_no.json
@@ -60,12 +60,15 @@
"BackDevices_darkmode_enabled": "Mørk modus Aktivert",
"CLEAR_NEW_FLAG_description": "",
"CLEAR_NEW_FLAG_name": "",
+ "CustProps_cant_remove": "",
"DAYS_TO_KEEP_EVENTS_description": "Dette er en vedlikeholdsinnstilling. Dette spesifiserer antall dager verdt med hendelsesoppføringer som vil beholdes. Alle eldre hendelser vil bli slettet med jevne mellomrom. Gjelder også for plugin-hendelseshistorikk.",
"DAYS_TO_KEEP_EVENTS_name": "Slett hendelser eldre enn",
"DISCOVER_PLUGINS_description": "",
"DISCOVER_PLUGINS_name": "",
"DevDetail_Copy_Device_Title": "
Kopier detaljer fra enhet",
"DevDetail_Copy_Device_Tooltip": "Kopier detaljer fra enheten via nedtrekks menyen. Alt på denne siden vil bli overskrevet",
+ "DevDetail_CustomProperties_Title": "",
+ "DevDetail_CustomProps_reset_info": "",
"DevDetail_DisplayFields_Title": "",
"DevDetail_EveandAl_AlertAllEvents": "Varsel Alle Hendelser",
"DevDetail_EveandAl_AlertDown": "Varsel Nede",
@@ -205,6 +208,7 @@
"Device_Shortcut_OnlineChart": "Enhetens tilstedeværelse",
"Device_TableHead_AlertDown": "",
"Device_TableHead_Connected_Devices": "Tilkoblinger",
+ "Device_TableHead_CustomProps": "",
"Device_TableHead_Favorite": "Favoritt",
"Device_TableHead_FirstSession": "Første Økt",
"Device_TableHead_GUID": "GUID",
@@ -305,6 +309,7 @@
"Gen_ReadDocs": "Les mer i dokumentasjonen.",
"Gen_Remove_All": "Fjern alle",
"Gen_Remove_Last": "Fjern sist",
+ "Gen_Reset": "",
"Gen_Restore": "Kjør Gjenopprett",
"Gen_Run": "Kjør",
"Gen_Save": "Lagre",
diff --git a/front/php/templates/language/pl_pl.json b/front/php/templates/language/pl_pl.json
index 1f9004b5..88ceee45 100755
--- a/front/php/templates/language/pl_pl.json
+++ b/front/php/templates/language/pl_pl.json
@@ -60,12 +60,15 @@
"BackDevices_darkmode_enabled": "Tryb ciemny Włączony",
"CLEAR_NEW_FLAG_description": "",
"CLEAR_NEW_FLAG_name": "",
+ "CustProps_cant_remove": "",
"DAYS_TO_KEEP_EVENTS_description": "To jest ustawienie konserwacji. Określa ile dni mają być utrzymywane wpisy wydarzeń. Wszystkie starsze wpisy wydarzeń zostaną usunięte okresowo. Dotyczy także Historii Wydarzeń Pluginów.",
"DAYS_TO_KEEP_EVENTS_name": "Usuń wydarzenia starsze niż",
"DISCOVER_PLUGINS_description": "",
"DISCOVER_PLUGINS_name": "",
"DevDetail_Copy_Device_Title": "
Kopiuj opis z urządzenia",
"DevDetail_Copy_Device_Tooltip": "Kopiuj opis z urządzenia z listy rozwijanej. Wszystko na tej stronie zostanie nadpisane",
+ "DevDetail_CustomProperties_Title": "",
+ "DevDetail_CustomProps_reset_info": "",
"DevDetail_DisplayFields_Title": "",
"DevDetail_EveandAl_AlertAllEvents": "Powiadamiaj o wszystkich wydarzeniach",
"DevDetail_EveandAl_AlertDown": "Wyłącz powiadomienia",
@@ -205,6 +208,7 @@
"Device_Shortcut_OnlineChart": "Obecność urządzenia",
"Device_TableHead_AlertDown": "",
"Device_TableHead_Connected_Devices": "Połączenia",
+ "Device_TableHead_CustomProps": "",
"Device_TableHead_Favorite": "Ulubione",
"Device_TableHead_FirstSession": "Pierwsza Sesja",
"Device_TableHead_GUID": "GUID",
@@ -305,6 +309,7 @@
"Gen_ReadDocs": "Przeczytaj więcej w dokumentacji.",
"Gen_Remove_All": "Usuń wszystko",
"Gen_Remove_Last": "Usuń ostatnie",
+ "Gen_Reset": "",
"Gen_Restore": "Wykonaj Przywracanie",
"Gen_Run": "Wykonaj",
"Gen_Save": "Zapisz",
diff --git a/front/php/templates/language/pt_br.json b/front/php/templates/language/pt_br.json
index a42489a0..072d5dfa 100755
--- a/front/php/templates/language/pt_br.json
+++ b/front/php/templates/language/pt_br.json
@@ -60,12 +60,15 @@
"BackDevices_darkmode_enabled": "Modo Noturno Habilitado",
"CLEAR_NEW_FLAG_description": "Se habilitado (
0 está desativado), dispositivos marcados como
Novo Dispositivo serão desmarcados se o limite (especificado em horas) exceder o tempo da
Primeira Sessão .",
"CLEAR_NEW_FLAG_name": "",
+ "CustProps_cant_remove": "",
"DAYS_TO_KEEP_EVENTS_description": "Esta é uma definição de manutenção. Especifica o número de dias de entradas de eventos que serão mantidas. Todos os eventos mais antigos serão eliminados periodicamente. Também se aplica ao Histórico de eventos do plug-in.",
"DAYS_TO_KEEP_EVENTS_name": "Excluir eventos mais antigos que",
"DISCOVER_PLUGINS_description": "",
"DISCOVER_PLUGINS_name": "",
"DevDetail_Copy_Device_Title": "
Copiar detalhes do dispositivo",
"DevDetail_Copy_Device_Tooltip": "Copiar detalhes do dispositivo a partir da lista pendente. Tudo o que se encontra nesta página será substituído",
+ "DevDetail_CustomProperties_Title": "",
+ "DevDetail_CustomProps_reset_info": "",
"DevDetail_DisplayFields_Title": "",
"DevDetail_EveandAl_AlertAllEvents": "Alerte Todos os Eventos",
"DevDetail_EveandAl_AlertDown": "Alerta Desligado",
@@ -205,6 +208,7 @@
"Device_Shortcut_OnlineChart": "Presença do dispositivo",
"Device_TableHead_AlertDown": "",
"Device_TableHead_Connected_Devices": "Conexões",
+ "Device_TableHead_CustomProps": "",
"Device_TableHead_Favorite": "Favorito",
"Device_TableHead_FirstSession": "Primeira sessão",
"Device_TableHead_GUID": "GUID",
@@ -305,6 +309,7 @@
"Gen_ReadDocs": "Leia mais em documentos.",
"Gen_Remove_All": "Remover tudo",
"Gen_Remove_Last": "Remover o último",
+ "Gen_Reset": "",
"Gen_Restore": "Executar restauração",
"Gen_Run": "Executar",
"Gen_Save": "Salvar",
diff --git a/front/php/templates/language/ru_ru.json b/front/php/templates/language/ru_ru.json
index dc51e462..30053b2d 100755
--- a/front/php/templates/language/ru_ru.json
+++ b/front/php/templates/language/ru_ru.json
@@ -60,12 +60,15 @@
"BackDevices_darkmode_enabled": "Темный режим включен",
"CLEAR_NEW_FLAG_description": "Если этот параметр включен (
0 отключен), устройства, помеченные как
Новое устройство, станут неотмеченными, если лимит времени, указанный в часах, превышает время их
первой сессии.",
"CLEAR_NEW_FLAG_name": "Удалить новый флаг",
+ "CustProps_cant_remove": "",
"DAYS_TO_KEEP_EVENTS_description": "Это настройка обслуживания. Здесь указывается количество дней, в течение которых будут храниться записи о событиях. Все старые события будут периодически удаляться. Также применимо к истории событий плагина.",
"DAYS_TO_KEEP_EVENTS_name": "Удалить события старше",
"DISCOVER_PLUGINS_description": "",
"DISCOVER_PLUGINS_name": "",
"DevDetail_Copy_Device_Title": "Скопировать данные с устройства",
"DevDetail_Copy_Device_Tooltip": "Скопируйте данные с устройства из раскрывающегося списка. Все на этой странице будет перезаписано",
+ "DevDetail_CustomProperties_Title": "",
+ "DevDetail_CustomProps_reset_info": "",
"DevDetail_DisplayFields_Title": "Дисплей",
"DevDetail_EveandAl_AlertAllEvents": "Оповещения о событиях",
"DevDetail_EveandAl_AlertDown": "Оповещение о доступности",
@@ -205,6 +208,7 @@
"Device_Shortcut_OnlineChart": "Присутствие устройств",
"Device_TableHead_AlertDown": "Оповещение о сост. ВЫКЛ",
"Device_TableHead_Connected_Devices": "Соединения",
+ "Device_TableHead_CustomProps": "",
"Device_TableHead_Favorite": "Избранное",
"Device_TableHead_FirstSession": "Первый сеанс",
"Device_TableHead_GUID": "GUID",
@@ -305,6 +309,7 @@
"Gen_ReadDocs": "Подробнее читайте в документации.",
"Gen_Remove_All": "Удалить все",
"Gen_Remove_Last": "Удалить последний",
+ "Gen_Reset": "",
"Gen_Restore": "Запустить восстановление",
"Gen_Run": "Запустить",
"Gen_Save": "Сохранить",
diff --git a/front/php/templates/language/tr_tr.json b/front/php/templates/language/tr_tr.json
index 8738c304..d3d0eeee 100755
--- a/front/php/templates/language/tr_tr.json
+++ b/front/php/templates/language/tr_tr.json
@@ -60,12 +60,15 @@
"BackDevices_darkmode_enabled": "",
"CLEAR_NEW_FLAG_description": "",
"CLEAR_NEW_FLAG_name": "",
+ "CustProps_cant_remove": "",
"DAYS_TO_KEEP_EVENTS_description": "",
"DAYS_TO_KEEP_EVENTS_name": "",
"DISCOVER_PLUGINS_description": "",
"DISCOVER_PLUGINS_name": "",
"DevDetail_Copy_Device_Title": "",
"DevDetail_Copy_Device_Tooltip": "",
+ "DevDetail_CustomProperties_Title": "",
+ "DevDetail_CustomProps_reset_info": "",
"DevDetail_DisplayFields_Title": "",
"DevDetail_EveandAl_AlertAllEvents": "",
"DevDetail_EveandAl_AlertDown": "",
@@ -205,6 +208,7 @@
"Device_Shortcut_OnlineChart": "",
"Device_TableHead_AlertDown": "",
"Device_TableHead_Connected_Devices": "Bağlantılar",
+ "Device_TableHead_CustomProps": "",
"Device_TableHead_Favorite": "",
"Device_TableHead_FirstSession": "İlk Oturum",
"Device_TableHead_GUID": "",
@@ -305,6 +309,7 @@
"Gen_ReadDocs": "",
"Gen_Remove_All": "Tümünü kaldır",
"Gen_Remove_Last": "",
+ "Gen_Reset": "",
"Gen_Restore": "",
"Gen_Run": "Çalıştır",
"Gen_Save": "Kaydet",
diff --git a/front/php/templates/language/uk_ua.json b/front/php/templates/language/uk_ua.json
index 26146e06..fb4dfb7a 100755
--- a/front/php/templates/language/uk_ua.json
+++ b/front/php/templates/language/uk_ua.json
@@ -60,12 +60,15 @@
"BackDevices_darkmode_enabled": "Темний режим увімкнено",
"CLEAR_NEW_FLAG_description": "Якщо ввімкнено (
0 вимкнено), пристрої, позначені як
Новий пристрій, не будуть позначені, якщо ліміт часу (вказаний у годинах) перевищує їхній
Перший сеанс час.",
"CLEAR_NEW_FLAG_name": "Очистити новий прапор",
+ "CustProps_cant_remove": "",
"DAYS_TO_KEEP_EVENTS_description": "Це налаштування обслуговування. Це визначає кількість днів записів про події, які зберігатимуться. Усі старіші події періодично видалятимуться. Також застосовується до історії подій плагінів.",
"DAYS_TO_KEEP_EVENTS_name": "Видалити події, старші за",
"DISCOVER_PLUGINS_description": "Вимкніть цю опцію, щоб прискорити ініціалізацію та збереження налаштувань. Якщо вимкнено, плагіни не виявляються, і ви не можете додавати нові плагіни до параметра
LOADED_PLUGINS.",
"DISCOVER_PLUGINS_name": "Відкрийте для себе плагіни",
"DevDetail_Copy_Device_Title": "Скопіюйте деталі з пристрою",
"DevDetail_Copy_Device_Tooltip": "Скопіюйте деталі пристрою зі спадного списку. Усе на цій сторінці буде перезаписано",
+ "DevDetail_CustomProperties_Title": "",
+ "DevDetail_CustomProps_reset_info": "",
"DevDetail_DisplayFields_Title": "Дисплей",
"DevDetail_EveandAl_AlertAllEvents": "Повідомлення про події",
"DevDetail_EveandAl_AlertDown": "Сповіщення вниз",
@@ -205,6 +208,7 @@
"Device_Shortcut_OnlineChart": "Наявність пристрою",
"Device_TableHead_AlertDown": "Сповіщення вниз",
"Device_TableHead_Connected_Devices": "Зв'язки",
+ "Device_TableHead_CustomProps": "",
"Device_TableHead_Favorite": "улюблений",
"Device_TableHead_FirstSession": "Перша сесія",
"Device_TableHead_GUID": "GUID",
@@ -305,6 +309,7 @@
"Gen_ReadDocs": "Детальніше читайте в документах.",
"Gen_Remove_All": "Видалити Все",
"Gen_Remove_Last": "Видаліть останнім",
+ "Gen_Reset": "",
"Gen_Restore": "Запустіть Restore",
"Gen_Run": "бігти",
"Gen_Save": "зберегти",
diff --git a/front/php/templates/language/zh_cn.json b/front/php/templates/language/zh_cn.json
index c147086b..4907f1b3 100755
--- a/front/php/templates/language/zh_cn.json
+++ b/front/php/templates/language/zh_cn.json
@@ -60,12 +60,15 @@
"BackDevices_darkmode_enabled": "已启用暗黑模式",
"CLEAR_NEW_FLAG_description": "",
"CLEAR_NEW_FLAG_name": "",
+ "CustProps_cant_remove": "",
"DAYS_TO_KEEP_EVENTS_description": "这是维护设置。它指定将保留的事件条目的天数。所有较旧的事件将被定期删除。也适用于插件事件历史记录。",
"DAYS_TO_KEEP_EVENTS_name": "删除早于",
"DISCOVER_PLUGINS_description": "",
"DISCOVER_PLUGINS_name": "",
"DevDetail_Copy_Device_Title": "
从设备复制详细信息",
"DevDetail_Copy_Device_Tooltip": "从下拉列表中复制设备的详细信息。此页面上的所有内容都将被覆盖",
+ "DevDetail_CustomProperties_Title": "",
+ "DevDetail_CustomProps_reset_info": "",
"DevDetail_DisplayFields_Title": "",
"DevDetail_EveandAl_AlertAllEvents": "提醒所有事件",
"DevDetail_EveandAl_AlertDown": "警报关闭",
@@ -205,6 +208,7 @@
"Device_Shortcut_OnlineChart": "设备统计",
"Device_TableHead_AlertDown": "",
"Device_TableHead_Connected_Devices": "链接",
+ "Device_TableHead_CustomProps": "",
"Device_TableHead_Favorite": "收藏",
"Device_TableHead_FirstSession": "加入",
"Device_TableHead_GUID": "GUID",
@@ -305,6 +309,7 @@
"Gen_ReadDocs": "在文档中阅读更多内容。",
"Gen_Remove_All": "全部删除",
"Gen_Remove_Last": "删除最后一个",
+ "Gen_Reset": "",
"Gen_Restore": "运行恢复",
"Gen_Run": "运行",
"Gen_Save": "保存",
diff --git a/front/plugins/custom_props/README.md b/front/plugins/custom_props/README.md
new file mode 100755
index 00000000..068ab5d1
--- /dev/null
+++ b/front/plugins/custom_props/README.md
@@ -0,0 +1,8 @@
+## Overview
+
+Settings related to the custom properties functionality on a device.
+
+### Usage
+
+- Head to **Settings** > **Custom Properties** to adjust the default values.
+
diff --git a/front/plugins/custom_props/config.json b/front/plugins/custom_props/config.json
new file mode 100755
index 00000000..a4d23aea
--- /dev/null
+++ b/front/plugins/custom_props/config.json
@@ -0,0 +1,370 @@
+{
+ "code_name": "custom_props",
+ "unique_prefix": "CUSTPROP",
+ "plugin_type": "system",
+ "enabled": true,
+ "data_source": "template",
+ "show_ui": false,
+ "localized": ["display_name", "description", "icon"],
+ "display_name": [
+ {
+ "language_code": "en_us",
+ "string": "Custom properties"
+ }
+ ],
+ "description": [
+ {
+ "language_code": "en_us",
+ "string": "Settings related to the custom properties functionality on a device."
+ }
+ ],
+ "icon": [
+ {
+ "language_code": "en_us",
+ "string": "
"
+ }
+ ],
+ "params": [],
+ "settings": [
+ {
+ "function": "icon",
+ "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": [
+ "PGkgY2xhc3M9ImZhcyBmYS10cmFzaC1hbHQiPjwvaT4=",
+ "PGkgY2xhc3M9ImZhcyBmYS1leHRlcm5hbC1saW5rLWFsdCI+PC9pPg==",
+ "PGkgY2xhc3M9ImZhcyBmYS1hcnJvdy1yaWdodCI+PC9pPg==",
+ "PGkgY2xhc3M9ImZhcyBmYS1zZWFyY2giPjwvaT4=",
+ "PGkgY2xhc3M9ImZhcyBmYS1jb2dzIj48L2k+",
+ "PGkgY2xhc3M9ImZhcyBmYS1leWUiPjwvaT4=",
+ "PGkgY2xhc3M9ImZhcyBmYS1kYXRhYmFzZSI+PC9pPg=="
+ ],
+ "options": [],
+ "localized": ["name","description"],
+ "name": [
+ {
+ "language_code": "en_us",
+ "string": "Icon"
+ }
+ ],
+ "description": [
+ {
+ "language_code": "en_us",
+ "string": "List of icons that can be used on a custom property."
+ }
+ ]
+ },
+ {
+ "function": "type",
+ "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."
+ }
+ ]
+ },
+ {
+ "function": "args",
+ "type": {
+ "dataType": "string",
+ "elements": [
+ {
+ "elementType": "input",
+ "elementOptions": [],
+ "transformers": []
+ }
+ ]
+ },
+ "maxLength": 50,
+ "default_value": "",
+ "options": [],
+ "localized": ["name","description"],
+ "name": [
+ {
+ "language_code": "en_us",
+ "string": "Arguments"
+ }
+ ],
+ "description": [
+ {
+ "language_code": "en_us",
+ "string": "Arguments for the property type."
+ }
+ ]
+ },
+ {
+ "function": "name",
+ "type": {
+ "dataType": "string",
+ "elements": [
+ {
+ "elementType": "input",
+ "elementOptions": [],
+ "transformers": []
+ }
+ ]
+ },
+ "maxLength": 50,
+ "default_value": "",
+ "options": [],
+ "localized": ["name","description"],
+ "name": [
+ {
+ "language_code": "en_us",
+ "string": "Name"
+ }
+ ],
+ "description": [
+ {
+ "language_code": "en_us",
+ "string": "Name of the property displayed on hover."
+ }
+ ]
+ },
+ {
+ "function": "notes",
+ "type": {
+ "dataType": "string",
+ "elements": [
+ {
+ "elementType": "input",
+ "elementOptions": [],
+ "transformers": []
+ }
+ ]
+ },
+ "maxLength": 50,
+ "default_value": "",
+ "options": [],
+ "localized": ["name","description"],
+ "name": [
+ {
+ "language_code": "en_us",
+ "string": "Notes"
+ }
+ ],
+ "description": [
+ {
+ "language_code": "en_us",
+ "string": "Additional notes."
+ }
+ ]
+ },
+ {
+ "function": "show",
+ "type": {
+ "dataType": "boolean",
+ "elements": [
+ {
+ "elementType": "input",
+ "elementOptions": [{ "type": "checkbox" }],
+ "transformers": []
+ }
+ ]
+ },
+ "default_value": true,
+ "options": [],
+ "localized": ["name", "description"],
+ "name": [
+ {
+ "language_code": "en_us",
+ "string": "Show"
+ }
+ ],
+ "description": [
+ {
+ "language_code": "en_us",
+ "string": "Show in device list."
+ }
+ ]
+ },
+ {
+ "function": "actions",
+ "type": {
+ "dataType": "none",
+ "elements": [
+ {
+ "elementType": "span",
+ "elementOptions": [
+ {
+ "cssClasses": "input-group-addon pointer actionIcon"
+ },
+ {
+ "placeholder": "
"
+ },
+ {
+ "onClick": "removeDataTableRow(this)"
+ }
+ ],
+ "transformers": []
+ },
+ {
+ "elementType": "span",
+ "elementOptions": [
+ {
+ "cssClasses": "input-group-addon pointer actionIcon"
+ },
+ {
+ "placeholder": "
"
+ },
+ {
+ "onClick": "cloneDataTableRow(this)"
+ }
+ ],
+ "transformers": []
+ }
+ ]
+ },
+ "maxLength": 50,
+ "default_value": [
+ ],
+ "options": [],
+ "localized": ["name","description"],
+ "name": [
+ {
+ "language_code": "en_us",
+ "string": "Action"
+ }
+ ],
+ "description": [
+ {
+ "language_code": "en_us",
+ "string": "Actions on the property."
+ }
+ ]
+ }
+ ]
+}
diff --git a/front/plugins/newdev_template/config.json b/front/plugins/newdev_template/config.json
index c63bc8b2..ff1e1cb3 100755
--- a/front/plugins/newdev_template/config.json
+++ b/front/plugins/newdev_template/config.json
@@ -6,7 +6,11 @@
"enabled": true,
"data_source": "template",
"show_ui": false,
- "localized": ["display_name", "description", "icon"],
+ "localized": [
+ "display_name",
+ "description",
+ "icon"
+ ],
"display_name": [
{
"language_code": "en_us",
@@ -34,21 +38,41 @@
{
"elementType": "input",
"elementOptions": [
- { "placeholder": "Enter value" },
- { "suffix": "_in" },
- { "cssClasses": "col-sm-10" },
- { "prefillValue": "null" }
+ {
+ "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" }
+ {
+ "sourceSuffixes": [
+ "_in"
+ ]
+ },
+ {
+ "separator": ""
+ },
+ {
+ "cssClasses": "col-xs-12"
+ },
+ {
+ "onClick": "addList(this, false)"
+ },
+ {
+ "getStringKey": "Gen_Add"
+ }
],
"transformers": []
},
@@ -56,31 +80,57 @@
"elementType": "select",
"elementHasInputValue": 1,
"elementOptions": [
- { "multiple": "true" },
- { "readonly": "true" },
- { "editable": "true" }
+ {
+ "multiple": "true"
+ },
+ {
+ "readonly": "true"
+ },
+ {
+ "editable": "true"
+ }
],
"transformers": []
},
{
"elementType": "button",
"elementOptions": [
- { "sourceSuffixes": [] },
- { "separator": "" },
- { "cssClasses": "col-xs-6" },
- { "onClick": "removeAllOptions(this)" },
- { "getStringKey": "Gen_Remove_All" }
+ {
+ "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" }
+ {
+ "sourceSuffixes": []
+ },
+ {
+ "separator": ""
+ },
+ {
+ "cssClasses": "col-xs-6"
+ },
+ {
+ "onClick": "removeFromList(this)"
+ },
+ {
+ "getStringKey": "Gen_Remove_Last"
+ }
],
"transformers": []
}
@@ -88,7 +138,10 @@
},
"default_value": [],
"options": [],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -110,21 +163,41 @@
{
"elementType": "input",
"elementOptions": [
- { "placeholder": "Enter value" },
- { "suffix": "_in" },
- { "cssClasses": "col-sm-10" },
- { "prefillValue": "null" }
+ {
+ "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" }
+ {
+ "sourceSuffixes": [
+ "_in"
+ ]
+ },
+ {
+ "separator": ""
+ },
+ {
+ "cssClasses": "col-xs-12"
+ },
+ {
+ "onClick": "addList(this, false)"
+ },
+ {
+ "getStringKey": "Gen_Add"
+ }
],
"transformers": []
},
@@ -132,31 +205,57 @@
"elementType": "select",
"elementHasInputValue": 1,
"elementOptions": [
- { "multiple": "true" },
- { "readonly": "true" },
- { "editable": "true" }
+ {
+ "multiple": "true"
+ },
+ {
+ "readonly": "true"
+ },
+ {
+ "editable": "true"
+ }
],
"transformers": []
},
{
"elementType": "button",
"elementOptions": [
- { "sourceSuffixes": [] },
- { "separator": "" },
- { "cssClasses": "col-xs-6" },
- { "onClick": "removeAllOptions(this)" },
- { "getStringKey": "Gen_Remove_All" }
+ {
+ "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" }
+ {
+ "sourceSuffixes": []
+ },
+ {
+ "separator": ""
+ },
+ {
+ "cssClasses": "col-xs-6"
+ },
+ {
+ "onClick": "removeFromList(this)"
+ },
+ {
+ "getStringKey": "Gen_Remove_Last"
+ }
],
"transformers": []
}
@@ -164,7 +263,10 @@
},
"default_value": [],
"options": [],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -186,21 +288,41 @@
{
"elementType": "input",
"elementOptions": [
- { "placeholder": "Enter value" },
- { "suffix": "_in" },
- { "cssClasses": "col-sm-10" },
- { "prefillValue": "null" }
+ {
+ "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" }
+ {
+ "sourceSuffixes": [
+ "_in"
+ ]
+ },
+ {
+ "separator": ""
+ },
+ {
+ "cssClasses": "col-xs-12"
+ },
+ {
+ "onClick": "addList(this, false)"
+ },
+ {
+ "getStringKey": "Gen_Add"
+ }
],
"transformers": []
},
@@ -208,31 +330,59 @@
"elementType": "select",
"elementHasInputValue": 1,
"elementOptions": [
- { "multiple": "true" },
- { "readonly": "true" },
- { "editable": "true" }
+ {
+ "multiple": "true"
+ },
+ {
+ "readonly": "true"
+ },
+ {
+ "editable": "true"
+ }
],
- "transformers": ["base64"]
+ "transformers": [
+ "base64"
+ ]
},
{
"elementType": "button",
"elementOptions": [
- { "sourceSuffixes": [] },
- { "separator": "" },
- { "cssClasses": "col-xs-6" },
- { "onClick": "removeFromList(this)" },
- { "getStringKey": "Gen_Remove_Last" }
+ {
+ "sourceSuffixes": []
+ },
+ {
+ "separator": ""
+ },
+ {
+ "cssClasses": "col-xs-6"
+ },
+ {
+ "onClick": "removeFromList(this)"
+ },
+ {
+ "getStringKey": "Gen_Remove_Last"
+ }
],
"transformers": []
},
{
"elementType": "button",
"elementOptions": [
- { "sourceSuffixes": [] },
- { "separator": "" },
- { "cssClasses": "col-xs-6" },
- { "onClick": "removeAllOptions(this)" },
- { "getStringKey": "Gen_Remove_All" }
+ {
+ "sourceSuffixes": []
+ },
+ {
+ "separator": ""
+ },
+ {
+ "cssClasses": "col-xs-6"
+ },
+ {
+ "onClick": "removeAllOptions(this)"
+ },
+ {
+ "getStringKey": "Gen_Remove_All"
+ }
],
"transformers": []
}
@@ -251,7 +401,10 @@
"Iy4q"
],
"options": [],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -272,14 +425,21 @@
"elements": [
{
"elementType": "input",
- "elementOptions": [{ "type": "checkbox" }],
+ "elementOptions": [
+ {
+ "type": "checkbox"
+ }
+ ],
"transformers": []
}
]
},
"default_value": false,
"options": [],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -300,7 +460,11 @@
"elements": [
{
"elementType": "input",
- "elementOptions": [{ "readonly": "true" }],
+ "elementOptions": [
+ {
+ "readonly": "true"
+ }
+ ],
"transformers": []
}
]
@@ -308,7 +472,10 @@
"maxLength": 50,
"default_value": "",
"options": [],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -337,7 +504,10 @@
"maxLength": 50,
"default_value": "",
"options": [],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -358,7 +528,11 @@
"elements": [
{
"elementType": "input",
- "elementOptions": [{ "readonly": "true" }],
+ "elementOptions": [
+ {
+ "readonly": "true"
+ }
+ ],
"transformers": []
}
]
@@ -366,7 +540,10 @@
"maxLength": 50,
"default_value": "(unknown)",
"options": [],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -382,16 +559,25 @@
},
{
"function": "devIcon",
- "events": ["copy_icons", "add_icon"],
+ "events": [
+ "copy_icons",
+ "add_icon"
+ ],
"type": {
"dataType": "string",
"elements": [
{
"elementType": "span",
"elementOptions": [
- { "cssClasses": "input-group-addon iconPreview" },
- { "getStringKey": "Gen_SelectIcon" },
- { "customId": "NEWDEV_devIcon_preview" }
+ {
+ "cssClasses": "input-group-addon iconPreview"
+ },
+ {
+ "getStringKey": "Gen_SelectIcon"
+ },
+ {
+ "customId": "NEWDEV_devIcon_preview"
+ }
],
"transformers": []
},
@@ -399,18 +585,24 @@
"elementType": "select",
"elementHasInputValue": 1,
"elementOptions": [
- { "cssClasses": "col-xs-12" },
+ {
+ "cssClasses": "iconInputVal"
+ },
{
"onChange": "updateIconPreview(this)"
},
- { "customParams": "NEWDEV_devIcon,NEWDEV_devIcon_preview" }
+ {
+ "customParams": "NEWDEV_devIcon,NEWDEV_devIcon_preview"
+ }
],
"transformers": []
- }
+ }
]
},
"default_value": "",
- "options": ["{value}"],
+ "options": [
+ "{value}"
+ ],
"options_params": [
{
"name": "value",
@@ -418,7 +610,10 @@
"value": "WITH RECURSIVE SettingsIcons AS (SELECT REPLACE(REPLACE(REPLACE(setValue, '[', ''), ']', ''), '''', '') AS icon_list FROM Settings WHERE setKey = 'UI_ICONS'), SplitIcons AS (SELECT TRIM(SUBSTR(icon_list, 1, INSTR(icon_list || ',', ',') - 1)) AS icon, SUBSTR(icon_list, INSTR(icon_list || ',', ',') + 1) AS remaining_icons FROM SettingsIcons WHERE icon_list <> '' UNION ALL SELECT TRIM(SUBSTR(remaining_icons, 1, INSTR(remaining_icons || ',', ',') - 1)) AS icon, SUBSTR(remaining_icons, INSTR(remaining_icons || ',', ',') + 1) AS remaining_icons FROM SplitIcons WHERE remaining_icons <> '') SELECT DISTINCT * FROM (SELECT icon as name, icon as id FROM SplitIcons UNION SELECT '❌None' AS name, '' AS id UNION SELECT devIcon AS name, devIcon AS id FROM Devices WHERE devIcon <> '') AS combined_results;"
}
],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -434,16 +629,24 @@
},
{
"function": "devOwner",
- "events": ["add_option"],
+ "events": [
+ "add_option"
+ ],
"type": {
"dataType": "string",
"elements": [
- { "elementType": "select", "elementOptions": [], "transformers": [] }
+ {
+ "elementType": "select",
+ "elementOptions": [],
+ "transformers": []
+ }
]
},
"maxLength": 30,
"default_value": "",
- "options": ["{value}"],
+ "options": [
+ "{value}"
+ ],
"options_params": [
{
"name": "value",
@@ -451,7 +654,10 @@
"value": "SELECT DISTINCT '' as id, '❌None' as name UNION SELECT devOwner as id, devOwner as name FROM (SELECT devOwner FROM Devices UNION SELECT 'House' ) AS all_devices ORDER BY id;"
}
],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -467,16 +673,24 @@
},
{
"function": "devType",
- "events": ["add_option"],
+ "events": [
+ "add_option"
+ ],
"type": {
"dataType": "string",
"elements": [
- { "elementType": "select", "elementOptions": [], "transformers": [] }
+ {
+ "elementType": "select",
+ "elementOptions": [],
+ "transformers": []
+ }
]
},
"maxLength": 30,
"default_value": "",
- "options": ["{value}"],
+ "options": [
+ "{value}"
+ ],
"options_params": [
{
"name": "value",
@@ -489,7 +703,10 @@
"value": "UI_LANG"
}
],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -518,7 +735,10 @@
"maxLength": 250,
"default_value": "",
"options": [],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -528,7 +748,7 @@
"description": [
{
"language_code": "en_us",
- "string": "The vendor of the device. If set to empty or
(unknown) teh app will try to auto-detect it."
+ "string": "The vendor of the device. If set to empty or
(unknown) the app will try to auto-detect it."
}
]
},
@@ -539,14 +759,21 @@
"elements": [
{
"elementType": "input",
- "elementOptions": [{ "type": "checkbox" }],
+ "elementOptions": [
+ {
+ "type": "checkbox"
+ }
+ ],
"transformers": []
}
]
},
"default_value": 0,
"options": [],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -562,16 +789,24 @@
},
{
"function": "devGroup",
- "events": ["add_option"],
+ "events": [
+ "add_option"
+ ],
"type": {
"dataType": "string",
"elements": [
- { "elementType": "select", "elementOptions": [], "transformers": [] }
+ {
+ "elementType": "select",
+ "elementOptions": [],
+ "transformers": []
+ }
]
},
"maxLength": 10,
"default_value": "",
- "options": ["{value}"],
+ "options": [
+ "{value}"
+ ],
"options_params": [
{
"name": "value",
@@ -579,7 +814,10 @@
"value": "SELECT DISTINCT '' as id, '❌None' as name UNION SELECT devGroup as id, devGroup as name FROM (SELECT devGroup FROM Devices WHERE devGroup <> '' UNION SELECT 'Personal' UNION SELECT 'Always on' UNION SELECT 'Friends' UNION SELECT 'Others' ) AS all_devices ORDER BY id;"
}
],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -595,16 +833,24 @@
},
{
"function": "devLocation",
- "events": ["add_option"],
+ "events": [
+ "add_option"
+ ],
"type": {
"dataType": "string",
"elements": [
- { "elementType": "select", "elementOptions": [], "transformers": [] }
+ {
+ "elementType": "select",
+ "elementOptions": [],
+ "transformers": []
+ }
]
},
"maxLength": 250,
"default_value": "",
- "options": ["{value}"],
+ "options": [
+ "{value}"
+ ],
"options_params": [
{
"name": "value",
@@ -612,7 +858,10 @@
"value": "SELECT DISTINCT '' AS id, '❌None' AS name UNION SELECT devLocation AS id, devLocation AS name FROM Devices WHERE devLocation NOT IN ('', 'null') AND devLocation IS NOT NULL UNION SELECT 'Bathroom' AS id, 'Bathroom' AS name UNION SELECT 'Bedroom', 'Bedroom' UNION SELECT 'Dining room', 'Dining room' UNION SELECT 'Hall', 'Hall' UNION SELECT 'Kitchen', 'Kitchen' UNION SELECT 'Laundry', 'Laundry' UNION SELECT 'Living room', 'Living room' UNION SELECT 'Study', 'Study' UNION SELECT 'Attic', 'Attic' UNION SELECT 'Basement', 'Basement' UNION SELECT 'Garage', 'Garage' UNION SELECT 'Back yard', 'Back yard' UNION SELECT 'Garden', 'Garden' UNION SELECT 'Terrace', 'Terrace' ORDER BY id;"
}
],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -631,12 +880,19 @@
"type": {
"dataType": "string",
"elements": [
- { "elementType": "textarea", "elementOptions": [], "transformers": [] }
+ {
+ "elementType": "textarea",
+ "elementOptions": [],
+ "transformers": []
+ }
]
},
"default_value": "",
"options": [],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -657,7 +913,11 @@
"elements": [
{
"elementType": "input",
- "elementOptions": [{ "readonly": "true" }],
+ "elementOptions": [
+ {
+ "readonly": "true"
+ }
+ ],
"transformers": []
}
]
@@ -665,7 +925,10 @@
"format": "date-time",
"default_value": "",
"options": [],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -686,7 +949,11 @@
"elements": [
{
"elementType": "input",
- "elementOptions": [{ "readonly": "true" }],
+ "elementOptions": [
+ {
+ "readonly": "true"
+ }
+ ],
"transformers": []
}
]
@@ -694,7 +961,10 @@
"format": "date-time",
"default_value": "",
"options": [],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -715,14 +985,21 @@
"elements": [
{
"elementType": "input",
- "elementOptions": [{ "type": "checkbox" }],
+ "elementOptions": [
+ {
+ "type": "checkbox"
+ }
+ ],
"transformers": []
}
]
},
"default_value": 0,
"options": [],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -743,14 +1020,21 @@
"elements": [
{
"elementType": "input",
- "elementOptions": [{ "type": "checkbox" }],
+ "elementOptions": [
+ {
+ "type": "checkbox"
+ }
+ ],
"transformers": []
}
]
},
"default_value": 1,
"options": [],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -771,14 +1055,21 @@
"elements": [
{
"elementType": "input",
- "elementOptions": [{ "type": "checkbox" }],
+ "elementOptions": [
+ {
+ "type": "checkbox"
+ }
+ ],
"transformers": []
}
]
},
"default_value": 1,
"options": [],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -799,14 +1090,21 @@
"elements": [
{
"elementType": "input",
- "elementOptions": [{ "type": "checkbox" }],
+ "elementOptions": [
+ {
+ "type": "checkbox"
+ }
+ ],
"transformers": []
}
]
},
"default_value": 1,
"options": [],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -827,14 +1125,21 @@
"elements": [
{
"elementType": "input",
- "elementOptions": [{ "type": "checkbox" }],
+ "elementOptions": [
+ {
+ "type": "checkbox"
+ }
+ ],
"transformers": []
}
]
},
"default_value": 0,
"options": [],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -853,11 +1158,17 @@
"type": {
"dataType": "string",
"elements": [
- { "elementType": "select", "elementOptions": [], "transformers": [] }
+ {
+ "elementType": "select",
+ "elementOptions": [],
+ "transformers": []
+ }
]
},
"default_value": 0,
- "options": ["{value}"],
+ "options": [
+ "{value}"
+ ],
"options_params": [
{
"name": "value",
@@ -865,7 +1176,10 @@
"value": "SELECT '0' as id, '0 (notify all)' as name UNION SELECT '168' as id, '1 week' as name UNION SELECT '24' as id, '1 day' as name UNION SELECT '8' as id, '8 h' as name UNION SELECT '1' as id, '1 h' as name"
}
],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -886,7 +1200,11 @@
"elements": [
{
"elementType": "input",
- "elementOptions": [{ "readonly": "true" }],
+ "elementOptions": [
+ {
+ "readonly": "true"
+ }
+ ],
"transformers": []
}
]
@@ -894,7 +1212,10 @@
"format": "date-time",
"default_value": "",
"options": [],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -915,14 +1236,21 @@
"elements": [
{
"elementType": "input",
- "elementOptions": [{ "type": "checkbox" }],
+ "elementOptions": [
+ {
+ "type": "checkbox"
+ }
+ ],
"transformers": []
}
]
},
"default_value": 1,
"options": [],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -943,14 +1271,21 @@
"elements": [
{
"elementType": "input",
- "elementOptions": [{ "type": "checkbox" }],
+ "elementOptions": [
+ {
+ "type": "checkbox"
+ }
+ ],
"transformers": []
}
]
},
"default_value": 1,
"options": [],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -971,14 +1306,21 @@
"elements": [
{
"elementType": "input",
- "elementOptions": [{ "type": "checkbox" }],
+ "elementOptions": [
+ {
+ "type": "checkbox"
+ }
+ ],
"transformers": []
}
]
},
"default_value": 0,
"options": [],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -994,15 +1336,23 @@
},
{
"function": "devParentMAC",
- "events": ["go_to_node"],
+ "events": [
+ "go_to_node"
+ ],
"type": {
"dataType": "string",
"elements": [
- { "elementType": "select", "elementOptions": [], "transformers": [] }
+ {
+ "elementType": "select",
+ "elementOptions": [],
+ "transformers": []
+ }
]
},
"default_value": "",
- "options": ["{value}"],
+ "options": [
+ "{value}"
+ ],
"options_params": [
{
"name": "value",
@@ -1015,7 +1365,10 @@
"value": "KNWN_target_macs"
}
],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -1043,7 +1396,10 @@
},
"default_value": 0,
"options": [],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -1071,7 +1427,10 @@
},
"default_value": "",
"options": [],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -1099,7 +1458,10 @@
},
"default_value": "",
"options": [],
- "localized": ["name", "description"],
+ "localized": [
+ "name",
+ "description"
+ ],
"name": [
{
"language_code": "en_us",
@@ -1112,9 +1474,114 @@
"string": "The network site."
}
]
- }
- ],
- "required": [
+ },
+ {
+ "function": "devCustomProps",
+ "type": {
+ "dataType": "string",
+ "elements": [
+ {
+ "elementType": "datatable",
+ "elementHasInputValue": 1,
+ "elementOptions": [
+ {
+ "columns": [
+ {
+ "settingKey": "CUSTPROP_icon",
+ "optionsOverride":"setting.CUSTPROP_icon",
+ "typeOverride": {
+ "dataType": "string",
+ "elements": [
+ {
+ "elementType": "span",
+ "elementOptions": [
+ {
+ "cssClasses": "input-group-addon iconPreview"
+ },
+ {
+ "getStringKey": "Gen_SelectIcon"
+ },
+ {
+ "customId": "CUSTPROP_icon_preview"
+ }
+ ],
+ "transformers": []
+ },
+ {
+ "elementType": "select",
+ "elementHasInputValue": 1,
+ "elementOptions": [
+ {
+ "cssClasses": "iconInputVal"
+ },
+ {
+ "onChange": "updateIconPreview(this)"
+ },
+ {
+ "customParams": "CUSTPROP_icon,CUSTPROP_icon_preview"
+ }
+ ],
+ "transformers": []
+ }
+ ]
+ }
+ },
+ {
+ "settingKey": "CUSTPROP_type",
+ "optionsOverride":"setting.CUSTPROP_type",
+ "typeOverride": {
+ "dataType": "string",
+ "elements": [
+ {
+ "elementType": "select",
+ "elementOptions": [],
+ "transformers": []
+ }
+ ]
+ }
+ },
+ {
+ "settingKey": "CUSTPROP_name"
+ },
+ {
+ "settingKey": "CUSTPROP_args"
+ },
+ {
+ "settingKey": "CUSTPROP_notes"
+ },
+ {
+ "settingKey": "CUSTPROP_show"
+ },
+ {
+ "settingKey": "CUSTPROP_actions"
+ }
+ ]
+ }
+ ],
+ "transformers": []
+ }
+ ]
+ },
+ "default_value": "WwogIFsKICAgIHsKICAgICAgIkNVU1RQUk9QX2ljb24iOiAiUEdrZ1kyeGhjM005SW1aaGN5Qm1ZUzEwY21GemFDMWhiSFFpUGp3dmFUND0iCiAgICB9LAogICAgewogICAgICAiQ1VTVFBST1BfdHlwZSI6ICJkZWxldGVfZGV2IgogICAgfSwKICAgIHsKICAgICAgIkNVU1RQUk9QX25hbWUiOiAiIgogICAgfSwKICAgIHsKICAgICAgIkNVU1RQUk9QX2FyZ3MiOiAiRGVsZXRlIGRldmljZSIKICAgIH0sCiAgICB7CiAgICAgICJDVVNUUFJPUF9ub3RlcyI6ICIiCiAgICB9LAogICAgewogICAgICAiQ1VTVFBST1Bfc2hvdyI6IHRydWUKICAgIH0KICBdCl0=",
+ "options": [],
+ "localized": [
+ "name",
+ "description"
+ ],
+ "name": [
+ {
+ "language_code": "en_us",
+ "string": "Properties"
+ }
+ ],
+ "description": [
+ {
+ "language_code": "en_us",
+ "string": "Custom device properties to store additional data or to perform an action on the device. Check the
documentation on Custom Properties for additional details."
+ }
+ ]
+ }
],
+ "required": [],
"additionalProperties": false
-}
+}
\ No newline at end of file
diff --git a/front/plugins/ui_settings/config.json b/front/plugins/ui_settings/config.json
index 50d0f07c..58577385 100755
--- a/front/plugins/ui_settings/config.json
+++ b/front/plugins/ui_settings/config.json
@@ -347,7 +347,8 @@
"Device_TableHead_LastIP",
"Device_TableHead_Status",
"Device_TableHead_MAC_full",
- "Device_TableHead_SourcePlugin"
+ "Device_TableHead_SourcePlugin",
+ "Device_TableHead_CustomProps"
],
"options": [
"Device_TableHead_Name",
@@ -375,7 +376,8 @@
"Device_TableHead_SSID",
"Device_TableHead_SourcePlugin",
"Device_TableHead_PresentLastScan",
- "Device_TableHead_AlertDown"
+ "Device_TableHead_AlertDown",
+ "Device_TableHead_CustomProps"
],
"localized": ["name", "description"],
"name": [
diff --git a/front/settings.php b/front/settings.php
index 1b450989..93714103 100755
--- a/front/settings.php
+++ b/front/settings.php
@@ -501,7 +501,7 @@ $settingsJSON_DB = json_encode($settings, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX
}
// INPUT
- inputFormHtml = generateFormHtml(set, valIn);
+ inputFormHtml = generateFormHtml(settingsData, set, valIn, null, null);
// construct final HTML for the setting
setHtml += inputFormHtml + overrideHtml + `
@@ -565,13 +565,12 @@ $settingsJSON_DB = json_encode($settings, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX
setType = set["setType"]
setCodeName = set["setKey"]
- console.log(prefix);
+ // console.log(prefix);
- const setTypeObject = JSON.parse(setType.replace(/'/g, '"'));
+ const setTypeObject = JSON.parse(processQuotes(setType))
// console.log(setTypeObject);
const dataType = setTypeObject.dataType;
-
// get the element with the input value(s)
let elements = setTypeObject.elements.filter(element => element.elementHasInputValue === 1);
@@ -602,12 +601,18 @@ $settingsJSON_DB = json_encode($settings, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX
onClick,
onChange,
customParams,
- customId
+ customId,
+ columns
} = handleElementOptions('none', elementOptions, transformers, val = "");
let value;
- if (dataType === "string" ||
+ if (dataType === "string" && elementWithInputValue.elementType === "datatable" ) {
+
+ value = collectTableData(`#${setCodeName}_table`)
+ settingsArray.push([prefix, setCodeName, dataType, btoa(JSON.stringify(value))]);
+
+ } else if (dataType === "string" ||
(dataType === "integer" && (inputType === "number" || inputType === "text"))) {
value = $('#' + setCodeName).val();
@@ -646,11 +651,17 @@ $settingsJSON_DB = json_encode($settings, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX
}
});
}
-
+
value = JSON.stringify(temps);
settingsArray.push([prefix, setCodeName, dataType, value]);
+
+ } else if (dataType === "none") {
+ // no value to save
+ value = ""
+ settingsArray.push([prefix, setCodeName, dataType, value]);
+
} else if (dataType === "json") {
value = $('#' + setCodeName).val();
@@ -675,7 +686,7 @@ $settingsJSON_DB = json_encode($settings, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX
console.log(settingsArray);
console.log( JSON.stringify(settingsArray));
- // return;
+ // return; // 🐛 🔺
// trigger a save settings event in the backend
$.ajax({
method: "POST",
@@ -735,12 +746,14 @@ $settingsJSON_DB = json_encode($settings, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX
{
// check if config file has been updated
$.get('/php/server/query_json.php', { file: 'app_state.json', nocache: Date.now() }, function(appState) {
+
+ console.log("Settings: Got app_state.json");
fileModificationTime = ;
// console.log(appState["settingsImported"]*1000)
importedMiliseconds = parseInt((appState["settingsImported"]*1000));
- humanReadable = (new Date(importedMiliseconds)).toLocaleString("en-UK", { timeZone: "" });
+
// check if displayed settings are outdated
if(appState["showSpinner"] || fileModificationTime > importedMiliseconds)
@@ -754,6 +767,7 @@ $settingsJSON_DB = json_encode($settings, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX
checkInitialization();
}
+ humanReadable = (new Date(importedMiliseconds)).toLocaleString("en-UK", { timeZone: "" });
document.getElementById('lastImportedTime').innerHTML = humanReadable;
})
diff --git a/server/const.py b/server/const.py
index 97ccc59a..82647122 100755
--- a/server/const.py
+++ b/server/const.py
@@ -59,6 +59,7 @@ sql_devices_all = """
IFNULL(devSSID, '') AS devSSID,
IFNULL(devSyncHubNode, '') AS devSyncHubNode,
IFNULL(devSourcePlugin, '') AS devSourcePlugin,
+ IFNULL(devCustomProps, '') AS devCustomProps,
CASE
WHEN devIsNew = 1 THEN 'New'
WHEN devPresentLastScan = 1 THEN 'On-line'
diff --git a/server/database.py b/server/database.py
index aa18a488..52620fa6 100755
--- a/server/database.py
+++ b/server/database.py
@@ -475,6 +475,20 @@ class DB():
self.sql.execute(""" DROP VIEW IF EXISTS Sessions_Devices;""")
self.sql.execute("""CREATE VIEW Sessions_Devices AS SELECT * FROM Sessions LEFT JOIN "Devices" ON ses_MAC = devMac;""")
+
+
+ # add fields if missing
+
+ # devCustomProps column
+ devCustomProps_missing = self.sql.execute ("""
+ SELECT COUNT(*) AS CNTREC FROM pragma_table_info('Devices') WHERE name='devCustomProps'
+ """).fetchone()[0] == 0
+
+ if devCustomProps_missing :
+ mylog('verbose', ["[upgradeDB] Adding devCustomProps to the Devices table"])
+ self.sql.execute("""
+ ALTER TABLE "Devices" ADD "devCustomProps" TEXT
+ """)
# -------------------------------------------------------------------------
# Settings table setup
diff --git a/server/device.py b/server/device.py
index 80c75031..0a2dce28 100755
--- a/server/device.py
+++ b/server/device.py
@@ -226,7 +226,8 @@ def create_new_devices (db):
devGroup,
devComments,
devLogEvents,
- devLocation"""
+ devLocation,
+ devCustomProps"""
newDevDefaults = f"""{get_setting_value('NEWDEV_devAlertEvents')},
{get_setting_value('NEWDEV_devAlertDown')},
@@ -240,7 +241,9 @@ def create_new_devices (db):
'{sanitize_SQL_input(get_setting_value('NEWDEV_devGroup'))}',
'{sanitize_SQL_input(get_setting_value('NEWDEV_devComments'))}',
{get_setting_value('NEWDEV_devLogEvents')},
- '{sanitize_SQL_input(get_setting_value('NEWDEV_devLocation'))}'"""
+ '{sanitize_SQL_input(get_setting_value('NEWDEV_devLocation'))}',
+ '{sanitize_SQL_input(get_setting_value('NEWDEV_devCustomProps'))}'
+ """
# Fetch data from CurrentScan skipping ignored devices by IP and MAC
query = f"""SELECT cur_MAC, cur_Name, cur_Vendor, cur_ScanMethod, cur_IP, cur_SyncHubNodeName, cur_NetworkNodeMAC, cur_PORT, cur_NetworkSite, cur_SSID, cur_Type
diff --git a/server/graphql_server/graphql_schema.py b/server/graphql_server/graphql_schema.py
index 3a5afbc4..02e97727 100755
--- a/server/graphql_server/graphql_schema.py
+++ b/server/graphql_server/graphql_schema.py
@@ -62,6 +62,7 @@ class Device(ObjectType):
devSSID = String()
devSyncHubNode = String()
devSourcePlugin = String()
+ devCustomProps = String()
devStatus = String()
devIsRandomMac = Int()
devParentChildrenCount = Int()
diff --git a/server/initialise.py b/server/initialise.py
index 29a244a1..0411e3e1 100755
--- a/server/initialise.py
+++ b/server/initialise.py
@@ -202,7 +202,7 @@ def importConfigs (db, all_plugins):
# Plugins START
# -----------------
- necessary_plugins = ['UI', 'DBCLNP', 'INTRNT','MAINT','NEWDEV', 'SETPWD', 'SYNC', 'VNDRPDT', 'WORKFLOWS']
+ necessary_plugins = ['UI', 'CUSTPROP', 'DBCLNP', 'INTRNT','MAINT','NEWDEV', 'SETPWD', 'SYNC', 'VNDRPDT', 'WORKFLOWS']
# make sure necessary plugins are loaded
conf.LOADED_PLUGINS += [plugin for plugin in necessary_plugins if plugin not in conf.LOADED_PLUGINS]
diff --git a/test/test_helper.py b/test/test_helper.py
index e217065d..576b8601 100755
--- a/test/test_helper.py
+++ b/test/test_helper.py
@@ -29,7 +29,7 @@ def test_updateSubnets():
assert len(result) == 2
# -------------------------------------------------------------------------------
-# Function to insert 10,000 random device entries
+# Function to insert N random device entries
def insert_devices(db_path, num_entries=1):
conn = sqlite3.connect(db_path)
cursor = conn.cursor()
@@ -85,9 +85,10 @@ def insert_devices(db_path, num_entries=1):
devSite,
devSSID,
devSyncHubNode,
- devSourcePlugin
+ devSourcePlugin,
+ devCustomProps
)
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
"""
# List of device types, vendors, groups, locations
@@ -128,6 +129,7 @@ def insert_devices(db_path, num_entries=1):
dev_ssid = "" # Left as NULL
dev_sync_hub_node = "" # Left as NULL
dev_source_plugin = "" # Left as NULL
+ dev_devCustomProps = "" # Left as NULL
# Execute the insert query
cursor.execute(insert_query, (
@@ -160,7 +162,8 @@ def insert_devices(db_path, num_entries=1):
dev_site,
dev_ssid,
dev_sync_hub_node,
- dev_source_plugin
+ dev_source_plugin,
+ dev_devCustomProps
))
# Commit after every 1000 rows to improve performance