From 8948ce741d6e724b4eed86a50b172c3b1b94e0e3 Mon Sep 17 00:00:00 2001 From: Tristan Ancelet Date: Tue, 9 May 2023 21:42:20 -0500 Subject: [PATCH] Began working on expanding out the front-end to more pages. --- crontabs.php | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++ index.php | 50 +++++++++++++++++++++++++++++++++++---------- main.js | 4 +++- 3 files changed, 99 insertions(+), 12 deletions(-) create mode 100644 crontabs.php diff --git a/crontabs.php b/crontabs.php new file mode 100644 index 0000000..9e27099 --- /dev/null +++ b/crontabs.php @@ -0,0 +1,57 @@ + + + + + + + + This is a test + + + + +
+ + + +
+ Total Crontabs:
+ +
+ +
+
+ All Crontabs +
+
+
Crontab
Created At
Last Modified
+
+ query("SELECT crontab_path, crontab_created_timestamp, crontab_modified_timestamp FROM crontabs;"); + + while ($row = $res->fetchArray()){ + echo "
"; + echo "
{$row['crontab_path']}
{$row['crontab_created_timestamp']}
{$row['crontab_modified_timestamp']}
"; + echo "
"; + } + ?> +
+
+ +
+
+ + + \ No newline at end of file diff --git a/index.php b/index.php index 5fd133c..4f5ff4d 100644 --- a/index.php +++ b/index.php @@ -26,6 +26,16 @@
Test +
+ "; + $db = new SQLite3('../webcron.db'); + $res = $db->querySingle("SELECT COUNT(job_id) FROM job_history;"); + echo "Job History Entries: $res
"; + $res = $db->querySingle("SELECT COUNT(log_id) FROM logs;"); + echo "Log Entries: $res
"; + ?>
@@ -36,15 +46,15 @@
Level
# of occurances
-
-
Warning
N/A
-
-
-
Critical
N/A
-
-
-
Info
N/A
-
+ query("SELECT * FROM log_statistics_last_7_days;"); + while ($row = $res->fetchArray()){ + echo "
"; + echo "
{$row['log_level_name']}
{$row['count']}
"; + echo "
"; + } + ?> @@ -52,8 +62,17 @@ Script Failures (Last 10)
-
Date
Script
+
Date/Time
Script
Exit Code
+ query("SELECT * FROM last_ten_failed_jobs;"); + while ($row = $res->fetchArray()){ + echo "
"; + echo "
{$row['job_timestamp']}
{$row['job_source']}
{$row['job_exit_code']}
"; + echo "
"; + } + ?>
@@ -61,8 +80,17 @@ Jobs Run (Last 10)
-
Date/Time
Script
+
Date/Time
Script
Exit Code
Job Result
+ query("SELECT * FROM job_history ORDER BY job_timestamp DESC LIMIT 10;"); + while ($row = $res->fetchArray()){ + echo "
"; + echo "
{$row['job_timestamp']}
{$row['job_source']}
{$row['job_exit_code']}
{$row['job_result']}
"; + echo "
"; + } + ?>
diff --git a/main.js b/main.js index d175cf8..aad8b48 100644 --- a/main.js +++ b/main.js @@ -8,4 +8,6 @@ function request_sqlite_version () { function setInfoSection (string) { var info_section = document.getElementById("content"); info_section.innerHTML = request_sqlite_version(); -} \ No newline at end of file +} + +