From 311478e7253f7c55568809739316c6e0a28dd91b Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 26 Jun 2022 15:54:07 +0900 Subject: [PATCH] chore(client): tweak client --- packages/client/src/components/instance-card-mini.vue | 10 ++++++---- packages/client/src/components/user-card-mini.vue | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/packages/client/src/components/instance-card-mini.vue b/packages/client/src/components/instance-card-mini.vue index de16dacf7b..72d83bd992 100644 --- a/packages/client/src/components/instance-card-mini.vue +++ b/packages/client/src/components/instance-card-mini.vue @@ -5,7 +5,7 @@ {{ instance.name ?? instance.host }} {{ instance.host }} / {{ instance.softwareName || '?' }} {{ instance.softwareVersion }} - + @@ -18,10 +18,12 @@ const props = defineProps<{ instance: misskey.entities.Instance; }>(); -const chart = $ref(null); +let chartValues = $ref(null); -os.apiGet('charts/instance', { host: props.instance.host, limit: 16, span: 'day' }).then(res => { - chart = res; +os.apiGet('charts/instance', { host: props.instance.host, limit: 16 + 1, span: 'day' }).then(res => { + // 今日のぶんの値はまだ途中の値であり、それも含めると大抵の場合前日よりも下降しているようなグラフになってしまうため今日は弾く + res.requests.received.splice(0, 1); + chartValues = res.requests.received; }); diff --git a/packages/client/src/components/user-card-mini.vue b/packages/client/src/components/user-card-mini.vue index 2c3e0fe956..997431d1ba 100644 --- a/packages/client/src/components/user-card-mini.vue +++ b/packages/client/src/components/user-card-mini.vue @@ -5,7 +5,7 @@ @{{ acct(user) }} - + @@ -19,10 +19,12 @@ const props = defineProps<{ user: misskey.entities.User; }>(); -const chart = $ref(null); +let chartValues = $ref(null); -os.apiGet('charts/user/notes', { userId: props.user.id, limit: 16, span: 'day' }).then(res => { - chart = res; +os.apiGet('charts/user/notes', { userId: props.user.id, limit: 16 + 1, span: 'day' }).then(res => { + // 今日のぶんの値はまだ途中の値であり、それも含めると大抵の場合前日よりも下降しているようなグラフになってしまうため今日は弾く + res.inc.splice(0, 1); + chartValues = res.inc; });