up
This commit is contained in:
48
AZ.Compute/Web/js/app.js
Normal file
48
AZ.Compute/Web/js/app.js
Normal 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];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user