workflow_launcher/renderer.js

24 lines
731 B
JavaScript
Raw Normal View History

2024-03-11 11:01:07 -04:00
const workflowsList = document.getElementById('workflows')
fetch('./workflows.json')
.then((response) => response.json())
.then((workflowsJson) => {
workflowsJson.workflows.forEach((site) => {
2024-03-12 08:38:55 -04:00
let li = document.createElement('li')
2024-05-24 02:25:41 -04:00
li.className = 'list-group-item'
2024-03-11 11:01:07 -04:00
let img = document.createElement('img')
let a = document.createElement('a')
img.src = site.logo
img.alt = site.name
a.href = site.script
2024-03-12 08:38:55 -04:00
let name = document.createTextNode(site.name)
2024-04-25 00:54:32 -04:00
let span = document.createElement('span')
2024-05-24 02:25:41 -04:00
span.className = 'p-1'
2024-03-11 11:01:07 -04:00
a.appendChild(img)
2024-04-25 00:54:32 -04:00
span.appendChild(name)
a.appendChild(span)
2024-03-11 11:01:07 -04:00
li.appendChild(a)
workflowsList.appendChild(li)
})
2024-05-24 02:25:41 -04:00
})
2024-03-11 11:01:07 -04:00