mirror of
https://github.com/OliveTin/OliveTin
synced 2025-12-14 18:15:37 +00:00
feature: HTML/JS/CSS minifiction and cache busting
This commit is contained in:
34
webui.dev/js/ExecutionButton.js
Normal file
34
webui.dev/js/ExecutionButton.js
Normal file
@@ -0,0 +1,34 @@
|
||||
import { ExecutionFeedbackButton } from './ExecutionFeedbackButton.js'
|
||||
|
||||
class ExecutionButton extends ExecutionFeedbackButton {
|
||||
constructFromJson (json) {
|
||||
this.executionUuid = json
|
||||
this.ellapsed = 0
|
||||
|
||||
this.appendChild(document.createElement('button'))
|
||||
this.isWaiting = true
|
||||
|
||||
this.setAttribute('id', 'execution-' + json)
|
||||
|
||||
this.btn = this.querySelector('button')
|
||||
this.btn.innerText = 'Executing...'
|
||||
this.btn.onclick = () => {
|
||||
this.show()
|
||||
}
|
||||
|
||||
this.domTitle = this.btn
|
||||
}
|
||||
|
||||
show () {
|
||||
window.executionDialog.reset()
|
||||
window.executionDialog.show()
|
||||
window.executionDialog.fetchExecutionResult(this.executionUuid)
|
||||
}
|
||||
|
||||
onExecStatusChanged () {
|
||||
this.domTitle.innerText = this.ellapsed + 's'
|
||||
this.btn.title = this.ellapsed + ' seconds'
|
||||
}
|
||||
}
|
||||
|
||||
window.customElements.define('execution-button', ExecutionButton)
|
||||
Reference in New Issue
Block a user