This commit is contained in:
syuilo 2022-12-27 12:43:21 +09:00
parent 2353b5f553
commit c213e28ad7
1 changed files with 76 additions and 54 deletions

View File

@ -1,8 +1,9 @@
<template> <template>
<div class="zbcjwnqg"> <div :class="$style.root">
<div class="main"> <MkFolder class="item">
<div class="body"> <template #header>Chart</template>
<div class="selects" style="display: flex;"> <div :class="$style.chart">
<div class="selects">
<MkSelect v-model="chartSrc" style="margin: 0; flex: 1;"> <MkSelect v-model="chartSrc" style="margin: 0; flex: 1;">
<optgroup :label="i18n.ts.federation"> <optgroup :label="i18n.ts.federation">
<option value="federation">{{ i18n.ts._charts.federation }}</option> <option value="federation">{{ i18n.ts._charts.federation }}</option>
@ -29,15 +30,23 @@
<option value="day">{{ i18n.ts.perDay }}</option> <option value="day">{{ i18n.ts.perDay }}</option>
</MkSelect> </MkSelect>
</div> </div>
<div class="chart"> <div class="chart _panel">
<MkChart :src="chartSrc" :span="chartSpan" :limit="chartLimit" :detailed="detailed"></MkChart> <MkChart :src="chartSrc" :span="chartSpan" :limit="chartLimit" :detailed="detailed"></MkChart>
</div> </div>
</div> </div>
</div> </MkFolder>
<div class="heatmap _panel">
<MkFolder class="item">
<template #header>Active users heatmap</template>
<div class="_panel" :class="$style.heatmap">
<MkActiveUsersHeatmap/> <MkActiveUsersHeatmap/>
</div> </div>
<div class="subpub"> </MkFolder>
<MkFolder class="item">
<template #header>Federation</template>
<div :class="$style.federation">
<div class="pies">
<div class="sub"> <div class="sub">
<div class="title">Sub</div> <div class="title">Sub</div>
<canvas ref="subDoughnutEl"></canvas> <canvas ref="subDoughnutEl"></canvas>
@ -48,6 +57,8 @@
</div> </div>
</div> </div>
</div> </div>
</MkFolder>
</div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
@ -76,6 +87,7 @@ import { useChartTooltip } from '@/scripts/use-chart-tooltip';
import * as os from '@/os'; import * as os from '@/os';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
import MkActiveUsersHeatmap from '@/components/MkActiveUsersHeatmap.vue'; import MkActiveUsersHeatmap from '@/components/MkActiveUsersHeatmap.vue';
import MkFolder from '@/components/MkFolder.vue';
Chart.register( Chart.register(
ArcElement, ArcElement,
@ -185,27 +197,36 @@ onMounted(() => {
}); });
</script> </script>
<style lang="scss" scoped> <style lang="scss" module>
.zbcjwnqg { .root {
> .main { &:global {
background: var(--panel); > .item {
border-radius: var(--radius);
padding: 24px;
margin-bottom: 16px; margin-bottom: 16px;
}
}
}
.chart {
&:global {
> .selects {
display: flex;
margin-bottom: 12px;
}
> .body {
> .chart { > .chart {
padding: 8px 0 0 0; padding: 16px;
} }
} }
} }
> .heatmap { .heatmap {
padding: 16px; padding: 16px;
margin-bottom: 16px; margin-bottom: 16px;
} }
> .subpub { .federation {
&:global {
> .pies {
display: flex; display: flex;
gap: 16px; gap: 16px;
@ -230,4 +251,5 @@ onMounted(() => {
} }
} }
} }
}
</style> </style>