Highlight still connected devices in green on teh timeline

This commit is contained in:
jokob-sk
2022-07-24 18:31:39 +10:00
parent 3e1f770226
commit 3df87f6f36

View File

@@ -217,9 +217,9 @@ function getDeviceSessions() {
// Disconnection DateTime // Disconnection DateTime
if ($row['ses_StillConnected'] == true) { if ($row['ses_StillConnected'] == true) {
$end = '...'; $end = '...';
} elseif ($row['ses_EventTypeDisconnection'] == '<missing event>') { } elseif ($row['ses_EventTypeDisconnection'] == '<missing event>') {
$end = $row['ses_EventTypeDisconnection']; $end = $row['ses_EventTypeDisconnection'];
} else { } else {
$end = formatDate ($row['ses_DateTimeDisconnection']); $end = formatDate ($row['ses_DateTimeDisconnection']);
} }
@@ -267,7 +267,7 @@ function getDevicePresence() {
// SQL // SQL
$SQL = 'SELECT ses_EventTypeConnection, ses_DateTimeConnection, $SQL = 'SELECT ses_EventTypeConnection, ses_DateTimeConnection,
ses_EventTypeDisconnection, ses_DateTimeDisconnection, ses_IP, ses_AdditionalInfo, ses_EventTypeDisconnection, ses_DateTimeDisconnection, ses_IP, ses_AdditionalInfo, ses_StillConnected,
CASE CASE
WHEN ses_EventTypeConnection = "<missing event>" THEN WHEN ses_EventTypeConnection = "<missing event>" THEN
@@ -292,10 +292,13 @@ function getDevicePresence() {
// Event color // Event color
if ($row['ses_EventTypeConnection'] == '<missing event>' || $row['ses_EventTypeDisconnection'] == '<missing event>') { if ($row['ses_EventTypeConnection'] == '<missing event>' || $row['ses_EventTypeDisconnection'] == '<missing event>') {
$color = '#f39c12'; $color = '#f39c12';
} elseif ($row['ses_StillConnected'] == 1 ) {
$color = '#00a659';
} else { } else {
$color = '#0073b7'; $color = '#0073b7';
} }
// tooltip // tooltip
$tooltip = 'Connection: ' . formatEventDate ($row['ses_DateTimeConnection'], $row['ses_EventTypeConnection']) . chr(13) . $tooltip = 'Connection: ' . formatEventDate ($row['ses_DateTimeConnection'], $row['ses_EventTypeConnection']) . chr(13) .
'Disconnection: ' . formatEventDate ($row['ses_DateTimeDisconnection'], $row['ses_EventTypeDisconnection']) . chr(13) . 'Disconnection: ' . formatEventDate ($row['ses_DateTimeDisconnection'], $row['ses_EventTypeDisconnection']) . chr(13) .
@@ -331,9 +334,9 @@ function getEventsCalendar() {
$startDate = '"'. $_REQUEST ['start'] .'"'; $startDate = '"'. $_REQUEST ['start'] .'"';
$endDate = '"'. $_REQUEST ['end'] .'"'; $endDate = '"'. $_REQUEST ['end'] .'"';
// SQL // SQL
$SQL = 'SELECT ses_MAC, ses_EventTypeConnection, ses_DateTimeConnection, $SQL = 'SELECT ses_MAC, ses_EventTypeConnection, ses_DateTimeConnection,
ses_EventTypeDisconnection, ses_DateTimeDisconnection, ses_IP, ses_AdditionalInfo, ses_EventTypeDisconnection, ses_DateTimeDisconnection, ses_IP, ses_AdditionalInfo, ses_StillConnected,
CASE CASE
WHEN ses_EventTypeConnection = "<missing event>" THEN WHEN ses_EventTypeConnection = "<missing event>" THEN
@@ -357,6 +360,8 @@ function getEventsCalendar() {
// Event color // Event color
if ($row['ses_EventTypeConnection'] == '<missing event>' || $row['ses_EventTypeDisconnection'] == '<missing event>') { if ($row['ses_EventTypeConnection'] == '<missing event>' || $row['ses_EventTypeDisconnection'] == '<missing event>') {
$color = '#f39c12'; $color = '#f39c12';
} elseif ($row['ses_StillConnected'] == 1 ) {
$color = '#00a659';
} else { } else {
$color = '#0073b7'; $color = '#0073b7';
} }