summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-smartdns/htdocs/luci-static/resources
diff options
context:
space:
mode:
authorNick Peng <pymumu@gmail.com>2022-09-18 16:41:57 +0800
committerNick Peng <pymumu@gmail.com>2022-09-18 16:45:32 +0800
commitc751cc5180196198f08e6e3aac019270b26ff1e7 (patch)
tree9488959745fd7eb947d59cb81e48b3202a52e5b7 /applications/luci-app-smartdns/htdocs/luci-static/resources
parent20ae64edec9797561c8aa61d7e4ce1a39de0b18a (diff)
luci-app-smartdns: fix redirect error message issue
Signed-off-by: Nick Peng <pymumu@gmail.com>
Diffstat (limited to 'applications/luci-app-smartdns/htdocs/luci-static/resources')
-rw-r--r--applications/luci-app-smartdns/htdocs/luci-static/resources/view/smartdns/smartdns.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/applications/luci-app-smartdns/htdocs/luci-static/resources/view/smartdns/smartdns.js b/applications/luci-app-smartdns/htdocs/luci-static/resources/view/smartdns/smartdns.js
index 6f3f0ac16e..f44fd9b254 100644
--- a/applications/luci-app-smartdns/htdocs/luci-static/resources/view/smartdns/smartdns.js
+++ b/applications/luci-app-smartdns/htdocs/luci-static/resources/view/smartdns/smartdns.js
@@ -57,7 +57,6 @@ function smartdnsRenderStatus(res) {
var autoSetDnsmasq = uci.get_first('smartdns', 'smartdns', 'auto_set_dnsmasq');
var smartdnsPort = uci.get_first('smartdns', 'smartdns', 'port');
var dnsmasqServer = uci.get_first('dhcp', 'dnsmasq', 'server');
- uci.unload('dhcp');
if (isRunning) {
renderHTML += "<span style=\"color:green;font-weight:bold\">SmartDNS - " + _("RUNNING") + "</span>";
@@ -68,9 +67,10 @@ function smartdnsRenderStatus(res) {
if (autoSetDnsmasq === '1' && smartdnsPort != '53') {
var matchLine = "127.0.0.1#" + smartdnsPort;
- var dnsmasqServer = uci.get_first('dhcp', 'dnsmasq', 'server') || "";
- if (dnsmasqServer.indexOf(matchLine) < 0) {
+ uci.unload('dhcp');
+ uci.load('dhcp');
+ if (dnsmasqServer == undefined || dnsmasqServer.indexOf(matchLine) < 0) {
renderHTML += "<br /><span style=\"color:red;font-weight:bold\">" + _("Dnsmasq Forwared To Smartdns Failure") + "</span>";
}
}
@@ -106,8 +106,7 @@ return view.extend({
view.innerHTML = smartdnsRenderStatus(res);
});
}
- poll.add(renderStatus);
- setTimeout(renderStatus, 1000);
+ poll.add(renderStatus, 1);
return E('div', { class: 'cbi-map' },
E('div', { class: 'cbi-section' }, [