This commit is contained in:
2024-06-25 14:47:28 +03:00
parent ce48d72209
commit 66d94ced8a
18 changed files with 1402 additions and 3 deletions

48
AZ.Compute/Web/js/app.js Normal file
View File

@@ -0,0 +1,48 @@
async function init() {
try {
connection = await wh.get(`iip://${window.location.hostname}`, {
autoReconnect: true
});
window.service = await connection.get("sys/service");
await app.setData(connection);
console.log(connection);
}
catch (ex)
{
alert(ex);
}
}
async function addJob() {
let cmd = prompt("Job command", "");
if (cmd != null) {
try {
await service.Compute(cmd, "");
} catch (ex) {
alert(ex);
}
}
}
async function addAgent() {
let ip = prompt("Agent IP or hostname", "");
if (ip != null) {
try {
await service.AddAgent(ip);
} catch (ex) {
alert(ex);
}
}
}
const FORMAT_CONNECTION_STATUS = (x) => ["Offline", "Connecting...", "Online"][x];