Skip to content

Commit

Permalink
Simplify 'Proxmox Version' field showing only the actual value and no…
Browse files Browse the repository at this point in the history
…t entire JSON
  • Loading branch information
emersonfelipesp committed Oct 14, 2024
1 parent fdb45e3 commit fdef108
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions netbox_proxbox/templates/netbox_proxbox/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,28 @@ <h1>Log Messages</h1>
let elemento = document.getElementsByClassName("proxmox_version")

for (let item of elemento) {

let td = item.getElementsByTagName("td")

let td = item.getElementsByTagName("td")

if (td[0].id) {

let tdID = td[0].id
try {
request = await fetch(`${fastapi_endpoint}/proxmox/version?source=netbox&list_all=false&plugin_name=netbox_proxbox&domain=${td[0].id}`)
request = await fetch(`${fastapi_endpoint}/proxmox/version?source=netbox&list_all=false&plugin_name=netbox_proxbox&domain=${tdID}`)
response = await request.json()

console.log(response[0])
// console.log(response[0])
} catch (error) {
console.log(error)
}

td[0].textContent = JSON.stringify(response)
for (let value in response[0]) {
console.log(response[0][value].release)
console.log(response[0][value].repoid)
console.log(response[0][value].version)

td[0].textContent = response[0][value].version
}
//td[0].textContent = JSON.stringify(response[0][value].version)

}
}
Expand Down

0 comments on commit fdef108

Please sign in to comment.