add: logo and icon fallback on server error
This commit is contained in:
parent
583d4913d9
commit
0db141cd13
5 changed files with 29 additions and 2 deletions
BIN
public/admin-logo.png
Normal file
BIN
public/admin-logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 34 KiB |
BIN
public/icon.png
Normal file
BIN
public/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 29 KiB |
|
@ -12,6 +12,7 @@
|
|||
<Teleport to="head">
|
||||
<title>{{ clubName }}</title>
|
||||
<link rel="icon" type="image/ico" :href="config.server_address + '/api/public/favicon.ico'" />
|
||||
<link rel="icon" type="image/png" href="/icon.png" />
|
||||
<link rel="manifest" :href="config.server_address + '/api/public/manifest.webmanifest'" />
|
||||
</Teleport>
|
||||
</template>
|
||||
|
|
|
@ -1,5 +1,13 @@
|
|||
<template>
|
||||
<img ref="icon" :src="url + '/api/public/icon.png'" alt="LOGO" class="h-full w-auto" />
|
||||
<img v-if="useFallback" ref="fallback" src="/icon.png" alt="LOGO" class="h-full w-auto" />
|
||||
<img
|
||||
v-else
|
||||
ref="icon"
|
||||
:src="url + '/api/public/icon.png'"
|
||||
alt="LOGO"
|
||||
class="h-full w-auto"
|
||||
@error="useFallback = true"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
@ -16,6 +24,11 @@ export default defineComponent({
|
|||
(this.$refs.icon as HTMLImageElement).src = url + "/api/public/icon.png?" + new Date().getTime();
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
useFallback: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState(useSettingStore, ["readSetting"]),
|
||||
icon() {
|
||||
|
|
|
@ -1,5 +1,13 @@
|
|||
<template>
|
||||
<img ref="logo" :src="url + '/api/public/applogo.png'" alt="LOGO" class="h-full w-auto" />
|
||||
<img v-if="useFallback" ref="fallback" src="/admin-logo.png" alt="LOGO" class="h-full w-auto" />
|
||||
<img
|
||||
v-else
|
||||
ref="logo"
|
||||
:src="url + '/api/public/applogo.png'"
|
||||
alt="LOGO"
|
||||
class="h-full w-auto"
|
||||
@error="useFallback = true"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
@ -16,6 +24,11 @@ export default defineComponent({
|
|||
(this.$refs.logo as HTMLImageElement).src = url + "/api/public/applogo.png?t=" + new Date().getTime();
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
useFallback: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState(useSettingStore, ["readSetting"]),
|
||||
logo() {
|
||||
|
|
Loading…
Add table
Reference in a new issue