mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-05-24 08:40:31 -04:00
Compare commits
43 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9232f31778 | ||
|
|
9c324b1817 | ||
|
|
25b5db0e23 | ||
|
|
2af9d1dd38 | ||
|
|
040216ce3c | ||
|
|
99c29fe86b | ||
|
|
27afadfcdc | ||
|
|
4342f0f212 | ||
|
|
405331d177 | ||
|
|
ffe2851e4f | ||
|
|
6ade5a4f63 | ||
|
|
e39845afc0 | ||
|
|
ffa1059b26 | ||
|
|
53eafb8c7b | ||
|
|
63b5346308 | ||
|
|
9b87b4dfe4 | ||
|
|
5e250c3950 | ||
|
|
ee8979aa09 | ||
|
|
9dc9cd3f2b | ||
|
|
2f2063c515 | ||
|
|
2568703376 | ||
|
|
4072bbf406 | ||
|
|
10757f0717 | ||
|
|
b77f727ed5 | ||
|
|
fa21d28c90 | ||
|
|
7cc9abf477 | ||
|
|
62f76f8bae | ||
|
|
e4a1fe741b | ||
|
|
0394461e2e | ||
|
|
b72405806e | ||
|
|
044949dc88 | ||
|
|
14665230ff | ||
|
|
0fb4150c96 | ||
|
|
018c43cdc4 | ||
|
|
3b34a42f10 | ||
|
|
faf12f4d18 | ||
|
|
85e07c639d | ||
|
|
097e5e738e | ||
|
|
af93a12b8f | ||
|
|
228078c07b | ||
|
|
f8014f1bf4 | ||
|
|
b6abdcb357 | ||
|
|
8d1696bc19 |
@@ -81,14 +81,16 @@ Linux distributions.
|
|||||||
- One-step Automated Update:
|
- One-step Automated Update:
|
||||||
#### `curl -sSL https://github.com/pucherot/Pi.Alert/raw/main/install/pialert_update.sh | bash`
|
#### `curl -sSL https://github.com/pucherot/Pi.Alert/raw/main/install/pialert_update.sh | bash`
|
||||||
|
|
||||||
|
# Uninstall process
|
||||||
## Device Management
|
|
||||||
<!--- --------------------------------------------------------------------- --->
|
<!--- --------------------------------------------------------------------- --->
|
||||||
|
- [Unistall process](docs/UNINSTALL.md)
|
||||||
|
|
||||||
|
|
||||||
|
# Device Management
|
||||||
|
<!--- --------------------------------------------------------------------- --->
|
||||||
- [Device Management instructions](docs/DEVICE_MANAGEMENT.md)
|
- [Device Management instructions](docs/DEVICE_MANAGEMENT.md)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Other useful info
|
## Other useful info
|
||||||
<!--- --------------------------------------------------------------------- --->
|
<!--- --------------------------------------------------------------------- --->
|
||||||
|
|
||||||
|
|||||||
@@ -167,8 +167,7 @@ def check_internet_IP ():
|
|||||||
def get_internet_IP ():
|
def get_internet_IP ():
|
||||||
# BUGFIX #46 - curl http://ipv4.icanhazip.com repeatedly is very slow
|
# BUGFIX #46 - curl http://ipv4.icanhazip.com repeatedly is very slow
|
||||||
# Using 'dig'
|
# Using 'dig'
|
||||||
dig_args = ['dig', '+short', '-4', 'myip.opendns.com',
|
dig_args = ['dig', '+short', '-4', 'myip.opendns.com', '@resolver1.opendns.com']
|
||||||
'@resolver1.opendns.com']
|
|
||||||
cmd_output = subprocess.check_output (dig_args, universal_newlines=True)
|
cmd_output = subprocess.check_output (dig_args, universal_newlines=True)
|
||||||
|
|
||||||
## BUGFIX #12 - Query IPv4 address (not IPv6)
|
## BUGFIX #12 - Query IPv4 address (not IPv6)
|
||||||
@@ -375,7 +374,7 @@ def scan_network ():
|
|||||||
read_DHCP_leases ()
|
read_DHCP_leases ()
|
||||||
|
|
||||||
# Load current scan data
|
# Load current scan data
|
||||||
print ('\nProcesising scan results...')
|
print ('\nProcessing scan results...')
|
||||||
print_log ('Save scanned devices')
|
print_log ('Save scanned devices')
|
||||||
save_scanned_devices (arpscan_devices, cycle_interval)
|
save_scanned_devices (arpscan_devices, cycle_interval)
|
||||||
|
|
||||||
@@ -446,20 +445,22 @@ def query_ScanCycle_Data (pOpenCloseDB = False):
|
|||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
def execute_arpscan (pRetries):
|
def execute_arpscan (pRetries):
|
||||||
# Prepara command arguments
|
|
||||||
arpscan_args = ['sudo', 'arp-scan', '--localnet', '--ignoredups',
|
# #101 - arp-scan subnet configuration
|
||||||
'--retry=' + str(pRetries)]
|
# Prepare command arguments
|
||||||
|
subnets = SCAN_SUBNETS.strip().split()
|
||||||
|
arpscan_args = ['sudo', 'arp-scan', '--ignoredups', '--retry=' + str(pRetries)] + subnets
|
||||||
|
# arpscan_args = ['sudo', 'arp-scan', SCAN_SUBNETS, '--ignoredups', '--retry=' + str(pRetries)]
|
||||||
|
# print (arpscan_args)
|
||||||
|
|
||||||
# TESTING - Fast Scan
|
# TESTING - Fast Scan
|
||||||
# arpscan_args = ['sudo', 'arp-scan', '--localnet', '--ignoredups',
|
# arpscan_args = ['sudo', 'arp-scan', '--localnet', '--ignoredups', '--retry=1']
|
||||||
# '--retry=1']
|
|
||||||
|
|
||||||
# DEBUG - arp-scan command
|
# DEBUG - arp-scan command
|
||||||
# print (" ".join (arpscan_args))
|
# print (" ".join (arpscan_args))
|
||||||
|
|
||||||
# Execute command
|
# Execute command
|
||||||
arpscan_output = subprocess.check_output (arpscan_args,
|
arpscan_output = subprocess.check_output (arpscan_args, universal_newlines=True)
|
||||||
universal_newlines=True)
|
|
||||||
|
|
||||||
# Search IP + MAC + Vendor as regular expresion
|
# Search IP + MAC + Vendor as regular expresion
|
||||||
re_ip = r'(?P<ip>((2[0-5]|1[0-9]|[0-9])?[0-9]\.){3}((2[0-5]|1[0-9]|[0-9])?[0-9]))'
|
re_ip = r'(?P<ip>((2[0-5]|1[0-9]|[0-9])?[0-9]\.){3}((2[0-5]|1[0-9]|[0-9])?[0-9]))'
|
||||||
@@ -576,6 +577,34 @@ def save_scanned_devices (p_arpscan_devices, p_cycle_interval):
|
|||||||
(int(startTime.strftime('%s')) - 60 * p_cycle_interval),
|
(int(startTime.strftime('%s')) - 60 * p_cycle_interval),
|
||||||
cycle) )
|
cycle) )
|
||||||
|
|
||||||
|
# Check Internet connectivity
|
||||||
|
internet_IP = get_internet_IP()
|
||||||
|
# TESTING - Force IP
|
||||||
|
# internet_IP = ""
|
||||||
|
if internet_IP != "" :
|
||||||
|
sql.execute ("""INSERT INTO CurrentScan (cur_ScanCycle, cur_MAC, cur_IP, cur_Vendor, cur_ScanMethod)
|
||||||
|
VALUES (?, 'Internet', ?, Null, 'queryDNS') """, (cycle, internet_IP) )
|
||||||
|
|
||||||
|
# #76 Add Local MAC of default local interface
|
||||||
|
# BUGFIX #106 - Device that pialert is running
|
||||||
|
# local_mac_cmd = ["bash -lc ifconfig `ip route list default | awk {'print $5'}` | grep ether | awk '{print $2}'"]
|
||||||
|
# local_mac_cmd = ["/sbin/ifconfig `ip route list default | sort -nk11 | head -1 | awk {'print $5'}` | grep ether | awk '{print $2}'"]
|
||||||
|
local_mac_cmd = ["/sbin/ifconfig `ip -o route get 1 | sed 's/^.*dev \\([^ ]*\\).*$/\\1/;q'` | grep ether | awk '{print $2}'"]
|
||||||
|
local_mac = subprocess.Popen (local_mac_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT).communicate()[0].decode().strip()
|
||||||
|
|
||||||
|
# local_dev_cmd = ["ip -o route get 1 | sed 's/^.*dev \\([^ ]*\\).*$/\\1/;q'"]
|
||||||
|
# local_dev = subprocess.Popen (local_dev_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT).communicate()[0].decode().strip()
|
||||||
|
|
||||||
|
# local_ip_cmd = ["ip route list default | awk {'print $7'}"]
|
||||||
|
local_ip_cmd = ["ip -o route get 1 | sed 's/^.*src \\([^ ]*\\).*$/\\1/;q'"]
|
||||||
|
local_ip = subprocess.Popen (local_ip_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT).communicate()[0].decode().strip()
|
||||||
|
|
||||||
|
# Check if local mac has been detected with other methods
|
||||||
|
sql.execute ("SELECT COUNT(*) FROM CurrentScan WHERE cur_ScanCycle = ? AND cur_MAC = ? ", (cycle, local_mac) )
|
||||||
|
if sql.fetchone()[0] == 0 :
|
||||||
|
sql.execute ("INSERT INTO CurrentScan (cur_ScanCycle, cur_MAC, cur_IP, cur_Vendor, cur_ScanMethod) "+
|
||||||
|
"VALUES ( ?, ?, ?, Null, 'local_MAC') ", (cycle, local_mac, local_ip) )
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
def print_scan_stats ():
|
def print_scan_stats ():
|
||||||
# Devices Detected
|
# Devices Detected
|
||||||
@@ -919,7 +948,8 @@ def update_devices_names ():
|
|||||||
|
|
||||||
# Devices without name
|
# Devices without name
|
||||||
print (' Trying to resolve devices without name...', end='')
|
print (' Trying to resolve devices without name...', end='')
|
||||||
for device in sql.execute ("SELECT * FROM Devices WHERE dev_Name IN ('(unknown)','') ") :
|
# BUGFIX #97 - Updating name of Devices w/o IP
|
||||||
|
for device in sql.execute ("SELECT * FROM Devices WHERE dev_Name IN ('(unknown)','') AND dev_LastIP <> '-'") :
|
||||||
# Resolve device name
|
# Resolve device name
|
||||||
newName = resolve_device_name (device['dev_MAC'], device['dev_LastIP'])
|
newName = resolve_device_name (device['dev_MAC'], device['dev_LastIP'])
|
||||||
|
|
||||||
@@ -955,11 +985,14 @@ def resolve_device_name (pMAC, pIP):
|
|||||||
if len(pMACstr) != 17 or len(mac) != 12 :
|
if len(pMACstr) != 17 or len(mac) != 12 :
|
||||||
return -2
|
return -2
|
||||||
|
|
||||||
|
# DEBUG
|
||||||
|
# print (pMAC, pIP)
|
||||||
|
|
||||||
# Resolve name with DIG
|
# Resolve name with DIG
|
||||||
dig_args = ['dig', '+short', '-x', pIP]
|
dig_args = ['dig', '+short', '-x', pIP]
|
||||||
newName = subprocess.check_output (dig_args, universal_newlines=True)
|
newName = subprocess.check_output (dig_args, universal_newlines=True)
|
||||||
|
|
||||||
# Check if Eliminate local domain
|
# Check returns
|
||||||
newName = newName.strip()
|
newName = newName.strip()
|
||||||
if len(newName) == 0 :
|
if len(newName) == 0 :
|
||||||
return -2
|
return -2
|
||||||
@@ -987,7 +1020,8 @@ def void_ghost_disconnections ():
|
|||||||
print_log ('Void - 1 Connect ghost events')
|
print_log ('Void - 1 Connect ghost events')
|
||||||
sql.execute ("""UPDATE Events SET eve_PairEventRowid = Null,
|
sql.execute ("""UPDATE Events SET eve_PairEventRowid = Null,
|
||||||
eve_EventType ='VOIDED - ' || eve_EventType
|
eve_EventType ='VOIDED - ' || eve_EventType
|
||||||
WHERE eve_EventType = 'Connected'
|
WHERE eve_MAC != 'Internet'
|
||||||
|
AND eve_EventType = 'Connected'
|
||||||
AND eve_DateTime = ?
|
AND eve_DateTime = ?
|
||||||
AND eve_MAC IN (
|
AND eve_MAC IN (
|
||||||
SELECT Events.eve_MAC
|
SELECT Events.eve_MAC
|
||||||
@@ -1006,7 +1040,8 @@ def void_ghost_disconnections ():
|
|||||||
# Void connect paired events
|
# Void connect paired events
|
||||||
print_log ('Void - 2 Paired events')
|
print_log ('Void - 2 Paired events')
|
||||||
sql.execute ("""UPDATE Events SET eve_PairEventRowid = Null
|
sql.execute ("""UPDATE Events SET eve_PairEventRowid = Null
|
||||||
WHERE eve_PairEventRowid IN (
|
WHERE eve_MAC != 'Internet'
|
||||||
|
AND eve_PairEventRowid IN (
|
||||||
SELECT Events.RowID
|
SELECT Events.RowID
|
||||||
FROM CurrentScan, Devices, ScanCycles, Events
|
FROM CurrentScan, Devices, ScanCycles, Events
|
||||||
WHERE cur_ScanCycle = ?
|
WHERE cur_ScanCycle = ?
|
||||||
@@ -1024,7 +1059,8 @@ def void_ghost_disconnections ():
|
|||||||
print_log ('Void - 3 Disconnect ghost events')
|
print_log ('Void - 3 Disconnect ghost events')
|
||||||
sql.execute ("""UPDATE Events SET eve_PairEventRowid = Null,
|
sql.execute ("""UPDATE Events SET eve_PairEventRowid = Null,
|
||||||
eve_EventType = 'VOIDED - '|| eve_EventType
|
eve_EventType = 'VOIDED - '|| eve_EventType
|
||||||
WHERE ROWID IN (
|
WHERE eve_MAC != 'Internet'
|
||||||
|
AND ROWID IN (
|
||||||
SELECT Events.RowID
|
SELECT Events.RowID
|
||||||
FROM CurrentScan, Devices, ScanCycles, Events
|
FROM CurrentScan, Devices, ScanCycles, Events
|
||||||
WHERE cur_ScanCycle = ?
|
WHERE cur_ScanCycle = ?
|
||||||
|
|||||||
@@ -35,3 +35,16 @@ PIHOLE_ACTIVE = False
|
|||||||
PIHOLE_DB = '/etc/pihole/pihole-FTL.db'
|
PIHOLE_DB = '/etc/pihole/pihole-FTL.db'
|
||||||
DHCP_ACTIVE = False
|
DHCP_ACTIVE = False
|
||||||
DHCP_LEASES = '/etc/pihole/dhcp.leases'
|
DHCP_LEASES = '/etc/pihole/dhcp.leases'
|
||||||
|
|
||||||
|
# arp-scan options & samples
|
||||||
|
#
|
||||||
|
# Scan local network (default)
|
||||||
|
# SCAN_SUBNETS = '--localnet'
|
||||||
|
#
|
||||||
|
# Scan two subnets
|
||||||
|
# SCAN_SUBNETS = '192.168.11.0/24 192.168.144.0/24'
|
||||||
|
#
|
||||||
|
# Scan using interface eth0
|
||||||
|
# SCAN_SUBNETS = '--localnet --interface=eth0'
|
||||||
|
|
||||||
|
SCAN_SUBNETS = '--localnet'
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
VERSION = '2.70'
|
VERSION = '3.02'
|
||||||
VERSION_YEAR = '2021'
|
VERSION_YEAR = '2021'
|
||||||
VERSION_DATE = '2021-02-01'
|
VERSION_DATE = '2021-04-24'
|
||||||
|
|||||||
BIN
db/pialert.db
BIN
db/pialert.db
Binary file not shown.
@@ -16,12 +16,15 @@ Estimated time: 20'
|
|||||||
|
|
||||||
## One-step Automated Install:
|
## One-step Automated Install:
|
||||||
<!--- --------------------------------------------------------------------- --->
|
<!--- --------------------------------------------------------------------- --->
|
||||||
`curl -sSL https://github.com/pucherot/Pi.Alert/raw/main/install/pialert_install.sh | bash`
|
#### `curl -sSL https://github.com/pucherot/Pi.Alert/raw/main/install/pialert_install.sh | bash`
|
||||||
|
|
||||||
## One-step Automated Update:
|
## One-step Automated Update:
|
||||||
<!--- --------------------------------------------------------------------- --->
|
<!--- --------------------------------------------------------------------- --->
|
||||||
`curl -sSL https://github.com/pucherot/Pi.Alert/raw/main/install/pialert_update.sh | bash`
|
#### `curl -sSL https://github.com/pucherot/Pi.Alert/raw/main/install/pialert_update.sh | bash`
|
||||||
|
|
||||||
|
## Uninstall process
|
||||||
|
<!--- --------------------------------------------------------------------- --->
|
||||||
|
- [Unistall process](./UNINSTALL.md)
|
||||||
|
|
||||||
## Installation process (step by step)
|
## Installation process (step by step)
|
||||||
<!--- --------------------------------------------------------------------- --->
|
<!--- --------------------------------------------------------------------- --->
|
||||||
@@ -90,7 +93,7 @@ Estimated time: 20'
|
|||||||
```
|
```
|
||||||
or this one if have severals interfaces
|
or this one if have severals interfaces
|
||||||
```
|
```
|
||||||
ip -o route get 1 | sed -n 's/.*src \([0-9.]\+\).*/\1/p'
|
ip -o route get 1 | sed 's/^.*src \([^ ]*\).*$/\1/;q'
|
||||||
```
|
```
|
||||||
|
|
||||||
- http://192.168.1.x/admin/
|
- http://192.168.1.x/admin/
|
||||||
@@ -105,7 +108,7 @@ Estimated time: 20'
|
|||||||
```
|
```
|
||||||
or this one if have severals interfaces
|
or this one if have severals interfaces
|
||||||
```
|
```
|
||||||
ip -o route get 1 | sed -n 's/.*src \([0-9.]\+\).*/\1/p'
|
ip -o route get 1 | sed 's/^.*src \([^ ]*\).*$/\1/;q'
|
||||||
```
|
```
|
||||||
|
|
||||||
- Pi-hole admin portal -> Local DNS -> DNS Records -> Add new domain /IP
|
- Pi-hole admin portal -> Local DNS -> DNS Records -> Add new domain /IP
|
||||||
@@ -126,27 +129,37 @@ Estimated time: 20'
|
|||||||
If you have installed Pi.hole, lighttpd and PHP are already installed and this
|
If you have installed Pi.hole, lighttpd and PHP are already installed and this
|
||||||
block is not necessary
|
block is not necessary
|
||||||
|
|
||||||
3.1 - Install lighttpd
|
3.1 - Install apt-utils
|
||||||
|
```
|
||||||
|
sudo apt-get install apt-utils -y
|
||||||
|
```
|
||||||
|
|
||||||
|
3.2 - Install lighttpd
|
||||||
```
|
```
|
||||||
sudo apt-get install lighttpd -y
|
sudo apt-get install lighttpd -y
|
||||||
```
|
```
|
||||||
|
|
||||||
3.2 - If Pi.Alert will be the only site available in this webserver, you can
|
3.3 - If Pi.Alert will be the only site available in this webserver, you can
|
||||||
redirect the default server page to pialert subfolder
|
redirect the default server page to pialert subfolder
|
||||||
```
|
```
|
||||||
sudo mv /var/www/html/index.lighttpd.html /var/www/html/index.lighttpd.html.old
|
sudo mv /var/www/html/index.lighttpd.html /var/www/html/index.lighttpd.html.old
|
||||||
sudo ln -s ~/pialert/install/index.html /var/www/html/index.html
|
sudo ln -s ~/pialert/install/index.html /var/www/html/index.html
|
||||||
```
|
```
|
||||||
|
|
||||||
3.3 - Install PHP
|
3.4 - Install PHP
|
||||||
```
|
```
|
||||||
sudo apt-get install php php-cgi php-fpm php-sqlite3 -y
|
sudo apt-get install php php-cgi php-fpm php-sqlite3 -y
|
||||||
```
|
```
|
||||||
|
|
||||||
3.4 - Activate PHP
|
3.5 - Activate PHP
|
||||||
```
|
```
|
||||||
sudo lighttpd-enable-mod fastcgi-php
|
sudo lighttpd-enable-mod fastcgi-php
|
||||||
sudo /etc/init.d/lighttpd restart
|
sudo service lighttpd restart
|
||||||
|
```
|
||||||
|
|
||||||
|
3.6 - Install sqlite3
|
||||||
|
```
|
||||||
|
sudo apt-get install sqlite3 -y
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@@ -158,9 +171,9 @@ block is not necessary
|
|||||||
sudo arp-scan -l
|
sudo arp-scan -l
|
||||||
```
|
```
|
||||||
|
|
||||||
4.2 - Install dnsutils utility
|
4.2 - Install dnsutils & net-tools utilities
|
||||||
```
|
```
|
||||||
sudo apt-get install dnsutils -y
|
sudo apt-get install dnsutils net-tools -y
|
||||||
```
|
```
|
||||||
|
|
||||||
4.3 - Test Python
|
4.3 - Test Python
|
||||||
@@ -232,9 +245,11 @@ block is not necessary
|
|||||||
- If you want to use email reporting, configure this parameters
|
- If you want to use email reporting, configure this parameters
|
||||||
```ini
|
```ini
|
||||||
REPORT_MAIL = True
|
REPORT_MAIL = True
|
||||||
|
REPORT_TO = 'user@gmail.com'
|
||||||
|
SMTP_SERVER = 'smtp.gmail.com'
|
||||||
|
SMTP_PORT = 587
|
||||||
SMTP_USER = 'user@gmail.com'
|
SMTP_USER = 'user@gmail.com'
|
||||||
SMTP_PASS = 'password'
|
SMTP_PASS = 'password'
|
||||||
REPORT_TO = 'user@gmail.com'
|
|
||||||
```
|
```
|
||||||
|
|
||||||
- If you want to update your Dynamic DNS, configure this parameters
|
- If you want to update your Dynamic DNS, configure this parameters
|
||||||
@@ -300,7 +315,7 @@ block is not necessary
|
|||||||
```
|
```
|
||||||
or this one if have severals interfaces
|
or this one if have severals interfaces
|
||||||
```
|
```
|
||||||
ip -o route get 1 | sed -n 's/.*src \([0-9.]\+\).*/\1/p'
|
ip -o route get 1 | sed 's/^.*src \([^ ]*\).*$/\1/;q'
|
||||||
```
|
```
|
||||||
- Pi-hole admin portal -> Local DNS -> DNS Records -> Add new domain /IP
|
- Pi-hole admin portal -> Local DNS -> DNS Records -> Add new domain /IP
|
||||||
- pi.alert 192.168.1.x
|
- pi.alert 192.168.1.x
|
||||||
@@ -317,7 +332,6 @@ block is not necessary
|
|||||||
|
|
||||||
- [Device Management instructions](./DEVICE_MANAGEMENT.md)
|
- [Device Management instructions](./DEVICE_MANAGEMENT.md)
|
||||||
|
|
||||||
|
|
||||||
### License
|
### License
|
||||||
GPL 3.0
|
GPL 3.0
|
||||||
[Read more here](../LICENSE.txt)
|
[Read more here](../LICENSE.txt)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
The latest versions of some operating systems (IOS and Android) incorporate a
|
The latest versions of some operating systems (IOS and Android) incorporate a
|
||||||
new & interesting functionality to improve privacy: **Random MACs**.
|
new & interesting functionality to improve privacy: **Random MACs**.
|
||||||
|
|
||||||
This functionality allows you to **hide the true MAC** of the device and
|
This functionality allows you to **hide the real MAC** of the device and
|
||||||
**assign a random MAC** when we connect to WIFI networks.
|
**assign a random MAC** when we connect to WIFI networks.
|
||||||
|
|
||||||
This behavior is especially useful when connecting to WIFI's that we do not
|
This behavior is especially useful when connecting to WIFI's that we do not
|
||||||
|
|||||||
64
docs/UNINSTALL.md
Normal file
64
docs/UNINSTALL.md
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
# Pi.Alert Uninstallation Guide
|
||||||
|
<!--- --------------------------------------------------------------------- --->
|
||||||
|
Estimated time: 5'
|
||||||
|
|
||||||
|
|
||||||
|
## One-step Automated Uninstall:
|
||||||
|
<!--- --------------------------------------------------------------------- --->
|
||||||
|
#### `curl -sSL https://github.com/pucherot/Pi.Alert/raw/main/install/pialert_uninstall.sh | bash`
|
||||||
|
|
||||||
|
## Uninstallation process (step by step)
|
||||||
|
<!--- --------------------------------------------------------------------- --->
|
||||||
|
|
||||||
|
1.1 - Remove Pi.Alert files
|
||||||
|
```
|
||||||
|
rm -r "~/pialert"
|
||||||
|
```
|
||||||
|
|
||||||
|
1.2 - Remove Pi.Alert web front
|
||||||
|
```
|
||||||
|
sudo rm "/var/www/html/pialert"
|
||||||
|
```
|
||||||
|
|
||||||
|
1.3 - Remove lighttpd Pi.Alert config
|
||||||
|
```
|
||||||
|
sudo rm "/etc/lighttpd/conf-available/pialert_front.conf"
|
||||||
|
sudo rm "/etc/lighttpd/conf-enabled/pialert_front.conf"
|
||||||
|
```
|
||||||
|
|
||||||
|
1.4 - Remove lighttpd Pi.Alert cache
|
||||||
|
```
|
||||||
|
sudo rm -r /var/cache/lighttpd/compress/pialert
|
||||||
|
```
|
||||||
|
|
||||||
|
1.5 - Remove Pi.Alert DNS entry
|
||||||
|
```
|
||||||
|
sudo sed -i '/pi.alert/d' /etc/pihole/custom.list
|
||||||
|
sudo pihole restartdns
|
||||||
|
```
|
||||||
|
|
||||||
|
1.6 - Remove Pi.Alert crontab jobs
|
||||||
|
```
|
||||||
|
crontab -l 2>/dev/null | sed ':a;N;$!ba;s/#-------------------------------------------------------------------------------\n# Pi.Alert\n# Open Source Network Guard \/ WIFI & LAN intrusion detector \n#\n# pialert.cron - Back module. Crontab jobs\n#-------------------------------------------------------------------------------\n# Puche 2021 pi.alert.application@gmail.com GNU GPLv3\n#-------------------------------------------------------------------------------//g' | crontab -
|
||||||
|
crontab -l 2>/dev/null | sed '/pialert.py/d' | crontab -
|
||||||
|
```
|
||||||
|
|
||||||
|
### Uninstallation Notes
|
||||||
|
<!--- --------------------------------------------------------------------- --->
|
||||||
|
- If you installed Pi-hole during the Pi.Alert installation process,
|
||||||
|
|
||||||
|
Pi-hole will still be available after uninstalling Pi.Alert
|
||||||
|
|
||||||
|
|
||||||
|
- lighttpd, PHP, arp-scan & Python have not been uninstalled
|
||||||
|
|
||||||
|
They may be required by other software
|
||||||
|
|
||||||
|
You can uninstall them manually with command 'apt-get remove XX'
|
||||||
|
|
||||||
|
### License
|
||||||
|
GPL 3.0
|
||||||
|
[Read more here](../LICENSE.txt)
|
||||||
|
|
||||||
|
### Contact
|
||||||
|
pi.alert.application@gmail.com
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
| Version | Description |
|
| Version | Description |
|
||||||
| ------- | --------------------------------------------------------------- |
|
| ------- | --------------------------------------------------------------- |
|
||||||
|
| v3.00 | Major set of New features & Enhancements |
|
||||||
| v2.70 | New features & Usability improvements in the web prontal |
|
| v2.70 | New features & Usability improvements in the web prontal |
|
||||||
| v2.61 | Bug fixing |
|
| v2.61 | Bug fixing |
|
||||||
| v2.60 | Improved the compability of installation process (Ubuntu) |
|
| v2.60 | Improved the compability of installation process (Ubuntu) |
|
||||||
@@ -13,6 +14,37 @@
|
|||||||
| v2.50 | First public release |
|
| v2.50 | First public release |
|
||||||
|
|
||||||
|
|
||||||
|
## Pi.Alert v3.02
|
||||||
|
<!--- --------------------------------------------------------------------- --->
|
||||||
|
**PENDING UPDATE DOC**
|
||||||
|
- Fixed: UNIQUE constraint failed with Local MAC #114
|
||||||
|
|
||||||
|
|
||||||
|
## Pi.Alert v3.01
|
||||||
|
<!--- --------------------------------------------------------------------- --->
|
||||||
|
**PENDING UPDATE DOC**
|
||||||
|
- Fixed: Problem with local MAC & IP (raspberry) #106
|
||||||
|
|
||||||
|
|
||||||
|
## Pi.Alert v3.00
|
||||||
|
<!--- --------------------------------------------------------------------- --->
|
||||||
|
**PENDING UPDATE DOC**
|
||||||
|
- `arp-scan` config options: interface, several subnets. #101 #15
|
||||||
|
- Next/previos button while editing devices #66 #37
|
||||||
|
- Internet presence/sessions monitoring #63
|
||||||
|
- Logical delete / archive / hide Device #93
|
||||||
|
- Flag to mark device with random MAC's #87
|
||||||
|
- New Device Types predefined in combobox #92
|
||||||
|
- Ask before leave the page with unsaved changes #104
|
||||||
|
- Option to don't mark devices as new during installation #94
|
||||||
|
- Uninstall script #62
|
||||||
|
- Fixed: Error updating name of devices w/o IP #97
|
||||||
|
- Fixed: Deleted devices reappear #84
|
||||||
|
- Fixed: Device running Pi.Alert must be marked as "on-line" #76
|
||||||
|
- Fixed: Incorrect calculation of presence hours #102
|
||||||
|
- Fixed: Problem redirect to homepage clicking in logo #103
|
||||||
|
|
||||||
|
|
||||||
## Pi.Alert v2.70
|
## Pi.Alert v2.70
|
||||||
<!--- --------------------------------------------------------------------- --->
|
<!--- --------------------------------------------------------------------- --->
|
||||||
- Added Client names resolution #43
|
- Added Client names resolution #43
|
||||||
|
|||||||
@@ -37,6 +37,10 @@
|
|||||||
color: #808080;
|
color: #808080;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.text-gray-20 {
|
||||||
|
color: rgba(192,192,192,20%);
|
||||||
|
}
|
||||||
|
|
||||||
.text-aqua-20 {
|
.text-aqua-20 {
|
||||||
color: rgba(0,192,239,20%);
|
color: rgba(0,192,239,20%);
|
||||||
}
|
}
|
||||||
@@ -151,6 +155,13 @@
|
|||||||
margin-bottom: 1.3em;
|
margin-bottom: 1.3em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pa-small-box-footer {
|
||||||
|
color: white !important;
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------------- */
|
||||||
.pa-small-box-aqua {
|
.pa-small-box-aqua {
|
||||||
border-top: 3px solid #00c0ef;
|
border-top: 3px solid #00c0ef;
|
||||||
box-shadow: 0 5px 5px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 5px 5px rgba(0, 0, 0, 0.1);
|
||||||
@@ -169,8 +180,6 @@
|
|||||||
color: #00c0ef;
|
color: #00c0ef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
.pa-small-box-green {
|
.pa-small-box-green {
|
||||||
border-top: 3px solid #00a65a;
|
border-top: 3px solid #00a65a;
|
||||||
@@ -228,7 +237,26 @@
|
|||||||
color: #dd4b39;
|
color: #dd4b39;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------------- */
|
||||||
|
.pa-small-box-gray {
|
||||||
|
border-top: 3px solid #a0a0a0;
|
||||||
|
box-shadow: 0 5px 5px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.pa-small-box-gray .inner {
|
||||||
|
color: #a0a0a0;
|
||||||
|
background-color:#FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pa-small-box-gray .inner h3 {
|
||||||
|
margin-left: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pa-small-box-gray .icon {
|
||||||
|
color: #a0a0a0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
Customized Box Borders
|
Customized Box Borders
|
||||||
----------------------------------------------------------------------------- */
|
----------------------------------------------------------------------------- */
|
||||||
@@ -304,6 +332,29 @@
|
|||||||
color: #B0B0B0;
|
color: #B0B0B0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -----------------------------------------------------------------------------
|
||||||
|
Customized buttons
|
||||||
|
----------------------------------------------------------------------------- */
|
||||||
|
.pa-btn {
|
||||||
|
padding: 10px;
|
||||||
|
min-width: 90px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pa-btn-delete {
|
||||||
|
border-color:#ffb060;
|
||||||
|
background-color:#ffd080;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pa-btn-delete:hover {
|
||||||
|
border-color:#ffb060;
|
||||||
|
background-color:#ffb060;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pa-btn-records, .pa-btn-records:hover, .pa-btn-records:focus, .pa-btn-records:active {
|
||||||
|
border-color:#ddd;
|
||||||
|
background-color:#f4f4f4;
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -42,15 +42,10 @@
|
|||||||
|
|
||||||
<div class="col-lg-3 col-sm-6 col-xs-6">
|
<div class="col-lg-3 col-sm-6 col-xs-6">
|
||||||
<a href="#" onclick="javascript: $('#tabDetails').trigger('click')">
|
<a href="#" onclick="javascript: $('#tabDetails').trigger('click')">
|
||||||
<div class="small-box bg-aqua pa-small-box-aqua">
|
<div class="small-box bg-aqua pa-small-box-aqua pa-small-box-2">
|
||||||
|
<div class="inner"> <h3 id="deviceStatus" style="margin-left: 0em"> -- </h3> </div>
|
||||||
<div class="inner">
|
|
||||||
<h4>Current Status</h4>
|
|
||||||
<h3 id="deviceStatus" style="margin-left: 0em"> -- </h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="icon"> <i id="deviceStatusIcon" class=""></i> </div>
|
<div class="icon"> <i id="deviceStatusIcon" class=""></i> </div>
|
||||||
<div class="small-box-footer"> Details <i class="fa fa-arrow-circle-right"></i> </div>
|
<div class="small-box-footer pa-small-box-footer"> Current Status <i class="fa fa-arrow-circle-right"></i> </div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -58,15 +53,10 @@
|
|||||||
<!-- top small box 2 ------------------------------------------------------- -->
|
<!-- top small box 2 ------------------------------------------------------- -->
|
||||||
<div class="col-lg-3 col-sm-6 col-xs-6">
|
<div class="col-lg-3 col-sm-6 col-xs-6">
|
||||||
<a href="#" onclick="javascript: $('#tabSessions').trigger('click');">
|
<a href="#" onclick="javascript: $('#tabSessions').trigger('click');">
|
||||||
<div class="small-box bg-green pa-small-box-green">
|
<div class="small-box bg-green pa-small-box-green pa-small-box-2">
|
||||||
|
<div class="inner"> <h3 id="deviceSessions"> -- </h3> </div>
|
||||||
<div class="inner">
|
|
||||||
<h4>Sessions</h4>
|
|
||||||
<h3 id="deviceSessions"> -- </h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="icon"> <i class="fa fa-plug"></i> </div>
|
<div class="icon"> <i class="fa fa-plug"></i> </div>
|
||||||
<div class="small-box-footer"> Details <i class="fa fa-arrow-circle-right"></i> </div>
|
<div class="small-box-footer pa-small-box-footer"> Sesions <i class="fa fa-arrow-circle-right"></i> </div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -74,15 +64,10 @@
|
|||||||
<!-- top small box 3 ------------------------------------------------------- -->
|
<!-- top small box 3 ------------------------------------------------------- -->
|
||||||
<div class="col-lg-3 col-sm-6 col-xs-6">
|
<div class="col-lg-3 col-sm-6 col-xs-6">
|
||||||
<a href="#" onclick="javascript: $('#tabPresence').trigger('click')">
|
<a href="#" onclick="javascript: $('#tabPresence').trigger('click')">
|
||||||
<div class="small-box bg-yellow pa-small-box-yellow">
|
<div class="small-box bg-yellow pa-small-box-yellow pa-small-box-2">
|
||||||
|
<div class="inner"> <h3 id="deviceEvents" style="margin-left: 0em"> -- </h3> </div>
|
||||||
<div class="inner">
|
|
||||||
<h4 id="deviceEventsTitle"> Presence </h4>
|
|
||||||
<h3 id="deviceEvents" style="margin-left: 0em"> -- </h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="deviceEventsIcon" class="icon"> <i class="fa fa-calendar"></i> </div>
|
<div id="deviceEventsIcon" class="icon"> <i class="fa fa-calendar"></i> </div>
|
||||||
<div class="small-box-footer"> Details <i class="fa fa-arrow-circle-right"></i> </div>
|
<div class="small-box-footer pa-small-box-footer"> Presence <i class="fa fa-arrow-circle-right"></i> </div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -90,15 +75,10 @@
|
|||||||
<!-- top small box 4 ------------------------------------------------------ -->
|
<!-- top small box 4 ------------------------------------------------------ -->
|
||||||
<div class="col-lg-3 col-sm-6 col-xs-6">
|
<div class="col-lg-3 col-sm-6 col-xs-6">
|
||||||
<a href="#" onclick="javascript: $('#tabEvents').trigger('click');">
|
<a href="#" onclick="javascript: $('#tabEvents').trigger('click');">
|
||||||
<div class="small-box bg-red pa-small-box-red">
|
<div class="small-box bg-red pa-small-box-red pa-small-box-2">
|
||||||
|
<div class="inner"> <h3 id="deviceDownAlerts"> -- </h3> </div>
|
||||||
<div class="inner">
|
|
||||||
<h4>Down Alerts</h4>
|
|
||||||
<h3 id="deviceDownAlerts"> -- </h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="icon"> <i class="fa fa-warning"></i> </div>
|
<div class="icon"> <i class="fa fa-warning"></i> </div>
|
||||||
<div class="small-box-footer"> Details <i class="fa fa-arrow-circle-right"></i> </div>
|
<div class="small-box-footer pa-small-box-footer"> Down Alerts <i class="fa fa-arrow-circle-right"></i> </div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -111,13 +91,28 @@
|
|||||||
<div class="col-lg-12 col-sm-12 col-xs-12">
|
<div class="col-lg-12 col-sm-12 col-xs-12">
|
||||||
<!-- <div class="box-transparent"> -->
|
<!-- <div class="box-transparent"> -->
|
||||||
|
|
||||||
|
|
||||||
<div id="navDevice" class="nav-tabs-custom">
|
<div id="navDevice" class="nav-tabs-custom">
|
||||||
<ul class="nav nav-tabs" style="fon t-size:16px;">
|
<ul class="nav nav-tabs" style="fon t-size:16px;">
|
||||||
<li> <a id="tabDetails" href="#panDetails" data-toggle="tab"> Details </a></li>
|
<li> <a id="tabDetails" href="#panDetails" data-toggle="tab"> Details </a></li>
|
||||||
<li> <a id="tabSessions" href="#panSessions" data-toggle="tab"> Sessions </a></li>
|
<li> <a id="tabSessions" href="#panSessions" data-toggle="tab"> Sessions </a></li>
|
||||||
<li> <a id="tabPresence" href="#panPresence" data-toggle="tab"> Presence </a></li>
|
<li> <a id="tabPresence" href="#panPresence" data-toggle="tab"> Presence </a></li>
|
||||||
<li> <a id="tabEvents" href="#panEvents" data-toggle="tab"> Events </a></li>
|
<li> <a id="tabEvents" href="#panEvents" data-toggle="tab"> Events </a></li>
|
||||||
|
|
||||||
|
<div class="btn-group pull-right">
|
||||||
|
<button type="button" class="btn btn-default" style="padding: 10px; min-width: 30px;"
|
||||||
|
id="btnPrevious" onclick="previousRecord()"> <i class="fa fa-chevron-left"></i> </button>
|
||||||
|
|
||||||
|
<div class="btn pa-btn-records" style="padding: 10px; min-width: 30px; margin-left: 1px;"
|
||||||
|
id="txtRecord" > 0 / 0 </div>
|
||||||
|
|
||||||
|
<button type="button" class="btn btn-default" style="padding: 10px; min-width: 30px; margin-left: 1px;"
|
||||||
|
id="btnNext" onclick="nextRecord()"> <i class="fa fa-chevron-right"></i> </button>
|
||||||
|
</div>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="tab-content" style="min-height: 430px">
|
<div class="tab-content" style="min-height: 430px">
|
||||||
|
|
||||||
<!-- tab page 1 ------------------------------------------------------------ -->
|
<!-- tab page 1 ------------------------------------------------------------ -->
|
||||||
@@ -318,8 +313,8 @@
|
|||||||
<button type="button" class="btn btn-info dropdown-toggle" data-toggle="dropdown" aria-expanded="false" id="dropdownButtonScanCycle">
|
<button type="button" class="btn btn-info dropdown-toggle" data-toggle="dropdown" aria-expanded="false" id="dropdownButtonScanCycle">
|
||||||
<span class="fa fa-caret-down"></span></button>
|
<span class="fa fa-caret-down"></span></button>
|
||||||
<ul id="dropdownScanCycle" class="dropdown-menu dropdown-menu-right">
|
<ul id="dropdownScanCycle" class="dropdown-menu dropdown-menu-right">
|
||||||
<li><a href="javascript:void(0)" onclick="setTextValue('txtScanCycle','1 min')"> Scan 1' every 5'</a></li>
|
<li><a href="javascript:void(0)" onclick="setTextValue('txtScanCycle','1 min')"> Scan 1 min every 5 min</a></li>
|
||||||
<li><a href="javascript:void(0)" onclick="setTextValue('txtScanCycle','15 min');"> Scan 12' every 15'</a></li>
|
<li><a href="javascript:void(0)" onclick="setTextValue('txtScanCycle','15 min');"> Scan 12 min every 15 min</a></li>
|
||||||
<li><a href="javascript:void(0)" onclick="setTextValue('txtScanCycle','0 min');"> Don't Scan</a></li>
|
<li><a href="javascript:void(0)" onclick="setTextValue('txtScanCycle','0 min');"> Don't Scan</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@@ -372,14 +367,42 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Archived -->
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-5 control-label">Archived:</label>
|
||||||
|
<div class="col-sm-7" style="padding-top:6px;">
|
||||||
|
<input class="checkbox blue hidden" id="chkArchived" type="checkbox">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Randomized MAC -->
|
||||||
|
<div class="form-group" >
|
||||||
|
<label class="col-sm-5 control-label">Random MAC:</label>
|
||||||
|
<div class="col-sm-7" style="padding-top:6px;">
|
||||||
|
<span id="iconRandomMACinactive" data-toggle="tooltip" data-placement="right" title="Random MAC is Inactive">
|
||||||
|
<i style="font-size: 24px;" class="text-gray glyphicon glyphicon-random"></i>     </span>
|
||||||
|
|
||||||
|
<span id="iconRandomMACactive" data-toggle="tooltip" data-placement="right" title="Random MAC is Active" class="hidden">
|
||||||
|
<i style="font-size: 24px;" class="text-yellow glyphicon glyphicon-random"></i>     </span>
|
||||||
|
|
||||||
|
<a href="https://github.com/pucherot/Pi.Alert/blob/main/docs/RAMDOM_MAC.md" target="_blank" style="color: #777;">
|
||||||
|
<i class="fa fa-info-circle"></i> </a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Buttons -->
|
<!-- Buttons -->
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<button type="button" class="btn btn-primary pull-right" style="padding: 10px; min-width: 90px;" id="btnSave" onclick="setDeviceData()"> Save </button>
|
<div class="pull-right">
|
||||||
<button type="button" class="btn btn-default pull-right" style="padding: 10px; min-width: 90px; margin-right:10px;" id="btnRestore" onclick="getDeviceData(true)"> Reset Changes </button>
|
<button type="button" class="btn btn-default pa-btn pa-btn-delete" style="margin-left:0px;"
|
||||||
<button type="button" class="btn bg-default pull-right" style="padding: 10px; min-width: 90px; margin-right:10px; background-color:#ffd080;" id="btnDelete" onclick="askDeleteDevice()"> Delete Device </button>
|
id="btnDelete" onclick="askDeleteDevice()"> Delete Device </button>
|
||||||
|
<button type="button" class="btn btn-default pa-btn" style="margin-left:6px;"
|
||||||
|
id="btnRestore" onclick="getDeviceData(true)"> Reset Changes </button>
|
||||||
|
<button type="button" disabled class="btn btn-primary pa-btn" style="margin-left:6px; "
|
||||||
|
id="btnSave" onclick="setDeviceData()" > Save </button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -488,6 +511,8 @@
|
|||||||
<script>
|
<script>
|
||||||
|
|
||||||
var mac = '';
|
var mac = '';
|
||||||
|
var devicesList = [];
|
||||||
|
var pos = -1;
|
||||||
var parPeriod = 'Front_Details_Period';
|
var parPeriod = 'Front_Details_Period';
|
||||||
var parTab = 'Front_Details_Tab';
|
var parTab = 'Front_Details_Tab';
|
||||||
var parSessionsRows = 'Front_Details_Sessions_Rows';
|
var parSessionsRows = 'Front_Details_Sessions_Rows';
|
||||||
@@ -558,10 +583,20 @@ function main () {
|
|||||||
initializeDatatables();
|
initializeDatatables();
|
||||||
initializeCalendar();
|
initializeCalendar();
|
||||||
|
|
||||||
|
// Read Cookies
|
||||||
|
devicesList = getCookie('devicesList');
|
||||||
|
deleteCookie ('devicesList');
|
||||||
|
if (devicesList != '') {
|
||||||
|
devicesList = JSON.parse (devicesList);
|
||||||
|
} else {
|
||||||
|
devicesList = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// query data
|
// query data
|
||||||
getDeviceData(true);
|
getDeviceData(true);
|
||||||
getSessionsPresenceEvents();
|
getSessionsPresenceEvents();
|
||||||
|
|
||||||
// Force re-render calendar on tab change
|
// Force re-render calendar on tab change
|
||||||
// (bugfix for render error at left panel)
|
// (bugfix for render error at left panel)
|
||||||
$(document).on('shown.bs.tab', 'a[data-toggle="tab"]', function (nav) {
|
$(document).on('shown.bs.tab', 'a[data-toggle="tab"]', function (nav) {
|
||||||
@@ -570,6 +605,13 @@ function main () {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Ask before exit without saving data
|
||||||
|
window.onbeforeunload = function(){
|
||||||
|
if ( ! document.getElementById('btnSave').hasAttribute('disabled') ) {
|
||||||
|
return 'Are you sure you want to discard unsaved changes?';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -578,6 +620,7 @@ function main () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
function initializeTabs () {
|
function initializeTabs () {
|
||||||
// Activate panel
|
// Activate panel
|
||||||
@@ -619,7 +662,7 @@ function initializeiCheck () {
|
|||||||
radioClass: 'iradio_flat-red',
|
radioClass: 'iradio_flat-red',
|
||||||
increaseArea: '20%'
|
increaseArea: '20%'
|
||||||
});
|
});
|
||||||
|
|
||||||
// When toggle iCheck
|
// When toggle iCheck
|
||||||
$('input').on('ifToggled', function(event){
|
$('input').on('ifToggled', function(event){
|
||||||
// Hide / Show Events
|
// Hide / Show Events
|
||||||
@@ -629,6 +672,11 @@ function initializeiCheck () {
|
|||||||
} else {
|
} else {
|
||||||
// Activate save & restore
|
// Activate save & restore
|
||||||
activateSaveRestoreData();
|
activateSaveRestoreData();
|
||||||
|
|
||||||
|
// Ask skip notifications
|
||||||
|
// if (event.currentTarget.id == 'chkArchived' ) {
|
||||||
|
// askSkipNotifications();
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -896,7 +944,7 @@ function periodChanged () {
|
|||||||
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
function getDeviceData (updatePanelData=false) {
|
function getDeviceData (readAllData=false) {
|
||||||
// stop timer
|
// stop timer
|
||||||
stopTimerRefreshData();
|
stopTimerRefreshData();
|
||||||
|
|
||||||
@@ -905,6 +953,15 @@ function getDeviceData (updatePanelData=false) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Deactivate next previous buttons
|
||||||
|
if (readAllData) {
|
||||||
|
$('#btnPrevious').attr ('disabled','');
|
||||||
|
$('#btnPrevious').addClass ('text-gray50');
|
||||||
|
$('#btnNext').attr ('disabled','');
|
||||||
|
$('#btnNext').addClass ('text-gray50');
|
||||||
|
$("body").css ("cursor", "progress");
|
||||||
|
}
|
||||||
|
|
||||||
// get data from server
|
// get data from server
|
||||||
$.get('php/server/devices.php?action=getDeviceData&mac='+ mac + '&period='+ period, function(data) {
|
$.get('php/server/devices.php?action=getDeviceData&mac='+ mac + '&period='+ period, function(data) {
|
||||||
|
|
||||||
@@ -912,8 +969,15 @@ function getDeviceData (updatePanelData=false) {
|
|||||||
|
|
||||||
// check device exists
|
// check device exists
|
||||||
if (deviceData['dev_MAC'] == null) {
|
if (deviceData['dev_MAC'] == null) {
|
||||||
$('#pageTitle').html ('Device not found: <small>'+ mac +'</small>');
|
// Status
|
||||||
|
$('#deviceStatus').html ('--');
|
||||||
|
$('#deviceStatus')[0].className = 'text-gray';
|
||||||
|
$('#deviceStatusIcon')[0].className = '';
|
||||||
|
|
||||||
|
$('#deviceSessions').html ('--');
|
||||||
|
$('#deviceDownAlerts').html ('--');
|
||||||
|
$('#deviceEvents').html ('--');
|
||||||
|
|
||||||
$('#txtMAC').val ('--');
|
$('#txtMAC').val ('--');
|
||||||
$('#txtName').val ('--');
|
$('#txtName').val ('--');
|
||||||
$('#txtOwner').val ('--');
|
$('#txtOwner').val ('--');
|
||||||
@@ -935,11 +999,23 @@ function getDeviceData (updatePanelData=false) {
|
|||||||
$('#chkAlertEvents').iCheck ('uncheck')
|
$('#chkAlertEvents').iCheck ('uncheck')
|
||||||
$('#chkAlertDown').iCheck ('uncheck')
|
$('#chkAlertDown').iCheck ('uncheck')
|
||||||
$('#txtSkipRepeated').val ('--');
|
$('#txtSkipRepeated').val ('--');
|
||||||
$('#chkNewDevice').iCheck ('uncheck')
|
$('#chkNewDevice').iCheck ('uncheck');
|
||||||
|
$('#chkArchived').iCheck ('uncheck');
|
||||||
|
|
||||||
|
$('#iconRandomMACactive').addClass ('hidden');
|
||||||
|
$('#iconRandomMACinactive').removeClass ('hidden');
|
||||||
|
|
||||||
// Deactivate controls
|
// Deactivate controls
|
||||||
$('#panDetails :input').attr('disabled', true);
|
$('#panDetails :input').attr('disabled', true);
|
||||||
|
|
||||||
|
// Check if device is deleted o no exists in this session
|
||||||
|
if (pos == -1) {
|
||||||
|
devicesList = [];
|
||||||
|
$('#pageTitle').html ('Device not found: <small>'+ mac +'</small>');
|
||||||
|
} else {
|
||||||
|
$('#pageTitle').html ('Device deleted');
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Name
|
// Name
|
||||||
@@ -949,7 +1025,7 @@ function getDeviceData (updatePanelData=false) {
|
|||||||
} else {
|
} else {
|
||||||
$('#pageTitle').html (deviceData['dev_Name'] + ' ('+ deviceData['dev_Owner'] +')');
|
$('#pageTitle').html (deviceData['dev_Name'] + ' ('+ deviceData['dev_Owner'] +')');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
$('#deviceStatus').html (deviceData['dev_Status']);
|
$('#deviceStatus').html (deviceData['dev_Status']);
|
||||||
switch (deviceData['dev_Status']) {
|
switch (deviceData['dev_Status']) {
|
||||||
@@ -976,14 +1052,19 @@ function getDeviceData (updatePanelData=false) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Device info
|
// Device info
|
||||||
if (updatePanelData) {
|
if (readAllData) {
|
||||||
|
// Activate controls
|
||||||
|
$('#panDetails :input').attr('disabled', false);
|
||||||
|
|
||||||
|
mac =deviceData['dev_MAC'];
|
||||||
|
|
||||||
$('#txtMAC').val (deviceData['dev_MAC']);
|
$('#txtMAC').val (deviceData['dev_MAC']);
|
||||||
$('#txtName').val (deviceData['dev_Name']);
|
$('#txtName').val (deviceData['dev_Name']);
|
||||||
$('#txtOwner').val (deviceData['dev_Owner']);
|
$('#txtOwner').val (deviceData['dev_Owner']);
|
||||||
$('#txtDeviceType').val (deviceData['dev_DeviceType']);
|
$('#txtDeviceType').val (deviceData['dev_DeviceType']);
|
||||||
$('#txtVendor').val (deviceData['dev_Vendor']);
|
$('#txtVendor').val (deviceData['dev_Vendor']);
|
||||||
|
|
||||||
if (deviceData['dev_Favorite'] == 1) {$('#chkFavorite').iCheck('check');}
|
if (deviceData['dev_Favorite'] == 1) {$('#chkFavorite').iCheck('check');} else {$('#chkFavorite').iCheck('uncheck');}
|
||||||
$('#txtGroup').val (deviceData['dev_Group']);
|
$('#txtGroup').val (deviceData['dev_Group']);
|
||||||
$('#txtLocation').val (deviceData['dev_Location']);
|
$('#txtLocation').val (deviceData['dev_Location']);
|
||||||
$('#txtComments').val (deviceData['dev_Comments']);
|
$('#txtComments').val (deviceData['dev_Comments']);
|
||||||
@@ -992,27 +1073,94 @@ function getDeviceData (updatePanelData=false) {
|
|||||||
$('#txtLastConnection').val (deviceData['dev_LastConnection']);
|
$('#txtLastConnection').val (deviceData['dev_LastConnection']);
|
||||||
$('#txtLastIP').val (deviceData['dev_LastIP']);
|
$('#txtLastIP').val (deviceData['dev_LastIP']);
|
||||||
$('#txtStatus').val (deviceData['dev_Status']);
|
$('#txtStatus').val (deviceData['dev_Status']);
|
||||||
if (deviceData['dev_StaticIP'] == 1) {$('#chkStaticIP').iCheck('check');}
|
if (deviceData['dev_StaticIP'] == 1) {$('#chkStaticIP').iCheck('check');} else {$('#chkStaticIP').iCheck('uncheck');}
|
||||||
|
|
||||||
$('#txtScanCycle').val (deviceData['dev_ScanCycle'] +' min');
|
$('#txtScanCycle').val (deviceData['dev_ScanCycle'] +' min');
|
||||||
if (deviceData['dev_AlertEvents'] == 1) {$('#chkAlertEvents').iCheck('check');}
|
if (deviceData['dev_AlertEvents'] == 1) {$('#chkAlertEvents').iCheck('check');} else {$('#chkAlertEvents').iCheck('uncheck');}
|
||||||
if (deviceData['dev_AlertDeviceDown'] == 1) {$('#chkAlertDown').iCheck('check');}
|
if (deviceData['dev_AlertDeviceDown'] == 1) {$('#chkAlertDown').iCheck('check');} else {$('#chkAlertDown').iCheck('uncheck');}
|
||||||
$('#txtSkipRepeated').val (findSkipRepeated (deviceData['dev_SkipRepeated']));
|
$('#txtSkipRepeated').val (findSkipRepeated (deviceData['dev_SkipRepeated']));
|
||||||
if (deviceData['dev_NewDevice'] == 1) {$('#chkNewDevice').iCheck('check');}
|
if (deviceData['dev_NewDevice'] == 1) {$('#chkNewDevice').iCheck('check');} else {$('#chkNewDevice').iCheck('uncheck');}
|
||||||
|
if (deviceData['dev_Archived'] == 1) {$('#chkArchived').iCheck('check');} else {$('#chkArchived').iCheck('uncheck');}
|
||||||
|
|
||||||
|
if (deviceData['dev_RandomMAC'] == 1) {$('#iconRandomMACactive').removeClass ('hidden');
|
||||||
|
$('#iconRandomMACinactive').addClass ('hidden'); }
|
||||||
|
else {$('#iconRandomMACactive').addClass ('hidden');
|
||||||
|
$('#iconRandomMACinactive').removeClass ('hidden'); };
|
||||||
deactivateSaveRestoreData ();
|
deactivateSaveRestoreData ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if device is part of the devicesList
|
||||||
|
pos = devicesList.indexOf (deviceData['rowid']);
|
||||||
|
if (pos == -1) {
|
||||||
|
devicesList =[deviceData['rowid']];
|
||||||
|
pos=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Record number
|
||||||
|
$('#txtRecord').html (pos+1 +' / '+ devicesList.length);
|
||||||
|
|
||||||
|
// Deactivate previous button
|
||||||
|
if (pos <= 0) {
|
||||||
|
$('#btnPrevious').attr ('disabled','');
|
||||||
|
$('#btnPrevious').addClass ('text-gray50');
|
||||||
|
} else {
|
||||||
|
$('#btnPrevious').removeAttr ('disabled');
|
||||||
|
$('#btnPrevious').removeClass ('text-gray50');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deactivate next button
|
||||||
|
if (pos >= (devicesList.length-1)) {
|
||||||
|
$('#btnNext').attr ('disabled','');
|
||||||
|
$('#btnNext').addClass ('text-gray50');
|
||||||
|
} else {
|
||||||
|
$('#btnNext').removeAttr ('disabled');
|
||||||
|
$('#btnNext').removeClass ('text-gray50');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Timer for refresh data
|
// Timer for refresh data
|
||||||
|
$("body").css("cursor", "default");
|
||||||
newTimerRefreshData (getDeviceData);
|
newTimerRefreshData (getDeviceData);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
function setDeviceData () {
|
function previousRecord () {
|
||||||
|
// Save Changes
|
||||||
|
if ( ! document.getElementById('btnSave').hasAttribute('disabled') ) {
|
||||||
|
setDeviceData (previousRecord);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Previous Record
|
||||||
|
if (pos > 0) {
|
||||||
|
pos--;
|
||||||
|
mac = devicesList[pos].toString();
|
||||||
|
getDeviceData (true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
function nextRecord () {
|
||||||
|
// Save Changes
|
||||||
|
if ( ! document.getElementById('btnSave').hasAttribute('disabled') ) {
|
||||||
|
setDeviceData (nextRecord);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Next Record
|
||||||
|
if (pos < (devicesList.length-1) ) {
|
||||||
|
pos++;
|
||||||
|
mac = devicesList[pos].toString();
|
||||||
|
getDeviceData (true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
function setDeviceData (refreshCallback='') {
|
||||||
// Check MAC
|
// Check MAC
|
||||||
if (mac == '') {
|
if (mac == '') {
|
||||||
return;
|
return;
|
||||||
@@ -1034,14 +1182,48 @@ function setDeviceData () {
|
|||||||
+ '&alertdown=' + ($('#chkAlertDown')[0].checked * 1)
|
+ '&alertdown=' + ($('#chkAlertDown')[0].checked * 1)
|
||||||
+ '&skiprepeated=' + $('#txtSkipRepeated').val().split(' ')[0]
|
+ '&skiprepeated=' + $('#txtSkipRepeated').val().split(' ')[0]
|
||||||
+ '&newdevice=' + ($('#chkNewDevice')[0].checked * 1)
|
+ '&newdevice=' + ($('#chkNewDevice')[0].checked * 1)
|
||||||
|
+ '&archived=' + ($('#chkArchived')[0].checked * 1)
|
||||||
, function(msg) {
|
, function(msg) {
|
||||||
|
|
||||||
|
// deactivate button
|
||||||
deactivateSaveRestoreData ();
|
deactivateSaveRestoreData ();
|
||||||
showMessage (msg);
|
showMessage (msg);
|
||||||
|
|
||||||
|
// Callback fuction
|
||||||
|
if (typeof refreshCallback == 'function') {
|
||||||
|
refreshCallback();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
function askSkipNotifications () {
|
||||||
|
// Check MAC
|
||||||
|
if (mac == '') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// When Archived
|
||||||
|
if ($('#chkArchived')[0].checked && $('#txtScanCycle').val().split(' ')[0] != "0") {
|
||||||
|
// Ask skip notifications
|
||||||
|
showModalDefault ('Device Archived', 'Do you want to skip all notifications for this device?',
|
||||||
|
'Cancel', 'Ok', 'skipNotifications');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
function skipNotifications () {
|
||||||
|
// Check MAC
|
||||||
|
if (mac == '') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set cycle 0
|
||||||
|
$('#txtScanCycle').val ('0 min');
|
||||||
|
activateSaveRestoreData();
|
||||||
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
function askDeleteDevice () {
|
function askDeleteDevice () {
|
||||||
// Check MAC
|
// Check MAC
|
||||||
@@ -1050,7 +1232,7 @@ function askDeleteDevice () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Ask delete device
|
// Ask delete device
|
||||||
showModal ('Delete Device', 'Are you sure you want to delete this device?',
|
showModalWarning ('Delete Device', 'Are you sure you want to delete this device?<br>(maybe you prefer to archive it)',
|
||||||
'Cancel', 'Delete', 'deleteDevice');
|
'Cancel', 'Delete', 'deleteDevice');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,65 +27,67 @@
|
|||||||
<!-- top small box 1 ------------------------------------------------------- -->
|
<!-- top small box 1 ------------------------------------------------------- -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div class="col-lg-3 col-sm-6 col-xs-6">
|
<div class="col-lg-2 col-sm-4 col-xs-6">
|
||||||
<a href="#" onclick="javascript: getDevicesList('all');">
|
<a href="#" onclick="javascript: getDevicesList('all');">
|
||||||
<div class="small-box bg-aqua pa-small-box-aqua">
|
<div class="small-box bg-aqua pa-small-box-aqua pa-small-box-2">
|
||||||
|
<div class="inner"> <h3 id="devicesAll"> -- </h3> </div>
|
||||||
<div class="inner">
|
<div class="icon"> <i class="fa fa-laptop text-aqua-20"></i> </div>
|
||||||
<h4>Total Devices</h4>
|
<div class="small-box-footer pa-small-box-footer"> All Devices <i class="fa fa-arrow-circle-right"></i> </div>
|
||||||
<h3 id="devicesAll"> -- </h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="icon"> <i class="fa fa-laptop"></i> </div>
|
|
||||||
<div class="small-box-footer"> Details <i class="fa fa-arrow-circle-right"></i> </div>
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- top small box 2 ------------------------------------------------------- -->
|
<!-- top small box 2 ------------------------------------------------------- -->
|
||||||
<div class="col-lg-3 col-sm-6 col-xs-6">
|
<div class="col-lg-2 col-sm-4 col-xs-6">
|
||||||
<a href="#" onclick="javascript: getDevicesList('connected');">
|
<a href="#" onclick="javascript: getDevicesList('connected');">
|
||||||
<div class="small-box bg-green pa-small-box-green">
|
<div class="small-box bg-green pa-small-box-green pa-small-box-2">
|
||||||
|
<div class="inner"> <h3 id="devicesConnected"> -- </h3> </div>
|
||||||
<div class="inner">
|
<div class="icon"> <i class="fa fa-plug text-green-20"></i> </div>
|
||||||
<h4>Connected</h4>
|
<div class="small-box-footer pa-small-box-footer"> Connected <i class="fa fa-arrow-circle-right"></i> </div>
|
||||||
<h3 id="devicesConnected"> -- </h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="icon"> <i class="fa fa-plug"></i> </div>
|
|
||||||
<div class="small-box-footer"> Details <i class="fa fa-arrow-circle-right"></i> </div>
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- top small box 3 ------------------------------------------------------- -->
|
<!-- top small box 3 ------------------------------------------------------- -->
|
||||||
<div class="col-lg-3 col-sm-6 col-xs-6">
|
<div class="col-lg-2 col-sm-4 col-xs-6">
|
||||||
<a href="#" onclick="javascript: getDevicesList('new');">
|
<a href="#" onclick="javascript: getDevicesList('favorites');">
|
||||||
<div class="small-box bg-yellow pa-small-box-yellow">
|
<div class="small-box bg-yellow pa-small-box-yellow pa-small-box-2">
|
||||||
|
<div class="inner"> <h3 id="devicesFavorites"> -- </h3> </div>
|
||||||
<div class="inner">
|
<div class="icon"> <i class="fa fa-star text-yellow-20"></i> </div>
|
||||||
<h4>New Devices</h4>
|
<div class="small-box-footer pa-small-box-footer"> Favorites <i class="fa fa-arrow-circle-right"></i> </div>
|
||||||
<h3 id="devicesNew"> -- </h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="icon"> <i class="ion ion-plus-round"></i> </div>
|
|
||||||
<div class="small-box-footer"> Details <i class="fa fa-arrow-circle-right"></i> </div>
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- top small box 4 ------------------------------------------------------- -->
|
<!-- top small box 4 ------------------------------------------------------- -->
|
||||||
<div class="col-lg-3 col-sm-6 col-xs-6">
|
<div class="col-lg-2 col-sm-4 col-xs-6">
|
||||||
|
<a href="#" onclick="javascript: getDevicesList('new');">
|
||||||
|
<div class="small-box bg-yellow pa-small-box-yellow pa-small-box-2">
|
||||||
|
<div class="inner"> <h3 id="devicesNew"> -- </h3> </div>
|
||||||
|
<div class="icon"> <i class="ion ion-plus-round text-yellow-20"></i> </div>
|
||||||
|
<div class="small-box-footer pa-small-box-footer"> New Devices <i class="fa fa-arrow-circle-right"></i> </div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- top small box 5 ------------------------------------------------------- -->
|
||||||
|
<div class="col-lg-2 col-sm-4 col-xs-6">
|
||||||
<a href="#" onclick="javascript: getDevicesList('down');">
|
<a href="#" onclick="javascript: getDevicesList('down');">
|
||||||
<div class="small-box bg-red pa-small-box-red">
|
<div class="small-box bg-red pa-small-box-red pa-small-box-2">
|
||||||
|
<div class="inner"> <h3 id="devicesDown"> -- </h3> </div>
|
||||||
|
<div class="icon"> <i class="fa fa-warning text-red-20"></i> </div>
|
||||||
|
<div class="small-box-footer pa-small-box-footer"> Down Alerts <i class="fa fa-arrow-circle-right"></i> </div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="inner">
|
<!-- top small box 6 ------------------------------------------------------- -->
|
||||||
<h4>Down Alerts</h4>
|
<div class="col-lg-2 col-sm-4 col-xs-6">
|
||||||
<h3 id="devicesDown"> -- </h3>
|
<a href="#" onclick="javascript: getDevicesList('archived');">
|
||||||
</div>
|
<div class="small-box bg-gray pa-small-box-gray pa-small-box-2">
|
||||||
|
<div class="inner"> <h3 id="devicesArchived"> -- </h3> </div>
|
||||||
<div class="icon"> <i class="fa fa-warning"></i> </div>
|
<div class="icon"> <i class="fa fa-eye-slash text-gray-20"></i> </div>
|
||||||
<div class="small-box-footer"> Details <i class="fa fa-arrow-circle-right"></i> </div>
|
<div class="small-box-footer pa-small-box-footer"> Archived <i class="fa fa-arrow-circle-right"></i> </div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -110,15 +112,17 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Owner</th>
|
<th>Owner</th>
|
||||||
<th>Device type</th>
|
<th>Type</th>
|
||||||
<th>Favorite</th>
|
<th>Favorite</th>
|
||||||
<th>Group</th>
|
<th>Group</th>
|
||||||
<th>First Session</th>
|
<th>First Session</th>
|
||||||
<th>Last Session</th>
|
<th>Last Session</th>
|
||||||
<th>Last IP</th>
|
<th>Last IP</th>
|
||||||
|
<th>MAC</th>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th>MAC</th>
|
<th>MAC</th>
|
||||||
<th>Last IP Order</th>
|
<th>Last IP Order</th>
|
||||||
|
<th>Rowid</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
</table>
|
</table>
|
||||||
@@ -187,8 +191,8 @@ function main () {
|
|||||||
// query data
|
// query data
|
||||||
getDevicesTotals();
|
getDevicesTotals();
|
||||||
getDevicesList (deviceStatus);
|
getDevicesList (deviceStatus);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
@@ -209,15 +213,16 @@ function initializeDatatable () {
|
|||||||
// 'order' : [[3,'desc'], [0,'asc']],
|
// 'order' : [[3,'desc'], [0,'asc']],
|
||||||
|
|
||||||
'columnDefs' : [
|
'columnDefs' : [
|
||||||
{visible: false, targets: [9, 10] },
|
{visible: false, targets: [10, 11, 12] },
|
||||||
{className: 'text-center', targets: [3, 8] },
|
{className: 'text-center', targets: [3, 8, 9] },
|
||||||
{width: '0px', targets: 8 },
|
{width: '80px', targets: [5, 6] },
|
||||||
{orderData: [10], targets: 7 },
|
{width: '0px', targets: 9 },
|
||||||
|
{orderData: [11], targets: 7 },
|
||||||
|
|
||||||
// Device Name
|
// Device Name
|
||||||
{targets: [0],
|
{targets: [0],
|
||||||
'createdCell': function (td, cellData, rowData, row, col) {
|
'createdCell': function (td, cellData, rowData, row, col) {
|
||||||
$(td).html ('<b><a href="deviceDetails.php?mac='+ rowData[9] +'" class="">'+ cellData +'</a></b>');
|
$(td).html ('<b><a href="deviceDetails.php?mac='+ rowData[10] +'" class="">'+ cellData +'</a></b>');
|
||||||
} },
|
} },
|
||||||
|
|
||||||
// Favorite
|
// Favorite
|
||||||
@@ -236,18 +241,29 @@ function initializeDatatable () {
|
|||||||
$(td).html (translateHTMLcodes (cellData));
|
$(td).html (translateHTMLcodes (cellData));
|
||||||
} },
|
} },
|
||||||
|
|
||||||
// Status color
|
// Random MAC
|
||||||
{targets: [8],
|
{targets: [8],
|
||||||
|
'createdCell': function (td, cellData, rowData, row, col) {
|
||||||
|
if (cellData == 1){
|
||||||
|
$(td).html ('<i data-toggle="tooltip" data-placement="right" title="Random MAC" style="font-size: 16px;" class="text-yellow glyphicon glyphicon-random"></i>');
|
||||||
|
} else {
|
||||||
|
$(td).html ('');
|
||||||
|
}
|
||||||
|
} },
|
||||||
|
|
||||||
|
// Status color
|
||||||
|
{targets: [9],
|
||||||
'createdCell': function (td, cellData, rowData, row, col) {
|
'createdCell': function (td, cellData, rowData, row, col) {
|
||||||
switch (cellData) {
|
switch (cellData) {
|
||||||
case 'Down': color='red'; break;
|
case 'Down': color='red'; break;
|
||||||
case 'New': color='yellow'; break;
|
case 'New': color='yellow'; break;
|
||||||
case 'On-line': color='green'; break;
|
case 'On-line': color='green'; break;
|
||||||
case 'Off-line': color='gray text-white'; break;
|
case 'Off-line': color='gray text-white'; break;
|
||||||
|
case 'Archived': color='gray text-white'; break;
|
||||||
default: color='aqua'; break;
|
default: color='aqua'; break;
|
||||||
};
|
};
|
||||||
|
|
||||||
$(td).html ('<a href="deviceDetails.php?mac='+ rowData[9] +'" class="badge bg-'+ color +'">'+ cellData +'</a>');
|
$(td).html ('<a href="deviceDetails.php?mac='+ rowData[10] +'" class="badge bg-'+ color +'">'+ cellData +'</a>');
|
||||||
} },
|
} },
|
||||||
],
|
],
|
||||||
|
|
||||||
@@ -259,13 +275,18 @@ function initializeDatatable () {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Save Parameters rows & order when changed
|
// Save cookie Rows displayed, and Parameters rows & order
|
||||||
$('#tableDevices').on( 'length.dt', function ( e, settings, len ) {
|
$('#tableDevices').on( 'length.dt', function ( e, settings, len ) {
|
||||||
setParameter (parTableRows, len);
|
setParameter (parTableRows, len);
|
||||||
} );
|
} );
|
||||||
|
|
||||||
$('#tableDevices').on( 'order.dt', function () {
|
$('#tableDevices').on( 'order.dt', function () {
|
||||||
setParameter (parTableOrder, JSON.stringify (table.order()) );
|
setParameter (parTableOrder, JSON.stringify (table.order()) );
|
||||||
|
setCookie ('devicesList',JSON.stringify (table.column(12, { 'search': 'applied' }).data().toArray()) );
|
||||||
|
} );
|
||||||
|
|
||||||
|
$('#tableDevices').on( 'search.dt', function () {
|
||||||
|
setCookie ('devicesList', JSON.stringify (table.column(12, { 'search': 'applied' }).data().toArray()) );
|
||||||
} );
|
} );
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -281,8 +302,10 @@ function getDevicesTotals () {
|
|||||||
|
|
||||||
$('#devicesAll').html (totalsDevices[0].toLocaleString());
|
$('#devicesAll').html (totalsDevices[0].toLocaleString());
|
||||||
$('#devicesConnected').html (totalsDevices[1].toLocaleString());
|
$('#devicesConnected').html (totalsDevices[1].toLocaleString());
|
||||||
$('#devicesNew').html (totalsDevices[2].toLocaleString());
|
$('#devicesFavorites').html (totalsDevices[2].toLocaleString());
|
||||||
$('#devicesDown').html (totalsDevices[3].toLocaleString());
|
$('#devicesNew').html (totalsDevices[3].toLocaleString());
|
||||||
|
$('#devicesDown').html (totalsDevices[4].toLocaleString());
|
||||||
|
$('#devicesArchived').html (totalsDevices[5].toLocaleString());
|
||||||
|
|
||||||
// Timer for refresh data
|
// Timer for refresh data
|
||||||
newTimerRefreshData (getDevicesTotals);
|
newTimerRefreshData (getDevicesTotals);
|
||||||
@@ -297,12 +320,13 @@ function getDevicesList (status) {
|
|||||||
|
|
||||||
// Define color & title for the status selected
|
// Define color & title for the status selected
|
||||||
switch (deviceStatus) {
|
switch (deviceStatus) {
|
||||||
case 'all': tableTitle = 'Total Devices'; color = 'aqua'; break;
|
case 'all': tableTitle = 'All Devices'; color = 'aqua'; break;
|
||||||
case 'connected': tableTitle = 'Connected Devices'; color = 'green'; break;
|
case 'connected': tableTitle = 'Connected Devices'; color = 'green'; break;
|
||||||
case 'new': tableTitle = 'New Devices'; color = 'yellow'; break;
|
case 'favorites': tableTitle = 'Favorites'; color = 'yellow'; break;
|
||||||
case 'down': tableTitle = 'Down Alerts'; color = 'red'; break;
|
case 'new': tableTitle = 'New Devices'; color = 'yellow'; break;
|
||||||
case 'favorites': tableTitle = 'Favorites'; color = 'yellow'; break;
|
case 'down': tableTitle = 'Down Alerts'; color = 'red'; break;
|
||||||
default: tableTitle = 'Devices'; boxClass = ''; break;
|
case 'archived': tableTitle = 'Archived Devices'; color = 'gray'; break;
|
||||||
|
default: tableTitle = 'Devices'; color = 'gray'; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set title and color
|
// Set title and color
|
||||||
|
|||||||
@@ -43,8 +43,7 @@
|
|||||||
<div class="small-box bg-aqua pa-small-box-aqua pa-small-box-2">
|
<div class="small-box bg-aqua pa-small-box-aqua pa-small-box-2">
|
||||||
<div class="inner"> <h3 id="eventsAll"> -- </h3> </div>
|
<div class="inner"> <h3 id="eventsAll"> -- </h3> </div>
|
||||||
<div class="icon"> <i class="fa fa-bolt text-aqua-20"></i> </div>
|
<div class="icon"> <i class="fa fa-bolt text-aqua-20"></i> </div>
|
||||||
|
<div class="small-box-footer pa-small-box-footer"> All events <i class="fa fa-arrow-circle-right"></i> </div>
|
||||||
<div class="small-box-footer"> All events <i class="fa fa-arrow-circle-right"></i> </div>
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -55,8 +54,7 @@
|
|||||||
<div class="small-box bg-green pa-small-box-green pa-small-box-2">
|
<div class="small-box bg-green pa-small-box-green pa-small-box-2">
|
||||||
<div class="inner"> <h3 id="eventsSessions"> -- </h3> </div>
|
<div class="inner"> <h3 id="eventsSessions"> -- </h3> </div>
|
||||||
<div class="icon"> <i class="fa fa-plug text-green-20"></i> </div>
|
<div class="icon"> <i class="fa fa-plug text-green-20"></i> </div>
|
||||||
|
<div class="small-box-footer pa-small-box-footer"> Sessions <i class="fa fa-arrow-circle-right"></i> </div>
|
||||||
<div class="small-box-footer"> Sessions <i class="fa fa-arrow-circle-right"></i> </div>
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -67,8 +65,7 @@
|
|||||||
<div class="small-box bg-yellow pa-small-box-yellow pa-small-box-2">
|
<div class="small-box bg-yellow pa-small-box-yellow pa-small-box-2">
|
||||||
<div class="inner"> <h3 id="eventsMissing"> -- </h3> </div>
|
<div class="inner"> <h3 id="eventsMissing"> -- </h3> </div>
|
||||||
<div class="icon"> <i class="fa fa-exchange text-yellow-20"></i> </div>
|
<div class="icon"> <i class="fa fa-exchange text-yellow-20"></i> </div>
|
||||||
|
<div class="small-box-footer pa-small-box-footer"> Missing Sessions <i class="fa fa-arrow-circle-right"></i> </div>
|
||||||
<div class="small-box-footer"> Missing Sessions <i class="fa fa-arrow-circle-right"></i> </div>
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -79,8 +76,7 @@
|
|||||||
<div class="small-box bg-yellow pa-small-box-yellow pa-small-box-2">
|
<div class="small-box bg-yellow pa-small-box-yellow pa-small-box-2">
|
||||||
<div class="inner"> <h3 id="eventsVoided"> -- </h3> </div>
|
<div class="inner"> <h3 id="eventsVoided"> -- </h3> </div>
|
||||||
<div class="icon text-aqua-20"> <i class="fa fa-exclamation-circle text-yellow-20"></i> </div>
|
<div class="icon text-aqua-20"> <i class="fa fa-exclamation-circle text-yellow-20"></i> </div>
|
||||||
|
<div class="small-box-footer pa-small-box-footer"> Voided Sessions <i class="fa fa-arrow-circle-right"></i> </div>
|
||||||
<div class="small-box-footer"> Voided Sessions <i class="fa fa-arrow-circle-right"></i> </div>
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -91,8 +87,7 @@
|
|||||||
<div class="small-box bg-yellow pa-small-box-yellow pa-small-box-2">
|
<div class="small-box bg-yellow pa-small-box-yellow pa-small-box-2">
|
||||||
<div class="inner"> <h3 id="eventsNewDevices"> -- </h3> </div>
|
<div class="inner"> <h3 id="eventsNewDevices"> -- </h3> </div>
|
||||||
<div class="icon"> <i class="ion ion-plus-round text-yellow-20"></i> </div>
|
<div class="icon"> <i class="ion ion-plus-round text-yellow-20"></i> </div>
|
||||||
|
<div class="small-box-footer pa-small-box-footer"> New Devices <i class="fa fa-arrow-circle-right"></i> </div>
|
||||||
<div class="small-box-footer"> New Devices <i class="fa fa-arrow-circle-right"></i> </div>
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -103,8 +98,7 @@
|
|||||||
<div class="small-box bg-red pa-small-box-red pa-small-box-2">
|
<div class="small-box bg-red pa-small-box-red pa-small-box-2">
|
||||||
<div class="inner"> <h3 id="eventsDown"> -- </h3> </div>
|
<div class="inner"> <h3 id="eventsDown"> -- </h3> </div>
|
||||||
<div class="icon"> <i class="fa fa-warning text-red-20"></i> </div>
|
<div class="icon"> <i class="fa fa-warning text-red-20"></i> </div>
|
||||||
|
<div class="small-box-footer pa-small-box-footer"> Down Alerts <i class="fa fa-arrow-circle-right"></i> </div>
|
||||||
<div class="small-box-footer"> Down Alerts <i class="fa fa-arrow-circle-right"></i> </div>
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
144
front/index.php
144
front/index.php
@@ -27,65 +27,67 @@
|
|||||||
<!-- top small box 1 ------------------------------------------------------- -->
|
<!-- top small box 1 ------------------------------------------------------- -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div class="col-lg-3 col-sm-6 col-xs-6">
|
<div class="col-lg-2 col-sm-4 col-xs-6">
|
||||||
<a href="#" onclick="javascript: getDevicesList('all');">
|
<a href="#" onclick="javascript: getDevicesList('all');">
|
||||||
<div class="small-box bg-aqua pa-small-box-aqua">
|
<div class="small-box bg-aqua pa-small-box-aqua pa-small-box-2">
|
||||||
|
<div class="inner"> <h3 id="devicesAll"> -- </h3> </div>
|
||||||
<div class="inner">
|
<div class="icon"> <i class="fa fa-laptop text-aqua-20"></i> </div>
|
||||||
<h4>Total Devices</h4>
|
<div class="small-box-footer pa-small-box-footer"> All Devices <i class="fa fa-arrow-circle-right"></i> </div>
|
||||||
<h3 id="devicesAll"> -- </h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="icon"> <i class="fa fa-laptop"></i> </div>
|
|
||||||
<div class="small-box-footer"> Details <i class="fa fa-arrow-circle-right"></i> </div>
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- top small box 2 ------------------------------------------------------- -->
|
<!-- top small box 2 ------------------------------------------------------- -->
|
||||||
<div class="col-lg-3 col-sm-6 col-xs-6">
|
<div class="col-lg-2 col-sm-4 col-xs-6">
|
||||||
<a href="#" onclick="javascript: getDevicesList('connected');">
|
<a href="#" onclick="javascript: getDevicesList('connected');">
|
||||||
<div class="small-box bg-green pa-small-box-green">
|
<div class="small-box bg-green pa-small-box-green pa-small-box-2">
|
||||||
|
<div class="inner"> <h3 id="devicesConnected"> -- </h3> </div>
|
||||||
<div class="inner">
|
<div class="icon"> <i class="fa fa-plug text-green-20"></i> </div>
|
||||||
<h4>Connected</h4>
|
<div class="small-box-footer pa-small-box-footer"> Connected <i class="fa fa-arrow-circle-right"></i> </div>
|
||||||
<h3 id="devicesConnected"> -- </h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="icon"> <i class="fa fa-plug"></i> </div>
|
|
||||||
<div class="small-box-footer"> Details <i class="fa fa-arrow-circle-right"></i> </div>
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- top small box 3 ------------------------------------------------------- -->
|
<!-- top small box 3 ------------------------------------------------------- -->
|
||||||
<div class="col-lg-3 col-sm-6 col-xs-6">
|
<div class="col-lg-2 col-sm-4 col-xs-6">
|
||||||
<a href="#" onclick="javascript: getDevicesList('new');">
|
<a href="#" onclick="javascript: getDevicesList('favorites');">
|
||||||
<div class="small-box bg-yellow pa-small-box-yellow">
|
<div class="small-box bg-yellow pa-small-box-yellow pa-small-box-2">
|
||||||
|
<div class="inner"> <h3 id="devicesFavorites"> -- </h3> </div>
|
||||||
<div class="inner">
|
<div class="icon"> <i class="fa fa-star text-yellow-20"></i> </div>
|
||||||
<h4>New Devices</h4>
|
<div class="small-box-footer pa-small-box-footer"> Favorites <i class="fa fa-arrow-circle-right"></i> </div>
|
||||||
<h3 id="devicesNew"> -- </h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="icon"> <i class="ion ion-plus-round"></i> </div>
|
|
||||||
<div class="small-box-footer"> Details <i class="fa fa-arrow-circle-right"></i> </div>
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- top small box 4 ------------------------------------------------------- -->
|
<!-- top small box 4 ------------------------------------------------------- -->
|
||||||
<div class="col-lg-3 col-sm-6 col-xs-6">
|
<div class="col-lg-2 col-sm-4 col-xs-6">
|
||||||
|
<a href="#" onclick="javascript: getDevicesList('new');">
|
||||||
|
<div class="small-box bg-yellow pa-small-box-yellow pa-small-box-2">
|
||||||
|
<div class="inner"> <h3 id="devicesNew"> -- </h3> </div>
|
||||||
|
<div class="icon"> <i class="ion ion-plus-round text-yellow-20"></i> </div>
|
||||||
|
<div class="small-box-footer pa-small-box-footer"> New Devices <i class="fa fa-arrow-circle-right"></i> </div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- top small box 5 ------------------------------------------------------- -->
|
||||||
|
<div class="col-lg-2 col-sm-4 col-xs-6">
|
||||||
<a href="#" onclick="javascript: getDevicesList('down');">
|
<a href="#" onclick="javascript: getDevicesList('down');">
|
||||||
<div class="small-box bg-red pa-small-box-red">
|
<div class="small-box bg-red pa-small-box-red pa-small-box-2">
|
||||||
|
<div class="inner"> <h3 id="devicesDown"> -- </h3> </div>
|
||||||
|
<div class="icon"> <i class="fa fa-warning text-red-20"></i> </div>
|
||||||
|
<div class="small-box-footer pa-small-box-footer"> Down Alerts <i class="fa fa-arrow-circle-right"></i> </div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="inner">
|
<!-- top small box 6 ------------------------------------------------------- -->
|
||||||
<h4>Down Alerts</h4>
|
<div class="col-lg-2 col-sm-4 col-xs-6">
|
||||||
<h3 id="devicesDown"> -- </h3>
|
<a href="#" onclick="javascript: getDevicesList('archived');">
|
||||||
</div>
|
<div class="small-box bg-gray pa-small-box-gray pa-small-box-2">
|
||||||
|
<div class="inner"> <h3 id="devicesArchived"> -- </h3> </div>
|
||||||
<div class="icon"> <i class="fa fa-warning"></i> </div>
|
<div class="icon"> <i class="fa fa-eye-slash text-gray-20"></i> </div>
|
||||||
<div class="small-box-footer"> Details <i class="fa fa-arrow-circle-right"></i> </div>
|
<div class="small-box-footer pa-small-box-footer"> Archived <i class="fa fa-arrow-circle-right"></i> </div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -110,15 +112,17 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Owner</th>
|
<th>Owner</th>
|
||||||
<th>Device type</th>
|
<th>Type</th>
|
||||||
<th>Favorite</th>
|
<th>Favorite</th>
|
||||||
<th>Group</th>
|
<th>Group</th>
|
||||||
<th>First Session</th>
|
<th>First Session</th>
|
||||||
<th>Last Session</th>
|
<th>Last Session</th>
|
||||||
<th>Last IP</th>
|
<th>Last IP</th>
|
||||||
|
<th>MAC</th>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th>MAC</th>
|
<th>MAC</th>
|
||||||
<th>Last IP Order</th>
|
<th>Last IP Order</th>
|
||||||
|
<th>Rowid</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
</table>
|
</table>
|
||||||
@@ -187,8 +191,8 @@ function main () {
|
|||||||
// query data
|
// query data
|
||||||
getDevicesTotals();
|
getDevicesTotals();
|
||||||
getDevicesList (deviceStatus);
|
getDevicesList (deviceStatus);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
@@ -209,15 +213,16 @@ function initializeDatatable () {
|
|||||||
// 'order' : [[3,'desc'], [0,'asc']],
|
// 'order' : [[3,'desc'], [0,'asc']],
|
||||||
|
|
||||||
'columnDefs' : [
|
'columnDefs' : [
|
||||||
{visible: false, targets: [9, 10] },
|
{visible: false, targets: [10, 11, 12] },
|
||||||
{className: 'text-center', targets: [3, 8] },
|
{className: 'text-center', targets: [3, 8, 9] },
|
||||||
{width: '0px', targets: 8 },
|
{width: '80px', targets: [5, 6] },
|
||||||
{orderData: [10], targets: 7 },
|
{width: '0px', targets: 9 },
|
||||||
|
{orderData: [11], targets: 7 },
|
||||||
|
|
||||||
// Device Name
|
// Device Name
|
||||||
{targets: [0],
|
{targets: [0],
|
||||||
'createdCell': function (td, cellData, rowData, row, col) {
|
'createdCell': function (td, cellData, rowData, row, col) {
|
||||||
$(td).html ('<b><a href="deviceDetails.php?mac='+ rowData[9] +'" class="">'+ cellData +'</a></b>');
|
$(td).html ('<b><a href="deviceDetails.php?mac='+ rowData[10] +'" class="">'+ cellData +'</a></b>');
|
||||||
} },
|
} },
|
||||||
|
|
||||||
// Favorite
|
// Favorite
|
||||||
@@ -236,18 +241,29 @@ function initializeDatatable () {
|
|||||||
$(td).html (translateHTMLcodes (cellData));
|
$(td).html (translateHTMLcodes (cellData));
|
||||||
} },
|
} },
|
||||||
|
|
||||||
// Status color
|
// Random MAC
|
||||||
{targets: [8],
|
{targets: [8],
|
||||||
|
'createdCell': function (td, cellData, rowData, row, col) {
|
||||||
|
if (cellData == 1){
|
||||||
|
$(td).html ('<i data-toggle="tooltip" data-placement="right" title="Random MAC" style="font-size: 16px;" class="text-yellow glyphicon glyphicon-random"></i>');
|
||||||
|
} else {
|
||||||
|
$(td).html ('');
|
||||||
|
}
|
||||||
|
} },
|
||||||
|
|
||||||
|
// Status color
|
||||||
|
{targets: [9],
|
||||||
'createdCell': function (td, cellData, rowData, row, col) {
|
'createdCell': function (td, cellData, rowData, row, col) {
|
||||||
switch (cellData) {
|
switch (cellData) {
|
||||||
case 'Down': color='red'; break;
|
case 'Down': color='red'; break;
|
||||||
case 'New': color='yellow'; break;
|
case 'New': color='yellow'; break;
|
||||||
case 'On-line': color='green'; break;
|
case 'On-line': color='green'; break;
|
||||||
case 'Off-line': color='gray text-white'; break;
|
case 'Off-line': color='gray text-white'; break;
|
||||||
|
case 'Archived': color='gray text-white'; break;
|
||||||
default: color='aqua'; break;
|
default: color='aqua'; break;
|
||||||
};
|
};
|
||||||
|
|
||||||
$(td).html ('<a href="deviceDetails.php?mac='+ rowData[9] +'" class="badge bg-'+ color +'">'+ cellData +'</a>');
|
$(td).html ('<a href="deviceDetails.php?mac='+ rowData[10] +'" class="badge bg-'+ color +'">'+ cellData +'</a>');
|
||||||
} },
|
} },
|
||||||
],
|
],
|
||||||
|
|
||||||
@@ -259,13 +275,18 @@ function initializeDatatable () {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Save Parameters rows & order when changed
|
// Save cookie Rows displayed, and Parameters rows & order
|
||||||
$('#tableDevices').on( 'length.dt', function ( e, settings, len ) {
|
$('#tableDevices').on( 'length.dt', function ( e, settings, len ) {
|
||||||
setParameter (parTableRows, len);
|
setParameter (parTableRows, len);
|
||||||
} );
|
} );
|
||||||
|
|
||||||
$('#tableDevices').on( 'order.dt', function () {
|
$('#tableDevices').on( 'order.dt', function () {
|
||||||
setParameter (parTableOrder, JSON.stringify (table.order()) );
|
setParameter (parTableOrder, JSON.stringify (table.order()) );
|
||||||
|
setCookie ('devicesList',JSON.stringify (table.column(12, { 'search': 'applied' }).data().toArray()) );
|
||||||
|
} );
|
||||||
|
|
||||||
|
$('#tableDevices').on( 'search.dt', function () {
|
||||||
|
setCookie ('devicesList', JSON.stringify (table.column(12, { 'search': 'applied' }).data().toArray()) );
|
||||||
} );
|
} );
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -281,8 +302,10 @@ function getDevicesTotals () {
|
|||||||
|
|
||||||
$('#devicesAll').html (totalsDevices[0].toLocaleString());
|
$('#devicesAll').html (totalsDevices[0].toLocaleString());
|
||||||
$('#devicesConnected').html (totalsDevices[1].toLocaleString());
|
$('#devicesConnected').html (totalsDevices[1].toLocaleString());
|
||||||
$('#devicesNew').html (totalsDevices[2].toLocaleString());
|
$('#devicesFavorites').html (totalsDevices[2].toLocaleString());
|
||||||
$('#devicesDown').html (totalsDevices[3].toLocaleString());
|
$('#devicesNew').html (totalsDevices[3].toLocaleString());
|
||||||
|
$('#devicesDown').html (totalsDevices[4].toLocaleString());
|
||||||
|
$('#devicesArchived').html (totalsDevices[5].toLocaleString());
|
||||||
|
|
||||||
// Timer for refresh data
|
// Timer for refresh data
|
||||||
newTimerRefreshData (getDevicesTotals);
|
newTimerRefreshData (getDevicesTotals);
|
||||||
@@ -297,12 +320,13 @@ function getDevicesList (status) {
|
|||||||
|
|
||||||
// Define color & title for the status selected
|
// Define color & title for the status selected
|
||||||
switch (deviceStatus) {
|
switch (deviceStatus) {
|
||||||
case 'all': tableTitle = 'Total Devices'; color = 'aqua'; break;
|
case 'all': tableTitle = 'All Devices'; color = 'aqua'; break;
|
||||||
case 'connected': tableTitle = 'Connected Devices'; color = 'green'; break;
|
case 'connected': tableTitle = 'Connected Devices'; color = 'green'; break;
|
||||||
case 'new': tableTitle = 'New Devices'; color = 'yellow'; break;
|
case 'favorites': tableTitle = 'Favorites'; color = 'yellow'; break;
|
||||||
case 'down': tableTitle = 'Down Alerts'; color = 'red'; break;
|
case 'new': tableTitle = 'New Devices'; color = 'yellow'; break;
|
||||||
case 'favorites': tableTitle = 'Favorites'; color = 'yellow'; break;
|
case 'down': tableTitle = 'Down Alerts'; color = 'red'; break;
|
||||||
default: tableTitle = 'Devices'; boxClass = ''; break;
|
case 'archived': tableTitle = 'Archived Devices'; color = 'gray'; break;
|
||||||
|
default: tableTitle = 'Devices'; color = 'gray'; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set title and color
|
// Set title and color
|
||||||
|
|||||||
@@ -13,20 +13,98 @@ var modalCallbackFunction = '';
|
|||||||
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
function showModal (title, message, btnCancel, btnOK, callbackFunction) {
|
function setCookie (cookie, value, expirationHours='') {
|
||||||
|
// Calc expiration date
|
||||||
|
var expires = '';
|
||||||
|
if (typeof expirationHours === 'number') {
|
||||||
|
expires = ';expires=' + new Date(Date.now() + expirationHours *60*60*1000).toUTCString();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save Cookie
|
||||||
|
document.cookie = cookie + "=" + value + expires;
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
function getCookie (cookie) {
|
||||||
|
// Array of cookies
|
||||||
|
var allCookies = document.cookie.split(';');
|
||||||
|
|
||||||
|
// For each cookie
|
||||||
|
for (var i = 0; i < allCookies.length; i++) {
|
||||||
|
var currentCookie = allCookies[i].trim();
|
||||||
|
|
||||||
|
// If the current cookie is the correct cookie
|
||||||
|
if (currentCookie.indexOf (cookie +'=') == 0) {
|
||||||
|
// Return value
|
||||||
|
return currentCookie.substring (cookie.length+1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return empty (not found)
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
function deleteCookie (cookie) {
|
||||||
|
document.cookie = cookie + '=;expires=Thu, 01 Jan 1970 00:00:00 UTC';
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
function deleteAllCookies() {
|
||||||
|
// Array of cookies
|
||||||
|
var allCookies = document.cookie.split(";");
|
||||||
|
|
||||||
|
// For each cookie
|
||||||
|
for (var i = 0; i < allCookies.length; i++) {
|
||||||
|
var cookie = allCookies[i].trim();
|
||||||
|
var eqPos = cookie.indexOf("=");
|
||||||
|
var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
|
||||||
|
document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 UTC";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
function showModalDefault (title, message, btnCancel, btnOK, callbackFunction) {
|
||||||
// set captions
|
// set captions
|
||||||
$('#modal-title').html (title);
|
$('#modal-default-title').html (title);
|
||||||
$('#modal-message').html (message);
|
$('#modal-default-message').html (message);
|
||||||
$('#modal-cancel').html (btnCancel);
|
$('#modal-default-cancel').html (btnCancel);
|
||||||
$('#modal-OK').html (btnOK);
|
$('#modal-default-OK').html (btnOK);
|
||||||
modalCallbackFunction = callbackFunction;
|
modalCallbackFunction = callbackFunction;
|
||||||
|
|
||||||
|
// Show modal
|
||||||
|
$('#modal-default').modal('show');
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
function showModalWarning (title, message, btnCancel, btnOK, callbackFunction) {
|
||||||
|
// set captions
|
||||||
|
$('#modal-warning-title').html (title);
|
||||||
|
$('#modal-warning-message').html (message);
|
||||||
|
$('#modal-warning-cancel').html (btnCancel);
|
||||||
|
$('#modal-warning-OK').html (btnOK);
|
||||||
|
modalCallbackFunction = callbackFunction;
|
||||||
|
|
||||||
// Show modal
|
// Show modal
|
||||||
$('#modal-warning').modal('show');
|
$('#modal-warning').modal('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
function modalOK () {
|
function modalDefaultOK () {
|
||||||
|
// Hide modal
|
||||||
|
$('#modal-default').modal('hide');
|
||||||
|
|
||||||
|
// timer to execute function
|
||||||
|
window.setTimeout( function() {
|
||||||
|
window[modalCallbackFunction]();
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
function modalWarningOK () {
|
||||||
// Hide modal
|
// Hide modal
|
||||||
$('#modal-warning').modal('hide');
|
$('#modal-warning').modal('hide');
|
||||||
|
|
||||||
|
|||||||
@@ -57,19 +57,22 @@ function getDeviceData() {
|
|||||||
$mac = $_REQUEST['mac'];
|
$mac = $_REQUEST['mac'];
|
||||||
|
|
||||||
// Device Data
|
// Device Data
|
||||||
$sql = 'SELECT *,
|
$sql = 'SELECT rowid, *,
|
||||||
CASE WHEN dev_AlertDeviceDown=1 AND dev_PresentLastScan=0 THEN "Down"
|
CASE WHEN dev_AlertDeviceDown=1 AND dev_PresentLastScan=0 THEN "Down"
|
||||||
WHEN dev_PresentLastScan=1 THEN "On-line"
|
WHEN dev_PresentLastScan=1 THEN "On-line"
|
||||||
ELSE "Off-line" END as dev_Status
|
ELSE "Off-line" END as dev_Status
|
||||||
FROM Devices
|
FROM Devices
|
||||||
WHERE dev_MAC="'. $mac .'"';
|
WHERE dev_MAC="'. $mac .'" or cast(rowid as text)="'. $mac. '"';
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
$row = $result -> fetchArray (SQLITE3_ASSOC);
|
$row = $result -> fetchArray (SQLITE3_ASSOC);
|
||||||
$deviceData = $row;
|
$deviceData = $row;
|
||||||
|
$mac = $deviceData['dev_MAC'];
|
||||||
|
|
||||||
$deviceData['dev_FirstConnection'] = formatDate ($row['dev_FirstConnection']); // Date formated
|
$deviceData['dev_FirstConnection'] = formatDate ($row['dev_FirstConnection']); // Date formated
|
||||||
$deviceData['dev_LastConnection'] = formatDate ($row['dev_LastConnection']); // Date formated
|
$deviceData['dev_LastConnection'] = formatDate ($row['dev_LastConnection']); // Date formated
|
||||||
|
|
||||||
|
$deviceData['dev_RandomMAC'] = ( in_array($mac[1], array("2","6","A","E","a","e")) ? 1 : 0);
|
||||||
|
|
||||||
// Count Totals
|
// Count Totals
|
||||||
$condition = ' WHERE eve_MAC="'. $mac .'" AND eve_DateTime >= '. $periodDate;
|
$condition = ' WHERE eve_MAC="'. $mac .'" AND eve_DateTime >= '. $periodDate;
|
||||||
|
|
||||||
@@ -89,16 +92,16 @@ function getDeviceData() {
|
|||||||
$row = $result -> fetchArray (SQLITE3_NUM);
|
$row = $result -> fetchArray (SQLITE3_NUM);
|
||||||
$deviceData['dev_Events'] = $row[0];
|
$deviceData['dev_Events'] = $row[0];
|
||||||
|
|
||||||
// Donw Alerts
|
// Down Alerts
|
||||||
$sql = 'SELECT COUNT(*) FROM Events '. $condition .' AND eve_EventType = "Device Down"';
|
$sql = 'SELECT COUNT(*) FROM Events '. $condition .' AND eve_EventType = "Device Down"';
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
$row = $result -> fetchArray (SQLITE3_NUM);
|
$row = $result -> fetchArray (SQLITE3_NUM);
|
||||||
$deviceData['dev_DownAlerts'] = $row[0];
|
$deviceData['dev_DownAlerts'] = $row[0];
|
||||||
|
|
||||||
// Presence hours
|
// Presence hours
|
||||||
$sql = 'SELECT SUM (julianday (IFNULL (ses_DateTimeDisconnection, DATETIME("now")))
|
$sql = 'SELECT CAST(( MAX (0, SUM (julianday (IFNULL (ses_DateTimeDisconnection, DATETIME("now","localtime")))
|
||||||
- julianday (CASE WHEN ses_DateTimeConnection < '. $periodDate .' THEN '. $periodDate .'
|
- julianday (CASE WHEN ses_DateTimeConnection < '. $periodDate .' THEN '. $periodDate .'
|
||||||
ELSE ses_DateTimeConnection END)) *24
|
ELSE ses_DateTimeConnection END)) *24 )) AS INT)
|
||||||
FROM Sessions
|
FROM Sessions
|
||||||
WHERE ses_MAC="'. $mac .'"
|
WHERE ses_MAC="'. $mac .'"
|
||||||
AND ses_DateTimeConnection IS NOT NULL
|
AND ses_DateTimeConnection IS NOT NULL
|
||||||
@@ -136,7 +139,8 @@ function setDeviceData() {
|
|||||||
dev_AlertEvents = "'. quotes($_REQUEST['alertevents']) .'",
|
dev_AlertEvents = "'. quotes($_REQUEST['alertevents']) .'",
|
||||||
dev_AlertDeviceDown = "'. quotes($_REQUEST['alertdown']) .'",
|
dev_AlertDeviceDown = "'. quotes($_REQUEST['alertdown']) .'",
|
||||||
dev_SkipRepeated = "'. quotes($_REQUEST['skiprepeated']) .'",
|
dev_SkipRepeated = "'. quotes($_REQUEST['skiprepeated']) .'",
|
||||||
dev_NewDevice = "'. quotes($_REQUEST['newdevice']) .'"
|
dev_NewDevice = "'. quotes($_REQUEST['newdevice']) .'",
|
||||||
|
dev_Archived = "'. quotes($_REQUEST['archived']) .'"
|
||||||
WHERE dev_MAC="' . $_REQUEST['mac'] .'"';
|
WHERE dev_MAC="' . $_REQUEST['mac'] .'"';
|
||||||
// update Data
|
// update Data
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
@@ -177,15 +181,20 @@ function getDevicesTotals() {
|
|||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
// All
|
// All
|
||||||
$result = $db->query('SELECT COUNT(*) FROM Devices ');
|
$result = $db->query('SELECT COUNT(*) FROM Devices '. getDeviceCondition ('all'));
|
||||||
$row = $result -> fetchArray (SQLITE3_NUM);
|
$row = $result -> fetchArray (SQLITE3_NUM);
|
||||||
$devices = $row[0];
|
$devices = $row[0];
|
||||||
|
|
||||||
// Connected
|
// On-Line
|
||||||
$result = $db->query('SELECT COUNT(*) FROM Devices '. getDeviceCondition ('connected') );
|
$result = $db->query('SELECT COUNT(*) FROM Devices '. getDeviceCondition ('connected') );
|
||||||
$row = $result -> fetchArray (SQLITE3_NUM);
|
$row = $result -> fetchArray (SQLITE3_NUM);
|
||||||
$connected = $row[0];
|
$connected = $row[0];
|
||||||
|
|
||||||
|
// Favorites
|
||||||
|
$result = $db->query('SELECT COUNT(*) FROM Devices '. getDeviceCondition ('favorites') );
|
||||||
|
$row = $result -> fetchArray (SQLITE3_NUM);
|
||||||
|
$favorites = $row[0];
|
||||||
|
|
||||||
// New
|
// New
|
||||||
$result = $db->query('SELECT COUNT(*) FROM Devices '. getDeviceCondition ('new') );
|
$result = $db->query('SELECT COUNT(*) FROM Devices '. getDeviceCondition ('new') );
|
||||||
$row = $result -> fetchArray (SQLITE3_NUM);
|
$row = $result -> fetchArray (SQLITE3_NUM);
|
||||||
@@ -194,10 +203,14 @@ function getDevicesTotals() {
|
|||||||
// Down Alerts
|
// Down Alerts
|
||||||
$result = $db->query('SELECT COUNT(*) FROM Devices '. getDeviceCondition ('down'));
|
$result = $db->query('SELECT COUNT(*) FROM Devices '. getDeviceCondition ('down'));
|
||||||
$row = $result -> fetchArray (SQLITE3_NUM);
|
$row = $result -> fetchArray (SQLITE3_NUM);
|
||||||
$devicesDownAlert = $row[0];
|
$downAlert = $row[0];
|
||||||
|
|
||||||
echo (json_encode (array ($devices, $connected, $newDevices,
|
// Archived
|
||||||
$devicesDownAlert)));
|
$result = $db->query('SELECT COUNT(*) FROM Devices '. getDeviceCondition ('archived'));
|
||||||
|
$row = $result -> fetchArray (SQLITE3_NUM);
|
||||||
|
$archived = $row[0];
|
||||||
|
|
||||||
|
echo (json_encode (array ($devices, $connected, $favorites, $newDevices, $downAlert, $archived)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -210,7 +223,7 @@ function getDevicesList() {
|
|||||||
// SQL
|
// SQL
|
||||||
$condition = getDeviceCondition ($_REQUEST['status']);
|
$condition = getDeviceCondition ($_REQUEST['status']);
|
||||||
|
|
||||||
$sql = 'SELECT *, CASE
|
$sql = 'SELECT rowid, *, CASE
|
||||||
WHEN dev_AlertDeviceDown=1 AND dev_PresentLastScan=0 THEN "Down"
|
WHEN dev_AlertDeviceDown=1 AND dev_PresentLastScan=0 THEN "Down"
|
||||||
WHEN dev_NewDevice=1 THEN "New"
|
WHEN dev_NewDevice=1 THEN "New"
|
||||||
WHEN dev_PresentLastScan=1 THEN "On-line"
|
WHEN dev_PresentLastScan=1 THEN "On-line"
|
||||||
@@ -230,9 +243,11 @@ function getDevicesList() {
|
|||||||
formatDate ($row['dev_FirstConnection']),
|
formatDate ($row['dev_FirstConnection']),
|
||||||
formatDate ($row['dev_LastConnection']),
|
formatDate ($row['dev_LastConnection']),
|
||||||
$row['dev_LastIP'],
|
$row['dev_LastIP'],
|
||||||
|
( in_array($row['dev_MAC'][1], array("2","6","A","E","a","e")) ? 1 : 0),
|
||||||
$row['dev_Status'],
|
$row['dev_Status'],
|
||||||
$row['dev_MAC'], // MAC (hidden)
|
$row['dev_MAC'], // MAC (hidden)
|
||||||
formatIPlong ($row['dev_LastIP']) // IP orderable
|
formatIPlong ($row['dev_LastIP']), // IP orderable
|
||||||
|
$row['rowid'] // Rowid (hidden)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -332,6 +347,7 @@ function getDeviceTypes() {
|
|||||||
UNION SELECT 2 as dev_Order, "Server"
|
UNION SELECT 2 as dev_Order, "Server"
|
||||||
UNION SELECT 2 as dev_Order, "Singleboard Computer (SBC)"
|
UNION SELECT 2 as dev_Order, "Singleboard Computer (SBC)"
|
||||||
|
|
||||||
|
UNION SELECT 3 as dev_Order, "Domotic"
|
||||||
UNION SELECT 3 as dev_Order, "Game Console"
|
UNION SELECT 3 as dev_Order, "Game Console"
|
||||||
UNION SELECT 3 as dev_Order, "SmartTV"
|
UNION SELECT 3 as dev_Order, "SmartTV"
|
||||||
UNION SELECT 3 as dev_Order, "TV Decoder"
|
UNION SELECT 3 as dev_Order, "TV Decoder"
|
||||||
@@ -346,6 +362,8 @@ function getDeviceTypes() {
|
|||||||
UNION SELECT 5 as dev_Order, "NAS"
|
UNION SELECT 5 as dev_Order, "NAS"
|
||||||
UNION SELECT 5 as dev_Order, "PLC"
|
UNION SELECT 5 as dev_Order, "PLC"
|
||||||
UNION SELECT 5 as dev_Order, "Router"
|
UNION SELECT 5 as dev_Order, "Router"
|
||||||
|
UNION SELECT 5 as dev_Order, "USB LAN Adapter"
|
||||||
|
UNION SELECT 5 as dev_Order, "USB WIFI Adapter"
|
||||||
|
|
||||||
UNION SELECT 10 as dev_Order, "Other"
|
UNION SELECT 10 as dev_Order, "Other"
|
||||||
|
|
||||||
@@ -451,12 +469,13 @@ function getLocations() {
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
function getDeviceCondition ($deviceStatus) {
|
function getDeviceCondition ($deviceStatus) {
|
||||||
switch ($deviceStatus) {
|
switch ($deviceStatus) {
|
||||||
case 'all': return ''; break;
|
case 'all': return 'WHERE dev_Archived=0'; break;
|
||||||
case 'connected': return 'WHERE dev_PresentLastScan=1'; break;
|
case 'connected': return 'WHERE dev_Archived=0 AND dev_PresentLastScan=1'; break;
|
||||||
case 'new': return 'WHERE dev_NewDevice=1'; break;
|
case 'favorites': return 'WHERE dev_Archived=0 AND dev_Favorite=1'; break;
|
||||||
case 'down': return 'WHERE dev_AlertDeviceDown=1 AND dev_PresentLastScan=0'; break;
|
case 'new': return 'WHERE dev_Archived=0 AND dev_NewDevice=1'; break;
|
||||||
case 'favorites': return 'WHERE dev_Favorite=1'; break;
|
case 'down': return 'WHERE dev_Archived=0 AND dev_AlertDeviceDown=1 AND dev_PresentLastScan=0'; break;
|
||||||
default: return 'WHERE 1=0'; break;
|
case 'archived': return 'WHERE dev_Archived=1'; break;
|
||||||
|
default: return 'WHERE 1=0'; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
<!-- ----------------------------------------------------------------------- -->
|
<!-- ----------------------------------------------------------------------- -->
|
||||||
<!-- Logo -->
|
<!-- Logo -->
|
||||||
<a href="/" class="logo">
|
<a href="." class="logo">
|
||||||
<!-- mini logo for sidebar mini 50x50 pixels -->
|
<!-- mini logo for sidebar mini 50x50 pixels -->
|
||||||
<span class="logo-mini">P<b>a</b></span>
|
<span class="logo-mini">P<b>a</b></span>
|
||||||
<!-- logo for regular state and mobile devices -->
|
<!-- logo for regular state and mobile devices -->
|
||||||
@@ -140,7 +140,7 @@
|
|||||||
|
|
||||||
<!-- Sidebar user panel (optional) -->
|
<!-- Sidebar user panel (optional) -->
|
||||||
<div class="user-panel">
|
<div class="user-panel">
|
||||||
<a href="/" class="logo">
|
<a href="." class="logo">
|
||||||
<img src="img/pialertLogoGray80.png" class="img-responsive" alt="Pi.Alert Logo"/>
|
<img src="img/pialertLogoGray80.png" class="img-responsive" alt="Pi.Alert Logo"/>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -154,7 +154,6 @@
|
|||||||
<li class="header">MAIN MENU</li>
|
<li class="header">MAIN MENU</li>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- Optionally, you can add icons to the links -->
|
|
||||||
<li class=" <?php if (in_array (basename($_SERVER['SCRIPT_NAME']), array('devices.php', 'deviceDetails.php') ) ){ echo 'active'; } ?>">
|
<li class=" <?php if (in_array (basename($_SERVER['SCRIPT_NAME']), array('devices.php', 'deviceDetails.php') ) ){ echo 'active'; } ?>">
|
||||||
<a href="devices.php"><i class="fa fa-laptop"></i> <span>Devices</span></a>
|
<a href="devices.php"><i class="fa fa-laptop"></i> <span>Devices</span></a>
|
||||||
</li>
|
</li>
|
||||||
@@ -177,14 +176,18 @@
|
|||||||
<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">
|
<ul class="treeview-menu">
|
||||||
<li><a href="#">Scan Cycles</a></li>
|
<li class=" <?php if (in_array (basename($_SERVER['SCRIPT_NAME']), array('scancycles.php', 'scancyclesDetails.php') ) ){ echo 'active'; } ?>">
|
||||||
|
<a href="scancycles.php"><i class="fa fa-link"></i> <span>Scan Cycles</span></a>
|
||||||
|
</li>
|
||||||
<li><a href="#">Cron Status</a></li>
|
<li><a href="#">Cron Status</a></li>
|
||||||
<li><a href="#">Current IP</a></li>
|
<li><a href="#">Current IP</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
-->
|
-->
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<!-- /.sidebar-menu -->
|
<!-- /.sidebar-menu -->
|
||||||
</section>
|
</section>
|
||||||
<!-- /.sidebar -->
|
<!-- /.sidebar -->
|
||||||
|
|||||||
@@ -7,6 +7,30 @@
|
|||||||
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3
|
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3
|
||||||
#--------------------------------------------------------------------------- -->
|
#--------------------------------------------------------------------------- -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Modal Default -->
|
||||||
|
<div class="modal fade" id="modal-default" style="display: none;">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
|
||||||
|
<div class="modal-header" style="background-color: #d0d0d0;">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
|
<h4 id="modal-default-title" class="modal-title"> Modal Default Title </h4>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="modal-default-message" class="modal-body"> Modal Default message </div>
|
||||||
|
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button id="modal-default-cancel" type="button" class="btn btn-default pull-left" style="min-width: 80px;" data-dismiss="modal"> Cancel </button>
|
||||||
|
<button id="modal-default-OK" type="button" class="btn btn-primary" style="min-width: 80px;" onclick="modalDefaultOK()"> OK </button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- /.modal-content -->
|
||||||
|
</div>
|
||||||
|
<!-- /.modal-dialog -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-- Modal warning -->
|
<!-- Modal warning -->
|
||||||
<div class="modal modal-warning fade" id="modal-warning" style="display: none;">
|
<div class="modal modal-warning fade" id="modal-warning" style="display: none;">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
@@ -14,22 +38,24 @@
|
|||||||
|
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
<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>
|
<h4 id="modal-warning-title" class="modal-title"> Modal Title </h4>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="modal-message" class="modal-body"> Modal message </div>
|
<div id="modal-warning-message" class="modal-body"> Modal message </div>
|
||||||
|
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button id="modal-cancel" type="button" class="btn btn-outline pull-left" data-dismiss="modal"> Cancel </button>
|
<button id="modal-warning-cancel" type="button" class="btn btn-outline pull-left" style="min-width: 80px;" data-dismiss="modal"> Cancel </button>
|
||||||
<button id="modal-OK" type="button" class="btn btn-outline" onclick="modalOK()"> OK </button>
|
<button id="modal-warning-OK" type="button" class="btn btn-outline" style="min-width: 80px;" onclick="modalWarningOK()"> OK </button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-- Alert float -->
|
<!-- Alert float -->
|
||||||
<div id="notification" class="alert alert-dimissible pa_alert_notification">
|
<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>
|
<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 id="alert-message"> Alert message </div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<!-- Content header--------------------------------------------------------- -->
|
<!-- Content header--------------------------------------------------------- -->
|
||||||
<section class="content-header">
|
<section class="content-header">
|
||||||
<h1 id="pageTitle">
|
<h1 id="pageTitle">
|
||||||
Presence by Devices
|
Presence by Device
|
||||||
</h1>
|
</h1>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
@@ -27,66 +27,67 @@
|
|||||||
<!-- top small box 1 ------------------------------------------------------- -->
|
<!-- top small box 1 ------------------------------------------------------- -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div class="col-lg-3 col-sm-6 col-xs-6">
|
<div class="col-lg-2 col-sm-4 col-xs-6">
|
||||||
<a href="#" onclick="javascript: getDevicesPresence('all');">
|
<a href="#" onclick="javascript: getDevicesPresence('all');">
|
||||||
<div class="small-box bg-aqua pa-small-box-aqua">
|
<div class="small-box bg-aqua pa-small-box-aqua pa-small-box-2">
|
||||||
|
<div class="inner"> <h3 id="devicesAll"> -- </h3> </div>
|
||||||
<div class="inner">
|
<div class="icon"> <i class="fa fa-laptop text-aqua-20"></i> </div>
|
||||||
<h4>All Devices</h4>
|
<div class="small-box-footer pa-small-box-footer"> All Devices <i class="fa fa-arrow-circle-right"></i> </div>
|
||||||
<h3 id="devicesAll"> -- </h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="icon"> <i class="fa fa-laptop"></i> </div>
|
|
||||||
<div class="small-box-footer"> Details <i class="fa fa-arrow-circle-right"></i> </div>
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- top small box 2 ------------------------------------------------------- -->
|
<!-- top small box 2 ------------------------------------------------------- -->
|
||||||
<div class="col-lg-3 col-sm-6 col-xs-6">
|
<div class="col-lg-2 col-sm-4 col-xs-6">
|
||||||
<a href="#" onclick="javascript: getDevicesPresence('connected');">
|
<a href="#" onclick="javascript: getDevicesPresence('connected');">
|
||||||
<div class="small-box bg-green pa-small-box-green">
|
<div class="small-box bg-green pa-small-box-green pa-small-box-2">
|
||||||
|
<div class="inner"> <h3 id="devicesConnected"> -- </h3> </div>
|
||||||
<div class="inner">
|
<div class="icon"> <i class="fa fa-plug text-green-20"></i> </div>
|
||||||
<h4>Connected</h4>
|
<div class="small-box-footer pa-small-box-footer"> Connected <i class="fa fa-arrow-circle-right"></i> </div>
|
||||||
<h3 id="devicesConnected"> -- </h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="icon"> <i class="fa fa-plug"></i> </div>
|
|
||||||
<div class="small-box-footer"> Details <i class="fa fa-arrow-circle-right"></i> </div>
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- top small box 3 ------------------------------------------------------- -->
|
<!-- top small box 3 ------------------------------------------------------- -->
|
||||||
<div class="col-lg-3 col-sm-6 col-xs-6">
|
<div class="col-lg-2 col-sm-4 col-xs-6">
|
||||||
<a href="#" onclick="javascript: getDevicesPresence('new');">
|
<a href="#" onclick="javascript: getDevicesPresence('favorites');">
|
||||||
<div class="small-box bg-yellow pa-small-box-yellow">
|
<div class="small-box bg-yellow pa-small-box-yellow pa-small-box-2">
|
||||||
|
<div class="inner"> <h3 id="devicesFavorites"> -- </h3> </div>
|
||||||
<div class="inner">
|
<div class="icon"> <i class="fa fa-star text-yellow-20"></i> </div>
|
||||||
<h4>New Devices</h4>
|
<div class="small-box-footer pa-small-box-footer"> Favorites <i class="fa fa-arrow-circle-right"></i> </div>
|
||||||
<h3 id="devicesNew"> -- </h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="icon"> <i class="ion ion-plus-round"></i> </div>
|
|
||||||
<div class="small-box-footer"> Details <i class="fa fa-arrow-circle-right"></i> </div>
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- top small box 4 ------------------------------------------------------- -->
|
<!-- top small box 4 ------------------------------------------------------- -->
|
||||||
<div class="col-lg-3 col-sm-6 col-xs-6">
|
<div class="col-lg-2 col-sm-4 col-xs-6">
|
||||||
|
<a href="#" onclick="javascript: getDevicesPresence('new');">
|
||||||
|
<div class="small-box bg-yellow pa-small-box-yellow pa-small-box-2">
|
||||||
|
<div class="inner"> <h3 id="devicesNew"> -- </h3> </div>
|
||||||
|
<div class="icon"> <i class="ion ion-plus-round text-yellow-20"></i> </div>
|
||||||
|
<div class="small-box-footer pa-small-box-footer"> New Devices <i class="fa fa-arrow-circle-right"></i> </div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- top small box 5 ------------------------------------------------------- -->
|
||||||
|
<div class="col-lg-2 col-sm-4 col-xs-6">
|
||||||
<a href="#" onclick="javascript: getDevicesPresence('down');">
|
<a href="#" onclick="javascript: getDevicesPresence('down');">
|
||||||
<div class="small-box bg-red pa-small-box-red">
|
<div class="small-box bg-red pa-small-box-red pa-small-box-2">
|
||||||
|
<div class="inner"> <h3 id="devicesDown"> -- </h3> </div>
|
||||||
|
<div class="icon"> <i class="fa fa-warning text-red-20"></i> </div>
|
||||||
|
<div class="small-box-footer pa-small-box-footer"> Down Alerts <i class="fa fa-arrow-circle-right"></i> </div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="inner">
|
<!-- top small box 6 ------------------------------------------------------- -->
|
||||||
<h4>Down Alerts</h4>
|
<div class="col-lg-2 col-sm-4 col-xs-6">
|
||||||
<h3 id="devicesDown"> -- </h3>
|
<a href="#" onclick="javascript: getDevicesPresence('archived');">
|
||||||
</div>
|
<div class="small-box bg-gray pa-small-box-gray pa-small-box-2">
|
||||||
|
<div class="inner"> <h3 id="devicesHidden"> -- </h3> </div>
|
||||||
<div class="icon"> <i class="fa fa-warning"></i> </div>
|
<div class="icon"> <i class="fa fa-eye-slash text-gray-20"></i> </div>
|
||||||
<div class="small-box-footer"> Details <i class="fa fa-arrow-circle-right"></i> </div>
|
<div class="small-box-footer pa-small-box-footer"> Hidden <i class="fa fa-arrow-circle-right"></i> </div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -295,8 +296,10 @@ function getDevicesTotals () {
|
|||||||
|
|
||||||
$('#devicesAll').html (totalsDevices[0].toLocaleString());
|
$('#devicesAll').html (totalsDevices[0].toLocaleString());
|
||||||
$('#devicesConnected').html (totalsDevices[1].toLocaleString());
|
$('#devicesConnected').html (totalsDevices[1].toLocaleString());
|
||||||
$('#devicesNew').html (totalsDevices[2].toLocaleString());
|
$('#devicesFavorites').html (totalsDevices[2].toLocaleString());
|
||||||
$('#devicesDown').html (totalsDevices[3].toLocaleString());
|
$('#devicesNew').html (totalsDevices[3].toLocaleString());
|
||||||
|
$('#devicesDown').html (totalsDevices[4].toLocaleString());
|
||||||
|
$('#devicesHidden').html (totalsDevices[5].toLocaleString());
|
||||||
|
|
||||||
// Timer for refresh data
|
// Timer for refresh data
|
||||||
newTimerRefreshData (getDevicesTotals);
|
newTimerRefreshData (getDevicesTotals);
|
||||||
@@ -311,12 +314,13 @@ function getDevicesPresence (status) {
|
|||||||
|
|
||||||
// Defini color & title for the status selected
|
// Defini color & title for the status selected
|
||||||
switch (deviceStatus) {
|
switch (deviceStatus) {
|
||||||
case 'all': tableTitle = 'Total Devices'; color = 'aqua'; break;
|
case 'all': tableTitle = 'All Devices'; color = 'aqua'; break;
|
||||||
case 'connected': tableTitle = 'Connected Devices'; color = 'green'; break;
|
case 'connected': tableTitle = 'Connected Devices'; color = 'green'; break;
|
||||||
|
case 'favorites': tableTitle = 'Favorites'; color = 'yellow'; break;
|
||||||
case 'new': tableTitle = 'New Devices'; color = 'yellow'; break;
|
case 'new': tableTitle = 'New Devices'; color = 'yellow'; break;
|
||||||
case 'down': tableTitle = 'Down Alerts'; color = 'red'; break;
|
case 'down': tableTitle = 'Down Alerts'; color = 'red'; break;
|
||||||
case 'favorites': tableTitle = 'Favorites'; color = 'yellow'; break;
|
case 'archived': tableTitle = 'Archived Devices'; color = 'gray'; break;
|
||||||
default: tableTitle = 'Devices'; boxClass = ''; break;
|
default: tableTitle = 'Devices'; color = 'gray'; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set title and color
|
// Set title and color
|
||||||
|
|||||||
@@ -23,7 +23,8 @@
|
|||||||
|
|
||||||
LOG="pialert_install_`date +"%Y-%m-%d_%H-%M"`.log"
|
LOG="pialert_install_`date +"%Y-%m-%d_%H-%M"`.log"
|
||||||
|
|
||||||
MAIN_IP=`ip -o route get 1 | sed -n 's/.*src \([0-9.]\+\).*/\1/p'`
|
# MAIN_IP=`ip -o route get 1 | sed -n 's/.*src \([0-9.]\+\).*/\1/p'`
|
||||||
|
MAIN_IP=`ip -o route get 1 | sed 's/^.*src \([^ ]*\).*$/\1/;q'`
|
||||||
|
|
||||||
PIHOLE_INSTALL=false
|
PIHOLE_INSTALL=false
|
||||||
PIHOLE_ACTIVE=false
|
PIHOLE_ACTIVE=false
|
||||||
@@ -38,6 +39,8 @@
|
|||||||
|
|
||||||
USE_PYTHON_VERSION=0
|
USE_PYTHON_VERSION=0
|
||||||
PYTHON_BIN=python
|
PYTHON_BIN=python
|
||||||
|
|
||||||
|
FIRST_SCAN_KNOWN=true
|
||||||
|
|
||||||
REPORT_MAIL=False
|
REPORT_MAIL=False
|
||||||
REPORT_TO=user@gmail.com
|
REPORT_TO=user@gmail.com
|
||||||
@@ -104,7 +107,7 @@ ask_config() {
|
|||||||
PIHOLE_INSTALL=false
|
PIHOLE_INSTALL=false
|
||||||
if $PIHOLE_ACTIVE ; then
|
if $PIHOLE_ACTIVE ; then
|
||||||
msgbox "Pi-hole is already installed in this system." \
|
msgbox "Pi-hole is already installed in this system." \
|
||||||
"Perfect: Pi-hole Installation not necessary"
|
"Perfect: Pi-hole Installation is not necessary"
|
||||||
else
|
else
|
||||||
ask_yesno "Pi-hole is not installed." \
|
ask_yesno "Pi-hole is not installed." \
|
||||||
"Do you want to install Pi-hole before installing Pi.Alert ?" "YES"
|
"Do you want to install Pi-hole before installing Pi.Alert ?" "YES"
|
||||||
@@ -167,6 +170,11 @@ ask_config() {
|
|||||||
USE_PYTHON_VERSION=$ANSWER
|
USE_PYTHON_VERSION=$ANSWER
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Ask first scan options
|
||||||
|
ask_yesno "First Scan options" \
|
||||||
|
"Do you want to mark the new devices as known devices during the first scan?" "YES"
|
||||||
|
FIRST_SCAN_KNOWN=$ANSWER
|
||||||
|
|
||||||
# Ask e-mail notification config
|
# Ask e-mail notification config
|
||||||
MAIL_REPORT=false
|
MAIL_REPORT=false
|
||||||
ask_yesno "Pi.Alert can notify you by e-mail when a network event occurs" \
|
ask_yesno "Pi.Alert can notify you by e-mail when a network event occurs" \
|
||||||
@@ -216,7 +224,7 @@ ask_config() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Final config message
|
# Final config message
|
||||||
msgbox "Configuration finished. To updete the configuration, edit file:" \
|
msgbox "Configuration finished. To update the configuration, edit file:" \
|
||||||
"$PIALERT_HOME/config/pialert.conf"
|
"$PIALERT_HOME/config/pialert.conf"
|
||||||
|
|
||||||
msgbox "" "The installation will start now"
|
msgbox "" "The installation will start now"
|
||||||
@@ -304,6 +312,9 @@ add_pialert_DNS() {
|
|||||||
install_lighttpd() {
|
install_lighttpd() {
|
||||||
print_header "Lighttpd & PHP"
|
print_header "Lighttpd & PHP"
|
||||||
|
|
||||||
|
print_msg "- Installing apt-utils..."
|
||||||
|
sudo apt-get install apt-utils -y 2>&1 >> "$LOG"
|
||||||
|
|
||||||
print_msg "- Installing lighttpd..."
|
print_msg "- Installing lighttpd..."
|
||||||
sudo apt-get install lighttpd -y 2>&1 >> "$LOG"
|
sudo apt-get install lighttpd -y 2>&1 >> "$LOG"
|
||||||
|
|
||||||
@@ -319,7 +330,11 @@ install_lighttpd() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
print_msg "- Restarting lighttpd..."
|
print_msg "- Restarting lighttpd..."
|
||||||
sudo /etc/init.d/lighttpd restart 2>&1 >> "$LOG"
|
sudo service lighttpd restart 2>&1 >> "$LOG"
|
||||||
|
# sudo /etc/init.d/lighttpd restart 2>&1 >> "$LOG"
|
||||||
|
|
||||||
|
print_msg "- Installing sqlite3..."
|
||||||
|
sudo apt-get install sqlite3 -y 2>&1 >> "$LOG"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -335,8 +350,8 @@ install_arpscan() {
|
|||||||
print_msg "- Testing arp-scan..."
|
print_msg "- Testing arp-scan..."
|
||||||
sudo arp-scan -l | head -n -3 | tail +3 | tee -a "$LOG"
|
sudo arp-scan -l | head -n -3 | tail +3 | tee -a "$LOG"
|
||||||
|
|
||||||
print_msg "- Installing dnsutils..."
|
print_msg "- Installing dnsutils & net-tools..."
|
||||||
sudo apt-get install dnsutils -y 2>&1 >> "$LOG"
|
sudo apt-get install dnsutils net-tools -y 2>&1 >> "$LOG"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -377,7 +392,7 @@ install_python() {
|
|||||||
print_msg "- Using Python 3"
|
print_msg "- Using Python 3"
|
||||||
else
|
else
|
||||||
print_msg "- Installing Python 3..."
|
print_msg "- Installing Python 3..."
|
||||||
sudo apt-get install python -y 2>&1 >> "$LOG"
|
sudo apt-get install python3 -y 2>&1 >> "$LOG"
|
||||||
fi
|
fi
|
||||||
PYTHON_BIN="python3"
|
PYTHON_BIN="python3"
|
||||||
else
|
else
|
||||||
@@ -499,16 +514,22 @@ set_pialert_parameter() {
|
|||||||
test_pialert() {
|
test_pialert() {
|
||||||
print_msg "- Testing Pi.Alert HW vendors database update process..."
|
print_msg "- Testing Pi.Alert HW vendors database update process..."
|
||||||
print_msg "*** PLEASE WAIT A COUPLE OF MINUTES..."
|
print_msg "*** PLEASE WAIT A COUPLE OF MINUTES..."
|
||||||
stdbuf -i0 -o0 -e0 $PYTHON_BIN $PIALERT_HOME/back/pialert.py update_vendors_silent 2>&1 | tee -ai "$LOG"
|
stdbuf -i0 -o0 -e0 $PYTHON_BIN $PIALERT_HOME/back/pialert.py update_vendors_silent 2>&1 | tee -ai "$LOG"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
print_msg "- Testing Pi.Alert Internet IP Lookup..."
|
print_msg "- Testing Pi.Alert Internet IP Lookup..."
|
||||||
stdbuf -i0 -o0 -e0 $PYTHON_BIN $PIALERT_HOME/back/pialert.py internet_IP 2>&1 | tee -ai "$LOG"
|
stdbuf -i0 -o0 -e0 $PYTHON_BIN $PIALERT_HOME/back/pialert.py internet_IP 2>&1 | tee -ai "$LOG"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
print_msg "- Testing Pi.Alert Network scan..."
|
print_msg "- Testing Pi.Alert Network scan..."
|
||||||
print_msg "*** PLEASE WAIT A COUPLE OF MINUTES..."
|
print_msg "*** PLEASE WAIT A COUPLE OF MINUTES..."
|
||||||
stdbuf -i0 -o0 -e0 $PYTHON_BIN $PIALERT_HOME/back/pialert.py 1 2>&1 | tee -ai "$LOG"
|
stdbuf -i0 -o0 -e0 $PYTHON_BIN $PIALERT_HOME/back/pialert.py 1 2>&1 | tee -ai "$LOG"
|
||||||
|
|
||||||
|
if $FIRST_SCAN_KNOWN ; then
|
||||||
|
echo ""
|
||||||
|
print_msg "- Set devices as Known devices..."
|
||||||
|
sqlite3 $PIALERT_HOME/db/pialert.db "UPDATE Devices SET dev_NewDevice=0, dev_AlertEvents=0 WHERE dev_NewDevice=1" 2>&1 >> "$LOG"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
@@ -560,7 +581,8 @@ publish_pialert() {
|
|||||||
sudo ln -s ../conf-available/pialert_front.conf "$LIGHTTPD_CONF_DIR/conf-enabled/pialert_front.conf" 2>&1 >> "$LOG"
|
sudo ln -s ../conf-available/pialert_front.conf "$LIGHTTPD_CONF_DIR/conf-enabled/pialert_front.conf" 2>&1 >> "$LOG"
|
||||||
|
|
||||||
print_msg "- Restarting lighttpd..."
|
print_msg "- Restarting lighttpd..."
|
||||||
sudo /etc/init.d/lighttpd restart 2>&1 >> "$LOG"
|
sudo sudo service lighttpd restart 2>&1 >> "$LOG"
|
||||||
|
# sudo /etc/init.d/lighttpd restart 2>&1 >> "$LOG"
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|||||||
207
install/pialert_uninstall.sh
Normal file
207
install/pialert_uninstall.sh
Normal file
@@ -0,0 +1,207 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# Pi.Alert
|
||||||
|
# Open Source Network Guard / WIFI & LAN intrusion detector
|
||||||
|
#
|
||||||
|
# pialert_uninstall.sh - Uninstallation script
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# Variables
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
COLS=70
|
||||||
|
ROWS=12
|
||||||
|
|
||||||
|
INSTALL_DIR=~
|
||||||
|
PIALERT_HOME="$INSTALL_DIR/pialert"
|
||||||
|
|
||||||
|
LIGHTTPD_CONF_DIR="/etc/lighttpd"
|
||||||
|
WEBROOT="/var/www/html"
|
||||||
|
|
||||||
|
LOG="pialert_uninstall_`date +"%Y-%m-%d_%H-%M"`.log"
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# Main
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
main() {
|
||||||
|
print_superheader "Pi.Alert Uninstallation"
|
||||||
|
log "`date`"
|
||||||
|
log "Logfile: $LOG"
|
||||||
|
|
||||||
|
# Ask uninstallation
|
||||||
|
ask_yesno "This script will uninstall Pi.Alert from this system.\nUninstall path: $PIALERT_HOME" \
|
||||||
|
"Do you want to continue ?"
|
||||||
|
if ! $ANSWER ; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
msgbox "" "The uninstallation process will start now"
|
||||||
|
|
||||||
|
# Uninstall prrocess
|
||||||
|
print_header "Removing files"
|
||||||
|
sudo rm -r "$PIALERT_HOME" 2>&1 >> "$LOG"
|
||||||
|
sudo rm "$WEBROOT/pialert" 2>&1 >> "$LOG"
|
||||||
|
sudo rm "$LIGHTTPD_CONF_DIR/conf-available/pialert_front.conf" 2>&1 >> "$LOG"
|
||||||
|
sudo rm "$LIGHTTPD_CONF_DIR/conf-enabled/pialert_front.conf" 2>&1 >> "$LOG"
|
||||||
|
sudo rm -r /var/cache/lighttpd/compress/pialert 2>&1 >> "$LOG"
|
||||||
|
|
||||||
|
# Removing
|
||||||
|
print_header "Removing Pi.Alert DNS name"
|
||||||
|
if [ -f /etc/pihole/custom.list ] ; then
|
||||||
|
sudo sed -i '/pi.alert/d' /etc/pihole/custom.list 2>&1 >> "$LOG"
|
||||||
|
sudo pihole restartdns 2>&1 >> "$LOG"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Uninstall crontab jobs
|
||||||
|
print_header "Removing crontab jobs"
|
||||||
|
crontab -l 2>/dev/null | sed '/pialert.py/d' | sed ':a;N;$!ba;s/#-------------------------------------------------------------------------------\n# Pi.Alert\n# Open Source Network Guard \/ WIFI & LAN intrusion detector \n#\n# pialert.cron - Back module. Crontab jobs\n#-------------------------------------------------------------------------------\n# Puche 2021 pi.alert.application@gmail.com GNU GPLv3\n#-------------------------------------------------------------------------------//g' | crontab -
|
||||||
|
|
||||||
|
# final message
|
||||||
|
print_header "Uninstallation process finished"
|
||||||
|
print_msg "Note1: If you installed Pi-hole during the Pi.Alert installation process"
|
||||||
|
print_msg " Pi-hole will still be available after uninstalling Pi.Alert"
|
||||||
|
print_msg ""
|
||||||
|
print_msg "Note2: lighttpd, PHP, arp-scan & Python have not been uninstalled."
|
||||||
|
print_msg " They may be required by other software"
|
||||||
|
print_msg " You can uninstall them manually with command 'apt-get remove XX'"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# ASK
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
msgbox() {
|
||||||
|
LINE1=$(printf "%*s" $(((${#1}+$COLS-5)/2)) "$1")
|
||||||
|
LINE2=$(printf "%*s" $(((${#2}+$COLS-5)/2)) "$2")
|
||||||
|
|
||||||
|
END_DIALOG=false
|
||||||
|
while ! $END_DIALOG ; do
|
||||||
|
whiptail --title "Pi.Alert Uninstallation" --msgbox "$LINE1\\n\\n$LINE2" $ROWS $COLS
|
||||||
|
BUTTON=$?
|
||||||
|
ask_cancel
|
||||||
|
ANSWER=true
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
ask_yesno() {
|
||||||
|
LINE1=$(printf "%*s" $(((${#1}+$COLS-5)/2)) "$1")
|
||||||
|
LINE2=$(printf "%*s" $(((${#2}+$COLS-5)/2)) "$2")
|
||||||
|
|
||||||
|
if [ "$3" = "YES" ]; then
|
||||||
|
DEF_BUTTON=""
|
||||||
|
else
|
||||||
|
DEF_BUTTON="--defaultno"
|
||||||
|
fi
|
||||||
|
|
||||||
|
END_DIALOG=false
|
||||||
|
while ! $END_DIALOG ; do
|
||||||
|
whiptail --title "Pi.Alert Uninstallation" --yesno $DEF_BUTTON "$LINE1\\n\\n$LINE2" $ROWS $COLS
|
||||||
|
BUTTON=$?
|
||||||
|
ask_cancel
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "$BUTTON" = "0" ] ; then
|
||||||
|
ANSWER=true
|
||||||
|
else
|
||||||
|
ANSWER=false
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
ask_option() {
|
||||||
|
MENU_ARGS=("$@")
|
||||||
|
MENU_ARGS=("${MENU_ARGS[@]:1}")
|
||||||
|
|
||||||
|
END_DIALOG=false
|
||||||
|
while ! $END_DIALOG ; do
|
||||||
|
ANSWER=$(whiptail --title "Pi.Alert Uninstallation" --menu "$1" $ROWS $COLS "${MENU_ARGS[@]}" 3>&2 2>&1 1>&3 )
|
||||||
|
BUTTON=$?
|
||||||
|
ask_cancel CANCEL
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
ask_input() {
|
||||||
|
LINE1=$(printf "%*s" $(((${#1}+$COLS-5)/2)) "$1")
|
||||||
|
LINE2=$(printf "%*s" $(((${#2}+$COLS-5)/2)) "$2")
|
||||||
|
|
||||||
|
END_DIALOG=false
|
||||||
|
while ! $END_DIALOG ; do
|
||||||
|
ANSWER=$(whiptail --title "Pi.Alert Uninstallation" --inputbox "$LINE1\\n\\n$LINE2" $ROWS $COLS "$3" 3>&2 2>&1 1>&3 )
|
||||||
|
BUTTON=$?
|
||||||
|
ask_cancel CANCEL
|
||||||
|
|
||||||
|
if $END_DIALOG && [ "$ANSWER" = "" ] ; then
|
||||||
|
msgbox "" "You must enter a value"
|
||||||
|
END_DIALOG=false
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
ask_cancel() {
|
||||||
|
LINE0="Do you want to cancel the uninstallation process"
|
||||||
|
LINE0=$(printf "\n\n%*s" $(((${#LINE0}+$COLS-5)/2)) "$LINE0")
|
||||||
|
|
||||||
|
if [ "$BUTTON" = "1" ] && [ "$1" = "CANCEL" ] ; then BUTTON="255"; fi
|
||||||
|
|
||||||
|
if [ "$BUTTON" = "255" ] ; then
|
||||||
|
whiptail --title "Pi.Alert Uninstallation" --yesno --defaultno "$LINE0" $ROWS $COLS
|
||||||
|
|
||||||
|
if [ "$?" = "0" ] ; then
|
||||||
|
process_error "Uninstallation Aborted by User"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
END_DIALOG=true
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# Log
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
log() {
|
||||||
|
echo "$1" | tee -a "$LOG"
|
||||||
|
}
|
||||||
|
|
||||||
|
log_no_screen () {
|
||||||
|
echo "$1" >> "$LOG"
|
||||||
|
}
|
||||||
|
|
||||||
|
log_only_screen () {
|
||||||
|
echo "$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
print_msg() {
|
||||||
|
log_no_screen ""
|
||||||
|
log "$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
print_superheader() {
|
||||||
|
log ""
|
||||||
|
log "############################################################"
|
||||||
|
log " $1"
|
||||||
|
log "############################################################"
|
||||||
|
}
|
||||||
|
|
||||||
|
print_header() {
|
||||||
|
log ""
|
||||||
|
log "------------------------------------------------------------"
|
||||||
|
log " $1"
|
||||||
|
log "------------------------------------------------------------"
|
||||||
|
}
|
||||||
|
|
||||||
|
process_error() {
|
||||||
|
log ""
|
||||||
|
log "************************************************************"
|
||||||
|
log "************************************************************"
|
||||||
|
log "** ERROR UNINSTALLING PI.ALERT **"
|
||||||
|
log "************************************************************"
|
||||||
|
log "************************************************************"
|
||||||
|
log ""
|
||||||
|
|
||||||
|
# msgbox "****** ERROR UNINSTALLING Pi.ALERT ******" "$1"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
main
|
||||||
|
exit 0
|
||||||
@@ -35,6 +35,7 @@ main() {
|
|||||||
move_files
|
move_files
|
||||||
clean_files
|
clean_files
|
||||||
|
|
||||||
|
check_packages
|
||||||
download_pialert
|
download_pialert
|
||||||
update_config
|
update_config
|
||||||
update_db
|
update_db
|
||||||
@@ -51,8 +52,9 @@ main() {
|
|||||||
# Create backup
|
# Create backup
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
create_backup() {
|
create_backup() {
|
||||||
print_msg "- Deleting previous Pi.Alert backups..."
|
# Previous backups are not deleted
|
||||||
rm "$INSTALL_DIR/"pialert_update_backup_*.tar 2>/dev/null || :
|
# print_msg "- Deleting previous Pi.Alert backups..."
|
||||||
|
# rm "$INSTALL_DIR/"pialert_update_backup_*.tar 2>/dev/null || :
|
||||||
|
|
||||||
print_msg "- Creating new Pi.Alert backup..."
|
print_msg "- Creating new Pi.Alert backup..."
|
||||||
cd "$INSTALL_DIR"
|
cd "$INSTALL_DIR"
|
||||||
@@ -85,6 +87,21 @@ clean_files() {
|
|||||||
rm -r "$PIALERT_HOME/"*.md 2>/dev/null || :
|
rm -r "$PIALERT_HOME/"*.md 2>/dev/null || :
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# Check packages
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
check_packages() {
|
||||||
|
print_msg "- Checking package apt-utils..."
|
||||||
|
sudo apt-get install apt-utils -y 2>&1 >> "$LOG"
|
||||||
|
|
||||||
|
print_msg "- Checking package sqlite3..."
|
||||||
|
sudo apt-get install sqlite3 -y 2>&1 >> "$LOG"
|
||||||
|
|
||||||
|
print_msg "- Checking packages dnsutils & net-tools..."
|
||||||
|
sudo apt-get install dnsutils net-tools -y 2>&1 >> "$LOG"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Download and uncompress Pi.Alert
|
# Download and uncompress Pi.Alert
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
@@ -128,6 +145,10 @@ update_config() {
|
|||||||
if ! grep -Fq QUERY_MYIP_SERVER "$PIALERT_HOME/config/pialert.conf" ; then
|
if ! grep -Fq QUERY_MYIP_SERVER "$PIALERT_HOME/config/pialert.conf" ; then
|
||||||
echo "QUERY_MYIP_SERVER = 'http://ipv4.icanhazip.com'" >> "$PIALERT_HOME/config/pialert.conf"
|
echo "QUERY_MYIP_SERVER = 'http://ipv4.icanhazip.com'" >> "$PIALERT_HOME/config/pialert.conf"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! grep -Fq SCAN_SUBNETS "$PIALERT_HOME/config/pialert.conf" ; then
|
||||||
|
echo "SCAN_SUBNETS = '--localnet'" >> "$PIALERT_HOME/config/pialert.conf"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
@@ -138,6 +159,9 @@ update_db() {
|
|||||||
sudo chgrp -R www-data $PIALERT_HOME/db 2>&1 >> "$LOG"
|
sudo chgrp -R www-data $PIALERT_HOME/db 2>&1 >> "$LOG"
|
||||||
chmod -R 770 $PIALERT_HOME/db 2>&1 >> "$LOG"
|
chmod -R 770 $PIALERT_HOME/db 2>&1 >> "$LOG"
|
||||||
|
|
||||||
|
print_msg "- Installing sqlite3..."
|
||||||
|
sudo apt-get install sqlite3 -y 2>&1 >> "$LOG"
|
||||||
|
|
||||||
print_msg "- Checking 'Parameters' table..."
|
print_msg "- Checking 'Parameters' table..."
|
||||||
TAB=`sqlite3 $PIALERT_HOME/db/pialert.db "SELECT COUNT(*) FROM sqlite_master WHERE type='table' AND name='Parameters' COLLATE NOCASE;"` 2>&1 >> "$LOG"
|
TAB=`sqlite3 $PIALERT_HOME/db/pialert.db "SELECT COUNT(*) FROM sqlite_master WHERE type='table' AND name='Parameters' COLLATE NOCASE;"` 2>&1 >> "$LOG"
|
||||||
if [ "$TAB" == "0" ] ; then
|
if [ "$TAB" == "0" ] ; then
|
||||||
@@ -159,6 +183,16 @@ update_db() {
|
|||||||
print_msg " - Adding column 'Location' to 'Devices'..."
|
print_msg " - Adding column 'Location' to 'Devices'..."
|
||||||
sqlite3 $PIALERT_HOME/db/pialert.db "ALTER TABLE Devices ADD COLUMN dev_Location STRING(250) COLLATE NOCASE;" 2>&1 >> "$LOG"
|
sqlite3 $PIALERT_HOME/db/pialert.db "ALTER TABLE Devices ADD COLUMN dev_Location STRING(250) COLLATE NOCASE;" 2>&1 >> "$LOG"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
COL=`sqlite3 $PIALERT_HOME/db/pialert.db "SELECT COUNT(*) FROM PRAGMA_TABLE_INFO ('Devices') WHERE name='dev_Archived' COLLATE NOCASE";` 2>&1 >> "$LOG"
|
||||||
|
if [ "$COL" == "0" ] ; then
|
||||||
|
print_msg " - Adding column 'Archived / Hidden' to 'Devices'..."
|
||||||
|
sqlite3 $PIALERT_HOME/db/pialert.db "ALTER TABLE Devices ADD COLUMN dev_Archived BOOLEAN NOT NULL DEFAULT (0) CHECK (dev_Archived IN (0, 1) );" 2>&1 >> "$LOG"
|
||||||
|
sqlite3 $PIALERT_HOME/db/pialert.db "CREATE INDEX IDX_dev_Archived ON Devices (dev_Archived);" 2>&1 >> "$LOG"
|
||||||
|
fi
|
||||||
|
|
||||||
|
print_msg "- Cheking Internet scancycle..."
|
||||||
|
sqlite3 $PIALERT_HOME/db/pialert.db "UPDATE Devices set dev_ScanCycle=1, dev_AlertEvents=1, dev_AlertDeviceDown=1 WHERE dev_MAC='Internet' AND dev_ScanCycle=0;" 2>&1 >> "$LOG"
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -8,12 +8,10 @@
|
|||||||
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3
|
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
PIALERT_VERSION=`awk '$1=="VERSION" { print $3 }' ../config/version.conf | tr -d \'`
|
|
||||||
PIALERT_DEV_PATH=/media/WD_4TB/dev
|
PIALERT_DEV_PATH=/media/WD_4TB/dev
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
|
||||||
cd $PIALERT_DEV_PATH
|
cd $PIALERT_DEV_PATH
|
||||||
pwd
|
pwd
|
||||||
|
PIALERT_VERSION=`awk '$1=="VERSION" { print $3 }' pialert/config/version.conf | tr -d \'`
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
ls -l pialert/tar/pialert*.tar
|
ls -l pialert/tar/pialert*.tar
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user