30 lines
1.0 KiB
JavaScript
30 lines
1.0 KiB
JavaScript
let param = {
|
|
'workflow': 'retrofit',
|
|
'application': '',
|
|
'buildings': []
|
|
}
|
|
document.getElementById("runScenario").addEventListener("click", runScenario)
|
|
async function runScenario() {
|
|
try {
|
|
document.getElementById('links').innerHTML = '<img id="spinner" src="../../img/spinner.gif" width="50px" />'
|
|
document.getElementById('buildings').style.backgroundColor = "#FFFFFF"
|
|
param['application'] = document.getElementById('application').value
|
|
let buildingsString = document.getElementById('buildings').value
|
|
if (buildingsString == "")
|
|
{
|
|
document.getElementById('links').innerHTML = ''
|
|
document.getElementById('buildings').style.backgroundColor = "#FFAAAA"
|
|
return
|
|
}
|
|
buildings = buildingsString.replace('\r', '').replace('\n', '').replace('\t', '').split(';').map(e => e.trim())
|
|
param['buildings'] = buildings
|
|
console.log(buildings)
|
|
await window.functions.run(param)
|
|
}
|
|
catch(ex) {
|
|
alert(ex)
|
|
}
|
|
}
|
|
window.functions.onTaskCompleted((value) => {
|
|
document.getElementById('links').innerHTML = value
|
|
}) |