mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-13 13:11:43 +00:00
35 lines
876 B
JavaScript
35 lines
876 B
JavaScript
import { findBy } from '@shell/utils/array';
|
|
import { get } from '@shell/utils/object';
|
|
import { HCI } from '../types';
|
|
import HarvesterResource from './harvester';
|
|
|
|
export default class HciNodeNetwork extends HarvesterResource {
|
|
get message() {
|
|
const conditions = get(this, 'status.conditions');
|
|
|
|
return (findBy(conditions, 'type', 'Ready') || {}).message ;
|
|
}
|
|
|
|
get isReady() {
|
|
const conditions = get(this, 'status.conditions');
|
|
|
|
return (findBy(conditions, 'type', 'Ready') || {})?.status === 'True';
|
|
}
|
|
|
|
get nics() {
|
|
return this?.status?.nics || [];
|
|
}
|
|
|
|
get attachNodeName() {
|
|
return get(this, `metadata.labels."network.harvesterhci.io/nodename"`) || '';
|
|
}
|
|
|
|
get linkMessage() {
|
|
return {
|
|
name: this.attachNodeName,
|
|
message: this.message,
|
|
to: `${ HCI.HOST }/${ this.attachNodeName }?mode=edit`
|
|
};
|
|
}
|
|
}
|