Skip to content

Commit

Permalink
luci-app-ddns: show the URL which will be used.
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Pazdziora <[email protected]>
  • Loading branch information
adelton authored and systemcrash committed Jan 22, 2025
1 parent 9d9a7f4 commit cb8f54a
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,7 @@ return view.extend({
return _this.handleGetServiceData(service).then(L.bind(function (service_data) {
s.service_available = true;
s.service_supported = true;
s.url = null;

if (service != '-') {
if (!service_data)
Expand All @@ -594,6 +595,11 @@ return view.extend({
service_data = JSON.parse(service_data);
if (ipv6 == "1" && !service_data.ipv6)
s.service_supported = false;
else if (ipv6 == "1") {
s.url = service_data.ipv6.url;
} else {
s.url = service_data.ipv4.url;
}
}
}

Expand Down Expand Up @@ -674,6 +680,14 @@ return view.extend({
};
}

if (Boolean(s.url)) {
o = s.taboption('basic', form.DummyValue, '_url', _("Update URL"));
o.rawhtml = true;
o.default = '<div style="font-family: monospace;">'
+ s.url.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")
+ '</div>';
}

var service_switch = s.taboption('basic', form.Button, '_switch_proto');
service_switch.modalonly = true;
service_switch.title = _('Really switch service?');
Expand Down

0 comments on commit cb8f54a

Please sign in to comment.