Skip to content

Commit

Permalink
Fix Device table not loading
Browse files Browse the repository at this point in the history
  • Loading branch information
jokob-sk committed Jan 22, 2023
1 parent a33c503 commit 7baae28
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 22 deletions.
2 changes: 1 addition & 1 deletion back/pialert.py
Original file line number Diff line number Diff line change
Expand Up @@ -3101,7 +3101,7 @@ def isNewVersion():
except requests.exceptions.ConnectionError as e:
file_print(" Couldn't check for new release.")
data = ""

# make sure we received a valid response and not an API rate limit exceeded message
if len(data) > 0 and "published_at" in data[0]:

Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ services:
network_mode: "host"
restart: unless-stopped
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:/home/pi/pialert/db
- ${APP_DATA_LOCATION}/pialert/db2:/home/pi/pialert/db
# (optional) useful for debugging if you have issues setting up the container
- ${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
Expand Down
12 changes: 8 additions & 4 deletions front/js/pialert_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,12 +292,16 @@ function settingsChanged()

// -----------------------------------------------------------------------------
function translateHTMLcodes (text) {
if (text == null) {
if (text == null || emptyArr.includes(text)) {
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 text2;

return "";
}


Expand Down
30 changes: 15 additions & 15 deletions front/php/server/devices.php
Original file line number Diff line number Diff line change
Expand Up @@ -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))
$columnOrderMapping = array(
array("dev_Name", 0, -1),
array("dev_Owner", 1, -1),
array("dev_DeviceType", 2, -1),
array("dev_Icon", 3, -1),
array("dev_Favorite", 4, -1),
array("dev_Group", 5, -1),
array("dev_FirstConnection", 6, -1),
array("dev_LastConnection", 7, -1),
array("dev_LastIP", 8, -1),
array("dev_MAC", 9, -1),
array("dev_Status", 10, -1),
array("dev_MAC_full", 11, -1),
array("dev_LastIP_orderable", 12, -1),
array("rowid", 13, -1),
array("dev_Network_Node_MAC_ADDR", 14, -1)
array("dev_Name", 0, 0),
array("dev_Owner", 1, 1),
array("dev_DeviceType", 2, 2),
array("dev_Icon", 3, 3),
array("dev_Favorite", 4, 4),
array("dev_Group", 5, 5),
array("dev_FirstConnection", 6, 6),
array("dev_LastConnection", 7, 7),
array("dev_LastIP", 8, 8),
array("dev_MAC", 9, 9),
array("dev_Status", 10, 10),
array("dev_MAC_full", 11, 11),
array("dev_LastIP_orderable", 12, 12),
array("rowid", 13, 13),
array("dev_Network_Node_MAC_ADDR", 14, 14)
);

// get device columns order
Expand Down
1 change: 1 addition & 0 deletions front/php/templates/language/en_us.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
'Device_TableHead_Type' => 'Type',
'Device_TableHead_Icon' => 'Icon',
'Device_TableHead_RowID' => 'Row ID',
'Device_TableHead_Rowid' => 'Row ID',
'Device_TableHead_Parent_MAC' => 'Parent node MAC',
'Device_TableHead_Favorite' => 'Favorite',
'Device_TableHead_Group' => 'Group',
Expand Down

0 comments on commit 7baae28

Please sign in to comment.