Skip to content

Commit

Permalink
luci-app-banip: sync with 0.9.5-2
Browse files Browse the repository at this point in the history
* fixed Set search issues in LuCI

Signed-off-by: Dirk Brenken <[email protected]>
  • Loading branch information
dibdot committed Apr 21, 2024
1 parent c6e201a commit aa463d0
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,15 @@ function handleAction(report, ev) {
'click': ui.createHandlerFn(this, function (ev) {
let ip = document.getElementById('search').value.trim().toLowerCase();
if (ip) {
document.getElementById('run').classList.add("spinning");
document.getElementById('search').value = ip;
document.getElementById('result').textContent = 'The search is running, please wait...';
L.resolveDefault(fs.exec_direct('/etc/init.d/banip', ['search', ip])).then(function (res) {
return L.resolveDefault(fs.exec_direct('/etc/init.d/banip', ['search', ip])).then(function (res) {
let result = document.getElementById('result');
if (res) {
result.textContent = res.trim();
} else {
result.textContent = _('No Search results!');
}
document.getElementById('run').classList.remove("spinning");
document.getElementById('search').value = '';
})
}
Expand Down Expand Up @@ -110,16 +108,14 @@ function handleAction(report, ev) {
'click': ui.createHandlerFn(this, function (ev) {
let set = document.getElementById('set').value;
if (set) {
document.getElementById('run').classList.add("spinning");
document.getElementById('result').textContent = 'The survey is running, please wait...';
L.resolveDefault(fs.exec_direct('/etc/init.d/banip', ['survey', set])).then(function (res) {
return L.resolveDefault(fs.exec_direct('/etc/init.d/banip', ['survey', set])).then(function (res) {
let result = document.getElementById('result');
if (res) {
result.textContent = res.trim();
} else {
result.textContent = _('No Search results!');
}
document.getElementById('run').classList.remove("spinning");
document.getElementById('set').value = '';
})
}
Expand Down

0 comments on commit aa463d0

Please sign in to comment.