Skip to content

Commit

Permalink
feat(client): Add object subs_info[*] = { url, name, order }
Browse files Browse the repository at this point in the history
  • Loading branch information
muink committed Dec 1, 2023
1 parent 5057a5e commit 74ca85e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
17 changes: 17 additions & 0 deletions htdocs/luci-static/resources/view/homeproxy/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,23 @@ return view.extend({
]);
}

/* Cache all subscription info, they will be called multiple times */
var subs_info = {};
{
let s = uci.get(data[0], 'subscription');
let urls = s.subscription_url;
let names = s.subscription_name || [];
if (urls) {
for (var i = 0; i < urls.length; i++) {
subs_info[hp.calcStringMD5(urls[i])] = {
"url": urls[i],
"name": names[i],
"order": i + 1
};
}
}
};

/* Cache all configured proxy nodes, they will be called multiple times */
var proxy_nodes = {};
uci.sections(data[0], 'node', (res) => {
Expand Down
4 changes: 4 additions & 0 deletions htdocs/luci-static/resources/view/homeproxy/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,10 @@ return view.extend({
return true;
}

o = s.taboption('subscription', form.DynamicList, 'subscription_name', _('Subscription Name-s'),
_('Add name for Subscription URL, correspond in sequence.'));
o.datatype = 'uciname';

o = s.taboption('subscription', form.ListValue, 'filter_nodes', _('Filter nodes'),
_('Drop/keep specific nodes from subscriptions.'));
o.value('disabled', _('Disable'));
Expand Down

0 comments on commit 74ca85e

Please sign in to comment.