mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-04 13:16:05 +08:00
Add pkg/harvester components + shell portings - 1
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
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`
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user