mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
v2.70
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
# Pi.Alert
|
||||
# Open Source Network Guard / WIFI & LAN intrusion detector
|
||||
#
|
||||
# footer.php - Front module. Common footer to all the front pages
|
||||
# footer.php - Front module. Common footer to all the web pages
|
||||
#-------------------------------------------------------------------------------
|
||||
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3
|
||||
#--------------------------------------------------------------------------- -->
|
||||
@@ -11,9 +11,7 @@
|
||||
<footer class="main-footer">
|
||||
<!-- Default to the left -->
|
||||
|
||||
<!--
|
||||
© 2020 Puche
|
||||
-->
|
||||
<!-- © 2020 Puche -->
|
||||
<?php
|
||||
$conf_file = '../config/version.conf';
|
||||
$conf_data = parse_ini_file($conf_file);
|
||||
@@ -23,9 +21,7 @@
|
||||
<!-- To the right -->
|
||||
<div class="pull-right no-hidden-xs">
|
||||
|
||||
<!--
|
||||
Pi.Alert  2.50  <small>(2019-12-30)</small>
|
||||
-->
|
||||
<!-- Pi.Alert 2.50 <small>(2019-12-30)</small> -->
|
||||
<?php
|
||||
$conf_file = '../config/version.conf';
|
||||
$conf_data = parse_ini_file($conf_file);
|
||||
@@ -34,34 +30,36 @@
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- ----------------------------------------------------------------------- -->
|
||||
<!-- Control Sidebar -->
|
||||
<!-- DELETED -->
|
||||
<!-- DELETED -->
|
||||
|
||||
</div>
|
||||
<!-- ./wrapper -->
|
||||
|
||||
<!-- ----------------------------------------------------------------------- -->
|
||||
<!-- REQUIRED JS SCRIPTS -->
|
||||
|
||||
<!-- jQuery 3 -->
|
||||
<script src="lib/AdminLTE/bower_components/jquery/dist/jquery.min.js"></script>
|
||||
<script src="lib/AdminLTE/bower_components/jquery/dist/jquery.min.js"></script>
|
||||
|
||||
<!-- Bootstrap 3.3.7 -->
|
||||
<script src="lib/AdminLTE/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
|
||||
<script src="lib/AdminLTE/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
|
||||
|
||||
<!-- AdminLTE App -->
|
||||
<script src="lib/AdminLTE/dist/js/adminlte.min.js"></script>
|
||||
<script src="lib/AdminLTE/dist/js/adminlte.min.js"></script>
|
||||
|
||||
<!-- Optionally, you can add Slimscroll and FastClick plugins.
|
||||
Both of these plugins are recommended to enhance the
|
||||
user experience. -->
|
||||
|
||||
<!-- SlimScroll -->
|
||||
<script src="lib/AdminLTE/bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
|
||||
<!-- <script src="lib/AdminLTE/bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script> -->
|
||||
<!-- FastClick -->
|
||||
<script src="lib/AdminLTE/bower_components/fastclick/lib/fastclick.js"></script>
|
||||
<!-- <script src="lib/AdminLTE/bower_components/fastclick/lib/fastclick.js"></script> -->
|
||||
|
||||
<!-- Pi.Alert -------------------------------------------------------------- -->
|
||||
<script src="js/pialert_common.js"></script>
|
||||
|
||||
<script src="js/pialert_common.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -2,52 +2,58 @@
|
||||
# Pi.Alert
|
||||
# Open Source Network Guard / WIFI & LAN intrusion detector
|
||||
#
|
||||
# header.php - Front module. Common header to all the front pages
|
||||
# header.php - Front module. Common header to all the web pages
|
||||
#-------------------------------------------------------------------------------
|
||||
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3
|
||||
#--------------------------------------------------------------------------- -->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<!-- ----------------------------------------------------------------------- -->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>Pi.Alert</title>
|
||||
|
||||
<!-- Tell the browser to be responsive to screen width -->
|
||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||
|
||||
<!-- Bootstrap 3.3.7 -->
|
||||
<link rel="stylesheet" href="lib/AdminLTE/bower_components/bootstrap/dist/css/bootstrap.min.css">
|
||||
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="lib/AdminLTE/bower_components/font-awesome/css/font-awesome.min.css">
|
||||
|
||||
<!-- Ionicons -->
|
||||
<link rel="stylesheet" href="lib/AdminLTE/bower_components/Ionicons/css/ionicons.min.css">
|
||||
|
||||
<!-- Theme style -->
|
||||
<link rel="stylesheet" href="lib/AdminLTE/dist/css/AdminLTE.min.css">
|
||||
|
||||
<!-- AdminLTE Skins. We have chosen the skin-blue for this starter
|
||||
page. However, you can choose any other skin. Make sure you
|
||||
apply the skin class to the body tag so the changes take effect. -->
|
||||
<link rel="stylesheet" href="lib/AdminLTE/dist/css/skins/skin-yellow-light.min.css">
|
||||
|
||||
|
||||
<!-- Pi.Alert CSS -->
|
||||
<link rel="stylesheet" href="css/pialert.css">
|
||||
|
||||
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
<!-- Google Font -->
|
||||
<link rel="stylesheet"
|
||||
href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
|
||||
|
||||
<!-- Page Icon -->
|
||||
<link rel="icon" type="image/png" sizes="160x160" href="img/pialertLogoGray80.png" />
|
||||
</head>
|
||||
|
||||
<!-- ----------------------------------------------------------------------- -->
|
||||
<!-- Layout Boxed Yellow -->
|
||||
<body class="hold-transition skin-yellow-light layout-boxed sidebar-mini" style="background-image: url('img/background.png');">
|
||||
<!-- Site wrapper -->
|
||||
@@ -56,6 +62,7 @@
|
||||
<!-- Main Header -->
|
||||
<header class="main-header">
|
||||
|
||||
<!-- ----------------------------------------------------------------------- -->
|
||||
<!-- Logo -->
|
||||
<a href="/" class="logo">
|
||||
<!-- mini logo for sidebar mini 50x50 pixels -->
|
||||
@@ -64,6 +71,7 @@
|
||||
<span class="logo-lg">Pi<b>.Alert</b></span>
|
||||
</a>
|
||||
|
||||
<!-- ----------------------------------------------------------------------- -->
|
||||
<!-- Header Navbar -->
|
||||
<nav class="navbar navbar-static-top" role="navigation">
|
||||
<!-- Sidebar toggle button-->
|
||||
@@ -90,12 +98,12 @@
|
||||
<!-- The user image in the menu -->
|
||||
<li class="user-header">
|
||||
<img src="img/pialertLogoWhite.png" class="img-circle" alt="Pi.Alert Logo" style="border-color:transparent">
|
||||
|
||||
<p>
|
||||
Open Source Network Guard
|
||||
<small>Designed for Raspberry Pi</small>
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<!-- Menu Body -->
|
||||
<li class="user-body">
|
||||
<div class="row">
|
||||
@@ -122,6 +130,8 @@
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<!-- ----------------------------------------------------------------------- -->
|
||||
<!-- Left side column. contains the logo and sidebar -->
|
||||
<aside class="main-sidebar">
|
||||
|
||||
@@ -133,117 +143,10 @@
|
||||
<a href="/" class="logo">
|
||||
<img src="img/pialertLogoGray80.png" class="img-responsive" alt="Pi.Alert Logo"/>
|
||||
</a>
|
||||
<div class="pull-left image">
|
||||
<!--
|
||||
<br><img src="img/pialertLogoBlack.png" class="img-responsive" alt="Pi.Alert Logo" style="display: table; table-layout: fixed;" />
|
||||
-->
|
||||
</div>
|
||||
|
||||
<div class="pull-left info" style="display: none">
|
||||
<p>Status</p>
|
||||
<?php
|
||||
|
||||
$pistatus = exec('sudo pihole status web');
|
||||
$pistatus=1;
|
||||
$FTL=true;
|
||||
$celsius=56.7;
|
||||
$temperatureunit='C';
|
||||
$nproc=2;
|
||||
$loaddata=array();
|
||||
$loaddata[]=1.1;
|
||||
$loaddata[]=1.2;
|
||||
$loaddata[]=1.3;
|
||||
$memory_usage=0.452;
|
||||
if ($pistatus == "1") {
|
||||
echo '<a id="status"><i class="fa fa-circle" style="color:#7FFF00"></i> Active</a>';
|
||||
} elseif ($pistatus == "0") {
|
||||
echo '<a id="status"><i class="fa fa-circle" style="color:#FF0000"></i> Offline</a>';
|
||||
} elseif ($pistatus == "-1") {
|
||||
echo '<a id="status"><i class="fa fa-circle" style="color:#FF0000"></i> DNS service not running</a>';
|
||||
} else {
|
||||
echo '<a id="status"><i class="fa fa-circle" style="color:#ff9900"></i> Unknown</a>';
|
||||
}
|
||||
|
||||
// CPU Temp
|
||||
if($FTL)
|
||||
{
|
||||
if ($celsius >= -273.15) {
|
||||
echo "<a id=\"temperature\"><i class=\"fa fa-fire\" style=\"color:";
|
||||
if ($celsius > 60) {
|
||||
echo "#FF0000";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "#3366FF";
|
||||
}
|
||||
echo "\"></i> Temp: ";
|
||||
if($temperatureunit === "F")
|
||||
{
|
||||
echo round($fahrenheit,1) . " °F";
|
||||
}
|
||||
elseif($temperatureunit === "K")
|
||||
{
|
||||
echo round($kelvin,1) . " K";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo round($celsius,1) . " °C";
|
||||
}
|
||||
echo "</a>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<a id=\"temperature\"><i class="fa fa-circle" style="color:#FF0000"></i> FTL offline</a>';
|
||||
}
|
||||
?>
|
||||
<br/>
|
||||
<?php
|
||||
echo "<a title=\"Detected $nproc cores\"><i class=\"fa fa-circle\" style=\"color:";
|
||||
if ($loaddata[0] > $nproc) {
|
||||
echo "#FF0000";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "#7FFF00";
|
||||
}
|
||||
echo "\"></i> Load: " . $loaddata[0] . " " . $loaddata[1] . " ". $loaddata[2] . "</a>";
|
||||
?>
|
||||
<br/>
|
||||
<?php
|
||||
echo "<a><i class=\"fa fa-circle\" style=\"color:";
|
||||
if ($memory_usage > 0.75 || $memory_usage < 0.0) {
|
||||
echo "#FF0000";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "#7FFF00";
|
||||
}
|
||||
if($memory_usage > 0.0)
|
||||
{
|
||||
echo "\"></i> Memory usage: " . sprintf("%.1f",100.0*$memory_usage) . " %</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\"></i> Memory usage: N/A</a>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- search form (Optional) -->
|
||||
<!--
|
||||
<form action="#" method="get" class="sidebar-form">
|
||||
<div class="input-group">
|
||||
<input type="text" name="q" class="form-control" placeholder="Search...">
|
||||
<span class="input-group-btn">
|
||||
<button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
-->
|
||||
<!-- /.search form -->
|
||||
<!-- DELETED -->
|
||||
|
||||
<!-- Sidebar Menu -->
|
||||
<ul class="sidebar-menu" data-widget="tree">
|
||||
|
||||
35
front/php/templates/notification.php
Normal file
35
front/php/templates/notification.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<!-- ---------------------------------------------------------------------------
|
||||
# Pi.Alert
|
||||
# Open Source Network Guard / WIFI & LAN intrusion detector
|
||||
#
|
||||
# notificacion.php - Front module. Common notification & modal window
|
||||
#-------------------------------------------------------------------------------
|
||||
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3
|
||||
#--------------------------------------------------------------------------- -->
|
||||
|
||||
<!-- Modal warning -->
|
||||
<div class="modal modal-warning fade" id="modal-warning" style="display: none;">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 id="modal-title" class="modal-title"> Modal Title </h4>
|
||||
</div>
|
||||
|
||||
<div id="modal-message" class="modal-body"> Modal message </div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button id="modal-cancel" type="button" class="btn btn-outline pull-left" data-dismiss="modal"> Cancel </button>
|
||||
<button id="modal-OK" type="button" class="btn btn-outline" onclick="modalOK()"> OK </button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Alert float -->
|
||||
<div id="notification" class="alert alert-dimissible pa_alert_notification">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<div id="alert-message"> Alert message </div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user