From 79adc501c2ade8ee53dab227931436df2228471e Mon Sep 17 00:00:00 2001 From: fujr Date: Thu, 24 Oct 2024 15:11:53 +0800 Subject: [PATCH] Fix typo in qmodem_mwan.sh and update warning message handling in modem_info.htm --- luci/luci-app-qmodem/luasrc/view/qmodem/modem_info.htm | 2 +- luci/luci-app-qmodem/root/usr/share/qmodem/generic.sh | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/luci/luci-app-qmodem/luasrc/view/qmodem/modem_info.htm b/luci/luci-app-qmodem/luasrc/view/qmodem/modem_info.htm index a1fb651..c535e9d 100644 --- a/luci/luci-app-qmodem/luasrc/view/qmodem/modem_info.htm +++ b/luci/luci-app-qmodem/luasrc/view/qmodem/modem_info.htm @@ -333,7 +333,7 @@ class ModemInfo { for (let entry of data){ let class_name,full_name,value,type; class_name = entry.class; - if (class_name == "warning") { + if (type == "warning_message") { warning_message.push(entry); continue; } diff --git a/luci/luci-app-qmodem/root/usr/share/qmodem/generic.sh b/luci/luci-app-qmodem/root/usr/share/qmodem/generic.sh index 0b34688..b667b96 100755 --- a/luci/luci-app-qmodem/root/usr/share/qmodem/generic.sh +++ b/luci/luci-app-qmodem/root/usr/share/qmodem/generic.sh @@ -35,10 +35,8 @@ add_warning_message_entry() json_add_string key "$key" json_add_string value "$value" json_add_string "full_name" "$key_full_name" - json_add_string "type" "warnning_message" - if [ -n "$class" ]; then - json_add_string "class" "$class" - fi + json_add_string "type" "warning_message" + json_add_string "class" "warning" json_close_object }