diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index db0bff1..8e38c30 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -38,28 +38,28 @@ repos: entry: make service-codestyle language: system pass_filenames: false - files: ^(service/|proto/|lang/) + files: ^(service/|proto/|lang/|Makefile) - id: frontend-codestyle name: frontend-codestyle entry: make frontend-codestyle language: system pass_filenames: false - files: ^frontend/ + files: ^(frontend/|Makefile) - id: service-unittests name: service-unittests entry: make service-unittests language: system pass_filenames: false - files: ^(service/|proto/|lang/) + files: ^(service/|proto/|lang/|Makefile) - id: service-build name: service-build entry: make service language: system pass_filenames: false - files: ^(service/|proto/|lang/) + files: ^(service/|proto/|lang/|Makefile) - id: it name: integration-tests diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 96ded27..4916cf4 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -33,7 +33,7 @@ "stylelint-config-standard": "^40.0.0" }, "engines": { - "node": ">=22.0.0" + "node": "^20.19.0 || >=22.12.0" } }, "node_modules/@babel/code-frame": { diff --git a/frontend/package.json b/frontend/package.json index 13ebbbb..e812077 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -41,6 +41,6 @@ "vue-router": "^5.1.0" }, "engines": { - "node": ">=22.0.0" + "node": "^20.19.0 || >=22.12.0" } } diff --git a/frontend/resources/vue/ActionButton.vue b/frontend/resources/vue/ActionButton.vue index 28b4c16..436556d 100644 --- a/frontend/resources/vue/ActionButton.vue +++ b/frontend/resources/vue/ActionButton.vue @@ -247,10 +247,16 @@ function updateFromJson (json) { if (json.datetimeRateLimitExpires) { const date = new Date(json.datetimeRateLimitExpires.replace(' ', 'T')) rateLimitExpires.value = date.getTime() / 1000 + if (bindingId.value) { + rateLimits[bindingId.value] = rateLimitExpires.value + } updateRateLimitStatus() } else if (json.datetimeRateLimitExpires === '') { // Explicitly clear if empty string rateLimitExpires.value = 0 + if (bindingId.value) { + rateLimits[bindingId.value] = 0 + } updateRateLimitStatus() } } @@ -359,6 +365,15 @@ async function pollExecutionUntilDone (trackingId) { } } +let stopButtonResultWatch = null + +function stopWatchingButtonResult () { + if (stopButtonResultWatch) { + stopButtonResultWatch() + stopButtonResultWatch = null + } +} + async function startAction (actionArgs) { buttonClasses.value = [] // Removes old animation classes @@ -376,7 +391,8 @@ async function startAction (actionArgs) { console.log('Watching buttonResults for', startActionArgs.uniqueTrackingId) - watch( + stopWatchingButtonResult() + stopButtonResultWatch = watch( () => buttonResults[startActionArgs.uniqueTrackingId], (newResult, oldResult) => { onLogEntryChanged(newResult) @@ -397,12 +413,18 @@ async function startAction (actionArgs) { await pollExecutionUntilDone(trackingId) } } catch (err) { + stopWatchingButtonResult() console.error('Failed to start action:', err) } } function onLogEntryChanged (logEntry) { + if (!logEntry) { + return + } + if (logEntry.executionFinished) { + stopWatchingButtonResult() onExecutionFinished(logEntry) } else if (logEntry.queued && !logEntry.executionStarted) { onExecutionQueued(logEntry) diff --git a/frontend/resources/vue/Dashboard.vue b/frontend/resources/vue/Dashboard.vue index 2ec8bc0..8f427cc 100644 --- a/frontend/resources/vue/Dashboard.vue +++ b/frontend/resources/vue/Dashboard.vue @@ -1,6 +1,6 @@