This commit is contained in:
syuilo 2022-12-27 12:43:21 +09:00
parent 2353b5f553
commit c213e28ad7

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,24 +30,34 @@
<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">
<MkActiveUsersHeatmap/> <MkFolder class="item">
</div> <template #header>Active users heatmap</template>
<div class="subpub"> <div class="_panel" :class="$style.heatmap">
<div class="sub"> <MkActiveUsersHeatmap/>
<div class="title">Sub</div>
<canvas ref="subDoughnutEl"></canvas>
</div> </div>
<div class="pub"> </MkFolder>
<div class="title">Pub</div>
<canvas ref="pubDoughnutEl"></canvas> <MkFolder class="item">
<template #header>Federation</template>
<div :class="$style.federation">
<div class="pies">
<div class="sub">
<div class="title">Sub</div>
<canvas ref="subDoughnutEl"></canvas>
</div>
<div class="pub">
<div class="title">Pub</div>
<canvas ref="pubDoughnutEl"></canvas>
</div>
</div>
</div> </div>
</div> </MkFolder>
</div> </div>
</template> </template>
@ -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,48 +197,58 @@ onMounted(() => {
}); });
</script> </script>
<style lang="scss" scoped> <style lang="scss" module>
.zbcjwnqg { .root {
> .main { &:global {
background: var(--panel); > .item {
border-radius: var(--radius); margin-bottom: 16px;
padding: 24px;
margin-bottom: 16px;
> .body {
> .chart {
padding: 8px 0 0 0;
}
} }
} }
}
> .heatmap { .chart {
padding: 16px; &:global {
margin-bottom: 16px; > .selects {
} display: flex;
margin-bottom: 12px;
> .subpub {
display: flex;
gap: 16px;
> .sub, > .pub {
flex: 1;
min-width: 0;
position: relative;
background: var(--panel);
border-radius: var(--radius);
padding: 24px;
max-height: 300px;
> .title {
position: absolute;
top: 24px;
left: 24px;
}
} }
@media (max-width: 600px) { > .chart {
flex-direction: column; padding: 16px;
}
}
}
.heatmap {
padding: 16px;
margin-bottom: 16px;
}
.federation {
&:global {
> .pies {
display: flex;
gap: 16px;
> .sub, > .pub {
flex: 1;
min-width: 0;
position: relative;
background: var(--panel);
border-radius: var(--radius);
padding: 24px;
max-height: 300px;
> .title {
position: absolute;
top: 24px;
left: 24px;
}
}
@media (max-width: 600px) {
flex-direction: column;
}
} }
} }
} }