fix: fix start action button in ActionDetailsView.vue

This commit is contained in:
jamesread 2025-10-30 00:08:12 +00:00
parent 61fc771ac3
commit b9d859ada2
1 changed files with 21 additions and 1 deletions

View File

@ -90,7 +90,7 @@
</template> </template>
<script setup> <script setup>
import { ref, computed, onMounted } from 'vue' import { ref, computed, onMounted, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router' import { useRoute, useRouter } from 'vue-router'
import Pagination from '../components/Pagination.vue' import Pagination from '../components/Pagination.vue'
import Section from 'picocrank/vue/components/Section.vue' import Section from 'picocrank/vue/components/Section.vue'
@ -155,6 +155,16 @@ async function fetchAction() {
} }
} }
function resetState() {
action.value = null
actionTitle.value = 'Action Details'
logs.value = []
totalCount.value = 0
currentPage.value = 1
searchText.value = ''
loading.value = true
}
function clearSearch() { function clearSearch() {
searchText.value = '' searchText.value = ''
} }
@ -218,6 +228,16 @@ onMounted(() => {
fetchAction() fetchAction()
fetchActionLogs() fetchActionLogs()
}) })
watch(
() => route.params.actionId,
() => {
resetState()
fetchAction()
fetchActionLogs()
},
{ immediate: false }
)
</script> </script>
<style scoped> <style scoped>