diff --git a/front/js/pialert_common.js b/front/js/pialert_common.js
index 4b663b2f..16174bce 100755
--- a/front/js/pialert_common.js
+++ b/front/js/pialert_common.js
@@ -206,7 +206,10 @@ function getString (key) {
// -----------------------------------------------------------------------------
// Modal dialog handling
// -----------------------------------------------------------------------------
-function showModalOk (title, message, callbackFunction = null) {
+function showModalOK (title, message, callbackFunction) {
+ showModalOk (title, message, callbackFunction)
+}
+function showModalOk (title, message, callbackFunction) {
// set captions
$('#modal-ok-title').html (title);
$('#modal-ok-message').html (message);
@@ -222,6 +225,8 @@ function showModalOk (title, message, callbackFunction = null) {
// Show modal
$('#modal-ok').modal('show');
}
+
+// -----------------------------------------------------------------------------
function showModalDefault (title, message, btnCancel, btnOK, callbackFunction) {
// set captions
$('#modal-default-title').html (title);
@@ -253,13 +258,17 @@ function showModalDefaultStrParam (title, message, btnCancel, btnOK, callbackFun
}
// -----------------------------------------------------------------------------
-function showModalWarning (title, message, btnCancel, btnOK, callbackFunction) {
+function showModalWarning (title, message, btnCancel=getString('Gen_Cancel'), btnOK=getString('Gen_Okay'), callbackFunction=null) {
// set captions
$('#modal-warning-title').html (title);
$('#modal-warning-message').html (message);
$('#modal-warning-cancel').html (btnCancel);
$('#modal-warning-OK').html (btnOK);
- modalCallbackFunction = callbackFunction;
+
+ if ( callbackFunction != null)
+ {
+ modalCallbackFunction = callbackFunction;
+ }
// Show modal
$('#modal-warning').modal('show');
diff --git a/front/network.php b/front/network.php
index 59455c46..e36fcb2c 100755
--- a/front/network.php
+++ b/front/network.php
@@ -456,32 +456,39 @@
@@ -612,13 +619,25 @@
// ---------------------------------------------------------------------------
var myTree;
- var treeAreaHeight = 800;
+ var visibleTreeArea = $(window).height()-135;
+ var treeAreaHeight = visibleTreeArea > 800 ? 800 : visibleTreeArea;
var emSize;
var nodeHeight;
var sizeCoefficient = 1
function initTree(myHierarchy)
{
+
+ console.log(myHierarchy)
+
+
+ if(myHierarchy.type == "")
+ {
+ showModalOk(getString('Network_Configuration_Error'), getString('Network_Root_Not_Configured'))
+
+ return;
+ }
+
// calculate the font size of the leaf nodes to fit everything into the tree area
leafNodesCount == 0 ? 1 : leafNodesCount;
emSize = ((treeAreaHeight/(25*leafNodesCount)).toFixed(2));
diff --git a/front/php/templates/language/en_us.json b/front/php/templates/language/en_us.json
index c757b769..021136e8 100755
--- a/front/php/templates/language/en_us.json
+++ b/front/php/templates/language/en_us.json
@@ -22,6 +22,8 @@
"AppEvents_Helper2" : "Helper 2",
"AppEvents_Helper3" : "Helper 3",
"AppEvents_Extra" : "Extra",
+ "Gen_Error" : "Error",
+ "Gen_Warning" : "Warning",
"Gen_Delete" : "Delete",
"Gen_DeleteAll" : "Delete all",
"Gen_Cancel" : "Cancel",
@@ -428,6 +430,9 @@
"Network_Node_Name" : "Node name",
"Network_Parent" : "Parent network device",
"Network_Cant_Assign" : "Can't assign the root Internet node as a child leaf node.",
+ "Network_NoDevices" : "Configuration Error",
+ "Network_Configuration_Error" : "Configuration Error",
+ "Network_Root_Not_Configured" : "Select a network device type, for example a Gateway, in the Type field of the the Internet root device to start configuring this screen.
More documentation can be found in the How to setup your Network page guide",
"Network_NoAssignedDevices" : "This network node does not have any assigned devices (leaf nodes). Assign one from bellow or go to the Details tab of any device in Devices, and assign it to a network Node (MAC) and Port there.",
"Network_Root_Unconfigurable": "Unconfigurable root",
"HelpFAQ_Title" : "Help / FAQ",