Skip to content

Commit

Permalink
Add-on logo: Fix jdbc logos not loading & list-item logo distorted (#…
Browse files Browse the repository at this point in the history
…2440)

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
  • Loading branch information
florian-h05 committed Mar 1, 2024
1 parent 80e762e commit 64a1e0a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div v-else-if="addon.properties && addon.properties.views" slot="subtitle">
<addon-stats-line :addon="addon" :iconSize="15" />
</div>
<addon-logo slot="media" class="logo-square" :addon="addon" size="64" logo-width="54" />
<addon-logo slot="media" class="logo-square" :addon="addon" size="64" />
<div v-if="showInstallActions" slot="after">
<f7-preloader v-if="addon.pending" color="blue" />
<f7-button v-else-if="addon.installed" class="install-button prevent-active-state-propagation" text="Remove" color="red" round small @click="buttonClicked" />
Expand All @@ -37,6 +37,7 @@
.logo
margin-left 0
max-height 54px
max-width 54px
.item-media i
padding-left 3px
.item-after
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<template>
<div>
<f7-icon v-show="!logoLoaded" :size="size" color="gray" :f7="addonIcon" class="default-icon" style="padding-left: 0; opacity: 0.2; position: absolute" />
<img v-if="!svgLogoError" class="lazy logo" :style="imgStyle" :width="logoWidth" ref="svgLogo"
<img v-if="!svgLogoError" class="lazy logo" :style="imgStyle" ref="svgLogo"
:data-src="imageUrl('svg')">
<img v-else-if="!pngLogoError" class="logo" :style="imgStyle" ref="pngLogo"
:src="imageUrl('png')" :width="logoWidth" @load="logoLoaded = true" @error="pngLogoError = true">
:src="imageUrl('png')" @load="logoLoaded = true" @error="pngLogoError = true">
</div>
</template>

<script>
import { AddonIcons } from '@/assets/addon-store'
export default {
props: ['addon', 'size', 'logoWidth'],
props: ['addon', 'size'],
data () {
return {
addonIcon: AddonIcons[this.addon.type],
Expand All @@ -33,7 +33,7 @@ export default {
if (this.addon.imageLink) return this.addon.imageLink.replace(/^\/\//, 'https://')
let docsBranch = 'final'
if (this.$store.state.runtimeInfo.buildString === 'Release Build') docsBranch = 'final-stable'
return `https://raw.githubusercontent.com/openhab/openhab-docs/${docsBranch}/images/addons/${this.addon.id.substring(this.addon.id.indexOf('-') + 1)}.${type}`
return `https://raw.githubusercontent.com/openhab/openhab-docs/${docsBranch}/images/addons/${this.addon.id}.${type}`
}
},
mounted () {
Expand Down

0 comments on commit 64a1e0a

Please sign in to comment.