mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
Fix presence, time selector, improve ntfy
This commit is contained in:
@@ -1387,7 +1387,7 @@ function getSessionsPresenceEvents () {
|
||||
// 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();
|
||||
|
||||
@@ -51,6 +51,7 @@ function OpenDB () {
|
||||
}
|
||||
|
||||
$db = SQLite3_connect(true);
|
||||
$db->exec('PRAGMA journal_mode = wal;');
|
||||
if(!$db)
|
||||
{
|
||||
die ('Error connecting to database');
|
||||
|
||||
@@ -225,7 +225,7 @@ function getDeviceSessions() {
|
||||
}
|
||||
|
||||
// Duration
|
||||
if ($row['ses_EventTypeConnection'] == '<missing event>' || $row['ses_EventTypeDisconnection'] == '<missing event>') {
|
||||
if ($row['ses_EventTypeConnection'] == '<missing event>' || $row['ses_EventTypeConnection'] == NULL || $row['ses_EventTypeDisconnection'] == '<missing event>' || $row['ses_EventTypeDisconnection'] == NULL) {
|
||||
$dur = '...';
|
||||
} elseif ($row['ses_StillConnected'] == true) {
|
||||
$dur = formatDateDiff ($row['ses_DateTimeConnection'], ''); //***********
|
||||
@@ -261,7 +261,6 @@ function getDevicePresence() {
|
||||
|
||||
// Request Parameters
|
||||
$mac = $_REQUEST['mac'];
|
||||
$periodDate = getDateFromPeriod();
|
||||
$startDate = '"'. formatDateISO ($_REQUEST ['start']) .'"';
|
||||
$endDate = '"'. formatDateISO ($_REQUEST ['end']) .'"';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user