Skip to content

Commit

Permalink
fix(client): fix writing custom direct/proxy domain list
Browse files Browse the repository at this point in the history
Signed-off-by: Tianling Shen <[email protected]>
  • Loading branch information
1715173329 committed Jan 10, 2025
1 parent d5de715 commit ac06c6a
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions htdocs/luci-static/resources/view/homeproxy/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1278,16 +1278,20 @@ return view.extend({
so.monospace = true;
so.datatype = 'hostname';
so.depends({'homeproxy.config.routing_mode': 'custom', '!reverse': true});
so.load = function(section_id) {
so.load = function(/* ... */) {
return L.resolveDefault(callReadDomainList('proxy_list')).then((res) => {
return res.content;
}, {});
}
so.write = function(section_id, value) {
so.write = function(_section_id, value) {
return callWriteDomainList('proxy_list', value);
}
so.remove = function(section_id, value) {
return callWriteDomainList('proxy_list', '');
so.remove = function(/* ... */) {
let routing_mode = this.map.lookupOption('routing_mode', 'config')[0].formvalue('config');

if (routing_mode !== 'custom')
return callWriteDomainList('proxy_list', '');
return true;
}
so.validate = function(section_id, value) {
if (section_id && value)
Expand All @@ -1307,16 +1311,20 @@ return view.extend({
so.monospace = true;
so.datatype = 'hostname';
so.depends({'homeproxy.config.routing_mode': 'custom', '!reverse': true});
so.load = function(section_id) {
so.load = function(/* ... */) {
return L.resolveDefault(callReadDomainList('direct_list')).then((res) => {
return res.content;
}, {});
}
so.write = function(section_id, value) {
so.write = function(_section_id, value) {
return callWriteDomainList('direct_list', value);
}
so.remove = function(section_id, value) {
return callWriteDomainList('direct_list', '');
so.remove = function(/* ... */) {
let routing_mode = this.map.lookupOption('routing_mode', 'config')[0].formvalue('config');

if (routing_mode !== 'custom')
return callWriteDomainList('direct_list', '');
return true;
}
so.validate = function(section_id, value) {
if (section_id && value)
Expand Down

0 comments on commit ac06c6a

Please sign in to comment.