mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
Support for executing multiple commands via /cmd
This commit is contained in:
1 parent
a2b2dbcfbf
commit
2316ffd493
5 files changed
+54
-18
No files matched your search
+12
-11
@@ -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}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user