🎁 Sync 2024-08-19 09:41

This commit is contained in:
github-actions[bot] 2024-08-19 09:41:35 +08:00
parent 774328c4df
commit 839300b476
2 changed files with 24 additions and 14 deletions

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-mosdns
PKG_VERSION:=1.6.0
PKG_VERSION:=1.6.1
PKG_RELEASE:=1
LUCI_TITLE:=LuCI Support for mosdns

View File

@ -37,7 +37,7 @@ function renderStatus(isRunning) {
}
return view.extend({
load: function() {
load: function () {
return Promise.all([
L.resolveDefault(fs.exec('/usr/bin/mosdns', ['version']), null),
]);
@ -314,10 +314,15 @@ return view.extend({
return fs.trimmed('/etc/mosdns/rule/cloudflare-cidr.txt');
};
o.write = function (section_id, formvalue) {
return fs.write('/etc/mosdns/rule/cloudflare-cidr.txt', formvalue.trim().replace(/\r\n/g, '\n') + '\n')
.then(function (i) {
return fs.exec('/etc/init.d/mosdns', ['restart']);
});
return this.cfgvalue(section_id).then(function (value) {
if (value == formvalue) {
return;
}
return fs.write('/etc/mosdns/rule/cloudflare-cidr.txt', formvalue.trim().replace(/\r\n/g, '\n') + '\n')
.then(function (i) {
return fs.exec('/etc/init.d/mosdns', ['restart']);
});
});
};
/* api */
@ -344,14 +349,19 @@ return view.extend({
return fs.trimmed('/etc/mosdns/config_custom.yaml');
};
o.write = function (section_id, formvalue) {
return fs.write('/etc/mosdns/config_custom.yaml', formvalue.trim().replace(/\r\n/g, '\n') + '\n')
.then(function (i) {
ui.addNotification(null, E('p', _('Configuration have been saved.')), 'info');
return fs.exec('/etc/init.d/mosdns', ['restart']);
})
.catch(function (e) {
ui.addNotification(null, E('p', _('Unable to save contents: %s').format(e.message)));
});
return this.cfgvalue(section_id).then(function (value) {
if (value == formvalue) {
return;
}
return fs.write('/etc/mosdns/config_custom.yaml', formvalue.trim().replace(/\r\n/g, '\n') + '\n')
.then(function (i) {
ui.addNotification(null, E('p', _('Configuration have been saved.')), 'info');
return fs.exec('/etc/init.d/mosdns', ['restart']);
})
.catch(function (e) {
ui.addNotification(null, E('p', _('Unable to save contents: %s').format(e.message)));
});
});
};
o = s.taboption('geodata', form.DynamicList, 'geosite_tags', _('GeoSite Tags'),