2023-05-27 20:53:50 +00:00
|
|
|
<?php
|
|
|
|
$root = $_SERVER['DOCUMENT_ROOT'];
|
|
|
|
require "$root/Libraries/table/class.php";
|
|
|
|
use table\Table;
|
|
|
|
$db = new SQLite3("../webcron.db");
|
|
|
|
?>
|
2023-05-07 01:05:15 +00:00
|
|
|
<!Doctype html>
|
|
|
|
<!--
|
|
|
|
Color pallet: https://colorhunt.co/palette/b9eddd87cbb9569daa577d86
|
|
|
|
-->
|
|
|
|
<html>
|
|
|
|
<head>
|
2023-05-07 04:56:16 +00:00
|
|
|
<!-- <script src="https://cdn.tailwindcss.com"></script> -->
|
2023-05-07 01:12:33 +00:00
|
|
|
<link rel="stylesheet" href="css/main.css">
|
2023-05-10 00:50:37 +00:00
|
|
|
<script src="main.js"> </script>
|
2023-05-13 18:21:52 +00:00
|
|
|
<title>Overview</title>
|
2023-05-07 01:05:15 +00:00
|
|
|
</head>
|
2023-05-07 04:56:16 +00:00
|
|
|
<body>
|
2023-05-07 01:05:15 +00:00
|
|
|
<nav>
|
2023-05-13 18:21:52 +00:00
|
|
|
<a class='nav-button' href='index.php'>Log Management</a>
|
|
|
|
<?php
|
|
|
|
$items = scandir(".");
|
|
|
|
foreach ($items as $item){
|
|
|
|
if (preg_match('/\.php$/', $item) && $item != "index.php"){
|
|
|
|
$item_name=ucfirst(explode('.', $item)[0]);
|
|
|
|
echo "<a class='nav-button' href='$item'>$item_name Management</a>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
2023-05-07 01:05:15 +00:00
|
|
|
</nav>
|
|
|
|
|
2023-05-07 04:56:16 +00:00
|
|
|
<div class="content_area bordered rounded_border">
|
|
|
|
|
|
|
|
<div class="menu_bar bordered_right cell">
|
2023-05-15 21:45:18 +00:00
|
|
|
<button class="menu_button" onclick="getLogHistory()"> Check Logs </button>
|
2023-05-07 04:56:16 +00:00
|
|
|
</div>
|
|
|
|
|
2023-05-10 00:50:37 +00:00
|
|
|
<div id="content" class="content cell">
|
|
|
|
Test
|
2023-05-10 02:42:20 +00:00
|
|
|
<br>
|
|
|
|
<?php
|
|
|
|
$user=shell_exec("whoami");
|
|
|
|
echo "User: $user<br>";
|
|
|
|
$res = $db->querySingle("SELECT COUNT(job_id) FROM job_history;");
|
|
|
|
echo "Job History Entries: $res<br>";
|
|
|
|
$res = $db->querySingle("SELECT COUNT(log_id) FROM logs;");
|
|
|
|
echo "Log Entries: $res<br>";
|
|
|
|
?>
|
2023-05-07 04:56:16 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="double_width_menu_bar bordered_left cell">
|
2023-05-27 20:53:50 +00:00
|
|
|
<?php
|
|
|
|
$table = new Table("log_statistics_last_7_days");
|
|
|
|
$table->set_pretty_name("Log Statistics (Last 7 Days)");
|
|
|
|
$query = $table->get_query();
|
|
|
|
$table->Load($db);
|
|
|
|
echo $query->get_query_string();
|
|
|
|
echo $table->get_html();
|
2023-05-07 04:56:16 +00:00
|
|
|
|
2023-05-27 20:53:50 +00:00
|
|
|
$table = new Table("last_ten_failed_jobs");
|
|
|
|
$table->set_pretty_name("Script Failures (Last 10)");
|
|
|
|
$query = $table->get_query();
|
|
|
|
$table->Load($db);
|
|
|
|
echo $query->get_query_string();
|
|
|
|
echo $table->get_html();
|
|
|
|
|
2023-05-07 04:56:16 +00:00
|
|
|
|
2023-05-27 20:53:50 +00:00
|
|
|
$table = new Table("job_history");
|
|
|
|
$table->set_pretty_name("Jobs Run (Last 10)");
|
|
|
|
$query = $table->get_query();
|
|
|
|
$query->set_order_by_column("job_timestamp DESC");
|
|
|
|
$query->set_limit(10);
|
|
|
|
$table->Load($db);
|
|
|
|
echo $query->get_query_string();
|
|
|
|
echo $table->get_html();
|
|
|
|
?>
|
2023-05-07 04:56:16 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</body>
|
2023-05-07 01:05:15 +00:00
|
|
|
</html>
|