Skip to content

Commit 764ee30

Browse files
authored
ui: fix zone icon in vm deploy zone selection (#6543)
* ui: fix zone icon in vm deploy zone selection Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com> * unnecessary conditions Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent 600d81e commit 764ee30

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

ui/src/components/view/ResourceIcon.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ export default {
4343
}
4444
},
4545
getDimensions () {
46+
const num = Number(this.size)
47+
if (Number.isInteger(num) && num > 0) {
48+
return num
49+
}
4650
switch (this.size) {
4751
case '4x':
4852
return 56

ui/src/views/compute/DeployVM.vue

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,11 @@
4545
<a-card-grid style="width:200px;" :title="zoneItem.name" :hoverable="false">
4646
<a-radio :value="zoneItem.id">
4747
<div>
48-
<img
48+
<resource-icon
4949
v-if="zoneItem && zoneItem.icon && zoneItem.icon.base64image"
50-
:src="getImg(zoneItem.icon.base64image)"
51-
style="marginTop: -30px; marginLeft: 60px"
52-
width="36px"
53-
height="36px" />
50+
:image="zoneItem.icon.base64image"
51+
size="36"
52+
style="marginTop: -30px; marginLeft: 60px" />
5453
<global-outlined v-else :style="{fontSize: '36px', marginLeft: '60px', marginTop: '-40px'}"/>
5554
</div>
5655
</a-radio>
@@ -1487,9 +1486,6 @@ export default {
14871486
'maxmemory' in serviceOffering.serviceofferingdetails && 'maxcpunumber' in serviceOffering.serviceofferingdetails &&
14881487
'minmemory' in serviceOffering.serviceofferingdetails
14891488
},
1490-
getImg (image) {
1491-
return 'data:image/png;charset=utf-8;base64, ' + image
1492-
},
14931489
updateOverrideRootDiskShowParam (val) {
14941490
if (val) {
14951491
this.showRootDiskSizeChanger = false

0 commit comments

Comments
 (0)