From 62f52c829a6107f275df80dd2492a7184c6a4368 Mon Sep 17 00:00:00 2001 From: Vitalii Date: Thu, 27 Jul 2023 14:41:22 +0300 Subject: [PATCH] web/satellite/vuetify: add charts to project dashboard Imported chart components from main project to vuetify app project dashboard with slight updates. Issue: https://github.com/storj/storj/issues/6071 Change-Id: I51254ea60aab59c7a841784b5dac7d41446e1df4 --- .../project/dashboard/BandwidthChart.vue | 6 +- .../vuetify-poc/src/styles/styles.scss | 1 + .../vuetify-poc/src/views/Dashboard.vue | 124 +++++++++++++++++- 3 files changed, 125 insertions(+), 6 deletions(-) diff --git a/web/satellite/src/components/project/dashboard/BandwidthChart.vue b/web/satellite/src/components/project/dashboard/BandwidthChart.vue index 885c36698b50..591087a1ff95 100644 --- a/web/satellite/src/components/project/dashboard/BandwidthChart.vue +++ b/web/satellite/src/components/project/dashboard/BandwidthChart.vue @@ -29,6 +29,7 @@ const props = withDefaults(defineProps<{ before: Date, width: number, height: number, + isVuetify?: boolean, }>(), { settledData: () => [], allocatedData: () => [], @@ -36,6 +37,7 @@ const props = withDefaults(defineProps<{ before: () => new Date(), width: 0, height: 0, + isVuetify: false, }); const chartKey = ref(0); @@ -99,10 +101,10 @@ function tooltip(tooltipModel: TooltipModel): void { let tooltipParams: TooltipParams; if (p.datasetIndex === 0) { tooltipParams = new TooltipParams(tooltipModel, 'bandwidth-chart', 'settled-bandwidth-tooltip', - settledTooltipMarkUp(tooltipModel), -20, 78); + settledTooltipMarkUp(tooltipModel), -20, props.isVuetify ? 68 : 78); } else { tooltipParams = new TooltipParams(tooltipModel, 'bandwidth-chart', 'allocated-bandwidth-tooltip', - allocatedTooltipMarkUp(tooltipModel), 95, 78); + allocatedTooltipMarkUp(tooltipModel), 95, props.isVuetify ? 68 : 78); } Tooltip.custom(tooltipParams); diff --git a/web/satellite/vuetify-poc/src/styles/styles.scss b/web/satellite/vuetify-poc/src/styles/styles.scss index ebb750c069e5..ebca218e0bd0 100644 --- a/web/satellite/vuetify-poc/src/styles/styles.scss +++ b/web/satellite/vuetify-poc/src/styles/styles.scss @@ -10,6 +10,7 @@ */ @use './settings'; + @import 'static/styles/variables'; // Light Theme .v-theme--light { diff --git a/web/satellite/vuetify-poc/src/views/Dashboard.vue b/web/satellite/vuetify-poc/src/views/Dashboard.vue index 22cefd98916f..1a7842260f83 100644 --- a/web/satellite/vuetify-poc/src/views/Dashboard.vue +++ b/web/satellite/vuetify-poc/src/views/Dashboard.vue @@ -6,6 +6,39 @@ + + + + + + + + + + + + + @@ -45,20 +78,25 @@