mirror of
https://github.com/openwrt/luci.git
synced 2026-05-31 10:31:55 +08:00
luci-app-unbound: correctness fixes
follow-up to 5780be0beb
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
This commit is contained in:
+1
-1
@@ -257,7 +257,7 @@ return view.extend({
|
|||||||
|
|
||||||
const qrs = s.taboption('resource', form.Flag, 'query_min_strict', _('Strict Minimize'),
|
const qrs = s.taboption('resource', form.Flag, 'query_min_strict', _('Strict Minimize'),
|
||||||
_("Strict version of 'query minimize' but it can break DNS"));
|
_("Strict version of 'query minimize' but it can break DNS"));
|
||||||
qrs.taboptional = true;
|
qrs.optional = true;
|
||||||
qrs.depends('query_minimize', '1');
|
qrs.depends('query_minimize', '1');
|
||||||
|
|
||||||
const eds = s.taboption('resource', form.Value, 'edns_size', _('EDNS Size'),
|
const eds = s.taboption('resource', form.Value, 'edns_size', _('EDNS Size'),
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ return view.extend({
|
|||||||
|
|
||||||
if (dhcp_c.content) {
|
if (dhcp_c.content) {
|
||||||
s.tab('dhcp', _('Show: DHCP'));
|
s.tab('dhcp', _('Show: DHCP'));
|
||||||
const dhcp_msg = s.taboption('manual', form.DummyValue, '_dhcp_msg', '');
|
const dhcp_msg = s.taboption('dhcp', form.DummyValue, '_dhcp_msg', '');
|
||||||
dhcp_msg.default = _("This shows '" + FILENAMES['dhcp'] + "' list of hosts from DHCP hook scripts.");
|
dhcp_msg.default = _("This shows '" + FILENAMES['dhcp'] + "' list of hosts from DHCP hook scripts.");
|
||||||
const dhcp = s.taboption('dhcp', form.TextValue, 'dhcp');
|
const dhcp = s.taboption('dhcp', form.TextValue, 'dhcp');
|
||||||
dhcp.rows = 25;
|
dhcp.rows = 25;
|
||||||
|
|||||||
@@ -13,7 +13,11 @@ return view.extend({
|
|||||||
if (!stat) {
|
if (!stat) {
|
||||||
return Promise.all([
|
return Promise.all([
|
||||||
L.resolveDefault(fs.stat('/sbin/logread'), {path: ''}),
|
L.resolveDefault(fs.stat('/sbin/logread'), {path: ''}),
|
||||||
L.resolveDefault('', {path: ''}),
|
Promise.resolve({ path: '' }),
|
||||||
|
Promise.resolve(null),
|
||||||
|
Promise.resolve(null),
|
||||||
|
Promise.resolve(null),
|
||||||
|
Promise.resolve(null),
|
||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
return Promise.all([
|
return Promise.all([
|
||||||
@@ -58,7 +62,7 @@ return view.extend({
|
|||||||
L.Poll.add(() => {
|
L.Poll.add(() => {
|
||||||
return L.resolveDefault(fs.exec_direct('/usr/sbin/unbound-control', ['-c', '/var/lib/unbound/unbound.conf', 'list_local_zones'])).then(function(res) {
|
return L.resolveDefault(fs.exec_direct('/usr/sbin/unbound-control', ['-c', '/var/lib/unbound/unbound.conf', 'list_local_zones'])).then(function(res) {
|
||||||
const zd = document.getElementById("zones_data");
|
const zd = document.getElementById("zones_data");
|
||||||
zd.value = res ? rest.trim() :_('No zones data yet!');
|
zd.value = res ? res.trim() :_('No zones data yet!');
|
||||||
zd.scrollTop = zd.scrollHeight;
|
zd.scrollTop = zd.scrollHeight;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
'require view';
|
'require view';
|
||||||
|
|
||||||
const RESOLV_FILE = '/tmp/resolv.conf.d/resolv.conf.auto';
|
const RESOLV_FILE = '/tmp/resolv.conf.d/resolv.conf.auto';
|
||||||
const LOGERR_CMD = "logread -e 'unbound.*error.*ssl library'";
|
|
||||||
const HELP_URL = 'https://github.com/openwrt/packages/blob/master/net/unbound/files/README.md';
|
const HELP_URL = 'https://github.com/openwrt/packages/blob/master/net/unbound/files/README.md';
|
||||||
|
|
||||||
let section_enabled = false;
|
let section_enabled = false;
|
||||||
@@ -24,7 +23,7 @@ return view.extend({
|
|||||||
load() {
|
load() {
|
||||||
return Promise.all([
|
return Promise.all([
|
||||||
fs.read(RESOLV_FILE).catch(() => ''),
|
fs.read(RESOLV_FILE).catch(() => ''),
|
||||||
fs.exec(LOGERR_CMD).catch(() => ''),
|
fs.exec('/sbin/logread', ['-e', 'unbound.*error.*ssl library']).catch(() => ''),
|
||||||
uci.load('unbound'),
|
uci.load('unbound'),
|
||||||
]).then(([resolv, logerr]) => ({
|
]).then(([resolv, logerr]) => ({
|
||||||
resolvContent: resolv || '',
|
resolvContent: resolv || '',
|
||||||
|
|||||||
Reference in New Issue
Block a user