From a4781f8a6f04ceb60bbece5497a928027e7dba8f Mon Sep 17 00:00:00 2001 From: kzolotarev95 Date: Sun, 28 Jun 2026 18:34:07 +0400 Subject: [PATCH] Add temperature panel and calmer colors --- files/www/cgi-bin/owrt-full-backup | 47 +++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/files/www/cgi-bin/owrt-full-backup b/files/www/cgi-bin/owrt-full-backup index 60513fb..62ba983 100644 --- a/files/www/cgi-bin/owrt-full-backup +++ b/files/www/cgi-bin/owrt-full-backup @@ -486,6 +486,35 @@ storage_widgets() { done } +temperature_widgets() { + local path raw whole frac label printed type_path name_path + printed=0 + for path in /sys/class/thermal/thermal_zone*/temp /sys/class/hwmon/hwmon*/temp*_input; do + [ -r "$path" ] || continue + raw="$(cat "$path" 2>/dev/null | tr -dc '0-9')" + [ -n "$raw" ] || continue + case "$raw" in *[!0-9]*) continue ;; esac + if [ "$raw" -ge 1000 ] 2>/dev/null; then + whole="$((raw / 1000))" + frac="$(((raw % 1000) / 100))" + else + whole="$raw" + frac=0 + fi + label="Датчик температуры" + type_path="${path%/temp}/type" + name_path="${path%/temp*_input}/name" + if [ -r "$type_path" ]; then + label="$(cat "$type_path" 2>/dev/null | sed -n '1p')" + elif [ -r "$name_path" ]; then + label="$(cat "$name_path" 2>/dev/null | sed -n '1p')" + fi + printed=1 + printf '
%s%s
%s.%s °C
' "$(h "$label")" "$(h "$path")" "$(h "$whole")" "$(h "$frac")" + done + [ "$printed" = "1" ] || printf '

Датчик температуры не найден.

' +} + checkbox_attr() { [ "$1" = "1" ] && printf ' checked' } @@ -617,8 +646,8 @@ page() { $refresh_meta OpenWrt Full Backup