diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2022-01-25 02:36:46 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2022-01-25 02:36:46 +0300 |
commit | 8d71b8b95ee96d3727ddac9c270977c6f90732de (patch) | |
tree | e4b255483253e2247986efcbf90358947ee5d951 /index.html | |
parent | debian: 1.1.0-1 (diff) | |
parent | workflows/ci: run tests as root also (diff) | |
download | linux-status-8d71b8b95ee96d3727ddac9c270977c6f90732de.tar.gz linux-status-8d71b8b95ee96d3727ddac9c270977c6f90732de.zip |
Merge tag 'v1.2' into debian
Diffstat (limited to 'index.html')
-rw-r--r-- | index.html | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -64,12 +64,21 @@ h1, .h1 { <script src="js/jquery-3.3.1.min.js"></script> <script src="js/bootstrap.bundle.min.js"></script> <script> +function dump_fail(data) { + console.log('Response code was: ' + data.status + ' ' + data.statusText); + console.log('Response was:\n' + data.responseText); +} + +function get(url, success_callback) { + $.get(url, success_callback).fail(dump_fail); +} + function reboot() { - $.get('reboot'); + get('reboot'); } function shutdown() { - $.get('poweroff'); + get('poweroff'); } function set_hostname(data) { @@ -82,7 +91,7 @@ function set_top(data) { } function refresh_top() { - $.get('top', function(data) { + get('top', function(data) { set_top(JSON.parse(data)); }); } @@ -183,7 +192,7 @@ function set_users(data) { } function refresh_status() { - $.get('status', function(data) { + get('status', function(data) { data = JSON.parse(data); set_hostname(data['hostname']); set_system(data['system']); |