mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-03 20:56:06 +08:00
Compare commits
4
Commits
v1.6.0-rc6
..
v1.6.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
19b6842b21 | ||
|
|
fa78229d3a | ||
|
|
c3bfaf00ea | ||
|
|
1a176960bc |
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "harvester-ui-extension",
|
"name": "harvester-ui-extension",
|
||||||
"version": "1.6.0-rc6",
|
"version": "1.6.0",
|
||||||
"private": false,
|
"private": false,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20.0.0"
|
"node": ">=20.0.0"
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import { HCI } from '../types';
|
||||||
|
|
||||||
// TODO: delete this not used variable
|
// TODO: delete this not used variable
|
||||||
export const MemoryUnit = [{
|
export const MemoryUnit = [{
|
||||||
label: 'Mi',
|
label: 'Mi',
|
||||||
@@ -81,3 +83,14 @@ export const CSI_SECRETS = {
|
|||||||
CSI_NODE_STAGE_SECRET_NAME: 'csi.storage.k8s.io/node-stage-secret-name',
|
CSI_NODE_STAGE_SECRET_NAME: 'csi.storage.k8s.io/node-stage-secret-name',
|
||||||
CSI_NODE_STAGE_SECRET_NAMESPACE: 'csi.storage.k8s.io/node-stage-secret-namespace',
|
CSI_NODE_STAGE_SECRET_NAMESPACE: 'csi.storage.k8s.io/node-stage-secret-namespace',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Some harvester CRD type is not equal to model file name, define the mapping here
|
||||||
|
export const HARVESTER_CRD_MAP = {
|
||||||
|
node: HCI.HOST,
|
||||||
|
configmap: HCI.CLOUD_TEMPLATE,
|
||||||
|
persistentvolumeclaim: HCI.VOLUME,
|
||||||
|
'snapshot.storage.k8s.io.volumesnapshot': HCI.SNAPSHOT,
|
||||||
|
// specific groupable table detail page
|
||||||
|
'network.harvesterhci.io.vlanconfig': HCI.CLUSTER_NETWORK,
|
||||||
|
'kubeovn.io.subnet': HCI.VPC
|
||||||
|
};
|
||||||
|
|||||||
@@ -257,6 +257,7 @@ export default {
|
|||||||
:label="t('harvester.vmTemplate.tabs.basics')"
|
:label="t('harvester.vmTemplate.tabs.basics')"
|
||||||
>
|
>
|
||||||
<CpuMemory
|
<CpuMemory
|
||||||
|
class="mb-20"
|
||||||
:cpu="cpu"
|
:cpu="cpu"
|
||||||
:memory="memory"
|
:memory="memory"
|
||||||
:max-cpu="maxCpu"
|
:max-cpu="maxCpu"
|
||||||
|
|||||||
@@ -240,7 +240,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="mt-20">
|
<div>
|
||||||
<LabeledSelect
|
<LabeledSelect
|
||||||
v-model:value="checkedSsh"
|
v-model:value="checkedSsh"
|
||||||
:label="t('harvester.virtualMachine.input.sshKey')"
|
:label="t('harvester.virtualMachine.input.sshKey')"
|
||||||
|
|||||||
@@ -605,6 +605,7 @@ export default {
|
|||||||
:label="t('harvester.virtualMachine.detail.tabs.basics')"
|
:label="t('harvester.virtualMachine.detail.tabs.basics')"
|
||||||
>
|
>
|
||||||
<CpuMemory
|
<CpuMemory
|
||||||
|
class="mb-20"
|
||||||
:cpu="cpu"
|
:cpu="cpu"
|
||||||
:max-cpu="maxCpu"
|
:max-cpu="maxCpu"
|
||||||
:memory="memory"
|
:memory="memory"
|
||||||
|
|||||||
@@ -691,10 +691,13 @@ export default {
|
|||||||
this.spec.template.spec.domain.cpu.cores = this.cpu;
|
this.spec.template.spec.domain.cpu.cores = this.cpu;
|
||||||
this.spec.template.spec.domain.resources.limits.cpu = this.cpu?.toString();
|
this.spec.template.spec.domain.resources.limits.cpu = this.cpu?.toString();
|
||||||
this.spec.template.spec.domain.resources.limits.memory = this.memory;
|
this.spec.template.spec.domain.resources.limits.memory = this.memory;
|
||||||
// clean
|
// clean below fields as we don't need them if not enable CPU and memory hotplug
|
||||||
delete this.spec.template.spec.resources;
|
if (this.spec?.template?.spec?.domain?.cpu?.maxSockets) {
|
||||||
delete this.spec.template.spec.domain.memory;
|
delete this.spec.template.spec.domain.cpu.maxSockets;
|
||||||
delete this.spec.template.spec.domain.cpu.maxSockets;
|
}
|
||||||
|
if (this.spec?.template?.spec?.domain?.memory?.maxGuest) {
|
||||||
|
delete this.spec.template.spec.domain.memory.maxGuest;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,19 @@
|
|||||||
import SteveModel from '@shell/plugins/steve/steve-class';
|
import SteveModel from '@shell/plugins/steve/steve-class';
|
||||||
import { VIEW_IN_API, DEV } from '@shell/store/prefs';
|
import { VIEW_IN_API, DEV } from '@shell/store/prefs';
|
||||||
import { PRODUCT_NAME as HARVESTER_PRODUCT } from '../config/harvester';
|
import { PRODUCT_NAME as HARVESTER_PRODUCT } from '../config/harvester';
|
||||||
|
import { HARVESTER_CRD_MAP } from '../config/harvester-map';
|
||||||
|
|
||||||
export default class HarvesterResource extends SteveModel {
|
export default class HarvesterResource extends SteveModel {
|
||||||
get listLocation() {
|
get listLocation() {
|
||||||
const name = this.harvesterResourcesInExplorer ? 'c-cluster-product-resource' : `${ HARVESTER_PRODUCT }-c-cluster-resource`;
|
const name = this.harvesterResourcesInExplorer ? 'c-cluster-product-resource' : `${ HARVESTER_PRODUCT }-c-cluster-resource`;
|
||||||
|
const resource = HARVESTER_CRD_MAP[this.type] || this.type;
|
||||||
|
|
||||||
return this.$rootGetters['type-map/optionsFor'](this.type).customRoute || {
|
return this.$rootGetters['type-map/optionsFor'](this.type).customRoute || {
|
||||||
name,
|
name,
|
||||||
params: {
|
params: {
|
||||||
product: this.$rootGetters['productId'],
|
product: this.$rootGetters['productId'],
|
||||||
cluster: this.$rootGetters['clusterId'],
|
cluster: this.$rootGetters['clusterId'],
|
||||||
resource: this.type,
|
resource
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// This file is Cloud Configuration Templates page model
|
||||||
import { clone } from '@shell/utils/object';
|
import { clone } from '@shell/utils/object';
|
||||||
import { HCI } from '../../types';
|
import { HCI } from '../../types';
|
||||||
import HarvesterResource from '../harvester';
|
import HarvesterResource from '../harvester';
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export default class HarvesterNetworkAttachmentDef extends NetworkAttachmentDef
|
|||||||
params: {
|
params: {
|
||||||
product: HARVESTER_PRODUCT,
|
product: HARVESTER_PRODUCT,
|
||||||
cluster: this.$rootGetters['clusterId'],
|
cluster: this.$rootGetters['clusterId'],
|
||||||
resource: this.type,
|
resource: HCI.NETWORK_ATTACHMENT,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,19 @@ export default class HciClusterflow extends HarvesterFlow {
|
|||||||
return this.$rootGetters['harvester/all'](LOGGING.CLUSTER_OUTPUT) || [];
|
return this.$rootGetters['harvester/all'](LOGGING.CLUSTER_OUTPUT) || [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get listLocation() {
|
||||||
|
const listLocation = clone(super.listLocation);
|
||||||
|
|
||||||
|
listLocation.name = this.harvesterResourcesInExplorer ? 'c-cluster-product-resource' : `${ HARVESTER_PRODUCT }-c-cluster-resource`;
|
||||||
|
listLocation.params.resource = HCI.CLUSTER_FLOW;
|
||||||
|
|
||||||
|
return listLocation;
|
||||||
|
}
|
||||||
|
|
||||||
|
get harvesterResourcesInExplorer() {
|
||||||
|
return this.$rootGetters['productId'] !== HARVESTER_PRODUCT;
|
||||||
|
}
|
||||||
|
|
||||||
get _detailLocation() {
|
get _detailLocation() {
|
||||||
const schema = this.$getters['schemaFor'](this.type);
|
const schema = this.$getters['schemaFor'](this.type);
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,19 @@ export default class HciClusteroutput extends LogOutput {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get listLocation() {
|
||||||
|
const listLocation = clone(super.listLocation);
|
||||||
|
|
||||||
|
listLocation.name = this.harvesterResourcesInExplorer ? 'c-cluster-product-resource' : `${ HARVESTER_PRODUCT }-c-cluster-resource`;
|
||||||
|
listLocation.params.resource = HCI.CLUSTER_OUTPUT;
|
||||||
|
|
||||||
|
return listLocation;
|
||||||
|
}
|
||||||
|
|
||||||
|
get harvesterResourcesInExplorer() {
|
||||||
|
return this.$rootGetters['productId'] !== HARVESTER_PRODUCT;
|
||||||
|
}
|
||||||
|
|
||||||
get detailLocation() {
|
get detailLocation() {
|
||||||
const detailLocation = clone(this._detailLocation);
|
const detailLocation = clone(this._detailLocation);
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,19 @@ export default class HarvesterLogFlow extends Flow {
|
|||||||
return this.$rootGetters['harvester/all'](LOGGING.CLUSTER_OUTPUT) || [];
|
return this.$rootGetters['harvester/all'](LOGGING.CLUSTER_OUTPUT) || [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get listLocation() {
|
||||||
|
const listLocation = clone(super.listLocation);
|
||||||
|
|
||||||
|
listLocation.name = this.harvesterResourcesInExplorer ? 'c-cluster-product-resource' : `${ HARVESTER_PRODUCT }-c-cluster-resource`;
|
||||||
|
listLocation.params.resource = HCI.FLOW;
|
||||||
|
|
||||||
|
return listLocation;
|
||||||
|
}
|
||||||
|
|
||||||
|
get harvesterResourcesInExplorer() {
|
||||||
|
return this.$rootGetters['productId'] !== HARVESTER_PRODUCT;
|
||||||
|
}
|
||||||
|
|
||||||
get _detailLocation() {
|
get _detailLocation() {
|
||||||
const schema = this.$getters['schemaFor'](this.type);
|
const schema = this.$getters['schemaFor'](this.type);
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,19 @@ export default class HarvesterLogOutput extends LogOutput {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get listLocation() {
|
||||||
|
const listLocation = clone(super.listLocation);
|
||||||
|
|
||||||
|
listLocation.name = this.harvesterResourcesInExplorer ? 'c-cluster-product-resource' : `${ HARVESTER_PRODUCT }-c-cluster-resource`;
|
||||||
|
listLocation.params.resource = HCI.OUTPUT;
|
||||||
|
|
||||||
|
return listLocation;
|
||||||
|
}
|
||||||
|
|
||||||
|
get harvesterResourcesInExplorer() {
|
||||||
|
return this.$rootGetters['productId'] !== HARVESTER_PRODUCT;
|
||||||
|
}
|
||||||
|
|
||||||
get detailLocation() {
|
get detailLocation() {
|
||||||
const detailLocation = clone(this._detailLocation);
|
const detailLocation = clone(this._detailLocation);
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,19 @@ export default class HciAlertmanagerConfig extends SteveModel {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get listLocation() {
|
||||||
|
const listLocation = clone(super.listLocation);
|
||||||
|
|
||||||
|
listLocation.name = this.harvesterResourcesInExplorer ? 'c-cluster-product-resource' : `${ HARVESTER_PRODUCT }-c-cluster-resource`;
|
||||||
|
listLocation.params.resource = HCI.ALERTMANAGERCONFIG;
|
||||||
|
|
||||||
|
return listLocation;
|
||||||
|
}
|
||||||
|
|
||||||
|
get harvesterResourcesInExplorer() {
|
||||||
|
return this.$rootGetters['productId'] !== HARVESTER_PRODUCT;
|
||||||
|
}
|
||||||
|
|
||||||
get doneOverride() {
|
get doneOverride() {
|
||||||
const detailLocation = clone(this._detailLocation);
|
const detailLocation = clone(this._detailLocation);
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,19 @@ import Secret from '@shell/models/secret';
|
|||||||
import { NAMESPACE } from '@shell/config/types';
|
import { NAMESPACE } from '@shell/config/types';
|
||||||
|
|
||||||
export default class HciSecret extends Secret {
|
export default class HciSecret extends Secret {
|
||||||
|
get listLocation() {
|
||||||
|
const listLocation = clone(super.listLocation);
|
||||||
|
|
||||||
|
listLocation.name = this.harvesterResourcesInExplorer ? 'c-cluster-product-resource' : `${ HARVESTER_PRODUCT }-c-cluster-resource`;
|
||||||
|
listLocation.params.resource = HCI.SECRET;
|
||||||
|
|
||||||
|
return listLocation;
|
||||||
|
}
|
||||||
|
|
||||||
|
get harvesterResourcesInExplorer() {
|
||||||
|
return this.$rootGetters['productId'] !== HARVESTER_PRODUCT;
|
||||||
|
}
|
||||||
|
|
||||||
get _detailLocation() {
|
get _detailLocation() {
|
||||||
const schema = this.$getters['schemaFor'](this.type);
|
const schema = this.$getters['schemaFor'](this.type);
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,19 @@ import { isInternalStorageClass } from '../../utils/storage-class';
|
|||||||
export const LVM_DRIVER = 'lvm.driver.harvesterhci.io';
|
export const LVM_DRIVER = 'lvm.driver.harvesterhci.io';
|
||||||
|
|
||||||
export default class HciStorageClass extends StorageClass {
|
export default class HciStorageClass extends StorageClass {
|
||||||
|
get listLocation() {
|
||||||
|
const listLocation = clone(super.listLocation);
|
||||||
|
|
||||||
|
listLocation.name = this.harvesterResourcesInExplorer ? 'c-cluster-product-resource' : `${ HARVESTER_PRODUCT }-c-cluster-resource`;
|
||||||
|
listLocation.params.resource = HCI.STORAGE;
|
||||||
|
|
||||||
|
return listLocation;
|
||||||
|
}
|
||||||
|
|
||||||
|
get harvesterResourcesInExplorer() {
|
||||||
|
return this.$rootGetters['productId'] !== HARVESTER_PRODUCT;
|
||||||
|
}
|
||||||
|
|
||||||
get detailLocation() {
|
get detailLocation() {
|
||||||
const detailLocation = clone(this._detailLocation);
|
const detailLocation = clone(this._detailLocation);
|
||||||
|
|
||||||
@@ -94,13 +107,14 @@ export default class HciStorageClass extends StorageClass {
|
|||||||
get availableActions() {
|
get availableActions() {
|
||||||
let out = super.availableActions || [];
|
let out = super.availableActions || [];
|
||||||
|
|
||||||
out = out.map((action) => {
|
if (this.isInternalStorageClass()) {
|
||||||
if ((action.action === 'setDefault' || action.action === 'setAsDefault' || action.action === 'promptRemove') && this.isInternalStorageClass()) {
|
out = out.filter((action) => {
|
||||||
return { ...action, enabled: false };
|
return !['setDefault', 'setAsDefault', 'promptRemove'].includes(action.action);
|
||||||
}
|
});
|
||||||
|
}
|
||||||
return action;
|
if (out[0] && out[0].divider === true) {
|
||||||
});
|
out = out.slice(1);
|
||||||
|
}
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "harvester",
|
"name": "harvester",
|
||||||
"description": "Rancher UI Extension for Harvester",
|
"description": "Rancher UI Extension for Harvester",
|
||||||
"version": "1.6.0-rc6",
|
"version": "1.6.0",
|
||||||
"private": false,
|
"private": false,
|
||||||
"rancher": {
|
"rancher": {
|
||||||
"annotations": {
|
"annotations": {
|
||||||
|
|||||||
Reference in New Issue
Block a user