Compare commits

...

2 Commits

Author SHA1 Message Date
Jokob-sk
7baae289d1 Fix Device table not loading 2023-01-23 00:03:34 +11:00
Jokob-sk
a33c50361f Remove references to setting_darkmode 2023-01-22 17:03:49 +11:00
6 changed files with 29 additions and 32 deletions

View File

@@ -20,7 +20,6 @@ from email.mime.text import MIMEText
import sys import sys
import subprocess import subprocess
import os import os
import tempfile
import re import re
import time import time
import decimal import decimal

View File

@@ -7,11 +7,9 @@ services:
network_mode: "host" network_mode: "host"
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- ${APP_DATA_LOCATION}/pialert/config:/home/pi/pialert/config - ${APP_DATA_LOCATION}/pialert/config2:/home/pi/pialert/config
# - ${APP_DATA_LOCATION}/pialert/db/pialert.db:/home/pi/pialert/db/pialert.db # - ${APP_DATA_LOCATION}/pialert/db/pialert.db:/home/pi/pialert/db/pialert.db
- ${APP_DATA_LOCATION}/pialert/db:/home/pi/pialert/db - ${APP_DATA_LOCATION}/pialert/db2:/home/pi/pialert/db
# (optional) map an empty file with the name 'setting_darkmode' if you want to force the dark mode on container rebuilt
- ${APP_DATA_LOCATION}/pialert/db/setting_darkmode:/home/pi/pialert/db/setting_darkmode
# (optional) useful for debugging if you have issues setting up the container # (optional) useful for debugging if you have issues setting up the container
- ${LOGS_LOCATION}:/home/pi/pialert/front/log - ${LOGS_LOCATION}:/home/pi/pialert/front/log
# DELETE START anyone trying to use this file: comment out / delete BELOW lines, they are only for development purposes # DELETE START anyone trying to use this file: comment out / delete BELOW lines, they are only for development purposes

View File

@@ -45,7 +45,6 @@ docker run -d --rm --network=host \
| :------------- | :------------- |:-------------| | :------------- | :------------- |:-------------|
| **Required** | `:/home/pi/pialert/config` | Folder which will contain the `pialert.conf` file (see below for details) | | **Required** | `:/home/pi/pialert/config` | Folder which will contain the `pialert.conf` file (see below for details) |
| **Required** | `:/home/pi/pialert/db` | Folder which will contain the `pialert.db` file | | **Required** | `:/home/pi/pialert/db` | Folder which will contain the `pialert.db` file |
|Optional| `:/home/pi/pialert/db/setting_darkmode` | Map an empty file with the name `setting_darkmode` if you want to force the dark mode on container rebuilt |
|Optional| `:/home/pi/pialert/front/log` | Logs folder useful for debugging if you have issues setting up the container | |Optional| `:/home/pi/pialert/front/log` | Logs folder useful for debugging if you have issues setting up the container |
|Optional| `:/etc/pihole/pihole-FTL.db` | PiHole's `pihole-FTL.db` database file. Required if you want to use PiHole | |Optional| `:/etc/pihole/pihole-FTL.db` | PiHole's `pihole-FTL.db` database file. Required if you want to use PiHole |
|Optional| `:/etc/pihole/dhcp.leases` | PiHole's `dhcp.leases` file. Required if you want to use PiHole | |Optional| `:/etc/pihole/dhcp.leases` | PiHole's `dhcp.leases` file. Required if you want to use PiHole |
@@ -100,8 +99,6 @@ services:
volumes: volumes:
- local/path/pialert/config:/home/pi/pialert/config - local/path/pialert/config:/home/pi/pialert/config
- local/path/pialert/db:/home/pi/pialert/db - local/path/pialert/db:/home/pi/pialert/db
# (optional) map an empty file with the name 'setting_darkmode' if you want to force the dark mode on container rebuilt
- local/path/pialert/db/setting_darkmode:/home/pi/pialert/db/setting_darkmode
# (optional) useful for debugging if you have issues setting up the container # (optional) useful for debugging if you have issues setting up the container
- local/path/logs:/home/pi/pialert/front/log - local/path/logs:/home/pi/pialert/front/log
environment: environment:
@@ -128,8 +125,6 @@ services:
volumes: volumes:
- ${APP_DATA_LOCATION}/pialert/config:/home/pi/pialert/config - ${APP_DATA_LOCATION}/pialert/config:/home/pi/pialert/config
- ${APP_DATA_LOCATION}/pialert/db/pialert.db:/home/pi/pialert/db/pialert.db - ${APP_DATA_LOCATION}/pialert/db/pialert.db:/home/pi/pialert/db/pialert.db
# (optional) map an empty file with the name 'setting_darkmode' if you want to force the dark mode on container rebuilt
- ${APP_DATA_LOCATION}/pialert/db/setting_darkmode:/home/pi/pialert/db/setting_darkmode
# (optional) useful for debugging if you have issues setting up the container # (optional) useful for debugging if you have issues setting up the container
- ${LOGS_LOCATION}:/home/pi/pialert/front/log - ${LOGS_LOCATION}:/home/pi/pialert/front/log
environment: environment:

