workflow_launcher/workflows/idf/run.js
2024-05-24 08:25:41 +02:00

30 lines
938 B
JavaScript

document.getElementById('runWorkflow').addEventListener('click', runWorkflow)
async function runWorkflow() {
let param = {
'workflow': 'idf',
'application': '',
'building': []
}
try {
document.getElementById('links').innerHTML = '<img id="spinner" src="../../img/spinner.gif" width="50px" />'
document.getElementById('building').style.backgroundColor = '#FFFFFF'
param['application'] = document.getElementById('application').value
let building = document.getElementById('building').value
if (building == '')
{
document.getElementById('links').innerHTML = ''
document.getElementById('building').style.backgroundColor = '#FFAAAA'
return
}
param['building'] = building
console.log(building)
await window.functions.run(param)
}
catch(ex) {
alert(ex)
}
}
window.functions.onTaskCompleted((value) => {
document.getElementById('links').innerHTML = value
})