summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-pbr/htdocs/luci-static/resources/view/pbr
diff options
context:
space:
mode:
authorStan Grishin <stangri@melmac.ca>2022-12-19 03:58:01 +0000
committerStan Grishin <stangri@melmac.ca>2022-12-19 03:58:32 +0000
commit54c3ba32f9a2327ca4fdb9c419fb842108b17894 (patch)
tree22306790b79421296a203d184d398215f161d03c /applications/luci-app-pbr/htdocs/luci-static/resources/view/pbr
parenta27d2dbc32785c3389ea77a26714e7f6c67c9185 (diff)
luci-app-pbr: update to 1.0.1-1
* add more error/warning messages * better error/ubus error handling Signed-off-by: Stan Grishin <stangri@melmac.ca>
Diffstat (limited to 'applications/luci-app-pbr/htdocs/luci-static/resources/view/pbr')
-rw-r--r--applications/luci-app-pbr/htdocs/luci-static/resources/view/pbr/overview.js42
1 files changed, 37 insertions, 5 deletions
diff --git a/applications/luci-app-pbr/htdocs/luci-static/resources/view/pbr/overview.js b/applications/luci-app-pbr/htdocs/luci-static/resources/view/pbr/overview.js
index 32bc6cb2de..e2d9d7b9b2 100644
--- a/applications/luci-app-pbr/htdocs/luci-static/resources/view/pbr/overview.js
+++ b/applications/luci-app-pbr/htdocs/luci-static/resources/view/pbr/overview.js
@@ -25,10 +25,33 @@ return view.extend({
L.resolveDefault(pbr.getInterfaces(), {}),
L.resolveDefault(pbr.getPlatformSupport(), {}),
]).then(function (data) {
- var arrInterfaces = data[0][pkg.Name].interfaces;
- var replyPlatform = data[1][pkg.Name];
+ var arrInterfaces;
+ var replyPlatform;
var status, m, s, o;
+ if (data[0] && data[0][pkg.Name] && data[0][pkg.Name].interfaces) {
+ arrInterfaces = data[0][pkg.Name].interfaces;
+ }
+ else {
+ arrInterfaces = ["wan"];
+ }
+
+ if (data[1] && data[1][pkg.Name]) {
+ replyPlatform = data[1][pkg.Name];
+ }
+ else {
+ replyPlatform = {
+ ipset_installed: null,
+ nft_installed: null,
+ adguardhome_installed: null,
+ dnsmasq_installed: null,
+ unbound_installed: null,
+ adguardhome_ipset_support: null,
+ dnsmasq_ipset_support: null,
+ dnsmasq_nftset_support: null,
+ };
+ }
+
status = new pbr.status();
m = new form.Map(pkg.Name, _("Policy Based Routing - Configuration"));
@@ -56,13 +79,22 @@ return view.extend({
o.default = "1";
var text = "";
- if (!(replyPlatform.adguardhome_ipset_support)) {
+ if (replyPlatform.adguardhome_ipset_support === null) {
+ text += _("The %s support is unknown.").format("<i>adguardhome.ipset</i>") + "<br />"
+ }
+ else if (!(replyPlatform.adguardhome_ipset_support)) {
text += _("The %s is not supported on this system.").format("<i>adguardhome.ipset</i>") + "<br />"
}
- if (!(replyPlatform.dnsmasq_ipset_support)) {
+ if (replyPlatform.dnsmasq_ipset_support === null) {
+ text += _("The %s support is unknown.").format("<i>dnsmasq.ipset</i>") + "<br />"
+ }
+ else if (!(replyPlatform.dnsmasq_ipset_support)) {
text += _("The %s is not supported on this system.").format("<i>dnsmasq.ipset</i>") + "<br />"
}
- if (!(replyPlatform.dnsmasq_nftset_support)) {
+ if (replyPlatform.dnsmasq_nftset_support === null) {
+ text += _("The %s support is unknown.").format("<i>dnsmasq.nftset</i>") + "<br />"
+ }
+ else if (!(replyPlatform.dnsmasq_nftset_support)) {
text += _("The %s is not supported on this system.").format("<i>dnsmasq.nftset</i>") + "<br />"
}
text += _("Please check the %sREADME%s before changing this option.").format(