30 lines
946 B
JavaScript
30 lines
946 B
JavaScript
|
|
document.getElementById('runWorkflow').addEventListener('click', runWorkflow)
|
|
async function runWorkflow() {
|
|
let param = {
|
|
'workflow': 'idf',
|
|
'application': '',
|
|
'building': '',
|
|
'scenario': 'current status'
|
|
}
|
|
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
|
|
await window.functions.run(param)
|
|
}
|
|
catch(ex) {
|
|
alert(ex)
|
|
}
|
|
}
|
|
window.functions.onTaskCompleted((value) => {
|
|
document.getElementById('links').innerHTML = value
|
|
}) |