diff --git a/src/runboat/webui-templates/runboat-build-element.js b/src/runboat/webui-templates/runboat-build-element.js index 214a188..d2580c6 100644 --- a/src/runboat/webui-templates/runboat-build-element.js +++ b/src/runboat/webui-templates/runboat-build-element.js @@ -76,24 +76,32 @@ class RunboatBuildElement extends LitElement { }
- - - + + +
`; } startHandler(e) { - fetch(`/api/v1/builds/${this.build.name}/start`, {method: 'POST'}); + this.actionHandler("start"); } stopHandler(e) { - fetch(`/api/v1/builds/${this.build.name}/stop`, {method: 'POST'}); + this.actionHandler("stop"); } resetHandler(e) { - fetch(`/api/v1/builds/${this.build.name}/reset`, {method: 'POST'}); + this.actionHandler("reset"); + } + + static clickedStatus = "⏳"; + + actionHandler(action) { + this.build.status = RunboatBuildElement.clickedStatus; + this.requestUpdate(); + fetch(`/api/v1/builds/${this.build.name}/${action}`, {method: 'POST'}); } }