mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
wf work + fa upgrade + css cleanup + network tweaks
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 129 KiB |
@@ -1517,10 +1517,9 @@ input[readonly] {
|
|||||||
/* AdminLTE overrides */
|
/* AdminLTE overrides */
|
||||||
#networkTree .box
|
#networkTree .box
|
||||||
{
|
{
|
||||||
border-top:1px;
|
/* border-top:1px; */
|
||||||
border-top-color:grey;
|
border-top-color:grey;
|
||||||
padding:0px;
|
padding:0px;
|
||||||
padding-top:6px;
|
|
||||||
margin:0px;
|
margin:0px;
|
||||||
align-items:center;
|
align-items:center;
|
||||||
border-radius:20px;
|
border-radius:20px;
|
||||||
@@ -1528,7 +1527,7 @@ input[readonly] {
|
|||||||
/* display:flex; */
|
/* display:flex; */
|
||||||
flex-direction:column;
|
flex-direction:column;
|
||||||
justify-content:center;
|
justify-content:center;
|
||||||
display: inline-grid;
|
/* display: inline-grid; */
|
||||||
}
|
}
|
||||||
.helpIcon
|
.helpIcon
|
||||||
{
|
{
|
||||||
@@ -1577,17 +1576,16 @@ input[readonly] {
|
|||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#networkTree .netCollapse
|
#networkTree .netCollapse
|
||||||
{
|
{
|
||||||
display: block;
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
margin-left: 170px;
|
right: 0;
|
||||||
font-size: large;
|
margin-right: -3px;
|
||||||
left: -15px;
|
|
||||||
}
|
}
|
||||||
#networkTree .highlightedNode
|
#networkTree .highlightedNode
|
||||||
{
|
{
|
||||||
border: solid;
|
/* border: solid; */
|
||||||
border-color:cyan;
|
border-color:cyan;
|
||||||
}
|
}
|
||||||
#networkTree .netStatus-Off-line i,
|
#networkTree .netStatus-Off-line i,
|
||||||
@@ -1598,7 +1596,6 @@ input[readonly] {
|
|||||||
|
|
||||||
.spanNetworkTree {
|
.spanNetworkTree {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
/* width: 135px; */
|
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden !important;
|
overflow: hidden !important;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
@@ -1614,6 +1611,11 @@ input[readonly] {
|
|||||||
/* margin-left: 0.2em; */
|
/* margin-left: 0.2em; */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.networkTable .networkNodeTabHeaders a {
|
||||||
|
display: block;
|
||||||
|
height: 3em;
|
||||||
|
}
|
||||||
|
|
||||||
.networkTable .icon {
|
.networkTable .icon {
|
||||||
/* padding-left:2em; */
|
/* padding-left:2em; */
|
||||||
width:2em;
|
width:2em;
|
||||||
@@ -1632,7 +1634,6 @@ input[readonly] {
|
|||||||
|
|
||||||
.networkNodeTabHeaders
|
.networkNodeTabHeaders
|
||||||
{
|
{
|
||||||
max-width: 200px;
|
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-wrap: nowrap;
|
text-wrap: nowrap;
|
||||||
@@ -1710,13 +1711,6 @@ input[readonly] {
|
|||||||
padding-top: 20px;
|
padding-top: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.login-page .login-custom
|
|
||||||
{
|
|
||||||
width:480px;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/*Hidden special button*/
|
/*Hidden special button*/
|
||||||
|
|
||||||
@media (max-width: 365px) {
|
@media (max-width: 365px) {
|
||||||
@@ -1975,6 +1969,7 @@ input[readonly] {
|
|||||||
right: 0.1em;
|
right: 0.1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.workflows .remove-condition
|
.workflows .remove-condition
|
||||||
{
|
{
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
|
|||||||
@@ -74,10 +74,10 @@
|
|||||||
|
|
||||||
<!-- box-header -->
|
<!-- box-header -->
|
||||||
<div class="box-header">
|
<div class="box-header">
|
||||||
<div class=" col-md-9 ">
|
<div class=" col-sm-8 ">
|
||||||
<h3 id="tableDevicesTitle" class="box-title text-gray "></h3>
|
<h3 id="tableDevicesTitle" class="box-title text-gray "></h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="dummyDevice col-md-3 ">
|
<div class="dummyDevice col-sm-4 ">
|
||||||
<span id="multiEditPlc">
|
<span id="multiEditPlc">
|
||||||
<!-- multi edit button placeholder -->
|
<!-- multi edit button placeholder -->
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -92,10 +92,8 @@ if (isset ($_SESSION["login"]) == FALSE || $_SESSION["login"] != 1)
|
|||||||
<!-- iCheck -->
|
<!-- iCheck -->
|
||||||
<link rel="stylesheet" href="lib/iCheck/square/blue.css">
|
<link rel="stylesheet" href="lib/iCheck/square/blue.css">
|
||||||
<!-- Font Awesome -->
|
<!-- Font Awesome -->
|
||||||
<link rel="stylesheet" href="lib/font-awesome/fontawesome.min.css">
|
<link rel="stylesheet" href="lib/font-awesome/all.min.css">
|
||||||
<link rel="stylesheet" href="lib/font-awesome/solid.css">
|
|
||||||
<link rel="stylesheet" href="lib/font-awesome/brands.css">
|
|
||||||
<link rel="stylesheet" href="lib/font-awesome/v5-font-face.css">
|
|
||||||
<!-- Favicon -->
|
<!-- Favicon -->
|
||||||
<link id="favicon" rel="icon" type="image/x-icon" href="img/NetAlertX_logo.png">
|
<link id="favicon" rel="icon" type="image/x-icon" href="img/NetAlertX_logo.png">
|
||||||
|
|
||||||
@@ -112,7 +110,7 @@ switch ($UI_THEME) {
|
|||||||
?>
|
?>
|
||||||
<link rel="stylesheet" href="/css/offline-font.css">
|
<link rel="stylesheet" href="/css/offline-font.css">
|
||||||
</head>
|
</head>
|
||||||
<body class="hold-transition login-page">
|
<body class="hold-transition login-page col-sm-12 col-sx-12">
|
||||||
<div class="login-box login-custom">
|
<div class="login-box login-custom">
|
||||||
<div class="login-logo">
|
<div class="login-logo">
|
||||||
<a href="/index2.php">Net<b>Alert</b><sup>x</sup></a>
|
<a href="/index2.php">Net<b>Alert</b><sup>x</sup></a>
|
||||||
|
|||||||
9
front/lib/font-awesome/all.min.css
vendored
Executable file
9
front/lib/font-awesome/all.min.css
vendored
Executable file
File diff suppressed because one or more lines are too long
1516
front/lib/font-awesome/brands.css
vendored
1516
front/lib/font-awesome/brands.css
vendored
File diff suppressed because it is too large
Load Diff
6
front/lib/font-awesome/brands.min.css
vendored
6
front/lib/font-awesome/brands.min.css
vendored
File diff suppressed because one or more lines are too long
6
front/lib/font-awesome/fontawesome.min.css
vendored
6
front/lib/font-awesome/fontawesome.min.css
vendored
File diff suppressed because one or more lines are too long
19
front/lib/font-awesome/solid.css
vendored
19
front/lib/font-awesome/solid.css
vendored
@@ -1,19 +0,0 @@
|
|||||||
/*!
|
|
||||||
* Font Awesome Free 6.2.1 by @fontawesome - https://fontawesome.com
|
|
||||||
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
|
||||||
* Copyright 2022 Fonticons, Inc.
|
|
||||||
*/
|
|
||||||
:root, :host {
|
|
||||||
--fa-style-family-classic: 'Font Awesome 6 Free';
|
|
||||||
--fa-font-solid: normal 900 1em/1 'Font Awesome 6 Free'; }
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Font Awesome 6 Free';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 900;
|
|
||||||
font-display: block;
|
|
||||||
src: url("../webfonts/fa-solid-900.woff2") format("woff2"), url("../webfonts/fa-solid-900.ttf") format("truetype"); }
|
|
||||||
|
|
||||||
.fas,
|
|
||||||
.fa-solid {
|
|
||||||
font-weight: 900; }
|
|
||||||
6
front/lib/font-awesome/solid.min.css
vendored
6
front/lib/font-awesome/solid.min.css
vendored
@@ -1,6 +0,0 @@
|
|||||||
/*!
|
|
||||||
* Font Awesome Free 6.2.1 by @fontawesome - https://fontawesome.com
|
|
||||||
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
|
||||||
* Copyright 2022 Fonticons, Inc.
|
|
||||||
*/
|
|
||||||
:host,:root{--fa-style-family-classic:"Font Awesome 6 Free";--fa-font-solid:normal 900 1em/1 "Font Awesome 6 Free"}@font-face{font-family:"Font Awesome 6 Free";font-style:normal;font-weight:900;font-display:block;src:url(../webfonts/fa-solid-900.woff2) format("woff2"),url(../webfonts/fa-solid-900.ttf) format("truetype")}.fa-solid,.fas{font-weight:900}
|
|
||||||
22
front/lib/font-awesome/v5-font-face.css
vendored
22
front/lib/font-awesome/v5-font-face.css
vendored
@@ -1,22 +0,0 @@
|
|||||||
/*!
|
|
||||||
* Font Awesome Free 6.2.1 by @fontawesome - https://fontawesome.com
|
|
||||||
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
|
||||||
* Copyright 2022 Fonticons, Inc.
|
|
||||||
*/
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Font Awesome 5 Brands';
|
|
||||||
font-display: block;
|
|
||||||
font-weight: 400;
|
|
||||||
src: url("../webfonts/fa-brands-400.woff2") format("woff2"), url("../webfonts/fa-brands-400.ttf") format("truetype"); }
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Font Awesome 5 Free';
|
|
||||||
font-display: block;
|
|
||||||
font-weight: 900;
|
|
||||||
src: url("../webfonts/fa-solid-900.woff2") format("woff2"), url("../webfonts/fa-solid-900.ttf") format("truetype"); }
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Font Awesome 5 Free';
|
|
||||||
font-display: block;
|
|
||||||
font-weight: 400;
|
|
||||||
src: url("../webfonts/fa-regular-400.woff2") format("woff2"), url("../webfonts/fa-regular-400.ttf") format("truetype"); }
|
|
||||||
6
front/lib/font-awesome/v5-font-face.min.css
vendored
6
front/lib/font-awesome/v5-font-face.min.css
vendored
@@ -1,6 +0,0 @@
|
|||||||
/*!
|
|
||||||
* Font Awesome Free 6.2.1 by @fontawesome - https://fontawesome.com
|
|
||||||
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
|
||||||
* Copyright 2022 Fonticons, Inc.
|
|
||||||
*/
|
|
||||||
@font-face{font-family:"Font Awesome 5 Brands";font-display:block;font-weight:400;src:url(../webfonts/fa-brands-400.woff2) format("woff2"),url(../webfonts/fa-brands-400.ttf) format("truetype")}@font-face{font-family:"Font Awesome 5 Free";font-display:block;font-weight:900;src:url(../webfonts/fa-solid-900.woff2) format("woff2"),url(../webfonts/fa-solid-900.ttf) format("truetype")}@font-face{font-family:"Font Awesome 5 Free";font-display:block;font-weight:400;src:url(../webfonts/fa-regular-400.woff2) format("woff2"),url(../webfonts/fa-regular-400.ttf) format("truetype")}
|
|
||||||
@@ -6,8 +6,6 @@
|
|||||||
// online / offline badges HTML snippets
|
// online / offline badges HTML snippets
|
||||||
define('badge_online', '<div class="badge bg-green text-white" style="width: 60px;">Online</div>');
|
define('badge_online', '<div class="badge bg-green text-white" style="width: 60px;">Online</div>');
|
||||||
define('badge_offline', '<div class="badge bg-red text-white" style="width: 60px;">Offline</div>');
|
define('badge_offline', '<div class="badge bg-red text-white" style="width: 60px;">Offline</div>');
|
||||||
define('circle_online', '<div class="badge bg-green text-white" style="width: 10px; height: 10px; padding:2px; margin-top: -25px;"> </div>');
|
|
||||||
define('circle_offline', '<div class="badge bg-red text-white" style="width: 10px; height: 10px; padding:2px; margin-top: -25px;"> </div>');
|
|
||||||
define('sortable_column', ' <span class="sort-btn" onclick="sortColumn(this)"><i class="fa-solid fa-arrow-up-short-wide"></i></span>');
|
define('sortable_column', ' <span class="sort-btn" onclick="sortColumn(this)"><i class="fa-solid fa-arrow-up-short-wide"></i></span>');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -39,21 +37,18 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// online/offline status circle (red/green)
|
// online/offline status circle (red/green)
|
||||||
$node_badge = "";
|
$icon_style = "";
|
||||||
if($node_status == 1) // 1 means online, 0 offline
|
if($node_status == 0) // 1 means online, 0 offline
|
||||||
{
|
{
|
||||||
$node_badge = circle_online;
|
$icon_style = "style=\"color:var(--color-red);\"";
|
||||||
} else
|
}
|
||||||
{
|
|
||||||
$node_badge = circle_offline;
|
|
||||||
}
|
|
||||||
|
|
||||||
$decoded_icon = base64_decode($icon);
|
$decoded_icon = base64_decode($icon);
|
||||||
$idFromMac = str_replace(":", "_", $node_mac);
|
$idFromMac = str_replace(":", "_", $node_mac);
|
||||||
$str_tab_header = '<li class="networkNodeTabHeaders '.$activetab.' " >
|
$str_tab_header = '<li class="networkNodeTabHeaders '.$activetab.' " >
|
||||||
|
|
||||||
<a href="#'.$idFromMac.'" data-mytabmac="'.$node_mac.'" id="'.$idFromMac.'_id" data-toggle="tab" title="'.$node_name.' ">' // _id is added so it doesn't conflict with AdminLTE tab behavior
|
<a href="#'.$idFromMac.'" data-mytabmac="'.$node_mac.'" id="'.$idFromMac.'_id" data-toggle="tab" title="'.$node_name.' ">' // _id is added so it doesn't conflict with AdminLTE tab behavior
|
||||||
.'<div class="icon">'.$decoded_icon.' </div> <span class="node-name">'.$node_name.'</span>' .$str_port.$node_badge.
|
.'<div class="icon" '.$icon_style.'>'.$decoded_icon.' </div> <span class="node-name">'.$node_name.'</span>' .$str_port.
|
||||||
'</a>
|
'</a>
|
||||||
</li>';
|
</li>';
|
||||||
|
|
||||||
@@ -697,34 +692,56 @@ function attachTreeEvents()
|
|||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Handle network node click - select correct tab in the bottom table
|
// Handle network node click - select correct tab in the bottom table
|
||||||
function handleNodeClick(nodeData)
|
function handleNodeClick(el)
|
||||||
{
|
{
|
||||||
const targetTabMAC = nodeData.data.mac;
|
const targetTabMAC = $(el).attr("data-mytreemacmain");
|
||||||
|
|
||||||
var targetTab = $(`a[data-mytabmac="${targetTabMAC}"]`);
|
var targetTab = $(`a[data-mytabmac="${targetTabMAC}"]`);
|
||||||
|
|
||||||
// Simulate a click event on the target tab
|
if (targetTab.length) {
|
||||||
targetTab.click();
|
// Simulate a click event on the target tab
|
||||||
|
targetTab.click();
|
||||||
|
|
||||||
|
// Smooth scroll to the tab content
|
||||||
|
$('html, body').animate({
|
||||||
|
scrollTop: targetTab.offset().top - 50
|
||||||
|
}, 500); // Adjust the duration as needed
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
var myTree;
|
var myTree;
|
||||||
var visibleTreeArea = $(window).height()-155;
|
|
||||||
var nodeWidth = 120;
|
|
||||||
var emSize;
|
var emSize;
|
||||||
var nodeHeight;
|
var nodeHeight;
|
||||||
var sizeCoefficient = 1.4
|
// var sizeCoefficient = 1.4
|
||||||
|
|
||||||
|
function pxToEm(px, element) {
|
||||||
|
var baseFontSize = parseFloat($(element || "body").css("font-size"));
|
||||||
|
return px / baseFontSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
function emToPx(em, element) {
|
||||||
|
var baseFontSize = parseFloat($(element || "body").css("font-size"));
|
||||||
|
return Math.round(em * baseFontSize);
|
||||||
|
}
|
||||||
|
|
||||||
function initTree(myHierarchy)
|
function initTree(myHierarchy)
|
||||||
{
|
{
|
||||||
// calculate the drawing area based on teh tree width and available screen size
|
// calculate the drawing area based on teh tree width and available screen size
|
||||||
var treeAreaHeight = visibleTreeArea > 800 ? 800 : visibleTreeArea;
|
|
||||||
let screenWidth = $('.content-header').width();
|
let baseFontSize = parseFloat($('html').css('font-size'));
|
||||||
let treeWidth = (nodeWidth + 20) * parentNodesCount;
|
let treeAreaHeight = ($(window).height() - 155); ;
|
||||||
let treeAreaWidth = screenWidth < treeWidth ? treeWidth : screenWidth;
|
// calculate the font size of the leaf nodes to fit everything into the tree area
|
||||||
|
leafNodesCount == 0 ? 1 : leafNodesCount;
|
||||||
|
|
||||||
|
emSize = pxToEm((treeAreaHeight/(leafNodesCount)).toFixed(2));
|
||||||
|
|
||||||
|
let screenWidthEm = pxToEm($('.networkTable').width());
|
||||||
|
|
||||||
// init the drawing area size
|
// init the drawing area size
|
||||||
$("#networkTree").attr('style', `height:${treeAreaHeight}px; width:${treeAreaWidth}px`)
|
$("#networkTree").attr('style', `height:${treeAreaHeight}px; width:${emToPx(screenWidthEm)}px`)
|
||||||
|
|
||||||
if(myHierarchy.type == "")
|
if(myHierarchy.type == "")
|
||||||
{
|
{
|
||||||
@@ -733,13 +750,14 @@ function initTree(myHierarchy)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// calculate the font size of the leaf nodes to fit everything into the tree area
|
// handle if only a few nodes
|
||||||
leafNodesCount == 0 ? 1 : leafNodesCount;
|
emSize > 1 ? emSize = 1 : emSize = emSize;
|
||||||
emSize = ((treeAreaHeight/(25*leafNodesCount)).toFixed(2));
|
|
||||||
emSize = emSize > 1 ? 1 : emSize;
|
|
||||||
|
|
||||||
// nodeHeight = ((emSize*100*0.30).toFixed(0))
|
let nodeHeightPx = emToPx(emSize*1);
|
||||||
nodeHeight = ((emSize*100*0.30).toFixed(0))
|
let nodeWidthPx = emToPx(screenWidthEm / (parentNodesCount));
|
||||||
|
|
||||||
|
// handle if only a few nodes
|
||||||
|
nodeWidthPx > 160 ? nodeWidthPx = 160 : nodeWidthPx = nodeWidthPx;
|
||||||
|
|
||||||
console.log(Treeviz);
|
console.log(Treeviz);
|
||||||
|
|
||||||
@@ -747,8 +765,7 @@ function initTree(myHierarchy)
|
|||||||
htmlId: "networkTree",
|
htmlId: "networkTree",
|
||||||
renderNode: nodeData => {
|
renderNode: nodeData => {
|
||||||
|
|
||||||
var fontSize = "font-size:"+emSize+"em;";
|
|
||||||
|
|
||||||
(!emptyArr.includes(nodeData.data.port )) ? port = nodeData.data.port : port = "";
|
(!emptyArr.includes(nodeData.data.port )) ? port = nodeData.data.port : port = "";
|
||||||
|
|
||||||
(port == "" || port == 0 || port == 'None' ) ? portBckgIcon = `<i class="fa fa-wifi"></i>` : portBckgIcon = `<i class="fa fa-ethernet"></i>`;
|
(port == "" || port == 0 || port == 'None' ) ? portBckgIcon = `<i class="fa fa-wifi"></i>` : portBckgIcon = `<i class="fa fa-ethernet"></i>`;
|
||||||
@@ -761,10 +778,10 @@ function initTree(myHierarchy)
|
|||||||
${atob(nodeData.data.icon)}
|
${atob(nodeData.data.icon)}
|
||||||
</div>` : "";
|
</div>` : "";
|
||||||
devicePort = `<div class="netPort"
|
devicePort = `<div class="netPort"
|
||||||
style="width:${emSize*sizeCoefficient}em;height:${emSize*sizeCoefficient}em">
|
style="width:${emSize}em;height:${emSize}em">
|
||||||
${portHtml}</div>
|
${portHtml}</div>
|
||||||
<div class="portBckgIcon"
|
<div class="portBckgIcon"
|
||||||
style="margin-left:-${emSize*sizeCoefficient}em;">
|
style="margin-left:-${emSize}em;">
|
||||||
${portBckgIcon}
|
${portBckgIcon}
|
||||||
</div>`;
|
</div>`;
|
||||||
collapseExpandIcon = nodeData.data.hiddenChildren ?
|
collapseExpandIcon = nodeData.data.hiddenChildren ?
|
||||||
@@ -773,7 +790,7 @@ function initTree(myHierarchy)
|
|||||||
// generate +/- icon if node has children nodes
|
// generate +/- icon if node has children nodes
|
||||||
collapseExpandHtml = nodeData.data.hasChildren ?
|
collapseExpandHtml = nodeData.data.hasChildren ?
|
||||||
`<div class="netCollapse"
|
`<div class="netCollapse"
|
||||||
style="font-size:${emSize*sizeCoefficient}em;top:${emSize/6}em"
|
style="font-size:${nodeHeightPx/2}px;top:${nodeHeightPx/4}px"
|
||||||
data-mytreepath="${nodeData.data.path}"
|
data-mytreepath="${nodeData.data.path}"
|
||||||
data-mytreemac="${nodeData.data.mac}">
|
data-mytreemac="${nodeData.data.mac}">
|
||||||
<i class="fa fa-${collapseExpandIcon} pointer"></i>
|
<i class="fa fa-${collapseExpandIcon} pointer"></i>
|
||||||
@@ -787,21 +804,24 @@ function initTree(myHierarchy)
|
|||||||
// css indicating online/offline status
|
// css indicating online/offline status
|
||||||
statusCss = ` netStatus-${nodeData.data.status}`;
|
statusCss = ` netStatus-${nodeData.data.status}`;
|
||||||
|
|
||||||
return result = `<div class="box ${nodeData.data.hasChildren ? "pointer":""} ${statusCss} ${highlightedCss}"
|
return result = `<div
|
||||||
|
class="node-inner box ${nodeData.data.hasChildren ? "pointer":""} ${statusCss} ${highlightedCss}"
|
||||||
data-mytreemacmain="${nodeData.data.mac}"
|
data-mytreemacmain="${nodeData.data.mac}"
|
||||||
style="height:${nodeData.settings.nodeHeight}px;${fontSize}"
|
style="height:${nodeHeightPx}px;font-size:${nodeHeightPx-5}px;"
|
||||||
|
onclick="handleNodeClick(this)"
|
||||||
>
|
>
|
||||||
<div class="netNodeText">
|
<div class="netNodeText">
|
||||||
<strong>${devicePort} ${deviceIcon}
|
<strong>${devicePort} ${deviceIcon}
|
||||||
<span class="spanNetworkTree anonymizeDev" >${nodeData.data.name}</span>
|
<span class="spanNetworkTree anonymizeDev" style="width:${nodeWidthPx-50}px">${nodeData.data.name}</span>
|
||||||
</strong>
|
</strong>
|
||||||
${collapseExpandHtml}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
${collapseExpandHtml}`;
|
||||||
},
|
},
|
||||||
mainAxisNodeSpacing: 'auto',
|
mainAxisNodeSpacing: 'auto',
|
||||||
secondaryAxisNodeSpacing: 0.3,
|
// secondaryAxisNodeSpacing: 0.3,
|
||||||
nodeHeight: nodeHeight.toString(),
|
nodeHeight: nodeHeightPx,
|
||||||
|
nodeWidth: nodeWidthPx,
|
||||||
marginTop: '5',
|
marginTop: '5',
|
||||||
isHorizontal : true,
|
isHorizontal : true,
|
||||||
hasZoom: true,
|
hasZoom: true,
|
||||||
@@ -811,8 +831,8 @@ function initTree(myHierarchy)
|
|||||||
hasFlatData: false,
|
hasFlatData: false,
|
||||||
relationnalField: "children",
|
relationnalField: "children",
|
||||||
linkWidth: (nodeData) => 3,
|
linkWidth: (nodeData) => 3,
|
||||||
linkColor: (nodeData) => "#ffcc80",
|
linkColor: (nodeData) => "#ffcc80"
|
||||||
onNodeClick: (nodeData) => handleNodeClick(nodeData),
|
// onNodeClick: (nodeData) => handleNodeClick(nodeData),
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(deviceListGlobal);
|
console.log(deviceListGlobal);
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
<div class="pull-right no-hidden-xs">
|
<div class="pull-right no-hidden-xs">
|
||||||
| <a href="https://gurubase.io/g/netalertx" class="pointer" target="_blank" title="Ask AI"><i class="fa-regular fa-comment-dots fa-flip-horizontal"></i></a>
|
| <a href="https://gurubase.io/g/netalertx" class="pointer" target="_blank" title="Ask AI"><i class="fa-regular fa-comment-dots fa-flip-horizontal"></i></a>
|
||||||
| <a href="https://jokob-sk.github.io/NetAlertX/" class="pointer" target="_blank" title="Documentation"><i class="fa fa-book"></i></a>
|
| <a href="https://jokob-sk.github.io/NetAlertX/" class="pointer" target="_blank" title="Documentation"><i class="fa fa-book"></i></a>
|
||||||
| <a href="https://github.com/jokob-sk/NetAlertX/issues" class="pointer" target="_blank"><i class="fa-solid fa-bug" title="Report a bug"></i></a>
|
| <a href="https://github.com/jokob-sk/NetAlertX/issues" class="pointer" target="_blank"><i class="fa fa-bug" title="Report a bug"></i></a>
|
||||||
| <a href="https://discord.com/invite/NczTUTWyRr" class="pointer" target="_blank"><i class="fa-brands fa-discord" title="Join Discord"></i></a>
|
| <a href="https://discord.com/invite/NczTUTWyRr" class="pointer" target="_blank"><i class="fa-brands fa-discord" title="Join Discord"></i></a>
|
||||||
| <?= lang('Maintenance_built_on');?>: <?php include 'php/templates/build.php'; ?>
|
| <?= lang('Maintenance_built_on');?>: <?php include 'php/templates/build.php'; ?>
|
||||||
| Version: <?php include 'php/templates/version.php'; ?>
|
| Version: <?php include 'php/templates/version.php'; ?>
|
||||||
|
|||||||
@@ -59,10 +59,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<!-- Font Awesome -->
|
<!-- Font Awesome -->
|
||||||
<link rel="stylesheet" href="lib/font-awesome/fontawesome.min.css">
|
<link rel="stylesheet" href="lib/font-awesome/all.min.css">
|
||||||
<link rel="stylesheet" href="lib/font-awesome/solid.css">
|
|
||||||
<link rel="stylesheet" href="lib/font-awesome/brands.css">
|
|
||||||
<link rel="stylesheet" href="lib/font-awesome/v5-font-face.css">
|
|
||||||
|
|
||||||
<!-- Ionicons -->
|
<!-- Ionicons -->
|
||||||
<link rel="stylesheet" href="lib/Ionicons/ionicons.min.css">
|
<link rel="stylesheet" href="lib/Ionicons/ionicons.min.css">
|
||||||
@@ -421,20 +418,15 @@
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
<!-- Integrations menu item -->
|
<!-- Integrations menu item -->
|
||||||
<li class=" treeview <?php if (in_array (basename($_SERVER['SCRIPT_NAME']), array('plugins.php', 'workflows.php', 'appEvents.php' ) ) ){ echo 'active menu-open'; } ?>">
|
<li class=" treeview <?php if (in_array (basename($_SERVER['SCRIPT_NAME']), array('plugins.php', 'appEvents.php' ) ) ){ echo 'active menu-open'; } ?>">
|
||||||
<a href="#">
|
<a href="#">
|
||||||
<i class="fa fa-fw fa-plug"></i> <span><?= lang('Navigation_Integrations');?></span>
|
<i class="fa fa-fw fa-plug"></i> <span><?= lang('Navigation_Integrations');?></span>
|
||||||
<span class="pull-right-container">
|
<span class="pull-right-container">
|
||||||
<i class="fa fa-angle-left pull-right"></i>
|
<i class="fa fa-angle-left pull-right"></i>
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
<ul class="treeview-menu " style="display: <?php if (in_array (basename($_SERVER['SCRIPT_NAME']), array('plugins.php', 'workflows.php', 'appEvents.php' ) ) ){ echo 'block'; } else {echo 'none';} ?>;">
|
<ul class="treeview-menu " style="display: <?php if (in_array (basename($_SERVER['SCRIPT_NAME']), array('plugins.php', 'appEvents.php' ) ) ){ echo 'block'; } else {echo 'none';} ?>;">
|
||||||
<li>
|
<li>
|
||||||
<div class="info-icon-nav"> </div>
|
|
||||||
<a href="workflows.php"><?= lang('Navigation_Workflows');?></a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<div class="info-icon-nav"> </div>
|
|
||||||
<a href="appEvents.php"><?= lang('Navigation_AppEvents');?></a>
|
<a href="appEvents.php"><?= lang('Navigation_AppEvents');?></a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@@ -443,6 +435,11 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<!-- workflows menu item -->
|
||||||
|
<li class=" <?php if (in_array (basename($_SERVER['SCRIPT_NAME']), array('workflows.php') ) ){ echo 'active'; } ?>">
|
||||||
|
<a href="workflows.php"><i class="fa fa-fw fa-shuffle"></i> <span><?= lang('Navigation_Workflows');?></span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
<!-- system info menu item -->
|
<!-- system info menu item -->
|
||||||
<li class=" <?php if (in_array (basename($_SERVER['SCRIPT_NAME']), array('systeminfo.php') ) ){ echo 'active'; } ?>">
|
<li class=" <?php if (in_array (basename($_SERVER['SCRIPT_NAME']), array('systeminfo.php') ) ){ echo 'active'; } ?>">
|
||||||
<a href="systeminfo.php"><i class="fa fa-fw fa-info-circle"></i> <span><?= lang('Navigation_SystemInfo');?></span></a>
|
<a href="systeminfo.php"><i class="fa fa-fw fa-info-circle"></i> <span><?= lang('Navigation_SystemInfo');?></span></a>
|
||||||
|
|||||||
2
front/php/templates/language/ca_ca.json
Normal file → Executable file
2
front/php/templates/language/ca_ca.json
Normal file → Executable file
@@ -736,4 +736,4 @@
|
|||||||
"settings_update_item_warning": "Actualitza el valor sota. Sigues curós de seguir el format anterior. <b>No hi ha validació.</b>",
|
"settings_update_item_warning": "Actualitza el valor sota. Sigues curós de seguir el format anterior. <b>No hi ha validació.</b>",
|
||||||
"test_event_icon": "fa-vial-circle-check",
|
"test_event_icon": "fa-vial-circle-check",
|
||||||
"test_event_tooltip": "Deseu els canvis primer abans de comprovar la configuració."
|
"test_event_tooltip": "Deseu els canvis primer abans de comprovar la configuració."
|
||||||
}
|
}
|
||||||
2
front/php/templates/language/de_de.json
Normal file → Executable file
2
front/php/templates/language/de_de.json
Normal file → Executable file
@@ -817,4 +817,4 @@
|
|||||||
"settings_update_item_warning": "",
|
"settings_update_item_warning": "",
|
||||||
"test_event_icon": "",
|
"test_event_icon": "",
|
||||||
"test_event_tooltip": "Speichere die Änderungen, bevor Sie die Einstellungen testen."
|
"test_event_tooltip": "Speichere die Änderungen, bevor Sie die Einstellungen testen."
|
||||||
}
|
}
|
||||||
2
front/php/templates/language/es_es.json
Normal file → Executable file
2
front/php/templates/language/es_es.json
Normal file → Executable file
@@ -815,4 +815,4 @@
|
|||||||
"settings_update_item_warning": "Actualice el valor a continuación. Tenga cuidado de seguir el formato anterior. <b>O la validación no se realiza.</b>",
|
"settings_update_item_warning": "Actualice el valor a continuación. Tenga cuidado de seguir el formato anterior. <b>O la validación no se realiza.</b>",
|
||||||
"test_event_icon": "fa-vial-circle-check",
|
"test_event_icon": "fa-vial-circle-check",
|
||||||
"test_event_tooltip": "Guarda tus cambios antes de probar nuevos ajustes."
|
"test_event_tooltip": "Guarda tus cambios antes de probar nuevos ajustes."
|
||||||
}
|
}
|
||||||
2
front/php/templates/language/fr_fr.json
Normal file → Executable file
2
front/php/templates/language/fr_fr.json
Normal file → Executable file
@@ -736,4 +736,4 @@
|
|||||||
"settings_update_item_warning": "Mettre à jour la valeur ci-dessous. Veillez à bien suivre le même format qu'auparavant. <b>Il n'y a pas de pas de contrôle.</b>",
|
"settings_update_item_warning": "Mettre à jour la valeur ci-dessous. Veillez à bien suivre le même format qu'auparavant. <b>Il n'y a pas de pas de contrôle.</b>",
|
||||||
"test_event_icon": "fa-vial-circle-check",
|
"test_event_icon": "fa-vial-circle-check",
|
||||||
"test_event_tooltip": "Enregistrer d'abord vos modifications avant de tester vôtre paramétrage."
|
"test_event_tooltip": "Enregistrer d'abord vos modifications avant de tester vôtre paramétrage."
|
||||||
}
|
}
|
||||||
2
front/php/templates/language/it_it.json
Normal file → Executable file
2
front/php/templates/language/it_it.json
Normal file → Executable file
@@ -736,4 +736,4 @@
|
|||||||
"settings_update_item_warning": "Aggiorna il valore qui sotto. Fai attenzione a seguire il formato precedente. <b>La convalida non viene eseguita.</b>",
|
"settings_update_item_warning": "Aggiorna il valore qui sotto. Fai attenzione a seguire il formato precedente. <b>La convalida non viene eseguita.</b>",
|
||||||
"test_event_icon": "fa-vial-circle-check",
|
"test_event_icon": "fa-vial-circle-check",
|
||||||
"test_event_tooltip": "Salva le modifiche prima di provare le nuove impostazioni."
|
"test_event_tooltip": "Salva le modifiche prima di provare le nuove impostazioni."
|
||||||
}
|
}
|
||||||
2
front/php/templates/language/nb_no.json
Normal file → Executable file
2
front/php/templates/language/nb_no.json
Normal file → Executable file
@@ -736,4 +736,4 @@
|
|||||||
"settings_update_item_warning": "Oppdater verdien nedenfor. Pass på å følge forrige format. <b>Validering etterpå utføres ikke.</b>",
|
"settings_update_item_warning": "Oppdater verdien nedenfor. Pass på å følge forrige format. <b>Validering etterpå utføres ikke.</b>",
|
||||||
"test_event_icon": "fa-vial-circle-check",
|
"test_event_icon": "fa-vial-circle-check",
|
||||||
"test_event_tooltip": "Lagre endringene først, før du tester innstillingene dine."
|
"test_event_tooltip": "Lagre endringene først, før du tester innstillingene dine."
|
||||||
}
|
}
|
||||||
2
front/php/templates/language/pl_pl.json
Normal file → Executable file
2
front/php/templates/language/pl_pl.json
Normal file → Executable file
@@ -736,4 +736,4 @@
|
|||||||
"settings_update_item_warning": "Zaktualizuj poniższą wartość. Zachowaj ostrożność i postępuj zgodnie z poprzednim formatem. <b>Walidacja nie jest wykonywana.</b>",
|
"settings_update_item_warning": "Zaktualizuj poniższą wartość. Zachowaj ostrożność i postępuj zgodnie z poprzednim formatem. <b>Walidacja nie jest wykonywana.</b>",
|
||||||
"test_event_icon": "fa-vial-circle-check",
|
"test_event_icon": "fa-vial-circle-check",
|
||||||
"test_event_tooltip": "Zapisz zmiany zanim będziesz testować swoje ustawienia."
|
"test_event_tooltip": "Zapisz zmiany zanim będziesz testować swoje ustawienia."
|
||||||
}
|
}
|
||||||
0
front/php/templates/language/pt_br.json
Normal file → Executable file
0
front/php/templates/language/pt_br.json
Normal file → Executable file
2
front/php/templates/language/ru_ru.json
Normal file → Executable file
2
front/php/templates/language/ru_ru.json
Normal file → Executable file
@@ -736,4 +736,4 @@
|
|||||||
"settings_update_item_warning": "Обновить значение ниже. Будьте осторожны, следуя предыдущему формату. <b>Проверка не выполняется.</b>",
|
"settings_update_item_warning": "Обновить значение ниже. Будьте осторожны, следуя предыдущему формату. <b>Проверка не выполняется.</b>",
|
||||||
"test_event_icon": "fa-vial-circle-check",
|
"test_event_icon": "fa-vial-circle-check",
|
||||||
"test_event_tooltip": "Сначала сохраните изменения, прежде чем проверять настройки."
|
"test_event_tooltip": "Сначала сохраните изменения, прежде чем проверять настройки."
|
||||||
}
|
}
|
||||||
2
front/php/templates/language/uk_ua.json
Normal file → Executable file
2
front/php/templates/language/uk_ua.json
Normal file → Executable file
@@ -736,4 +736,4 @@
|
|||||||
"settings_update_item_warning": "Оновіть значення нижче. Слідкуйте за попереднім форматом. <b>Перевірка не виконана.</b>",
|
"settings_update_item_warning": "Оновіть значення нижче. Слідкуйте за попереднім форматом. <b>Перевірка не виконана.</b>",
|
||||||
"test_event_icon": "fa-vial-circle- check",
|
"test_event_icon": "fa-vial-circle- check",
|
||||||
"test_event_tooltip": "Перш ніж перевіряти налаштування, збережіть зміни."
|
"test_event_tooltip": "Перш ніж перевіряти налаштування, збережіть зміни."
|
||||||
}
|
}
|
||||||
2
front/php/templates/language/zh_cn.json
Normal file → Executable file
2
front/php/templates/language/zh_cn.json
Normal file → Executable file
@@ -736,4 +736,4 @@
|
|||||||
"settings_update_item_warning": "更新下面的值。请注意遵循先前的格式。<b>未执行验证。</b>",
|
"settings_update_item_warning": "更新下面的值。请注意遵循先前的格式。<b>未执行验证。</b>",
|
||||||
"test_event_icon": "",
|
"test_event_icon": "",
|
||||||
"test_event_tooltip": "在测试设置之前,请先保存更改。"
|
"test_event_tooltip": "在测试设置之前,请先保存更改。"
|
||||||
}
|
}
|
||||||
@@ -11,19 +11,19 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div id="buttons" class="bottom-buttons col-sm-12 col-xs-12">
|
<div id="buttons" class="bottom-buttons col-sm-12 col-xs-12">
|
||||||
<div class="add-workflow col-sm-12 col-xs-12">
|
<div class="add-workflow col-sm-4 col-xs-12">
|
||||||
<button type="button" class="btn btn-primary add-workflow-btn col-sm-12 col-xs-12" id="add">
|
<button type="button" class="btn btn-primary add-workflow-btn col-sm-12 col-xs-12" id="add">
|
||||||
<?= lang('WF_Add');?>
|
<i class="fa fa-fw fa-plus"></i> <?= lang('WF_Add');?>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="save-workflows col-sm-12 col-xs-12">
|
<div class="save-workflows col-sm-4 col-xs-12">
|
||||||
<button type="button" class="btn btn-primary col-sm-12 col-xs-12" id="save" onclick="saveWorkflows()">
|
<button type="button" class="btn btn-primary col-sm-12 col-xs-12" id="save" onclick="saveWorkflows()">
|
||||||
<?= lang('WF_Save');?>
|
<i class="fa fa-fw fa-floppy-disk"></i> <?= lang('WF_Save');?>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="restart-app col-sm-12 col-xs-12">
|
<div class="restart-app col-sm-4 col-xs-12">
|
||||||
<button type="button" class="btn btn-primary col-sm-12 col-xs-12" id="save" onclick="askRestartBackend()">
|
<button type="button" class="btn btn-primary col-sm-12 col-xs-12" id="save" onclick="askRestartBackend()">
|
||||||
<?= lang('Maint_RestartServer');?>
|
<i class="fa fa-fw fa-arrow-rotate-right"></i> <?= lang('Maint_RestartServer');?>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -108,6 +108,8 @@ function renderWorkflows() {
|
|||||||
// Generate UI for a single workflow
|
// Generate UI for a single workflow
|
||||||
function generateWorkflowUI(wf, wfIndex) {
|
function generateWorkflowUI(wf, wfIndex) {
|
||||||
|
|
||||||
|
let wfEnabled = (wf?.enabled ?? "No") == "Yes";
|
||||||
|
|
||||||
let $wfContainer = $("<div>", {
|
let $wfContainer = $("<div>", {
|
||||||
class: "workflow-card panel col-sm-12 col-sx-12",
|
class: "workflow-card panel col-sm-12 col-sx-12",
|
||||||
id: `wf-${wfIndex}-container`
|
id: `wf-${wfIndex}-container`
|
||||||
@@ -121,6 +123,11 @@ function generateWorkflowUI(wf, wfIndex) {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
let $wfEnabledIcon = $("<i>", {
|
||||||
|
class: `alignRight fa-regular ${wfEnabled ? "fa-dot-circle" : "fa-circle" }`
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
let $wfHeaderLink = $("<a>",
|
let $wfHeaderLink = $("<a>",
|
||||||
{
|
{
|
||||||
"class": "pointer ",
|
"class": "pointer ",
|
||||||
@@ -137,7 +144,7 @@ function generateWorkflowUI(wf, wfIndex) {
|
|||||||
}
|
}
|
||||||
).text(wf.name)
|
).text(wf.name)
|
||||||
|
|
||||||
$wfContainer.append($wfHeaderLink.append($wfLinkWrap.append($wfHeaderHeading)));
|
$wfContainer.append($wfHeaderLink.append($wfLinkWrap.append($wfHeaderHeading.append($wfEnabledIcon))));
|
||||||
|
|
||||||
// Collapsible panel start
|
// Collapsible panel start
|
||||||
|
|
||||||
@@ -157,7 +164,7 @@ function generateWorkflowUI(wf, wfIndex) {
|
|||||||
`[${wfIndex}].enabled`,
|
`[${wfIndex}].enabled`,
|
||||||
getString("WF_Enabled"),
|
getString("WF_Enabled"),
|
||||||
wfEnabledOptions,
|
wfEnabledOptions,
|
||||||
wf?.enabled ?? "No",
|
wfEnabled ? "Yes" :"No",
|
||||||
`wf-${wfIndex}-enabled`
|
`wf-${wfIndex}-enabled`
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -210,9 +217,10 @@ function generateWorkflowUI(wf, wfIndex) {
|
|||||||
class: "fa-solid fa-bolt bckg-icon-2-line"
|
class: "fa-solid fa-bolt bckg-icon-2-line"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$triggerSection.append($triggerIcon);
|
||||||
$triggerSection.append($triggerTypeDropdown);
|
$triggerSection.append($triggerTypeDropdown);
|
||||||
$triggerSection.append($eventTypeDropdown);
|
$triggerSection.append($eventTypeDropdown);
|
||||||
$triggerSection.append($triggerIcon);
|
|
||||||
$wfCollapsiblePanel.append($triggerSection);
|
$wfCollapsiblePanel.append($triggerSection);
|
||||||
|
|
||||||
// Conditions
|
// Conditions
|
||||||
@@ -323,11 +331,13 @@ function generateWorkflowUI(wf, wfIndex) {
|
|||||||
$actionRemoveButtonWrap.append($actionRemoveButton);
|
$actionRemoveButtonWrap.append($actionRemoveButton);
|
||||||
|
|
||||||
let $actionIcon = $("<i>", {
|
let $actionIcon = $("<i>", {
|
||||||
class: `fa-solid fa-person-running fa-flip-horizontal bckg-icon-${numberOfLines}-line `
|
class: `fa-solid fa-person-running fa-flip-horizontal bckg-icon-${numberOfLines}-line `
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$actionEl.prepend($actionIcon)
|
||||||
|
|
||||||
$actionElWrap.append($actionEl)
|
$actionElWrap.append($actionEl)
|
||||||
$actionElWrap.append($actionIcon)
|
|
||||||
$actionElWrap.append($actionRemoveButtonWrap)
|
$actionElWrap.append($actionRemoveButtonWrap)
|
||||||
|
|
||||||
$actionsContainer.append($actionElWrap);
|
$actionsContainer.append($actionElWrap);
|
||||||
|
|||||||
Reference in New Issue
Block a user