enhance(frontend): federated instance icon with proxy (welcome entrance) (#12213)

This commit is contained in:
Caipira 2023-11-03 17:38:33 +09:00 committed by GitHub
parent afd3b5d472
commit 470a1c30e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,7 +24,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MarqueeText :duration="40"> <MarqueeText :duration="40">
<MkA v-for="instance in instances" :key="instance.id" :class="$style.federationInstance" :to="`/instance-info/${instance.host}`" behavior="window"> <MkA v-for="instance in instances" :key="instance.id" :class="$style.federationInstance" :to="`/instance-info/${instance.host}`" behavior="window">
<!--<MkInstanceCardMini :instance="instance"/>--> <!--<MkInstanceCardMini :instance="instance"/>-->
<img v-if="instance.iconUrl" class="icon" :src="instance.iconUrl" alt=""/> <img v-if="instance.iconUrl" class="icon" :src="getInstanceIcon(instance)" alt=""/>
<span class="name _monospace">{{ instance.host }}</span> <span class="name _monospace">{{ instance.host }}</span>
</MkA> </MkA>
</MarqueeText> </MarqueeText>
@ -46,10 +46,15 @@ import { instance } from '@/instance.js';
import number from '@/filters/number.js'; import number from '@/filters/number.js';
import MkNumber from '@/components/MkNumber.vue'; import MkNumber from '@/components/MkNumber.vue';
import MkVisitorDashboard from '@/components/MkVisitorDashboard.vue'; import MkVisitorDashboard from '@/components/MkVisitorDashboard.vue';
import { getProxiedImageUrl } from '@/scripts/media-proxy.js';
let meta = $ref<Misskey.entities.Instance>(); let meta = $ref<Misskey.entities.Instance>();
let instances = $ref<any[]>(); let instances = $ref<any[]>();
function getInstanceIcon(instance): string {
return getProxiedImageUrl(instance.iconUrl, 'preview');
}
os.api('meta', { detail: true }).then(_meta => { os.api('meta', { detail: true }).then(_meta => {
meta = _meta; meta = _meta;
}); });