fix 1 cycling thru devices #509🩹
This commit is contained in:
@@ -644,14 +644,15 @@ if ($ENABLED_DARKMODE === True) {
|
|||||||
// ------------------------------------------------------------
|
// ------------------------------------------------------------
|
||||||
function getDevicesList()
|
function getDevicesList()
|
||||||
{
|
{
|
||||||
// Read cache
|
// Read cache (skip cookie expiry check)
|
||||||
devicesList = getCache('devicesList');
|
devicesList = getCache('devicesListAll_JSON', true);
|
||||||
|
|
||||||
if (devicesList != '') {
|
if (devicesList != '') {
|
||||||
devicesList = JSON.parse (devicesList);
|
devicesList = JSON.parse (devicesList);
|
||||||
} else {
|
} else {
|
||||||
devicesList = [];
|
devicesList = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
return devicesList;
|
return devicesList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1325,6 +1326,7 @@ function getDeviceData (readAllData=false) {
|
|||||||
|
|
||||||
// Check if device is part of the devicesList
|
// Check if device is part of the devicesList
|
||||||
pos = devicesList.findIndex(item => item.rowid == deviceData['rowid']);
|
pos = devicesList.findIndex(item => item.rowid == deviceData['rowid']);
|
||||||
|
|
||||||
if (pos == -1) {
|
if (pos == -1) {
|
||||||
devicesList.push({"rowid" : deviceData['rowid'], "mac" : deviceData['dev_MAC'], "name": deviceData['dev_Name'], "type": deviceData['dev_DeviceType']});
|
devicesList.push({"rowid" : deviceData['rowid'], "mac" : deviceData['dev_MAC'], "name": deviceData['dev_Name'], "type": deviceData['dev_DeviceType']});
|
||||||
pos=0;
|
pos=0;
|
||||||
@@ -1398,7 +1400,7 @@ function performSwitch(direction)
|
|||||||
// get new mac from the devicesList. Don't change to the commented out line below, the mac query string in the URL isn't updated yet!
|
// get new mac from the devicesList. Don't change to the commented out line below, the mac query string in the URL isn't updated yet!
|
||||||
// mac = params.mac;
|
// mac = params.mac;
|
||||||
|
|
||||||
mac = devicesList[pos].mac.toString();
|
mac = devicesList[pos].dev_MAC.toString();
|
||||||
|
|
||||||
setCache("piaDeviceDetailsMac", mac);
|
setCache("piaDeviceDetailsMac", mac);
|
||||||
|
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ function processColumnValue(dbColumnDef, value, index, type) {
|
|||||||
|
|
||||||
for (const option of dbColumnDef.options) {
|
for (const option of dbColumnDef.options) {
|
||||||
if (option.type === type) {
|
if (option.type === type) {
|
||||||
console.log(option.param)
|
// console.log(option.param)
|
||||||
value = eval(option.param);
|
value = eval(option.param);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user