+ "; + $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
"; + ?> +
diff --git a/api/crontab_stats.php b/api/crontab_stats.php index a1a167b..a0c8a64 100644 --- a/api/crontab_stats.php +++ b/api/crontab_stats.php @@ -1,5 +1,5 @@ "; -$crontab_counts=shell_exec('./count-crontabs.sh'); +$crontab_counts=shell_exec('../../Scripts/count-crontabs.sh'); echo "$crontab_counts"; ?> diff --git a/api/crontab_view.php b/api/crontab_view.php new file mode 100644 index 0000000..d19eed5 --- /dev/null +++ b/api/crontab_view.php @@ -0,0 +1,27 @@ +querySingle("select crontab_id from crontabs where crontab_path like '%/$name';"); + + if (empty($id)){ + echo "$name is not a valid crontab"; + } else { + $data = $db->querySingle("SELECT crontab_data FROM crontabs WHERE crontab_id = $id;"); + echo "$data"; + } + + + + +?> \ No newline at end of file diff --git a/api/table.php b/api/table.php index f3ee86f..24cf66c 100644 --- a/api/table.php +++ b/api/table.php @@ -5,6 +5,7 @@ This endpoint will get specific tables from the db Args will be: name: Table Name limit: number of entries to return (default all) + columns: This will be a comma delimited list of column names (in the order that it needs to be displayed) */ if ( ! array_key_exists("name", $_GET) ){ echo "A tablename was not provided with the request"; @@ -19,6 +20,11 @@ if ( array_key_exists("limit", $_GET)){ $limit=0; } +if ( array_key_exists("columns", $_GET)){ + echo $_GET["columns"]; + $columns = explode(',', $_GET["columns"]); +} + $query_modifier=""; if (filter_var($limit, FILTER_VALIDATE_INT)){ if ($limit > 0){ @@ -35,20 +41,32 @@ if (filter_var($limit, FILTER_VALIDATE_INT)){ echo '