summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-pbr/htdocs/luci-static
diff options
context:
space:
mode:
authorStan Grishin <stangri@melmac.ca>2022-12-11 20:37:03 -0700
committerGitHub <noreply@github.com>2022-12-11 20:37:03 -0700
commit35f0d50a4928f0678bde22ffcd4219a732563641 (patch)
tree8bdb988a4fd7914fb4536673b84b803c2dcb0994 /applications/luci-app-pbr/htdocs/luci-static
parent858252c7df9c2fd7237f14a94594cf29ddca5b18 (diff)
parentf8cbfa11c6583f298f505b103c73781f6349eba8 (diff)
Merge pull request #6142 from stangri/master-luci-app-pbr
luci-app-pbr: Detect missing iptables & error-proofing WebUI
Diffstat (limited to 'applications/luci-app-pbr/htdocs/luci-static')
-rw-r--r--applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js19
1 files changed, 15 insertions, 4 deletions
diff --git a/applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js b/applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js
index 8cd36bca7c..3eb04d0dff 100644
--- a/applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js
+++ b/applications/luci-app-pbr/htdocs/luci-static/resources/pbr/status.js
@@ -164,7 +164,12 @@ var status = baseclass.extend({
var warningsTitle = E('label', { class: 'cbi-value-title' }, _("Service Warnings"));
var text = "";
(reply.warnings).forEach(element => {
- text += (textLabelsTable[element.id]).format(element.extra || ' ') + "<br />";
+ if (element.id && textLabelsTable[element.id]) {
+ text += (textLabelsTable[element.id]).format(element.extra || ' ') + "<br />";
+ }
+ else {
+ text += _("Unknown Warning!") + "<br />";
+ }
});
var warningsText = E('div', {}, text);
var warningsField = E('div', { class: 'cbi-value-field' }, warningsText);
@@ -175,7 +180,8 @@ var status = baseclass.extend({
if (reply.errors && reply.errors.length) {
var textLabelsTable = {
errorConfigValidation: _("Config (%s) validation failure!").format('/etc/config/' + pkg.Name),
- errorNoIpFull: _("ip-full binary cannot be found!"),
+ errorNoIpFull: _("%s binary cannot be found!").formate('ip-full'),
+ errorNoIptables: _("%s binary cannot be found!").formate('iptables'),
errorNoIpset: _("Resolver set support (%s) requires ipset, but ipset binary cannot be found!").format(uci.get(pkg.Name, 'config', 'resolver_set')),
errorNoNft: _("Resolver set support (%s) requires nftables, but nft binary cannot be found!").format(uci.get(pkg.Name, 'config', 'resolver_set')),
errorResolverNotSupported: _("Resolver set (%s) is not supported on this system!").format(uci.get(pkg.Name, 'config', 'resolver_set')),
@@ -187,7 +193,7 @@ var status = baseclass.extend({
errorPolicyNoSrcDest: _("Policy '%s' has no source/destination parameters!"),
errorPolicyNoInterface: _("Policy '%s' has no assigned interface!"),
errorPolicyUnknownInterface: _("Policy '%s' has an unknown interface!"),
- errorPolicyProcess: _("%s"),
+ errorPolicyProcess: _("Policy processing error (%s)!"),
errorFailedSetup: _("Failed to set up '%s'!"),
errorFailedReload: _("Failed to reload '%s'!"),
errorUserFileNotFound: _("Custom user file '%s' not found or empty!"),
@@ -199,7 +205,12 @@ var status = baseclass.extend({
var errorsTitle = E('label', { class: 'cbi-value-title' }, _("Service Errors"));
var text = "";
(reply.errors).forEach(element => {
- text += (textLabelsTable[element.id]).format(element.extra || ' ') + "<br />";
+ if (element.id && textLabelsTable[element.id]) {
+ text += (textLabelsTable[element.id]).format(element.extra || ' ') + "<br />";
+ }
+ else {
+ text += _("Unknown Error!") + "<br />";
+ }
});
var errorsText = E('div', {}, text);
var errorsField = E('div', { class: 'cbi-value-field' }, errorsText);