Skip to content

Commit ee5b01f

Browse files
authored
ui: Show host as unsecure in listview (#5292)
1 parent 766fc80 commit ee5b01f

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

ui/src/components/view/ListView.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,9 @@
135135
</span>
136136
<span v-else>{{ text }}</span>
137137
</span>
138-
<template slot="state" slot-scope="text">
139-
<status :text="text ? text : ''" displayText />
138+
<template slot="state" slot-scope="text, record">
139+
<status v-if="$route.path.startsWith('/host')" :text="getHostState(record)" displayText />
140+
<status v-else :text="text ? text : ''" displayText />
140141
</template>
141142
<template slot="allocationstate" slot-scope="text">
142143
<status :text="text ? text : ''" displayText />
@@ -578,6 +579,12 @@ export default {
578579
}
579580
580581
return record.nic.filter(e => { return e.ip6address }).map(e => { return e.ip6address }).join(', ') || text
582+
},
583+
getHostState (host) {
584+
if (host && host.hypervisor === 'KVM' && host.state === 'Up' && host.details && host.details.secured !== 'true') {
585+
return 'Unsecure'
586+
}
587+
return host.state
581588
}
582589
}
583590
}

ui/src/components/widgets/Status.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ export default {
127127
case 'created':
128128
case 'maintenance':
129129
case 'pending':
130+
case 'unsecure':
130131
status = 'warning'
131132
break
132133
}

0 commit comments

Comments
 (0)