fix(frontend): アクティビティウィジェットのグラフモードが動作しない問題を修正

This commit is contained in:
kakkokari-gtyih 2025-09-24 15:07:22 +09:00
parent 0f8c068e84
commit 2c6cefd1ac
2 changed files with 6 additions and 2 deletions

View File

@ -34,7 +34,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue'; import { onMounted, ref } from 'vue';
const props = defineProps<{ const props = defineProps<{
activity: { activity: {
total: number; total: number;
@ -94,6 +94,10 @@ function render() {
pointsTotal.value = activity.map((d, i) => `${(i * zoom.value) + pos.value},${(1 - (d.total / peak)) * viewBoxY.value}`).join(' '); pointsTotal.value = activity.map((d, i) => `${(i * zoom.value) + pos.value},${(1 - (d.total / peak)) * viewBoxY.value}`).join(' ');
} }
} }
onMounted(() => {
render();
});
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View File

@ -7,7 +7,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkContainer :showHeader="widgetProps.showHeader" :naked="widgetProps.transparent" data-cy-mkw-activity class="mkw-activity"> <MkContainer :showHeader="widgetProps.showHeader" :naked="widgetProps.transparent" data-cy-mkw-activity class="mkw-activity">
<template #icon><i class="ti ti-chart-line"></i></template> <template #icon><i class="ti ti-chart-line"></i></template>
<template #header>{{ i18n.ts._widgets.activity }}</template> <template #header>{{ i18n.ts._widgets.activity }}</template>
<template #func="{ buttonStyleClass }"><button class="_button" :class="buttonStyleClass" @click="toggleView()"><i class="ti ti-selector"></i></button></template> <template #func="{ buttonStyleClass }"><button class="_button" :class="buttonStyleClass" @click="toggleView()"><i :class="widgetProps.view === 0 ? 'ti ti-chart-line' : 'ti ti-activity'"></i></button></template>
<div> <div>
<MkLoading v-if="fetching"/> <MkLoading v-if="fetching"/>