From c9965758e76e1d83bff2a7c4b1955aba691727b6 Mon Sep 17 00:00:00 2001 From: naskya Date: Sun, 17 Sep 2023 09:38:37 +0900 Subject: [PATCH] feat: open instance info by clicking the ticker (close #68) --- README.md | 1 + packages/client/src/components/MkInstanceTicker.vue | 6 ++++++ packages/client/src/components/MkNoteHeader.vue | 1 + 3 files changed, 8 insertions(+) diff --git a/README.md b/README.md index dc0192ec..3c6a7a49 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ ## 細かい変更点 +- 投稿中に表示されるインスタンスティッカーをクリックするとサーバー情報を開くように - サーバー設定の初期値を変更 - 新規登録を無効化 - サーバーメトリクスの表示を有効化 diff --git a/packages/client/src/components/MkInstanceTicker.vue b/packages/client/src/components/MkInstanceTicker.vue index a365cbc8..ec577cc0 100644 --- a/packages/client/src/components/MkInstanceTicker.vue +++ b/packages/client/src/components/MkInstanceTicker.vue @@ -6,6 +6,7 @@ " class="hpaizdrt" :style="bg" + @click.stop="os.pageWindow(instanceInfoUrl)" > {{ instance.name }} @@ -18,6 +19,7 @@ import { ref } from "vue"; import { instanceName, version } from "@/config"; import { instance as Instance } from "@/instance"; import { getProxiedImageUrlNullable } from "@/scripts/media-proxy"; +import * as os from "@/os"; const props = defineProps<{ instance?: { @@ -27,6 +29,7 @@ const props = defineProps<{ softwareName?: string; softwareVersion?: string; }; + host: string | null; }>(); const ticker = ref(null); @@ -44,6 +47,9 @@ const instance = props.instance ?? { softwareVersion: version, }; +const instanceInfoUrl = + props.host == null ? "/about" : `/instance-info/${props.host}`; + const commonNames = new Map([ ["birdsitelive", "BirdsiteLIVE"], ["bookwyrm", "BookWyrm"], diff --git a/packages/client/src/components/MkNoteHeader.vue b/packages/client/src/components/MkNoteHeader.vue index c3429bdd..0ee93a09 100644 --- a/packages/client/src/components/MkNoteHeader.vue +++ b/packages/client/src/components/MkNoteHeader.vue @@ -40,6 +40,7 @@ v-if="showTicker" class="ticker" :instance="note.user.instance" + :host="note.user.host" />