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:
@@ -55,7 +55,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<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 { Chart as ChartJS, ArcElement, Tooltip, Legend, CategoryScale, LinearScale, BarElement, Title } from 'chart.js'
|
||||||
import { Pie, Bar } from 'vue-chartjs'
|
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>
|
</script>
|
||||||
|
|||||||
@@ -81,7 +81,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, onMounted } from 'vue'
|
import { ref, computed, onMounted, onUnmounted } from 'vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
id: { type: String, required: true }
|
id: { type: String, required: true }
|
||||||
@@ -137,5 +137,14 @@ const severityClass = (sev) => {
|
|||||||
return map[sev] || map.info
|
return map[sev] || map.info
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(loadFindings)
|
let pollInterval = null
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
loadFindings()
|
||||||
|
pollInterval = setInterval(loadFindings, 10000)
|
||||||
|
})
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
if (pollInterval) clearInterval(pollInterval)
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ const totalFindings = (scan) => {
|
|||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
loadScans()
|
loadScans()
|
||||||
interval = setInterval(loadScans, 5000)
|
interval = setInterval(loadScans, 10000)
|
||||||
})
|
})
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
|
|||||||
@@ -80,7 +80,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted } from 'vue'
|
import { ref, onMounted, onUnmounted } from 'vue'
|
||||||
|
|
||||||
const targets = ref([])
|
const targets = ref([])
|
||||||
const form = ref({ id: null, name: '', address: '', schedule: 'manual', customSchedule: '' })
|
const form = ref({ id: null, name: '', address: '', schedule: 'manual', customSchedule: '' })
|
||||||
@@ -170,5 +170,14 @@ const runScan = async (id) => {
|
|||||||
loadTargets()
|
loadTargets()
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(loadTargets)
|
let pollInterval = null
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
loadTargets()
|
||||||
|
pollInterval = setInterval(loadTargets, 10000)
|
||||||
|
})
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
if (pollInterval) clearInterval(pollInterval)
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user