workflow_launcher/workflows/retrofit v2/run.js

30 lines
1.1 KiB
JavaScript
Raw Normal View History

let param = {
'workflow': 'retrofit v2',
'application': '',
'buildings': []
}
document.getElementById('runWorkflow').addEventListener('click', runWorkflow)
async function runWorkflow() {
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
})