-
-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jokob-sk
committed
Nov 22, 2024
1 parent
e776c3a
commit 0e438ff
Showing
29 changed files
with
64 additions
and
3,191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
//------------------------------------------------------------------------------ | ||
// check if authenticated | ||
require_once $_SERVER['DOCUMENT_ROOT'] . '/php/templates/security.php'; | ||
|
||
?> | ||
|
||
<script src="js/graph_online_history.js"></script> | ||
<script> | ||
$.get('api/table_online_history.json?nocache=' + Date.now(), function(res) { | ||
// Extracting data from the JSON response | ||
var timeStamps = []; | ||
var onlineCounts = []; | ||
var downCounts = []; | ||
var offlineCounts = []; | ||
var archivedCounts = []; | ||
|
||
res.data.forEach(function(entry) { | ||
var dateObj = new Date(entry.Scan_Date); | ||
var formattedTime = dateObj.toLocaleTimeString([], {hour: '2-digit', minute: '2-digit', hour12: false}); | ||
|
||
timeStamps.push(formattedTime); | ||
onlineCounts.push(entry.Online_Devices); | ||
downCounts.push(entry.Down_Devices); | ||
offlineCounts.push(entry.Offline_Devices); | ||
archivedCounts.push(entry.Archived_Devices); | ||
}); | ||
|
||
// Call your presenceOverTime function after data is ready | ||
presenceOverTime( | ||
timeStamps, | ||
onlineCounts, | ||
offlineCounts, | ||
archivedCounts, | ||
downCounts | ||
); | ||
}).fail(function() { | ||
// Handle any errors in fetching the data | ||
console.error('Error fetching online history data.'); | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.