fix(client): use proxied image for instance icon
This commit is contained in:
parent
d73cc8f9b8
commit
e4c2bba89a
4 changed files with 18 additions and 3 deletions
|
|
@ -6,7 +6,7 @@
|
|||
<MkLoading v-if="fetching"/>
|
||||
<transition-group v-else tag="div" :name="$store.state.animation ? 'chart' : ''" class="instances">
|
||||
<div v-for="(instance, i) in instances" :key="instance.id" class="instance">
|
||||
<img v-if="instance.iconUrl" :src="instance.iconUrl" alt=""/>
|
||||
<img :src="getInstanceIcon(instance)" alt=""/>
|
||||
<div class="body">
|
||||
<a class="a" :href="'https://' + instance.host" target="_blank" :title="instance.host">{{ instance.host }}</a>
|
||||
<p>{{ instance.softwareName || '?' }} {{ instance.softwareVersion }}</p>
|
||||
|
|
@ -27,6 +27,7 @@ import MkMiniChart from '@/components/MkMiniChart.vue';
|
|||
import * as os from '@/os';
|
||||
import { useInterval } from '@/scripts/use-interval';
|
||||
import { i18n } from '@/i18n';
|
||||
import { getProxiedImageUrlNullable } from '@/scripts/media-proxy';
|
||||
|
||||
const name = 'federation';
|
||||
|
||||
|
|
@ -71,6 +72,10 @@ useInterval(fetch, 1000 * 60, {
|
|||
afterMounted: true,
|
||||
});
|
||||
|
||||
function getInstanceIcon(instance): string {
|
||||
return getProxiedImageUrlNullable(instance.iconUrl, 'preview') ?? getProxiedImageUrlNullable(instance.faviconUrl, 'preview') ?? '/client-assets/dummy.png';
|
||||
}
|
||||
|
||||
defineExpose<WidgetComponentExpose>({
|
||||
name,
|
||||
configure,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue