diff --git a/front/deviceDetails.php b/front/deviceDetails.php index 0bad701e..fd61f163 100755 --- a/front/deviceDetails.php +++ b/front/deviceDetails.php @@ -1,7 +1,7 @@
@@ -62,51 +62,51 @@ - +
- -
+
-
- +
- + ?>
-
+
+ ?>
@@ -194,7 +194,7 @@ require 'php/templates/footer.php'; ?> - + @@ -215,10 +215,10 @@ switch ($UI_THEME) { // ------------------------------------------------------------ - mac = getMac() // can also be rowID!! not only mac - var devicesList = []; // this will contain a list the database row IDs of the devices ordered by the position displayed in the UI + mac = getMac() // can also be rowID!! not only mac + var devicesList = []; // this will contain a list the database row IDs of the devices ordered by the position displayed in the UI - var pos = -1; + var pos = -1; var parPeriod = 'Front_Details_Period'; var tab = 'tabDetails' @@ -250,16 +250,16 @@ function main () { period = '1 day'; sessionsRows = 50; eventsRows = 50; - // $('#chkHideConnectionEvents')[0].checked = eval(eventsHide == 'true'); + // $('#chkHideConnectionEvents')[0].checked = eval(eventsHide == 'true'); // Initialize components with parameters - + // Init tabs once DOM ready $( document ).ready(function() { initializeTabs(); }); - + } @@ -272,7 +272,7 @@ function periodChanged () { // ----------------------------------------------------------------------------- -// Left (prev) < > (next) Right toggles at the top right of device details to +// Left (prev) < > (next) Right toggles at the top right of device details to // cycle between devices function recordSwitch(direction) { @@ -281,7 +281,7 @@ function recordSwitch(direction) { showModalDefaultStrParam ('Unsaved changes', 'Do you want to discard your changes?', '', '', performSwitch, direction); } else - { + { performSwitch(direction) } } @@ -354,7 +354,7 @@ function performSwitch(direction) // Update the global position in the devices list variable 'pos' if (direction === "next") { console.log("direction:" + direction); - + if (pos < devicesList.length) { pos++; } @@ -377,13 +377,13 @@ function performSwitch(direction) // ----------------------------------------------------------------------------- // Activate save & restore on any value change -$(document).on('input', 'input:text', function() { +$(document).on('input', 'input:text', function() { settingsChanged(); }); // ----------------------------------------------------------------------------- -function initializeTabs () { +function initializeTabs () { key ="activeDevicesTab" @@ -392,7 +392,7 @@ function initializeTabs () { { selectedTab = getCache(key); } - + $('.nav-tabs a[id='+ selectedTab +']').tab('show'); // When changed save new current tab @@ -410,7 +410,7 @@ function initializeTabs () { //------------------------------------------------------------------------------ // Render the small boxes on top async function renderSmallBoxes() { - + try { // Show loading dialog showSpinner(); @@ -549,6 +549,7 @@ function updateDevicePageName(mac) { window.onload = function async() { + mac = getMac() // initializeTabs(); updateChevrons(mac); updateDevicePageName(mac); diff --git a/front/deviceDetailsEdit.php b/front/deviceDetailsEdit.php index ee512e10..e18b188d 100755 --- a/front/deviceDetailsEdit.php +++ b/front/deviceDetailsEdit.php @@ -288,7 +288,11 @@ // Save device data to DB function setDeviceData(direction = '', refreshCallback = '') { // Check MAC - if (mac === '') { + mac = getMac() + + if (isEmpty(mac)) { + + console.error("Mac not defined"); return; }