aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-07-27 22:42:45 +0000
committerEgor Tensin <Egor.Tensin@gmail.com>2023-07-27 22:42:45 +0000
commit62a6c04c1af29bed1153a7deb01fa57fa5cc89d1 (patch)
tree4897c6685a17940548778dd5e19b0e0dbb11a12d
parentdebian: 2.4-1 (diff)
parentupdate example screenshot (diff)
downloadlinux-status-62a6c04c1af29bed1153a7deb01fa57fa5cc89d1.tar.gz
linux-status-62a6c04c1af29bed1153a7deb01fa57fa5cc89d1.zip
Merge tag 'v2.4.1' into debian
Diffstat (limited to '')
-rw-r--r--doc/example.pngbin691707 -> 396709 bytes
-rw-r--r--html/index.html12
-rwxr-xr-xsrc/app.py3
-rwxr-xr-xtest/test.sh13
4 files changed, 16 insertions, 12 deletions
diff --git a/doc/example.png b/doc/example.png
index 8cf23fe..caec72a 100644
--- a/doc/example.png
+++ b/doc/example.png
Binary files differ
diff --git a/html/index.html b/html/index.html
index 8c4ebf1..b4baec0 100644
--- a/html/index.html
+++ b/html/index.html
@@ -10,13 +10,13 @@
<div class="container flex-shrink-0">
<div class="row mt-3">
<div class="col">
- <div style="display: flex; justify-content: space-between; align-items: center; gap: .5em;">
+ <div style="display: flex; justify-content: space-between; align-items: flex-end; gap: .5em;">
<div>
<h1 class="h2" id="hostname">-</h1>
<p class="mb-0 small">refreshed every <span id="status_refresh_interval">-</span> seconds</p>
</div>
<div>
- <div class="btn-group" role="group" id="power_buttons">
+ <div class="btn-group" role="group" style="width: 100%;" id="power_buttons">
<button type="button" class="btn btn-sm btn-warning" onclick="reboot();">Reboot</button>
<button type="button" class="btn btn-sm btn-danger" onclick="poweroff();">Shutdown</button>
</div>
@@ -210,16 +210,14 @@ function set_thermal(data) {
let type = info['type'];
let temp = info['temp'].toFixed(2) + '&deg;C';
let row = $('<tr/>')
- .append($('<td/>', {'class': 'py-0'})
- .append($('<code/>', {'class': 'text-reset'}).text(type)))
- .append($('<td/>', {'class': 'py-0 text-right'})
- .append($('<code/>', {'class': 'text-reset'}).html(temp)));
+ .append($('<td/>', {'class': 'pr-1'}).text(type))
+ .append($('<td/>', {'class': 'pl-1 text-right'}).html(temp));
body.append(row);
});
$('#thermal').empty();
$('#thermal').append($('<div/>', {'class': 'table-responsive'})
- .append($('<table/>', {'class': 'table table-borderless table-sm text-nowrap mb-0'})
+ .append($('<table/>', {'class': 'text-nowrap', 'style': 'width: 100%;'})
.append(body)));
}
diff --git a/src/app.py b/src/app.py
index 3964a38..274ff7b 100755
--- a/src/app.py
+++ b/src/app.py
@@ -585,6 +585,7 @@ def cgi_one_value(params, name, default=None):
class Request(Enum):
STATUS = 'status'
TOP = 'top'
+ THERMAL = 'thermal'
REBOOT = 'reboot'
POWEROFF = 'poweroff'
@@ -610,6 +611,8 @@ class Request(Enum):
return Status().complete()
if self is Request.TOP:
return Top().complete()
+ if self is Request.THERMAL:
+ return ThermalInfo().complete()
if self in [Request.REBOOT, Request.POWEROFF] and self.disable_power:
return Response(None, HTTPStatus.FORBIDDEN)
diff --git a/test/test.sh b/test/test.sh
index aaf80fd..c6366f7 100755
--- a/test/test.sh
+++ b/test/test.sh
@@ -141,10 +141,11 @@ run_curl_tests() {
run_curl_test '/index.html' '<link rel="stylesheet" href="css/bootstrap.min.css">' 'var status_refresh_interval_seconds'
# /status returns a JSON with a number of fields:
- run_curl_test '/status' '"hostname":' '"system":' '"user":'
-
- # /top is a `top` output:
+ run_curl_test '/status' '"hostname":' '"thermal":' '"system":' '"user":'
+ # /top is `top` output:
run_curl_test '/top' 'load average:'
+ # /thermal is also an endpoint:
+ run_curl_test '/thermal'
}
cgi_check_header() {
@@ -187,9 +188,11 @@ run_cgi_tests() {
# Check that app.py still works as a CGI script.
# /status returns a JSON with a number of fields:
- run_cgi_test 'status' '"hostname":' '"system":' '"user":'
- # /top is a `top` output:
+ run_cgi_test 'status' '"hostname":' '"thermal":' '"system":' '"user":'
+ # /top is `top` output:
run_cgi_test 'top' 'load average:'
+ # /thermal is also an endpoint:
+ run_cgi_test 'thermal'
}
main() {