feat: implement consistent 10-second data polling across dashboard and inspector components
Build and Push / build (nucleus, amd64, linux) (push) Successful in 16s
Build and Push / build (nucleus, amd64, linux) (push) Successful in 16s
This commit is contained in:
@@ -81,7 +81,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import { ref, computed, onMounted, onUnmounted } from 'vue'
|
||||
|
||||
const props = defineProps({
|
||||
id: { type: String, required: true }
|
||||
@@ -137,5 +137,14 @@ const severityClass = (sev) => {
|
||||
return map[sev] || map.info
|
||||
}
|
||||
|
||||
onMounted(loadFindings)
|
||||
let pollInterval = null
|
||||
|
||||
onMounted(() => {
|
||||
loadFindings()
|
||||
pollInterval = setInterval(loadFindings, 10000)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
if (pollInterval) clearInterval(pollInterval)
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user