mirror of
https://github.com/remittor/zapret-openwrt.git
synced 2025-12-18 13:38:11 +03:00
Add support for custom txt-configs
Example: /opt/zapret/ipset/cust1.txt
This commit is contained in:
@@ -247,6 +247,18 @@ return view.extend({
|
|||||||
15
|
15
|
||||||
).show();
|
).show();
|
||||||
|
|
||||||
|
add_delim(s);
|
||||||
|
|
||||||
|
for (let num = 1; num <= tools.custFileMax; num++) {
|
||||||
|
let fn = tools.custFileTemplate.format(num.toString());
|
||||||
|
let name = _('Custom file #' + num);
|
||||||
|
o = s.taboption(tabname, form.Button, '_cust_file%d_btn'.format(num), name);
|
||||||
|
o.inputtitle = _('Edit');
|
||||||
|
o.inputstyle = 'edit btn';
|
||||||
|
o.description = fn;
|
||||||
|
o.onclick = () => new tools.fileEditDialog(fn, name, '', '', 15).show();
|
||||||
|
}
|
||||||
|
|
||||||
let map_promise = m.render();
|
let map_promise = m.render();
|
||||||
map_promise.then(node => node.classList.add('fade-in'));
|
map_promise.then(node => node.classList.add('fade-in'));
|
||||||
return map_promise;
|
return map_promise;
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ return baseclass.extend({
|
|||||||
iplstExcludeFN : '/opt/zapret/ipset/zapret-ip-exclude.txt',
|
iplstExcludeFN : '/opt/zapret/ipset/zapret-ip-exclude.txt',
|
||||||
iplstUserFN : '/opt/zapret/ipset/zapret-ip-user.txt',
|
iplstUserFN : '/opt/zapret/ipset/zapret-ip-user.txt',
|
||||||
iplstUserExcludeFN: '/opt/zapret/ipset/zapret-ip-user-exclude.txt',
|
iplstUserExcludeFN: '/opt/zapret/ipset/zapret-ip-user-exclude.txt',
|
||||||
|
custFileMax : 4,
|
||||||
|
custFileTemplate : '/opt/zapret/ipset/cust%s.txt',
|
||||||
|
|
||||||
infoLabelStarting : '<span class="label-status starting">' + _('Starting') + '</span>',
|
infoLabelStarting : '<span class="label-status starting">' + _('Starting') + '</span>',
|
||||||
infoLabelRunning : '<span class="label-status running">' + _('Enabled') + '</span>',
|
infoLabelRunning : '<span class="label-status running">' + _('Enabled') + '</span>',
|
||||||
|
|||||||
@@ -85,6 +85,10 @@ define Package/$(PKG_NAME)/install
|
|||||||
$(INSTALL_CONF) ./ipset/zapret-ip-user.txt $(1)/opt/zapret/ipset/zapret-ip-user.txt
|
$(INSTALL_CONF) ./ipset/zapret-ip-user.txt $(1)/opt/zapret/ipset/zapret-ip-user.txt
|
||||||
$(INSTALL_CONF) ./ipset/zapret-ip-user-exclude.txt $(1)/opt/zapret/ipset/zapret-ip-user-exclude.txt
|
$(INSTALL_CONF) ./ipset/zapret-ip-user-exclude.txt $(1)/opt/zapret/ipset/zapret-ip-user-exclude.txt
|
||||||
$(INSTALL_CONF) ./ipset/zapret-ip-user-ipban.txt $(1)/opt/zapret/ipset/zapret-ip-user-ipban.txt
|
$(INSTALL_CONF) ./ipset/zapret-ip-user-ipban.txt $(1)/opt/zapret/ipset/zapret-ip-user-ipban.txt
|
||||||
|
$(INSTALL_CONF) ./ipset/cust1.txt $(1)/opt/zapret/ipset/cust1.txt
|
||||||
|
$(INSTALL_CONF) ./ipset/cust2.txt $(1)/opt/zapret/ipset/cust2.txt
|
||||||
|
$(INSTALL_CONF) ./ipset/cust3.txt $(1)/opt/zapret/ipset/cust3.txt
|
||||||
|
$(INSTALL_CONF) ./ipset/cust4.txt $(1)/opt/zapret/ipset/cust4.txt
|
||||||
$(INSTALL_BIN) ./sync_config.sh $(1)/opt/zapret/sync_config.sh
|
$(INSTALL_BIN) ./sync_config.sh $(1)/opt/zapret/sync_config.sh
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
|||||||
0
zapret/ipset/cust1.txt
Normal file
0
zapret/ipset/cust1.txt
Normal file
0
zapret/ipset/cust2.txt
Normal file
0
zapret/ipset/cust2.txt
Normal file
0
zapret/ipset/cust3.txt
Normal file
0
zapret/ipset/cust3.txt
Normal file
0
zapret/ipset/cust4.txt
Normal file
0
zapret/ipset/cust4.txt
Normal file
Reference in New Issue
Block a user