Skip to content

Commit 039e1ec

Browse files
committed
refactor
Signed-off-by: Abhishek Kumar <[email protected]>
1 parent c9aec4a commit 039e1ec

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

ui/src/components/view/InfoCard.vue

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
<edit-outlined class="upload-icon"/>
3131
</div>
3232
<slot name="avatar">
33-
<span v-if="(resource.icon && resource.icon.base64image || images.template || images.iso || resourceIcon) && !['router', 'systemvm', 'volume'].includes($route.path.split('/')[1])">
34-
<resource-icon :image="getImage(resource.icon && resource.icon.base64image || images.template || images.iso || resourceIcon)" size="4x" style="margin-right: 5px"/>
33+
<span v-if="resourceIcon && !['router', 'systemvm', 'volume'].includes($route.path.split('/')[1])">
34+
<resource-icon :image="resourceIcon" size="4x" style="margin-right: 5px"/>
3535
</span>
3636
<span v-else>
3737
<os-logo v-if="resource.ostypeid || resource.ostypename || ['guestoscategory'].includes($route.path.split('/')[1])" :osId="resource.ostypeid" :osName="resource.ostypename || resource.name" size="3x" @update-osname="setResourceOsType"/>
@@ -1010,15 +1010,16 @@ export default {
10101010
return [this.resource.keypairs.toString()]
10111011
},
10121012
resourceIcon () {
1013-
if (this.$showIcon()) {
1014-
if (this.resource?.icon?.base64image) {
1015-
return this.resource.icon.base64image
1016-
}
1017-
if (this.resource?.resourceIcon?.base64image) {
1018-
return this.resource.resourceIcon.base64image
1019-
}
1013+
if (!this.$showIcon()) {
1014+
return null
1015+
}
1016+
if (this.resource?.icon?.base64image) {
1017+
return this.resource.icon.base64image
1018+
}
1019+
if (this.resource?.resourceIcon?.base64image) {
1020+
return this.resource.resourceIcon.base64image
10201021
}
1021-
return null
1022+
return this.images.template || this.images.iso || null
10221023
},
10231024
routeFromResourceType () {
10241025
return this.$getRouteFromResourceType(this.resource.resourcetype)

0 commit comments

Comments
 (0)