mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-01 11:46: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",
|
||||
"version": "1.6.0-rc6",
|
||||
"version": "1.6.0",
|
||||
"private": false,
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { HCI } from '../types';
|
||||
|
||||
// TODO: delete this not used variable
|
||||
export const MemoryUnit = [{
|
||||
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_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')"
|
||||
>
|
||||
<CpuMemory
|
||||
class="mb-20"
|
||||
:cpu="cpu"
|
||||
:memory="memory"
|
||||
:max-cpu="maxCpu"
|
||||
|
||||
@@ -240,7 +240,7 @@ export default {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="mt-20">
|
||||
<div>
|
||||
<LabeledSelect
|
||||
v-model:value="checkedSsh"
|
||||
:label="t('harvester.virtualMachine.input.sshKey')"
|
||||
|
||||
@@ -605,6 +605,7 @@ export default {
|
||||
:label="t('harvester.virtualMachine.detail.tabs.basics')"
|
||||
>
|
||||
<CpuMemory
|
||||
class="mb-20"
|
||||
:cpu="cpu"
|
||||
:max-cpu="maxCpu"
|
||||
:memory="memory"
|
||||
|
||||
@@ -691,10 +691,13 @@ export default {
|
||||
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.memory = this.memory;
|
||||
// clean
|
||||
delete this.spec.template.spec.resources;
|
||||
delete this.spec.template.spec.domain.memory;
|
||||
delete this.spec.template.spec.domain.cpu.maxSockets;
|
||||
// clean below fields as we don't need them if not enable CPU and memory hotplug
|
||||
if (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 { VIEW_IN_API, DEV } from '@shell/store/prefs';
|
||||
import { PRODUCT_NAME as HARVESTER_PRODUCT } from '../config/harvester';
|
||||
import { HARVESTER_CRD_MAP } from '../config/harvester-map';
|
||||
|
||||
export default class HarvesterResource extends SteveModel {
|
||||
get listLocation() {
|
||||
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 || {
|
||||
name,
|
||||
params: {
|
||||
product: this.$rootGetters['productId'],
|
||||
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 { HCI } from '../../types';
|
||||
import HarvesterResource from '../harvester';
|
||||
|
||||
@@ -12,7 +12,7 @@ export default class HarvesterNetworkAttachmentDef extends NetworkAttachmentDef
|
||||
params: {
|
||||
product: HARVESTER_PRODUCT,
|
||||
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) || [];
|
||||
}
|
||||
|
||||
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() {
|
||||
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() {
|
||||
const detailLocation = clone(this._detailLocation);
|
||||
|
||||
|
||||
@@ -14,6 +14,19 @@ export default class HarvesterLogFlow extends Flow {
|
||||
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() {
|
||||
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() {
|
||||
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() {
|
||||
const detailLocation = clone(this._detailLocation);
|
||||
|
||||
|
||||
@@ -5,6 +5,19 @@ import Secret from '@shell/models/secret';
|
||||
import { NAMESPACE } from '@shell/config/types';
|
||||
|
||||
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() {
|
||||
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 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() {
|
||||
const detailLocation = clone(this._detailLocation);
|
||||
|
||||
@@ -94,13 +107,14 @@ export default class HciStorageClass extends StorageClass {
|
||||
get availableActions() {
|
||||
let out = super.availableActions || [];
|
||||
|
||||
out = out.map((action) => {
|
||||
if ((action.action === 'setDefault' || action.action === 'setAsDefault' || action.action === 'promptRemove') && this.isInternalStorageClass()) {
|
||||
return { ...action, enabled: false };
|
||||
}
|
||||
|
||||
return action;
|
||||
});
|
||||
if (this.isInternalStorageClass()) {
|
||||
out = out.filter((action) => {
|
||||
return !['setDefault', 'setAsDefault', 'promptRemove'].includes(action.action);
|
||||
});
|
||||
}
|
||||
if (out[0] && out[0].divider === true) {
|
||||
out = out.slice(1);
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "harvester",
|
||||
"description": "Rancher UI Extension for Harvester",
|
||||
"version": "1.6.0-rc6",
|
||||
"version": "1.6.0",
|
||||
"private": false,
|
||||
"rancher": {
|
||||
"annotations": {
|
||||
|
||||
Reference in New Issue
Block a user