mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-05 05:36:05 +08:00
Compare commits
24
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e5b487ebcb | ||
|
|
f058698fb5 | ||
|
|
208496d6f7 | ||
|
|
967966e852 | ||
|
|
f19809da04 | ||
|
|
bc3d9389f2 | ||
|
|
6fbdf5244e | ||
|
|
7b21f6bb2e | ||
|
|
0f6faed2dc | ||
|
|
021de41e68 | ||
|
|
65f4405d29 | ||
|
|
4bae62d046 | ||
|
|
4cc60e22a8 | ||
|
|
19b6842b21 | ||
|
|
fa78229d3a | ||
|
|
c3bfaf00ea | ||
|
|
1a176960bc | ||
|
|
e82ba9d9f5 | ||
|
|
f7fc001abd | ||
|
|
d1c676ee2c | ||
|
|
c562dd73ba | ||
|
|
1cd5e5ca7d | ||
|
|
1aaa8f71c4 | ||
|
|
003a09d0a9 |
@@ -4,4 +4,3 @@ numberOfReviewers: 0
|
|||||||
reviewers:
|
reviewers:
|
||||||
- a110605
|
- a110605
|
||||||
- houhoucoop
|
- houhoucoop
|
||||||
- NickChungSUSE
|
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
# .github/release.yml
|
||||||
|
changelog:
|
||||||
|
categories:
|
||||||
|
- title: Features
|
||||||
|
labels:
|
||||||
|
- feat
|
||||||
|
- title: Bug Fixes
|
||||||
|
labels:
|
||||||
|
- fix
|
||||||
|
- title: Dependencies
|
||||||
|
labels:
|
||||||
|
- deps
|
||||||
|
- title: Performance
|
||||||
|
labels:
|
||||||
|
- perf
|
||||||
|
- title: Documentation
|
||||||
|
labels:
|
||||||
|
- docs
|
||||||
|
- title: Style
|
||||||
|
labels:
|
||||||
|
- style
|
||||||
|
- title: Build & Continuous Integration
|
||||||
|
labels:
|
||||||
|
- build
|
||||||
|
- ci
|
||||||
|
- title: Security
|
||||||
|
labels:
|
||||||
|
- security
|
||||||
|
- title: Tests
|
||||||
|
labels:
|
||||||
|
- test
|
||||||
|
- title: Refactoring
|
||||||
|
labels:
|
||||||
|
- refactor
|
||||||
|
- title: Chores
|
||||||
|
labels:
|
||||||
|
- chore
|
||||||
|
- title: Others
|
||||||
|
labels:
|
||||||
|
- other
|
||||||
@@ -1,15 +1,17 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
"extends": ["config:recommended"],
|
"extends": [
|
||||||
|
"config:recommended",
|
||||||
|
":semanticCommitTypeAll(deps)",
|
||||||
|
":semanticCommitScopeDisabled"
|
||||||
|
],
|
||||||
"baseBranches": [
|
"baseBranches": [
|
||||||
"master",
|
|
||||||
"main",
|
"main",
|
||||||
"/^release-harvester-v\\d+\\.\\d+$/"
|
"/^release-harvester-v\\d+\\.\\d+$/"
|
||||||
],
|
],
|
||||||
"automergeMajor": false,
|
"automergeMajor": false,
|
||||||
"semanticCommits": "enabled",
|
"semanticCommits": "enabled",
|
||||||
"semanticCommitType": "chore",
|
"semanticCommitType": "deps",
|
||||||
"semanticCommitScope": "deps",
|
|
||||||
"prHourlyLimit": 12,
|
"prHourlyLimit": 12,
|
||||||
"timezone": "Asia/Taipei",
|
"timezone": "Asia/Taipei",
|
||||||
"schedule": ["after 10am on sunday"],
|
"schedule": ["after 10am on sunday"],
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ jobs:
|
|||||||
git push origin ${{ needs.setup-target-branch.outputs.target_branch }}
|
git push origin ${{ needs.setup-target-branch.outputs.target_branch }}
|
||||||
|
|
||||||
- name: Run Helm chart releaser
|
- name: Run Helm chart releaser
|
||||||
uses: helm/chart-releaser-action@v1.4.1
|
uses: helm/chart-releaser-action@v1.7.0
|
||||||
with:
|
with:
|
||||||
charts_dir: ./charts
|
charts_dir: ./charts
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
name: "[PR Management] Add PR Label"
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
types: [opened, reopened, edited]
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- 'release-harvester-v*'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
auto-assign-pr-label:
|
||||||
|
if: github.event.pull_request.draft == false
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ github.base_ref }}
|
||||||
|
- name: Setup Nodejs and yarn install
|
||||||
|
uses: ./.github/actions/setup
|
||||||
|
- name: Set PR label
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
PR_LABEL=$(node ./scripts/extract-release-label.mjs "${{ github.event.pull_request.title }}")
|
||||||
|
echo "PR_LABEL = $PR_LABEL"
|
||||||
|
gh pr edit ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --add-label "$PR_LABEL"
|
||||||
@@ -7,6 +7,7 @@ on:
|
|||||||
- main
|
- main
|
||||||
- 'release-*'
|
- 'release-*'
|
||||||
pull_request:
|
pull_request:
|
||||||
|
types: [opened, reopened, edited, synchronize]
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- 'release-*'
|
- 'release-*'
|
||||||
@@ -22,6 +23,11 @@ jobs:
|
|||||||
- name: Run tests
|
- name: Run tests
|
||||||
uses: ./.github/actions/lint
|
uses: ./.github/actions/lint
|
||||||
|
|
||||||
|
- name: Validate PR title lint
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
|
shell: bash
|
||||||
|
run: echo "${{ github.event.pull_request.title }}" | npx commitlint
|
||||||
|
|
||||||
- name: Validate commit messages
|
- name: Validate commit messages
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
+11
-10
@@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "harvester-ui-extension",
|
"name": "harvester-ui-extension",
|
||||||
"version": "1.6.0-rc4",
|
"version": "1.6.1-dev",
|
||||||
"private": false,
|
"private": false,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20.0.0"
|
"node": ">=20.0.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/plugin-transform-class-static-block": "7.26.0",
|
"@babel/plugin-transform-class-static-block": "7.28.3",
|
||||||
"@rancher/shell": "3.0.5-rc.7",
|
"@rancher/shell": "3.0.5-rc.8",
|
||||||
"cache-loader": "^4.1.0",
|
"cache-loader": "^4.1.0",
|
||||||
"color": "4.2.3",
|
"color": "4.2.3",
|
||||||
"ip": "2.0.1",
|
"ip": "2.0.1",
|
||||||
@@ -16,21 +16,21 @@
|
|||||||
"yaml": "^2.5.1"
|
"yaml": "^2.5.1"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"@types/node": "~20.10.0",
|
"@types/node": "~20.19.0",
|
||||||
"cronstrue": "2.50.0",
|
"cronstrue": "2.59.0",
|
||||||
"d3-color": "3.1.0",
|
"d3-color": "3.1.0",
|
||||||
"ejs": "3.1.10",
|
"ejs": "3.1.10",
|
||||||
"follow-redirects": "1.15.6",
|
"follow-redirects": "1.15.11",
|
||||||
"glob": "7.2.3",
|
"glob": "7.2.3",
|
||||||
"glob-parent": "6.0.2",
|
"glob-parent": "6.0.2",
|
||||||
"json5": "2.2.3",
|
"json5": "2.2.3",
|
||||||
"@types/lodash": "4.17.5",
|
"@types/lodash": "4.17.20",
|
||||||
"merge": "2.1.1",
|
"merge": "2.1.1",
|
||||||
"node-forge": "1.3.1",
|
"node-forge": "1.3.1",
|
||||||
"nth-check": "2.1.1",
|
"nth-check": "2.1.1",
|
||||||
"qs": "6.11.1",
|
"qs": "6.14.0",
|
||||||
"roarr": "7.0.4",
|
"roarr": "7.21.1",
|
||||||
"semver": "7.5.4",
|
"semver": "7.7.2",
|
||||||
"@vue/cli-service/html-webpack-plugin": "^5.0.0"
|
"@vue/cli-service/html-webpack-plugin": "^5.0.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -46,6 +46,7 @@
|
|||||||
"prepare": "husky"
|
"prepare": "husky"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@commitlint/load": "^19.8.1",
|
||||||
"@commitlint/cli": "^19.8.1",
|
"@commitlint/cli": "^19.8.1",
|
||||||
"@commitlint/config-conventional": "^19.8.1",
|
"@commitlint/config-conventional": "^19.8.1",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
|
|||||||
@@ -258,7 +258,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
softReboot() {
|
softReboot() {
|
||||||
this.vmResource.softrebootVM();
|
this.vmResource.doSoftReboot();
|
||||||
},
|
},
|
||||||
|
|
||||||
showKeysModal() {
|
showKeysModal() {
|
||||||
@@ -372,3 +372,12 @@ export default {
|
|||||||
background: rgb(40, 40, 40);
|
background: rgb(40, 40, 40);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.vm-console .v-popper__arrow-container {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.vm-console .v-popper__popper{
|
||||||
|
margin-top: 8px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -48,7 +48,8 @@ const FEATURE_FLAGS = {
|
|||||||
'cpuMemoryHotplug',
|
'cpuMemoryHotplug',
|
||||||
'cdiSettings',
|
'cdiSettings',
|
||||||
'vmCloneRunStrategy',
|
'vmCloneRunStrategy',
|
||||||
]
|
],
|
||||||
|
'v1.6.1': [],
|
||||||
};
|
};
|
||||||
|
|
||||||
const generateFeatureFlags = () => {
|
const generateFeatureFlags = () => {
|
||||||
|
|||||||
@@ -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
|
||||||
|
};
|
||||||
|
|||||||
@@ -44,6 +44,12 @@ export default {
|
|||||||
};
|
};
|
||||||
|
|
||||||
await allHash(hash);
|
await allHash(hash);
|
||||||
|
|
||||||
|
if (this.mode === _CREATE ) {
|
||||||
|
this.setDefaultVolumeSnapshotClass();
|
||||||
|
} else {
|
||||||
|
this.initCDISettingsFromAnnotations();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
@@ -59,14 +65,6 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
created() {
|
|
||||||
if (this.mode === _CREATE ) {
|
|
||||||
this.setDefaultVolumeSnapshotClass();
|
|
||||||
} else {
|
|
||||||
this.initCDISettingsFromAnnotations();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
inStore() {
|
inStore() {
|
||||||
return this.$store.getters['currentProduct'].inStore;
|
return this.$store.getters['currentProduct'].inStore;
|
||||||
@@ -148,7 +146,7 @@ export default {
|
|||||||
setDefaultVolumeSnapshotClass() {
|
setDefaultVolumeSnapshotClass() {
|
||||||
try {
|
try {
|
||||||
const setting = this.$store.getters[`${ this.inStore }/byId`](HCI.SETTING, HCI_SETTING.CSI_DRIVER_CONFIG);
|
const setting = this.$store.getters[`${ this.inStore }/byId`](HCI.SETTING, HCI_SETTING.CSI_DRIVER_CONFIG);
|
||||||
const config = JSON.parse(setting?.value || '{}');
|
const config = JSON.parse(setting?.value || setting?.default || '{}');
|
||||||
const defaultClass = config?.[this.provisioner]?.volumeSnapshotClassName || null;
|
const defaultClass = config?.[this.provisioner]?.volumeSnapshotClassName || null;
|
||||||
|
|
||||||
const allClasses = this.$store.getters[`${ this.inStore }/all`](VOLUME_SNAPSHOT_CLASS) || [];
|
const allClasses = this.$store.getters[`${ this.inStore }/all`](VOLUME_SNAPSHOT_CLASS) || [];
|
||||||
|
|||||||
@@ -297,18 +297,26 @@ export default {
|
|||||||
|
|
||||||
if (Object.keys(volumeModeAccessModes).length > 0) {
|
if (Object.keys(volumeModeAccessModes).length > 0) {
|
||||||
annotations[HCI_ANNOTATIONS.VOLUME_MODE_ACCESS_MODES] = JSON.stringify(volumeModeAccessModes);
|
annotations[HCI_ANNOTATIONS.VOLUME_MODE_ACCESS_MODES] = JSON.stringify(volumeModeAccessModes);
|
||||||
|
} else {
|
||||||
|
delete annotations[HCI_ANNOTATIONS.VOLUME_MODE_ACCESS_MODES];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.cdiSettings.volumeSnapshotClass) {
|
if (this.cdiSettings.volumeSnapshotClass) {
|
||||||
annotations[HCI_ANNOTATIONS.VOLUME_SNAPSHOT_CLASS] = this.cdiSettings.volumeSnapshotClass;
|
annotations[HCI_ANNOTATIONS.VOLUME_SNAPSHOT_CLASS] = this.cdiSettings.volumeSnapshotClass;
|
||||||
|
} else {
|
||||||
|
delete annotations[HCI_ANNOTATIONS.VOLUME_SNAPSHOT_CLASS];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.cdiSettings.cloneStrategy) {
|
if (this.cdiSettings.cloneStrategy) {
|
||||||
annotations[HCI_ANNOTATIONS.CLONE_STRATEGY] = this.cdiSettings.cloneStrategy;
|
annotations[HCI_ANNOTATIONS.CLONE_STRATEGY] = this.cdiSettings.cloneStrategy;
|
||||||
|
} else {
|
||||||
|
delete annotations[HCI_ANNOTATIONS.CLONE_STRATEGY];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.cdiSettings.filesystemOverhead) {
|
if (this.cdiSettings.filesystemOverhead) {
|
||||||
annotations[HCI_ANNOTATIONS.FILESYSTEM_OVERHEAD] = this.cdiSettings.filesystemOverhead;
|
annotations[HCI_ANNOTATIONS.FILESYSTEM_OVERHEAD] = this.cdiSettings.filesystemOverhead;
|
||||||
|
} else {
|
||||||
|
delete annotations[HCI_ANNOTATIONS.FILESYSTEM_OVERHEAD];
|
||||||
}
|
}
|
||||||
|
|
||||||
this.value.metadata.annotations = annotations;
|
this.value.metadata.annotations = annotations;
|
||||||
|
|||||||
@@ -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,11 +691,14 @@ 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
parseDiskRows(disk) {
|
parseDiskRows(disk) {
|
||||||
|
|||||||
@@ -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,25 @@ 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 {
|
||||||
|
// prevent harvester secret detail page be overridden.
|
||||||
|
// See isFullPageOverride in https://github.com/rancher/dashboard/blob/master/shell/components/ResourceDetail/index.vue
|
||||||
|
get fullDetailPageOverride() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -156,4 +156,8 @@ export default class HciSetting extends HarvesterResource {
|
|||||||
|
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get disableResourceDetailDrawer() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -327,6 +327,10 @@ export default class VirtVm extends HarvesterResource {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
doSoftReboot() {
|
||||||
|
this.doActionGrowl('softreboot', {});
|
||||||
|
}
|
||||||
|
|
||||||
softrebootVM(resources = this) {
|
softrebootVM(resources = this) {
|
||||||
this.$dispatch('promptModal', {
|
this.$dispatch('promptModal', {
|
||||||
resources,
|
resources,
|
||||||
@@ -1164,6 +1168,13 @@ export default class VirtVm extends HarvesterResource {
|
|||||||
return this.t('harvester.virtualMachine.hotplug.restartVMMessage');
|
return this.t('harvester.virtualMachine.hotplug.restartVMMessage');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const restoreConditions = this.restoreResource?.status?.conditions || [];
|
||||||
|
const restoreError = restoreConditions.find((s) => s.error === true && s.reason === 'Error' && s.type === 'Ready');
|
||||||
|
|
||||||
|
if (restoreError?.message) {
|
||||||
|
return restoreError.message;
|
||||||
|
}
|
||||||
|
|
||||||
return this.ingoreVMMessage ? '' : super.stateDescription;
|
return this.ingoreVMMessage ? '' : super.stateDescription;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "harvester",
|
"name": "harvester",
|
||||||
"description": "Rancher UI Extension for Harvester",
|
"description": "Rancher UI Extension for Harvester",
|
||||||
"version": "1.6.0-rc4",
|
"version": "1.6.1-dev",
|
||||||
"private": false,
|
"private": false,
|
||||||
"rancher": {
|
"rancher": {
|
||||||
"annotations": {
|
"annotations": {
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ export const docLink = (suffix, version) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export function getVersion(v) {
|
export function getVersion(v) {
|
||||||
// e.g v1.4.0
|
|
||||||
if (process.env.VUE_APP_SERVER_VERSION) {
|
if (process.env.VUE_APP_SERVER_VERSION) {
|
||||||
return process.env.VUE_APP_SERVER_VERSION;
|
return process.env.VUE_APP_SERVER_VERSION;
|
||||||
}
|
}
|
||||||
@@ -18,20 +17,21 @@ export function getVersion(v) {
|
|||||||
return `v${ semver.major(v) }.${ semver.minor(v) }.${ semver.patch(v) }`;
|
return `v${ semver.major(v) }.${ semver.minor(v) }.${ semver.patch(v) }`;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// fallback to the latest version
|
// fallback to the latest version
|
||||||
return latestVersion(Object.keys(RELEASE_FEATURES));
|
return getLatestVersion();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function latestVersion(versions) {
|
function getLatestVersion() {
|
||||||
return versions.sort((a, b) => semver.compare(a, b)).pop();
|
const allVersions = Object.keys(RELEASE_FEATURES).filter(semver.valid).sort(semver.rcompare);
|
||||||
|
|
||||||
|
return allVersions[0] || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// v1.3.3 => latest v1.3.x, v1.4.2 => latest v1.4.x
|
function getLatestCompatibleVersion(version) {
|
||||||
function latestMinorVersion(v) {
|
const allVersions = Object.keys(RELEASE_FEATURES).filter(semver.valid);
|
||||||
const minor = `v${ semver.major(v) }.${ semver.minor(v) }`;
|
const compatible = allVersions.filter((v) => semver.lte(v, version)).sort(semver.rcompare);
|
||||||
const minorVersions = Object.keys(RELEASE_FEATURES).filter((version) => version.startsWith(minor));
|
|
||||||
|
|
||||||
return latestVersion(minorVersions);
|
return compatible[0] || getLatestVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
export const featureEnabled = (featureKey, serverVersion) => {
|
export const featureEnabled = (featureKey, serverVersion) => {
|
||||||
@@ -46,12 +46,16 @@ export const featureEnabled = (featureKey, serverVersion) => {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let releasedFeatures = RELEASE_FEATURES[version];
|
const compatibleVersion = getLatestCompatibleVersion(version);
|
||||||
|
const releasedFeatures = RELEASE_FEATURES?.[compatibleVersion];
|
||||||
|
|
||||||
if (!releasedFeatures) {
|
if (!Array.isArray(releasedFeatures)) {
|
||||||
const fallback = latestMinorVersion(version);
|
// eslint-disable-next-line no-console
|
||||||
|
console.error(
|
||||||
|
`Feature flags for version ${ version } are not defined. Please upgrade Harvester UI extension and check the support matrix.`
|
||||||
|
);
|
||||||
|
|
||||||
releasedFeatures = RELEASE_FEATURES[fallback];
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return releasedFeatures.includes(featureKey);
|
return releasedFeatures.includes(featureKey);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ if [[ "$VERSION" != "$EXTENSION_VERSION" ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${TAG_VERSION}" != "$PKG_VERSION" ]]; then
|
if [[ "${TAG_VERSION}" != "${PKG_VERSION}"* ]]; then
|
||||||
echo "Package version $PKG_VERSION in pkg/harvester/package.json does not match tag version ${TAG_VERSION}"
|
echo "Package version $PKG_VERSION in pkg/harvester/package.json does not match tag version ${TAG_VERSION}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
/* eslint-disable no-console */
|
||||||
|
import load from "@commitlint/load";
|
||||||
|
|
||||||
|
if (process.argv.length < 3) {
|
||||||
|
console.error('No PR title as first argument');
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
const prTitle = process.argv[2];
|
||||||
|
const prLabel = prTitle.split(':')[0].trim();
|
||||||
|
|
||||||
|
const config = await load({ extends: ["./commitlint.config.js"] });
|
||||||
|
const commitPrefix = config?.rules?.['type-enum']?.[2] || [];
|
||||||
|
const label = commitPrefix.includes(prLabel) ? prLabel : 'other';
|
||||||
|
|
||||||
|
console.log(label);
|
||||||
Reference in New Issue
Block a user