first commit

This commit is contained in:
2026-04-09 13:05:27 +02:00
commit 3bbd7d6413
3084 changed files with 84284 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
let groupname = context.panel.elements.find(e => e.id === "groupname")?.value;
async function ejecutarPeticion() {
async function getToken() {
let token = null;
const res = await fetch("http://localhost:8080/api_jsonrpc.php", {
method: "GET",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
jsonrpc: "2.0",
method: "user.login",
params: {
username: "Admin",
password: "zabbix"
},
id: 1
})
});
const data = await res.json();
token = data.result;
return token;
}
let token = await getToken();
let groupRes = await fetch("http://localhost:8080/api_jsonrpc.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer " + token
},
body: JSON.stringify({
jsonrpc: "2.0",
method: "hostgroup.get",
params: {
output: "extend",
filter: { name: "" + groupName }
},
id: 2
})
});
return petition;
}
return ejecutarPeticion();