mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-01 03:36:04 +08:00
Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c3ba10bd22 | ||
|
|
5b7d54d0a3 | ||
|
|
99a216dfa0 | ||
|
|
e4c85f510e | ||
|
|
f391f018de | ||
|
|
4b2e92ea15 | ||
|
|
2f956d5946 | ||
|
|
5f8d556ea2 |
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "harvester-ui-extension",
|
||||
"version": "1.7.0-rc3",
|
||||
"version": "1.7.0-rc5",
|
||||
"private": false,
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
@@ -24,9 +24,9 @@
|
||||
"glob": "7.2.3",
|
||||
"glob-parent": "6.0.2",
|
||||
"json5": "2.2.3",
|
||||
"@types/lodash": "4.17.20",
|
||||
"@types/lodash": "4.17.21",
|
||||
"merge": "2.1.1",
|
||||
"node-forge": "1.3.1",
|
||||
"node-forge": "1.3.3",
|
||||
"nth-check": "2.1.1",
|
||||
"qs": "6.14.0",
|
||||
"roarr": "7.21.2",
|
||||
|
||||
@@ -62,7 +62,7 @@ export default {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !pvc.attachVM;
|
||||
return true;
|
||||
})
|
||||
.map((pvc) => {
|
||||
return {
|
||||
|
||||
+6
-8
@@ -99,7 +99,6 @@ export default {
|
||||
this.allPVCs
|
||||
.filter( (pvc) => {
|
||||
let isAvailable = true;
|
||||
let isBeingUsed = false;
|
||||
|
||||
this.rows.forEach( (O) => {
|
||||
if (O.volumeName === pvc.metadata.name) {
|
||||
@@ -111,17 +110,16 @@ export default {
|
||||
return false;
|
||||
}
|
||||
|
||||
// already used as image volume
|
||||
if (this.idx > 0 && pvc.metadata?.annotations?.[HCI_ANNOTATIONS.IMAGE_ID]) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (pvc.isGoldenImageVolume) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (pvc.attachVM && isAvailable && pvc.attachVM?.id === this.vm?.id && this.isEdit) {
|
||||
isBeingUsed = false;
|
||||
} else if (pvc.attachVM) {
|
||||
isBeingUsed = true;
|
||||
}
|
||||
|
||||
return isAvailable && !isBeingUsed && pvc.isAvailable;
|
||||
return isAvailable && pvc.isAvailable;
|
||||
})
|
||||
.map((pvc) => {
|
||||
return {
|
||||
|
||||
@@ -490,6 +490,7 @@ export default {
|
||||
if (this.isSingle) {
|
||||
if (!this.value.spec.template.spec.hostname) {
|
||||
this.value.spec.template.spec['hostname'] = this.value.metadata.name;
|
||||
this.spec.template.spec['hostname'] = this.value.metadata.name;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -273,7 +273,7 @@ export default {
|
||||
|
||||
needNewSecret() {
|
||||
// When creating a template it is always necessary to create a new secret.
|
||||
return this.isCreate ? true : this.showYaml ? false : this.resourceType === HCI.VM_VERSION;
|
||||
return this.showYaml ? false : this.resourceType === HCI.VM_VERSION || this.isCreate;
|
||||
},
|
||||
|
||||
defaultTerminationSetting() {
|
||||
@@ -708,17 +708,7 @@ export default {
|
||||
const volumeClaimTemplates = [];
|
||||
|
||||
disk.forEach( (R, index) => {
|
||||
const prefixName = this.value.metadata?.name || '';
|
||||
|
||||
let dataVolumeName = '';
|
||||
|
||||
if (R.source === SOURCE_TYPE.ATTACH_VOLUME) {
|
||||
dataVolumeName = R.volumeName;
|
||||
} else if (this.isClone || !this.hasCreateVolumes.includes(R.realName)) {
|
||||
dataVolumeName = `${ prefixName }-${ R.name }-${ randomStr(5).toLowerCase() }`;
|
||||
} else {
|
||||
dataVolumeName = R.realName;
|
||||
}
|
||||
const dataVolumeName = this.parseDataVolumeName(R);
|
||||
|
||||
const _disk = this.parseDisk(R, index);
|
||||
const _volume = this.parseVolume(R, dataVolumeName);
|
||||
@@ -1013,6 +1003,25 @@ export default {
|
||||
this['cpuMemoryHotplugEnabled'] = cpuMemoryHotplugEnabled;
|
||||
},
|
||||
|
||||
parseDataVolumeName(R) {
|
||||
const prefixName = this.value.metadata?.name || '';
|
||||
let dataVolumeName = '';
|
||||
|
||||
if (!R.dataVolumeName) {
|
||||
if (R.source === SOURCE_TYPE.ATTACH_VOLUME) {
|
||||
dataVolumeName = R.volumeName;
|
||||
} else if (this.isClone || !this.hasCreateVolumes.includes(R.realName)) {
|
||||
dataVolumeName = `${ prefixName }-${ R.name }-${ randomStr(5).toLowerCase() }`;
|
||||
} else {
|
||||
dataVolumeName = R.realName;
|
||||
}
|
||||
|
||||
R.dataVolumeName = dataVolumeName;
|
||||
}
|
||||
|
||||
return R.dataVolumeName;
|
||||
},
|
||||
|
||||
parseDisk(R, index) {
|
||||
const out = { name: R.name };
|
||||
|
||||
@@ -1638,7 +1647,7 @@ export default {
|
||||
|
||||
secretRef: {
|
||||
handler(secret) {
|
||||
if (secret && this.resourceType !== HCI.BACKUP) {
|
||||
if (secret && this.resourceType !== HCI.BACKUP && this.resourceType !== HCI.VM) {
|
||||
this.secretName = secret?.metadata.name;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "harvester",
|
||||
"description": "Rancher UI Extension for Harvester",
|
||||
"version": "1.7.0-rc3",
|
||||
"version": "1.7.0-rc5",
|
||||
"private": false,
|
||||
"rancher": {
|
||||
"annotations": {
|
||||
|
||||
@@ -3430,10 +3430,10 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee"
|
||||
integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==
|
||||
|
||||
"@types/lodash@4.17.20":
|
||||
version "4.17.20"
|
||||
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.17.20.tgz#1ca77361d7363432d29f5e55950d9ec1e1c6ea93"
|
||||
integrity sha512-H3MHACvFUEiujabxhaI/ImO6gUrd8oOurg7LQtS7mbwIXA/cUqWrvBsaeJ23aZEPk1TAYkurjfMbSELfoCXlGA==
|
||||
"@types/lodash@4.17.21":
|
||||
version "4.17.21"
|
||||
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.17.21.tgz#b806831543d696b14f8112db600ea9d3a1df6ea4"
|
||||
integrity sha512-FOvQ0YPD5NOfPgMzJihoT+Za5pdkDJWcbpuj1DjaKZIr/gxodQjY/uWEFlTNqW2ugXHUiL8lRQgw63dzKHZdeQ==
|
||||
|
||||
"@types/mime@^1":
|
||||
version "1.3.5"
|
||||
@@ -8225,9 +8225,9 @@ html-tags@^3.3.1:
|
||||
integrity sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ==
|
||||
|
||||
html-webpack-plugin@^5.0.0, html-webpack-plugin@^5.1.0:
|
||||
version "5.6.4"
|
||||
resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-5.6.4.tgz#d8cb0f7edff7745ae7d6cccb0bff592e9f7f7959"
|
||||
integrity sha512-V/PZeWsqhfpE27nKeX9EO2sbR+D17A+tLf6qU+ht66jdUsN0QLKJN27Z+1+gHrVMKgndBahes0PU6rRihDgHTw==
|
||||
version "5.6.5"
|
||||
resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-5.6.5.tgz#d57defb83cabbf29bf56b2d4bf10b67b650066be"
|
||||
integrity sha512-4xynFbKNNk+WlzXeQQ+6YYsH2g7mpfPszQZUi3ovKlj+pDmngQ7vRXjrrmGROabmKwyQkcgcX5hqfOwHbFmK5g==
|
||||
dependencies:
|
||||
"@types/html-minifier-terser" "^6.0.0"
|
||||
html-minifier-terser "^6.0.2"
|
||||
@@ -10310,10 +10310,10 @@ node-fetch@^2.6.7:
|
||||
dependencies:
|
||||
whatwg-url "^5.0.0"
|
||||
|
||||
node-forge@1.3.1, node-forge@^1:
|
||||
version "1.3.1"
|
||||
resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.1.tgz#be8da2af243b2417d5f646a770663a92b7e9ded3"
|
||||
integrity sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==
|
||||
node-forge@1.3.3, node-forge@^1:
|
||||
version "1.3.3"
|
||||
resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.3.tgz#0ad80f6333b3a0045e827ac20b7f735f93716751"
|
||||
integrity sha512-rLvcdSyRCyouf6jcOIPe/BgwG/d7hKjzMKOas33/pHEr6gbq18IK9zV7DiPvzsz0oBJPme6qr6H6kGZuI9/DZg==
|
||||
|
||||
node-int64@^0.4.0:
|
||||
version "0.4.0"
|
||||
@@ -13728,9 +13728,9 @@ yaml@^1.10.0, yaml@^1.10.2, yaml@^1.7.2:
|
||||
integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==
|
||||
|
||||
yaml@^2.5.1:
|
||||
version "2.8.1"
|
||||
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.8.1.tgz#1870aa02b631f7e8328b93f8bc574fac5d6c4d79"
|
||||
integrity sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==
|
||||
version "2.8.2"
|
||||
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.8.2.tgz#5694f25eca0ce9c3e7a9d9e00ce0ddabbd9e35c5"
|
||||
integrity sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==
|
||||
|
||||
yargs-parser@^18.1.2:
|
||||
version "18.1.3"
|
||||
|
||||
Reference in New Issue
Block a user