Add a new dashboard page.
This commit is contained in:
parent
89150e1164
commit
fd24b1898e
133 changed files with 17303 additions and 11112 deletions
30
webui/src/components/_commons/ChartDoughnut.vue
Normal file
30
webui/src/components/_commons/ChartDoughnut.vue
Normal file
|
@ -0,0 +1,30 @@
|
|||
<script>
|
||||
import { Doughnut } from 'vue-chartjs'
|
||||
|
||||
export default {
|
||||
extends: Doughnut,
|
||||
props: {
|
||||
chartdata: {
|
||||
type: Object,
|
||||
default: null
|
||||
},
|
||||
options: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
chartdata: function (newData, oldData) {
|
||||
// TODO - bug, 'update()' not update the chart, remplace for renderChart()
|
||||
// console.log('new data from watcher...', newData, oldData, this.$_.isEqual(newData.datasets[0].data, oldData.datasets[0].data))
|
||||
if (!this.$_.isEqual(newData.datasets[0].data, oldData.datasets[0].data)) {
|
||||
// this.$data._chart.update()
|
||||
this.renderChart(this.chartdata, this.options)
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.renderChart(this.chartdata, this.options)
|
||||
}
|
||||
}
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue