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': '',
|
2024-05-30 01:20:18 -04:00
|
|
|
'building': '',
|
|
|
|
'scenario': 'current status'
|
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
|
|
|
|
await window.functions.run(param)
|
|
|
|
}
|
|
|
|
catch(ex) {
|
|
|
|
alert(ex)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
window.functions.onTaskCompleted((value) => {
|
|
|
|
document.getElementById('links').innerHTML = value
|
|
|
|
})
|