From c89fa05978217d8e46ef48c4089d6fade59eb16c Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Thu, 4 Mar 2021 11:45:44 +0300 Subject: get rid of the /timers endpoit, use /status --- index.html | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) (limited to 'index.html') diff --git a/index.html b/index.html index 7c8f487..3cbf6cc 100644 --- a/index.html +++ b/index.html @@ -45,7 +45,7 @@ h1, .h1 {

           
           
-

systemctl --system list-timers --all refreshed every - seconds

+

systemctl --system list-timers --all refreshed every - seconds


           
@@ -121,7 +121,7 @@ function add_user(name) {

     
     
-

systemctl --user list-timers --all refreshed every ${timers_refresh_interval_seconds} seconds

+

systemctl --user list-timers --all refreshed every ${status_refresh_interval_seconds} seconds


     
@@ -164,38 +164,26 @@ function set_users(data) { function refresh_status() { $.get('status', function(data) { data = JSON.parse(data); - set_top(data['top']); set_hostname(data['hostname']); set_system(data['system']); set_users(data['user']); }); } -function refresh_timers() { - $.get('timers', function(data) { - data = JSON.parse(data); - set_system(data['system']); - set_users(data['user']); - }); -} +var status_refresh_interval_seconds = 30; -var timers_refresh_interval_seconds = 30; - -function loop_timers() { +function loop_status() { setInterval(function() { - refresh_timers(); - }, timers_refresh_interval_seconds * 1000); - $('#timers_system_refresh_interval').text(timers_refresh_interval_seconds); -} - -function loop() { - loop_top(); - loop_timers(); + refresh_status(); + }, status_refresh_interval_seconds * 1000); + $('#status_system_refresh_interval').text(status_refresh_interval_seconds); } function main() { + refresh_top(); refresh_status(); - loop(); + loop_top(); + loop_status(); } $(function() { -- cgit v1.2.3