Skip to content

Commit 3dbcc0a

Browse files
committed
ui: Show vm name in info card in deployvm
1 parent 5d36724 commit 3dbcc0a

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

ui/src/components/view/InfoCard.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,6 @@ export default {
713713
},
714714
data () {
715715
return {
716-
name: '',
717716
ipaddress: '',
718717
resourceType: '',
719718
annotationType: '',
@@ -769,10 +768,14 @@ export default {
769768
created () {
770769
this.setData()
771770
},
771+
computed: {
772+
name () {
773+
return this.resource.displayname || this.resource.displaytext || this.resource.name || this.resource.username ||
774+
this.resource.ipaddress || this.resource.virtualmachinename || this.resource.templatetype
775+
}
776+
},
772777
methods: {
773778
setData () {
774-
this.name = this.resource.displayname || this.resource.displaytext || this.resource.name || this.resource.username ||
775-
this.resource.ipaddress || this.resource.virtualmachinename || this.resource.templatetype
776779
if (this.resource.nic && this.resource.nic.length > 0) {
777780
this.ipaddress = this.resource.nic.filter(e => { return e.ipaddress }).map(e => { return e.ipaddress }).join(', ')
778781
} else {

ui/src/views/compute/DeployVM.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@
603603
</a-col>
604604
<a-col :md="24" :lg="7" v-if="!isMobile()">
605605
<a-affix :offsetTop="75">
606-
<info-card class="vm-info-card" :resource="vm" :title="vm.name ? this.$t('label.yourinstance') + ' : ' + vm.name : this.$t('label.yourinstance')" />
606+
<info-card class="vm-info-card" :resource="vm" :title="this.$t('label.yourinstance')" />
607607
</a-affix>
608608
</a-col>
609609
</a-row>

0 commit comments

Comments
 (0)