Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/dispatch/static/dispatch/src/dashboard/DashboardCard.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<template>
<v-card variant="outlined" :loading="loading">
<v-card-title>{{ title }}</v-card-title>
<apexchart :type="type" height="250" :options="localOptions" :series="series" />
<apexchart :type="type" height="250" :options="localOptions" :series="sanitize(series)" />
</v-card>
</template>

<script>
import VueApexCharts from "vue3-apexcharts"
import DOMPurify from "dompurify"

export default {
name: "DashboardCard",

Expand Down Expand Up @@ -40,7 +42,13 @@ export default {
required: true,
},
},

methods: {
sanitize(series) {
return series.map((s) => {
return { name: DOMPurify.sanitize(s.name), data: s.data }
})
},
},
data() {
return {
localOptions: JSON.parse(JSON.stringify(this.options)),
Expand Down
Loading