feat: implement consistent 10-second data polling across dashboard and inspector components
Build and Push / build (nucleus, amd64, linux) (push) Successful in 16s

This commit is contained in:
2026-07-17 09:46:54 +01:00
parent 1796c1696f
commit 8b7f984ac0
4 changed files with 34 additions and 7 deletions
+11 -2
View File
@@ -55,7 +55,7 @@
</template>
<script setup>
import { ref, onMounted, computed } from 'vue'
import { ref, onMounted, onUnmounted, computed } from 'vue'
import { Chart as ChartJS, ArcElement, Tooltip, Legend, CategoryScale, LinearScale, BarElement, Title } from 'chart.js'
import { Pie, Bar } from 'vue-chartjs'
@@ -140,5 +140,14 @@ const trendOptions = {
}
}
onMounted(loadStats)
let pollInterval = null
onMounted(() => {
loadStats()
pollInterval = setInterval(loadStats, 10000)
})
onUnmounted(() => {
if (pollInterval) clearInterval(pollInterval)
})
</script>
+11 -2
View File
@@ -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>
+1 -1
View File
@@ -101,7 +101,7 @@ const totalFindings = (scan) => {
onMounted(() => {
loadScans()
interval = setInterval(loadScans, 5000)
interval = setInterval(loadScans, 10000)
})
onUnmounted(() => {
+11 -2
View File
@@ -80,7 +80,7 @@
</template>
<script setup>
import { ref, onMounted } from 'vue'
import { ref, onMounted, onUnmounted } from 'vue'
const targets = ref([])
const form = ref({ id: null, name: '', address: '', schedule: 'manual', customSchedule: '' })
@@ -170,5 +170,14 @@ const runScan = async (id) => {
loadTargets()
}
onMounted(loadTargets)
let pollInterval = null
onMounted(() => {
loadTargets()
pollInterval = setInterval(loadTargets, 10000)
})
onUnmounted(() => {
if (pollInterval) clearInterval(pollInterval)
})
</script>