workflow_launcher/renderer.js
2024-03-12 13:38:55 +01:00

22 lines
655 B
JavaScript

const workflowsList = document.getElementById('workflows')
fetch('./workflows.json')
.then((response) => response.json())
.then((workflowsJson) => {
workflowsJson.workflows.forEach((site) => {
let li = document.createElement('li')
li.className = "list-group-item"
let img = document.createElement('img')
let a = document.createElement('a')
img.src = site.logo
img.alt = site.name
a.href = site.script
let name = document.createTextNode(site.name)
name.className = "p-1"
a.appendChild(img)
a.appendChild(name)
li.appendChild(a)
workflowsList.appendChild(li)
})
});