workflow_launcher/workflows/idf/run.js

30 lines
938 B
JavaScript
Raw Normal View History

2024-05-24 02:25:41 -04:00
document.getElementById('runWorkflow').addEventListener('click', runWorkflow)
async function runWorkflow() {
let param = {
2024-05-20 01:15:14 -04:00
'workflow': 'idf',
'application': '',
'building': []
2024-05-24 02:25:41 -04:00
}
2024-05-20 01:15:14 -04:00
try {
document.getElementById('links').innerHTML = '<img id="spinner" src="../../img/spinner.gif" width="50px" />'
2024-05-24 02:25:41 -04:00
document.getElementById('building').style.backgroundColor = '#FFFFFF'
2024-05-20 01:15:14 -04:00
param['application'] = document.getElementById('application').value
let building = document.getElementById('building').value
2024-05-24 02:25:41 -04:00
if (building == '')
2024-05-20 01:15:14 -04:00
{
document.getElementById('links').innerHTML = ''
2024-05-24 02:25:41 -04:00
document.getElementById('building').style.backgroundColor = '#FFAAAA'
2024-05-20 01:15:14 -04:00
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
})