diff --git a/dockerfiles/start.sh b/dockerfiles/start.sh
new file mode 100755
index 00000000..247ba2d4
--- /dev/null
+++ b/dockerfiles/start.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+/home/pi/pialert/dockerfiles/user-mapping.sh
+
+# if custom variables not set we do not need to do anything
+if [ -n "${TZ}" ]; then
+ sed -ie "s|Europe/Berlin|${TZ}|g" /home/pi/pialert/install/pialert.cron
+ sed -ie "s|Europe/Berlin|${TZ}|g" /home/pi/pialert/config/pialert.conf
+ crontab < /home/pi/pialert/install/pialert.cron
+fi
+if [ -n "${PORT}" ]; then
+ sed -ie 's/= 20211/= '${PORT}'/g' /etc/lighttpd/lighttpd.conf
+fi
+
+/etc/init.d/lighttpd start
+cron -f
diff --git a/dockerfiles/user-mapping.sh b/dockerfiles/user-mapping.sh
new file mode 100644
index 00000000..54803092
--- /dev/null
+++ b/dockerfiles/user-mapping.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+if [ -z "${USER}" ]; then
+ echo "We need USER to be set!"; exit 100
+fi
+
+# if both not set we do not need to do anything
+if [ -z "${HOST_USER_ID}" -a -z "${HOST_USER_GID}" ]; then
+ echo "Nothing to do here." ; exit 0
+fi
+
+# reset user_?id to either new id or if empty old (still one of above
+# might not be set)
+USER_ID=${HOST_USER_ID:=$USER_ID}
+USER_GID=${HOST_USER_GID:=$USER_GID}
+
+LINE=$(grep -F "${USER}" /etc/passwd)
+# replace all ':' with a space and create array
+array=( ${LINE//:/ } )
+
+# home is 5th element
+USER_HOME=${array[4]}
+
+sed -i -e "s/^${USER}:\([^:]*\):[0-9]*:[0-9]*/${USER}:\1:${USER_ID}:${USER_GID}/" /etc/passwd
+sed -i -e "s/^${USER}:\([^:]*\):[0-9]*/${USER}:\1:${USER_GID}/" /etc/group
+
+chown -R ${USER_ID}:${USER_GID} ${USER_HOME}
+
+exec su - "${USER}"
\ No newline at end of file
diff --git a/docs/img/1_devices.jpg b/docs/img/1_devices.jpg
index 7cd18cb0..4f0a499c 100644
Binary files a/docs/img/1_devices.jpg and b/docs/img/1_devices.jpg differ
diff --git a/docs/img/1_devices_dark.jpg b/docs/img/1_devices_dark.jpg
index 1314cbf7..1b768f8f 100644
Binary files a/docs/img/1_devices_dark.jpg and b/docs/img/1_devices_dark.jpg differ
diff --git a/docs/img/2_1_device_details.jpg b/docs/img/2_1_device_details.jpg
index ba001077..90ad2133 100644
Binary files a/docs/img/2_1_device_details.jpg and b/docs/img/2_1_device_details.jpg differ
diff --git a/docs/img/2_2_device_sessions.jpg b/docs/img/2_2_device_sessions.jpg
index 32f88447..063c63c1 100644
Binary files a/docs/img/2_2_device_sessions.jpg and b/docs/img/2_2_device_sessions.jpg differ
diff --git a/docs/img/2_3_device_presence.jpg b/docs/img/2_3_device_presence.jpg
index 7ab0123e..b74fd744 100644
Binary files a/docs/img/2_3_device_presence.jpg and b/docs/img/2_3_device_presence.jpg differ
diff --git a/docs/img/2_4_device_nmap.jpg b/docs/img/2_4_device_nmap.jpg
index d9f295fe..301b6744 100644
Binary files a/docs/img/2_4_device_nmap.jpg and b/docs/img/2_4_device_nmap.jpg differ
diff --git a/docs/img/2_5_device_nmap_ready.jpg b/docs/img/2_5_device_nmap_ready.jpg
index 8d6baa70..6184fa49 100644
Binary files a/docs/img/2_5_device_nmap_ready.jpg and b/docs/img/2_5_device_nmap_ready.jpg differ
diff --git a/docs/img/3_presence.jpg b/docs/img/3_presence.jpg
index b619e46f..7589dcca 100644
Binary files a/docs/img/3_presence.jpg and b/docs/img/3_presence.jpg differ
diff --git a/docs/img/5_maintain.jpg b/docs/img/5_maintain.jpg
index bfa68e09..69c2f569 100644
Binary files a/docs/img/5_maintain.jpg and b/docs/img/5_maintain.jpg differ
diff --git a/front/css/dark-patch.css b/front/css/dark-patch.css
index 40811a98..0c9ed484 100644
--- a/front/css/dark-patch.css
+++ b/front/css/dark-patch.css
@@ -594,7 +594,42 @@ input[type="password"]::-webkit-caps-lock-indicator {
}
/*** Additional fixes For Pi.Alert UI ***/
-
+.small-box {
+ border-radius: 10px;
+ border-top: 0px;
+}
+.pa-small-box-aqua .inner {
+ background-color: rgb(45,108,133);
+ border-top-left-radius: 10px;
+ border-top-right-radius: 10px;
+}
+.pa-small-box-green .inner {
+ background-color: rgb(31,76,46);
+ border-top-left-radius: 10px;
+ border-top-right-radius: 10px;
+}
+.pa-small-box-yellow .inner {
+ background-color: rgb(151,104,37);
+ border-top-left-radius: 10px;
+ border-top-right-radius: 10px;
+}
+.pa-small-box-red .inner {
+ background-color: rgb(120,50,38);
+ border-top-left-radius: 10px;
+ border-top-right-radius: 10px;
+}
+.pa-small-box-gray .inner {
+ background-color: #777;
+ /* color: rgba(20,20,20,30%); */
+ border-top-left-radius: 10px;
+ border-top-right-radius: 10px;
+}
+.pa-small-box-gray .inner h3 {
+ color: #bbb;
+}
+.text-gray-20 {
+ color: rgba(220,220,220,30%);
+}
.bg-gray {
background-color: #888888 !important;
}
@@ -670,4 +705,21 @@ input[type="password"]::-webkit-caps-lock-indicator {
.login-box-body {
color: #bec5cb;
background-color: #272c30;
-}
\ No newline at end of file
+}
+/* Add border radius to bottom of the status boxes*/
+.pa-small-box-footer {
+ border-bottom-left-radius: 10px;
+ border-bottom-right-radius: 10px;
+}
+
+.small-box > .inner h3, .small-box > .inner p {
+ margin-bottom: 0px;
+ margin-left: 0px;
+}
+.small-box:hover .icon {
+ font-size: 3.74em;
+}
+.small-box .icon {
+ top: 0.01em;
+ font-size: 3.25em;
+}
diff --git a/front/deviceDetails.php b/front/deviceDetails.php
index 1dfd5bf8..e17bc495 100644
--- a/front/deviceDetails.php
+++ b/front/deviceDetails.php
@@ -704,7 +704,6 @@ function main () {
// Read Cookies
devicesList = getCookie('devicesList');
- deleteCookie ('devicesList');
if (devicesList != '') {
devicesList = JSON.parse (devicesList);
} else {
@@ -1193,6 +1192,13 @@ function getDeviceData (readAllData=false) {
mac =deviceData['dev_MAC'];
+ // update the mac parameter in the URL, this makes the selected device persistent when the page is reloaded
+ var searchParams = new URLSearchParams(window.location.search);
+ searchParams.set("mac", mac);
+ var newRelativePathQuery = window.location.pathname + '?' + searchParams.toString();
+ history.pushState(null, '', newRelativePathQuery);
+ getSessionsPresenceEvents();
+
$('#txtMAC').val (deviceData['dev_MAC']);
$('#txtName').val (deviceData['dev_Name']);
$('#txtOwner').val (deviceData['dev_Owner']);
@@ -1254,7 +1260,7 @@ function getDeviceData (readAllData=false) {
$('#btnNext').removeAttr ('disabled');
$('#btnNext').removeClass ('text-gray50');
}
-
+
// Timer for refresh data
$("body").css("cursor", "default");
newTimerRefreshData (getDeviceData);
@@ -1422,13 +1428,16 @@ function deleteDevice () {
// -----------------------------------------------------------------------------
function getSessionsPresenceEvents () {
+ // Check MAC in url
+ var urlParams = new URLSearchParams(window.location.search);
+ mac = urlParams.get ('mac');
// Define Sessions datasource and query dada
$('#tableSessions').DataTable().ajax.url('php/server/events.php?action=getDeviceSessions&mac=' + mac +'&period='+ period).load();
// Define Presence datasource and query data
$('#calendar').fullCalendar('removeEventSources');
$('#calendar').fullCalendar('addEventSource',
- { url: 'php/server/events.php?action=getDevicePresence&mac=' + mac +'&period='+ period });
+ { url: 'php/server/events.php?action=getDevicePresence&mac=' + mac});
// Query events
getDeviceEvents();
diff --git a/front/devices.php b/front/devices.php
index f0033d05..071f0c02 100644
--- a/front/devices.php
+++ b/front/devices.php
@@ -114,7 +114,7 @@ if ($_SESSION["login"] != 1)