Support for executing multiple commands via /cmd

This commit is contained in:
UAb5eSMn
2026-05-15 13:27:09 +02:00
parent a2b2dbcfbf
commit 2316ffd493
5 changed files with 54 additions and 18 deletions
+12 -11
View File
@@ -12,18 +12,19 @@ async function ipSub() {
if (!checkIp(document.getElementById(ips[i]).value))
return;
}
var cmd = '';
for (let i=0; i<3;i++){
var cmd = ips[i]+' '+document.getElementById(ips[i]).value;
try {
const response = await fetch('/cmd', {
method: 'POST',
body: cmd
});
console.log('Completed!', response);
fetchIP();
} catch(err) {
console.error(`Error: ${err}`);
}
cmd += ips[i]+' '+document.getElementById(ips[i]).value+'\n';
}
try {
const response = await fetch('/cmd', {
method: 'POST',
body: cmd
});
console.log('Completed!', response);
fetchIP();
} catch(err) {
console.error(`Error: ${err}`);
}
}