summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/MkChart.vue
diff options
context:
space:
mode:
authorかっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>2024-09-06 17:23:40 +0900
committerGitHub <noreply@github.com>2024-09-06 17:23:40 +0900
commit567acea2a3a040dbde69748deb2112e3ff2b92b8 (patch)
tree1edc2bfd473e25038c6188da6e428ffc001a5f47 /packages/frontend/src/components/MkChart.vue
parentfix(misskey-js): content-typeはapplication/jsonでないもののみを記... (diff)
downloadsharkey-567acea2a3a040dbde69748deb2112e3ff2b92b8.tar.gz
sharkey-567acea2a3a040dbde69748deb2112e3ff2b92b8.tar.bz2
sharkey-567acea2a3a040dbde69748deb2112e3ff2b92b8.zip
fix(frontend): instance infoページで不必要なapiリクエストが飛ぶのを抑止 (#14515)
* fix(frontend): instance infoページで不必要なapiリクエストが飛ぶのを抑止 * fix
Diffstat (limited to 'packages/frontend/src/components/MkChart.vue')
-rw-r--r--packages/frontend/src/components/MkChart.vue50
1 files changed, 26 insertions, 24 deletions
diff --git a/packages/frontend/src/components/MkChart.vue b/packages/frontend/src/components/MkChart.vue
index 4b24562249..57d325b11a 100644
--- a/packages/frontend/src/components/MkChart.vue
+++ b/packages/frontend/src/components/MkChart.vue
@@ -13,29 +13,8 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</template>
-<script lang="ts" setup>
-/* eslint-disable id-denylist --
- Chart.js has a `data` attribute in most chart definitions, which triggers the
- id-denylist violation when setting it. This is causing about 60+ lint issues.
- As this is part of Chart.js's API it makes sense to disable the check here.
-*/
-import { onMounted, ref, shallowRef, watch } from 'vue';
-import { Chart } from 'chart.js';
-import * as Misskey from 'misskey-js';
-import { misskeyApiGet } from '@/scripts/misskey-api.js';
-import { defaultStore } from '@/store.js';
-import { useChartTooltip } from '@/scripts/use-chart-tooltip.js';
-import { chartVLine } from '@/scripts/chart-vline.js';
-import { alpha } from '@/scripts/color.js';
-import date from '@/filters/date.js';
-import bytes from '@/filters/bytes.js';
-import { initChart } from '@/scripts/init-chart.js';
-import { chartLegend } from '@/scripts/chart-legend.js';
-import MkChartLegend from '@/components/MkChartLegend.vue';
-
-initChart();
-
-type ChartSrc =
+<script lang="ts">
+export type ChartSrc =
| 'federation'
| 'ap-request'
| 'users'
@@ -62,7 +41,30 @@ type ChartSrc =
| 'per-user-pv'
| 'per-user-following'
| 'per-user-followers'
- | 'per-user-drive'
+ | 'per-user-drive';
+</script>
+
+<script lang="ts" setup>
+/* eslint-disable id-denylist --
+ Chart.js has a `data` attribute in most chart definitions, which triggers the
+ id-denylist violation when setting it. This is causing about 60+ lint issues.
+ As this is part of Chart.js's API it makes sense to disable the check here.
+*/
+import { onMounted, ref, shallowRef, watch } from 'vue';
+import { Chart } from 'chart.js';
+import * as Misskey from 'misskey-js';
+import { misskeyApiGet } from '@/scripts/misskey-api.js';
+import { defaultStore } from '@/store.js';
+import { useChartTooltip } from '@/scripts/use-chart-tooltip.js';
+import { chartVLine } from '@/scripts/chart-vline.js';
+import { alpha } from '@/scripts/color.js';
+import date from '@/filters/date.js';
+import bytes from '@/filters/bytes.js';
+import { initChart } from '@/scripts/init-chart.js';
+import { chartLegend } from '@/scripts/chart-legend.js';
+import MkChartLegend from '@/components/MkChartLegend.vue';
+
+initChart();
const props = withDefaults(defineProps<{
src: ChartSrc;