View File

@@ -292,12 +292,16 @@ function settingsChanged()
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
function translateHTMLcodes (text) { function translateHTMLcodes (text) {
if (text == null) { if (text == null || emptyArr.includes(text)) {
return null; return null;
} else if (typeof text === 'string' || text instanceof String)
{
var text2 = text.replace(new RegExp(' ', 'g'), "&nbsp");
text2 = text2.replace(new RegExp('<', 'g'), "&lt");
return text2;
} }
var text2 = text.replace(new RegExp(' ', 'g'), "&nbsp");
text2 = text2.replace(new RegExp('<', 'g'), "&lt"); return "";
return text2;
} }

View File

@@ -571,21 +571,21 @@ function getDevicesList() {
// This object is used to map from the old order ( second parameter, first number) to the 3rd parameter (Second number (here initialized to -1)) // This object is used to map from the old order ( second parameter, first number) to the 3rd parameter (Second number (here initialized to -1))
$columnOrderMapping = array( $columnOrderMapping = array(
array("dev_Name", 0, -1), array("dev_Name", 0, 0),
array("dev_Owner", 1, -1), array("dev_Owner", 1, 1),
array("dev_DeviceType", 2, -1), array("dev_DeviceType", 2, 2),
array("dev_Icon", 3, -1), array("dev_Icon", 3, 3),
array("dev_Favorite", 4, -1), array("dev_Favorite", 4, 4),
array("dev_Group", 5, -1), array("dev_Group", 5, 5),
array("dev_FirstConnection", 6, -1), array("dev_FirstConnection", 6, 6),
array("dev_LastConnection", 7, -1), array("dev_LastConnection", 7, 7),
array("dev_LastIP", 8, -1), array("dev_LastIP", 8, 8),
array("dev_MAC", 9, -1), array("dev_MAC", 9, 9),
array("dev_Status", 10, -1), array("dev_Status", 10, 10),
array("dev_MAC_full", 11, -1), array("dev_MAC_full", 11, 11),
array("dev_LastIP_orderable", 12, -1), array("dev_LastIP_orderable", 12, 12),
array("rowid", 13, -1), array("rowid", 13, 13),
array("dev_Network_Node_MAC_ADDR", 14, -1) array("dev_Network_Node_MAC_ADDR", 14, 14)
); );
// get device columns order // get device columns order

View File

@@ -68,6 +68,7 @@ $lang['en_us'] = array(
'Device_TableHead_Type' => 'Type', 'Device_TableHead_Type' => 'Type',
'Device_TableHead_Icon' => 'Icon', 'Device_TableHead_Icon' => 'Icon',
'Device_TableHead_RowID' => 'Row ID', 'Device_TableHead_RowID' => 'Row ID',
'Device_TableHead_Rowid' => 'Row ID',
'Device_TableHead_Parent_MAC' => 'Parent node MAC', 'Device_TableHead_Parent_MAC' => 'Parent node MAC',
'Device_TableHead_Favorite' => 'Favorite', 'Device_TableHead_Favorite' => 'Favorite',
'Device_TableHead_Group' => 'Group', 'Device_TableHead_Group' => 'Group',