ui: Show host as unsecure in listview (#5292)

This commit is contained in:
davidjumani 2021-08-09 13:34:56 +05:30 committed by GitHub
parent 766fc8031d
commit ee5b01f26a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -135,8 +135,9 @@
</span>
<span v-else>{{ text }}</span>
</span>
<template slot="state" slot-scope="text">
<status :text="text ? text : ''" displayText />
<template slot="state" slot-scope="text, record">
<status v-if="$route.path.startsWith('/host')" :text="getHostState(record)" displayText />
<status v-else :text="text ? text : ''" displayText />
</template>
<template slot="allocationstate" slot-scope="text">
<status :text="text ? text : ''" displayText />
@ -578,6 +579,12 @@ export default {
}
return record.nic.filter(e => { return e.ip6address }).map(e => { return e.ip6address }).join(', ') || text
},
getHostState (host) {
if (host && host.hypervisor === 'KVM' && host.state === 'Up' && host.details && host.details.secured !== 'true') {
return 'Unsecure'
}
return host.state
}
}
}

View File

@ -127,6 +127,7 @@ export default {
case 'created':
case 'maintenance':
case 'pending':
case 'unsecure':
status = 'warning'
break
}