graphs: make top level div and clean the timer
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<script setup>
|
||||
|
||||
import moment from 'moment-timezone';
|
||||
import { onMounted, useTemplateRef, watch } from 'vue';
|
||||
import { onMounted, onUnmounted, useTemplateRef, watch } from 'vue';
|
||||
import Chart from 'chart.js/auto';
|
||||
import { prettyDecimalSize } from 'pankow/utils';
|
||||
|
||||
@@ -216,6 +216,10 @@ onMounted(async function () {
|
||||
await onPeriodChanged();
|
||||
});
|
||||
|
||||
onUnmounted(async function () {
|
||||
if (liveRefreshIntervalId) clearInterval(liveRefreshIntervalId);
|
||||
});
|
||||
|
||||
defineExpose({
|
||||
setData,
|
||||
pushData,
|
||||
@@ -224,9 +228,11 @@ defineExpose({
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<label>{{ title }} <span class="pull-right text-small">{{ subtext }}</span></label>
|
||||
<div class="graph">
|
||||
<canvas ref="graphNode"></canvas>
|
||||
<div>
|
||||
<label>{{ title }} <span class="pull-right text-small">{{ subtext }}</span></label>
|
||||
<div class="graph">
|
||||
<canvas ref="graphNode"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user