mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-15 14:11:46 +00:00
Making harvester-manager load as an external extension
This commit is contained in:
parent
aba9c167e0
commit
40432c8261
32
package.json
32
package.json
@ -6,24 +6,14 @@
|
|||||||
"node": ">=20.0.0"
|
"node": ">=20.0.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@rancher/components": "0.3.0-alpha.1",
|
"@rancher/shell": "^3.0.0-rc.1",
|
||||||
"@rancher/shell": "2.0.0",
|
|
||||||
"@vue/cli-plugin-babel": "5.0.8",
|
|
||||||
"@vue/cli-plugin-typescript": "5.0.8",
|
|
||||||
"@vue/cli-service": "5.0.8",
|
|
||||||
"cache-loader": "^4.1.0",
|
"cache-loader": "^4.1.0",
|
||||||
"codemirror": ">=5.64.0 <6",
|
"color": "4.2.3",
|
||||||
"codemirror-editor-vue3": "^2.7.0",
|
"ip": "2.0.1",
|
||||||
"core-js": "3.25.3",
|
"node-polyfill-webpack-plugin": "^3.0.0"
|
||||||
"css-loader": "4.3.0",
|
|
||||||
"diff_match_patch": "^0.1.1",
|
|
||||||
"node-polyfill-webpack-plugin": "^3.0.0",
|
|
||||||
"yaml": "2.0.0"
|
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"@vue/cli-plugin-babel": "5.0.8",
|
"@types/node": "~20.10.0",
|
||||||
"@vue/cli-service": "5.0.8",
|
|
||||||
"@vue/cli-plugin-typescript": "5.0.8",
|
|
||||||
"d3-color": "3.1.0",
|
"d3-color": "3.1.0",
|
||||||
"ejs": "3.1.9",
|
"ejs": "3.1.9",
|
||||||
"follow-redirects": "1.15.2",
|
"follow-redirects": "1.15.2",
|
||||||
@ -45,17 +35,7 @@
|
|||||||
"clean": "./node_modules/@rancher/shell/scripts/clean",
|
"clean": "./node_modules/@rancher/shell/scripts/clean",
|
||||||
"build-pkg": "./node_modules/@rancher/shell/scripts/build-pkg.sh",
|
"build-pkg": "./node_modules/@rancher/shell/scripts/build-pkg.sh",
|
||||||
"serve-pkgs": "./node_modules/@rancher/shell/scripts/serve-pkgs",
|
"serve-pkgs": "./node_modules/@rancher/shell/scripts/serve-pkgs",
|
||||||
"vue-migrate": "scripts/vue-migrate.js",
|
|
||||||
"publish-pkgs": "./node_modules/@rancher/shell/scripts/extension/publish",
|
"publish-pkgs": "./node_modules/@rancher/shell/scripts/extension/publish",
|
||||||
"parse-tag-name": "./node_modules/@rancher/shell/scripts/extension/parse-tag-name",
|
"parse-tag-name": "./node_modules/@rancher/shell/scripts/extension/parse-tag-name"
|
||||||
"lint": "./node_modules/.bin/eslint --max-warnings 0 --ext .js,.ts,.vue .",
|
|
||||||
"test": "jest --watch",
|
|
||||||
"migrate": "node ./vue-migrate.js"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/jest": "^29.5.12",
|
|
||||||
"@types/lodash": "^4.17.5",
|
|
||||||
"@vue/vue3-jest": "^27.0.0-alpha.1",
|
|
||||||
"babel-plugin-transform-require-context": "^0.1.1"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -122,7 +122,7 @@ export default {
|
|||||||
</div>
|
</div>
|
||||||
<div class="mt-10">
|
<div class="mt-10">
|
||||||
<Tag
|
<Tag
|
||||||
v-for="((tag), i) in value" :key="i" class="tag"
|
v-for="(tag, i) in value" :key="i" class="tag"
|
||||||
>
|
>
|
||||||
<span>
|
<span>
|
||||||
{{ tag }}
|
{{ tag }}
|
||||||
@ -155,7 +155,7 @@ export default {
|
|||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
ref="addTagInput"
|
ref="addTagInput"
|
||||||
v-model:value="inputValue"
|
v-model="inputValue"
|
||||||
type="text"
|
type="text"
|
||||||
size="small"
|
size="small"
|
||||||
@blur="confirmAdd"
|
@blur="confirmAdd"
|
||||||
|
|||||||
114
pkg/harvester/config/harvester-manager.js
Normal file
114
pkg/harvester/config/harvester-manager.js
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
import { HCI, MANAGEMENT, CAPI } from '@shell/config/types';
|
||||||
|
import { HARVESTER, MULTI_CLUSTER } from '@shell/store/features';
|
||||||
|
import { STATE, NAME as NAME_COL, AGE, VERSION } from '@shell/config/table-headers';
|
||||||
|
import { allHash } from '@shell/utils/promise';
|
||||||
|
import { BLANK_CLUSTER } from '@shell/store/store-types.js';
|
||||||
|
|
||||||
|
export const PRODUCT_NAME = 'harvester-manager';
|
||||||
|
|
||||||
|
export const NAME = 'harvesterManager';
|
||||||
|
|
||||||
|
const MACHINE_POOLS = {
|
||||||
|
name: 'summary',
|
||||||
|
labelKey: 'tableHeaders.machines',
|
||||||
|
sort: false,
|
||||||
|
search: false,
|
||||||
|
value: 'nodes.length',
|
||||||
|
align: 'center',
|
||||||
|
width: 100,
|
||||||
|
};
|
||||||
|
|
||||||
|
const harvesterClustersLocation = {
|
||||||
|
name: 'c-cluster-product-resource',
|
||||||
|
params: {
|
||||||
|
cluster: BLANK_CLUSTER,
|
||||||
|
product: NAME,
|
||||||
|
resource: HCI.CLUSTER
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export function init($plugin, store) {
|
||||||
|
const {
|
||||||
|
product,
|
||||||
|
basicType,
|
||||||
|
headers,
|
||||||
|
spoofedType,
|
||||||
|
configureType
|
||||||
|
} = $plugin.DSL(store, NAME);
|
||||||
|
|
||||||
|
product({
|
||||||
|
ifHaveType: CAPI.RANCHER_CLUSTER,
|
||||||
|
ifFeature: [MULTI_CLUSTER, HARVESTER],
|
||||||
|
inStore: 'management',
|
||||||
|
icon: 'harvester',
|
||||||
|
removable: false,
|
||||||
|
showClusterSwitcher: false,
|
||||||
|
weight: 100,
|
||||||
|
to: harvesterClustersLocation,
|
||||||
|
category: 'hci',
|
||||||
|
});
|
||||||
|
|
||||||
|
configureType(HCI.CLUSTER, { showListMasthead: false });
|
||||||
|
headers(HCI.CLUSTER, [
|
||||||
|
STATE,
|
||||||
|
NAME_COL,
|
||||||
|
{
|
||||||
|
...VERSION,
|
||||||
|
value: 'kubernetesVersion',
|
||||||
|
getValue: (row) => row.kubernetesVersion
|
||||||
|
},
|
||||||
|
MACHINE_POOLS,
|
||||||
|
AGE,
|
||||||
|
{
|
||||||
|
name: 'harvester',
|
||||||
|
label: ' ',
|
||||||
|
align: 'right',
|
||||||
|
width: 65,
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
basicType([HCI.CLUSTER]);
|
||||||
|
spoofedType({
|
||||||
|
labelKey: 'harvesterManager.cluster.label',
|
||||||
|
name: HCI.CLUSTER,
|
||||||
|
type: HCI.CLUSTER,
|
||||||
|
namespaced: false,
|
||||||
|
weight: -1,
|
||||||
|
route: {
|
||||||
|
name: 'c-cluster-product-resource',
|
||||||
|
params: {
|
||||||
|
product: NAME,
|
||||||
|
resource: HCI.CLUSTER,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
exact: false,
|
||||||
|
schemas: [
|
||||||
|
{
|
||||||
|
id: HCI.CLUSTER,
|
||||||
|
type: 'schema',
|
||||||
|
collectionMethods: [],
|
||||||
|
resourceFields: {},
|
||||||
|
attributes: { namespaced: true },
|
||||||
|
},
|
||||||
|
],
|
||||||
|
group: 'Root',
|
||||||
|
getInstances: async() => {
|
||||||
|
const hash = {
|
||||||
|
rancherClusters: store.dispatch('management/findAll', { type: CAPI.RANCHER_CLUSTER }),
|
||||||
|
clusters: store.dispatch('management/findAll', { type: MANAGEMENT.CLUSTER }),
|
||||||
|
};
|
||||||
|
|
||||||
|
if (store.getters['management/schemaFor'](MANAGEMENT.NODE)) {
|
||||||
|
hash.nodes = store.dispatch('management/findAll', { type: MANAGEMENT.NODE });
|
||||||
|
}
|
||||||
|
|
||||||
|
const res = await allHash(hash);
|
||||||
|
|
||||||
|
return res.rancherClusters.map((c) => {
|
||||||
|
return {
|
||||||
|
...c,
|
||||||
|
type: HCI.CLUSTER,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
@ -255,7 +255,7 @@ export default {
|
|||||||
|
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<div
|
<div
|
||||||
v-for="(row,idx) in parsedRows" :key="idx"class="entry"
|
v-for="(row,idx) in parsedRows" :key="idx" class="entry"
|
||||||
>
|
>
|
||||||
<DetailText
|
<DetailText
|
||||||
:value="row.value"
|
:value="row.value"
|
||||||
|
|||||||
@ -75,7 +75,7 @@ export default {
|
|||||||
class="bottom"
|
class="bottom"
|
||||||
>
|
>
|
||||||
<Banner
|
<Banner
|
||||||
v-for="(err, i) in errors" :key="i"color="error"
|
v-for="(err, i) in errors" :key="i" color="error"
|
||||||
:label="err"
|
:label="err"
|
||||||
/>
|
/>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
|
|||||||
@ -127,7 +127,7 @@ export default {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-for="(row, idx) in rows" :key="idx"class="listener-row"
|
v-for="(row, idx) in rows" :key="idx" class="listener-row"
|
||||||
>
|
>
|
||||||
<div class="port-name">
|
<div class="port-name">
|
||||||
<span v-if="isView">
|
<span v-if="isView">
|
||||||
|
|||||||
@ -434,7 +434,7 @@ export default {
|
|||||||
<div class="row mt-20">
|
<div class="row mt-20">
|
||||||
<div class="col span-12">
|
<div class="col span-12">
|
||||||
<Banner
|
<Banner
|
||||||
v-for="(err, i) in nicErrors" :key="i"color="warning"
|
v-for="(err, i) in nicErrors" :key="i" color="warning"
|
||||||
:label="err"
|
:label="err"
|
||||||
/>
|
/>
|
||||||
<ArrayListSelect
|
<ArrayListSelect
|
||||||
|
|||||||
22
pkg/harvester/icon.svg
Normal file
22
pkg/harvester/icon.svg
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||||
|
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
|
||||||
|
<g id="icomoon-ignore">
|
||||||
|
</g>
|
||||||
|
<path d="M23,12.5c0,0,0-0.1,0-0.1c0,0,0,0,0,0c0-0.1,0-0.2,0-0.2c0,0,0,0,0,0c0,0,0-0.1,0-0.1c0,0,0,0,0,0c0,0,0,0,0-0.1l-2.6-4.5
|
||||||
|
c0,0,0,0,0-0.1c0,0,0,0,0,0c0,0,0-0.1-0.1-0.1c0,0,0,0,0,0c0,0-0.1,0-0.1-0.1l0,0l0,0c0,0-0.1,0-0.1,0c0,0,0,0,0,0c0,0-0.1,0-0.1,0
|
||||||
|
c0,0,0,0,0,0c0,0,0,0-0.1,0h-5.2c0,0,0,0-0.1,0c0,0,0,0,0,0c0,0-0.1,0-0.1,0c0,0,0,0,0,0c0,0-0.1,0-0.1,0l0,0l0,0c0,0-0.1,0-0.1,0.1
|
||||||
|
c0,0,0,0,0,0c0,0-0.1,0.1-0.1,0.1c0,0,0,0,0,0c0,0,0,0,0,0.1l-2.4,4.2H9.7l1.8-3.2h0.9c0.4,0,0.7-0.3,0.7-0.7c0-0.4-0.3-0.7-0.7-0.7
|
||||||
|
h-1.2c-0.2,0-0.5,0.1-0.6,0.3l-2.4,4.2H6.2l1.8-3.2h0.9c0.4,0,0.7-0.3,0.7-0.7c0-0.4-0.3-0.7-0.7-0.7H7.7c-0.2,0-0.5,0.1-0.6,0.3
|
||||||
|
l-2.4,4.2H2.8l1.8-3.2h0.9c0.4,0,0.7-0.3,0.7-0.7S5.8,7.1,5.5,7.1H4.3C4,7.1,3.8,7.2,3.7,7.4l-2.6,4.5c0,0,0,0,0,0.1c0,0,0,0,0,0
|
||||||
|
c0,0,0,0.1,0,0.1c0,0,0,0,0,0c0,0,0,0.1,0,0.1l0,0l0,0c0,0,0,0.1,0,0.1c0,0,0,0,0,0c0,0,0,0.1,0,0.1c0,0,0,0,0,0c0,0,0,0,0,0.1
|
||||||
|
l2.6,4.5c0.1,0.2,0.3,0.3,0.6,0.3h1.2c0.4,0,0.7-0.3,0.7-0.7s-0.3-0.7-0.7-0.7H4.6l-1.8-3.2h1.9l2.4,4.2c0.1,0.2,0.3,0.3,0.6,0.3
|
||||||
|
h1.2c0.4,0,0.7-0.3,0.7-0.7s-0.3-0.7-0.7-0.7H8.1l-1.8-3.2h1.9l2.4,4.2c0.1,0.2,0.3,0.3,0.6,0.3h1.2c0.4,0,0.7-0.3,0.7-0.7
|
||||||
|
c0-0.4-0.3-0.7-0.7-0.7h-0.9l-1.8-3.2h1.9l2.4,4.2c0,0,0,0,0,0.1c0,0,0,0,0,0c0,0,0,0.1,0.1,0.1c0,0,0,0,0,0c0,0,0.1,0,0.1,0.1l0,0
|
||||||
|
c0,0,0,0,0,0c0,0,0,0,0.1,0c0,0,0,0,0.1,0c0,0,0,0,0,0c0.1,0,0.1,0,0.2,0l0,0l5.2,0c0.1,0,0.1,0,0.2,0c0,0,0,0,0,0c0,0,0,0,0.1,0
|
||||||
|
c0,0,0,0,0.1,0c0,0,0,0,0,0l0,0c0,0,0.1,0,0.1-0.1c0,0,0,0,0,0c0,0,0.1-0.1,0.1-0.1c0,0,0,0,0,0c0,0,0,0,0-0.1L23,12.5
|
||||||
|
C22.9,12.5,22.9,12.5,23,12.5C22.9,12.5,22.9,12.5,23,12.5L23,12.5z M19.7,15.4L19,14.1l0.7-1.2h1.5L19.7,15.4L19.7,15.4z
|
||||||
|
M13.1,12.9h1.5l0.7,1.2l-0.8,1.3L13.1,12.9z M14.6,9l0.8,1.3l-0.7,1.2h-1.5L14.6,9L14.6,9z M16.5,13.4l-0.7-1.2l0.7-1.2h1.4
|
||||||
|
l0.7,1.2l-0.7,1.2H16.5z M17.9,9.7h-1.4l-0.8-1.3h2.9L17.9,9.7L17.9,9.7z M16.5,14.8h1.4l0.8,1.3h-2.9L16.5,14.8L16.5,14.8z
|
||||||
|
M19.7,11.6L19,10.4L19.7,9l1.5,2.5L19.7,11.6L19.7,11.6z"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.2 KiB |
@ -1,28 +1,18 @@
|
|||||||
import { importTypes } from '@rancher/auto-import';
|
import { importTypes } from '@rancher/auto-import';
|
||||||
import { IPlugin } from '@shell/core/types';
|
import { IPlugin } from '@shell/core/types';
|
||||||
import extensionRouting from './routing/harvester-routing';
|
import extensionRoutes from './routing/harvester-routing';
|
||||||
import harvesterCommonStore from './store/harvester-common';
|
|
||||||
import harvesterStore from './store/harvester-store';
|
|
||||||
import customValidators from './validators';
|
|
||||||
|
|
||||||
// Init the package
|
// Init the package
|
||||||
export default function(plugin: IPlugin): void {
|
export default function (plugin: IPlugin) {
|
||||||
// Auto-import model, detail, edit from the folders
|
// Auto-import model, detail, edit from the folders
|
||||||
importTypes(plugin);
|
importTypes(plugin);
|
||||||
|
|
||||||
// Provide plugin metadata from package.json
|
// Provide plugin metadata from package.json
|
||||||
plugin.metadata = require('./package.json');
|
plugin.metadata = require('./package.json');
|
||||||
|
|
||||||
// Load a product
|
// Built-in icon
|
||||||
plugin.addProduct(require('./product'));
|
plugin.metadata.icon = require('./icon.svg');
|
||||||
|
|
||||||
// Add Vue Routes
|
plugin.addProduct(require('./config/harvester-manager'));
|
||||||
plugin.addRoutes(extensionRouting);
|
plugin.addRoutes(extensionRoutes);
|
||||||
|
|
||||||
plugin.addDashboardStore(harvesterCommonStore.config.namespace, harvesterCommonStore.specifics, harvesterCommonStore.config);
|
|
||||||
plugin.addDashboardStore(harvesterStore.config.namespace, harvesterStore.specifics, harvesterStore.config, harvesterStore.init);
|
|
||||||
|
|
||||||
plugin.validators = customValidators;
|
|
||||||
|
|
||||||
plugin.register('component', 'NavHeaderRight', () => import(/* webpackChunkName: "pkg/harvester/components" */ `./components/HarvesterUpgradeHeader.vue`));
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1514,3 +1514,30 @@ typeLabel:
|
|||||||
one { IP Pool }
|
one { IP Pool }
|
||||||
other { IP Pools }
|
other { IP Pools }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
harvesterManager:
|
||||||
|
manage: Manage
|
||||||
|
cluster:
|
||||||
|
label: Harvester Clusters
|
||||||
|
none: There are no Harvester Clusters
|
||||||
|
learnMore: Learn more about Harvester from the <a target="_blank" href="https://harvesterhci.io/" rel="noopener noreferrer nofollow">Harvester Web Site</a> or read the the <a target="_blank" href="https://docs.harvesterhci.io/" rel="noopener noreferrer nofollow">Harvester Docs</a>
|
||||||
|
description: Harvester is a modern Hyperconverged infrastructure (HCI) solution built for bare metal servers using enterprise-grade open source technologies including Kubernetes, Kubevirt and Longhorn.
|
||||||
|
plugins:
|
||||||
|
loadError: Error loading harvester plugin
|
||||||
|
rke:
|
||||||
|
templateError: Incorrect template format
|
||||||
|
affinity:
|
||||||
|
thisPodNamespace: This VM's namespace
|
||||||
|
matchExpressions:
|
||||||
|
inNamespaces: "Workloads in these namespaces"
|
||||||
|
vmAffinityTitle: VM Scheduling
|
||||||
|
namespaces:
|
||||||
|
placeholder: e.g. default,system,base
|
||||||
|
label: Namespaces
|
||||||
|
addLabel: Add Workload Selector
|
||||||
|
topologyKey:
|
||||||
|
placeholder: 'topology.kubernetes.io/zone'
|
||||||
|
vGpu:
|
||||||
|
title: VGPUs
|
||||||
|
label: VGPU type
|
||||||
|
placeholder: 'Please select a VGPU'
|
||||||
|
|||||||
243
pkg/harvester/list/harvesterhci.io.management.cluster.vue
Normal file
243
pkg/harvester/list/harvesterhci.io.management.cluster.vue
Normal file
@ -0,0 +1,243 @@
|
|||||||
|
<script>
|
||||||
|
import BrandImage from '@shell/components/BrandImage';
|
||||||
|
import TypeDescription from '@shell/components/TypeDescription';
|
||||||
|
import ResourceTable from '@shell/components/ResourceTable';
|
||||||
|
import Masthead from '@shell/components/ResourceList/Masthead';
|
||||||
|
import Loading from '@shell/components/Loading';
|
||||||
|
import { HARVESTER_NAME as VIRTUAL } from '@shell/config/features';
|
||||||
|
import { CAPI, HCI, MANAGEMENT } from '@shell/config/types';
|
||||||
|
import { isHarvesterCluster } from '@shell/utils/cluster';
|
||||||
|
import { allHash } from '@shell/utils/promise';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
BrandImage,
|
||||||
|
ResourceTable,
|
||||||
|
Masthead,
|
||||||
|
TypeDescription,
|
||||||
|
Loading
|
||||||
|
},
|
||||||
|
|
||||||
|
props: {
|
||||||
|
schema: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
useQueryParamsForSimpleFiltering: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
async fetch() {
|
||||||
|
console.log('dfetchttt');
|
||||||
|
const inStore = this.$store.getters['currentProduct'].inStore;
|
||||||
|
|
||||||
|
const hash = await allHash({
|
||||||
|
hciClusters: this.$store.dispatch(`${ inStore }/findAll`, { type: HCI.CLUSTER }),
|
||||||
|
mgmtClusters: this.$store.dispatch(`${ inStore }/findAll`, { type: MANAGEMENT.CLUSTER })
|
||||||
|
});
|
||||||
|
|
||||||
|
this.hciClusters = hash.hciClusters;
|
||||||
|
this.mgmtClusters = hash.mgmtClusters;
|
||||||
|
},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
console.log('ddataata');
|
||||||
|
const resource = CAPI.RANCHER_CLUSTER;
|
||||||
|
|
||||||
|
return {
|
||||||
|
navigating: false,
|
||||||
|
VIRTUAL,
|
||||||
|
hciDashboard: HCI.DASHBOARD,
|
||||||
|
resource,
|
||||||
|
hResource: HCI.CLUSTER,
|
||||||
|
realSchema: this.$store.getters['management/schemaFor'](CAPI.RANCHER_CLUSTER),
|
||||||
|
hciClusters: [],
|
||||||
|
mgmtClusters: []
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
importLocation() {
|
||||||
|
return {
|
||||||
|
name: 'c-cluster-product-resource-create',
|
||||||
|
params: {
|
||||||
|
product: this.$store.getters['currentProduct'].name,
|
||||||
|
resource: this.schema.id,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
canCreateCluster() {
|
||||||
|
const schema = this.$store.getters['management/schemaFor'](CAPI.RANCHER_CLUSTER);
|
||||||
|
|
||||||
|
return !!schema?.collectionMethods.find((x) => x.toLowerCase() === 'post');
|
||||||
|
},
|
||||||
|
|
||||||
|
rows() {
|
||||||
|
return this.hciClusters.filter((c) => {
|
||||||
|
const cluster = this.mgmtClusters.find((cluster) => cluster?.metadata?.name === c?.status?.clusterName);
|
||||||
|
|
||||||
|
return isHarvesterCluster(cluster);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
typeDisplay() {
|
||||||
|
return this.t(`typeLabel."${ HCI.CLUSTER }"`, { count: this.row?.length || 0 });
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
async goToCluster(row) {
|
||||||
|
const timeout = setTimeout(() => {
|
||||||
|
// Don't show loading indicator for quickly fetched plugins
|
||||||
|
this.navigating = row.id;
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
try {
|
||||||
|
await row.goToCluster();
|
||||||
|
|
||||||
|
clearTimeout(timeout);
|
||||||
|
this.navigating = false;
|
||||||
|
} catch {
|
||||||
|
// The error handling is carried out within goToCluster, but just in case something happens before the promise chain can catch it...
|
||||||
|
clearTimeout(timeout);
|
||||||
|
this.navigating = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<Loading v-if="$fetchState.pending" />
|
||||||
|
<div v-else>
|
||||||
|
<Masthead
|
||||||
|
:schema="realSchema"
|
||||||
|
:resource="resource"
|
||||||
|
:is-creatable="false"
|
||||||
|
:type-display="typeDisplay"
|
||||||
|
>
|
||||||
|
<template #typeDescription>
|
||||||
|
<TypeDescription :resource="hResource" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template
|
||||||
|
v-if="canCreateCluster"
|
||||||
|
#extraActions
|
||||||
|
>
|
||||||
|
<router-link
|
||||||
|
:to="importLocation"
|
||||||
|
class="btn role-primary"
|
||||||
|
>
|
||||||
|
{{ t('cluster.importAction') }}
|
||||||
|
</router-link>
|
||||||
|
</template>
|
||||||
|
</Masthead>
|
||||||
|
|
||||||
|
<ResourceTable
|
||||||
|
v-if="rows && rows.length"
|
||||||
|
:schema="schema"
|
||||||
|
:rows="rows"
|
||||||
|
:is-creatable="true"
|
||||||
|
:namespaced="false"
|
||||||
|
:use-query-params-for-simple-filtering="useQueryParamsForSimpleFiltering"
|
||||||
|
>
|
||||||
|
<template #col:name="{row}">
|
||||||
|
<td>
|
||||||
|
<span class="cluster-link">
|
||||||
|
<a
|
||||||
|
v-if="row.isReady"
|
||||||
|
class="link"
|
||||||
|
:disabled="navigating ? true : null"
|
||||||
|
@click="goToCluster(row)"
|
||||||
|
>{{ row.nameDisplay }}</a>
|
||||||
|
<span v-else>
|
||||||
|
{{ row.nameDisplay }}
|
||||||
|
</span>
|
||||||
|
<i
|
||||||
|
class="icon icon-spinner icon-spin ml-5"
|
||||||
|
:class="{'navigating': navigating === row.id}"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #cell:harvester="{row}">
|
||||||
|
<router-link
|
||||||
|
class="btn btn-sm role-primary"
|
||||||
|
:to="row.detailLocation"
|
||||||
|
>
|
||||||
|
{{ t('harvesterManager.manage') }}
|
||||||
|
</router-link>
|
||||||
|
</template>
|
||||||
|
</ResourceTable>
|
||||||
|
<div v-else>
|
||||||
|
<div class="no-clusters">
|
||||||
|
{{ t('harvesterManager.cluster.none') }}
|
||||||
|
</div>
|
||||||
|
<hr class="info-section">
|
||||||
|
<div class="logo">
|
||||||
|
<BrandImage
|
||||||
|
file-name="harvester.png"
|
||||||
|
height="64"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="tagline">
|
||||||
|
<div>{{ t('harvesterManager.cluster.description') }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="tagline sub-tagline">
|
||||||
|
<div v-clean-html="t('harvesterManager.cluster.learnMore', {}, true)" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.cluster-link {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
// Use visibility to avoid the columns re-adjusting when the icon is shown
|
||||||
|
visibility: hidden;
|
||||||
|
|
||||||
|
&.navigating {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
.no-clusters {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-section {
|
||||||
|
margin-top: 60px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin: 60px 0 40px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tagline {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 30px;
|
||||||
|
|
||||||
|
> div {
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 22px;
|
||||||
|
max-width: 80%;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.link {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
@ -1,11 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "harvester",
|
"name": "harvester",
|
||||||
"description": "harvester plugin",
|
"description": "Provides the Virtualization Management feature in Rancher Manager",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": false,
|
"private": false,
|
||||||
"rancher": {
|
"rancher": {
|
||||||
"annotations": {
|
"annotations": {
|
||||||
"catalog.cattle.io/rancher-version": ">= v2.8.3"
|
"catalog.cattle.io/rancher-version": ">= v2.10.0",
|
||||||
|
"catalog.cattle.io/display-name": "Virtualization Manager"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@ -70,7 +70,7 @@ export function init($plugin: any, store: any) {
|
|||||||
|
|
||||||
if (isSingleVirtualCluster) {
|
if (isSingleVirtualCluster) {
|
||||||
const home = {
|
const home = {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: {
|
params: {
|
||||||
product: PRODUCT_NAME,
|
product: PRODUCT_NAME,
|
||||||
resource: HCI.DASHBOARD
|
resource: HCI.DASHBOARD
|
||||||
@ -80,7 +80,7 @@ export function init($plugin: any, store: any) {
|
|||||||
store.dispatch('setIsSingleProduct', {
|
store.dispatch('setIsSingleProduct', {
|
||||||
logo: require(`@shell/assets/images/providers/harvester.svg`),
|
logo: require(`@shell/assets/images/providers/harvester.svg`),
|
||||||
productNameKey: 'harvester.productLabel',
|
productNameKey: 'harvester.productLabel',
|
||||||
getVersionInfo: (store: any) => store.getters[`${ PRODUCT_NAME }/byId`]?.(HCI.SETTING, 'server-version')?.value || 'unknown',
|
getVersionInfo: (store: any) => store.getters[`${PRODUCT_NAME}/byId`]?.(HCI.SETTING, 'server-version')?.value || 'unknown',
|
||||||
afterLoginRoute: home,
|
afterLoginRoute: home,
|
||||||
logoRoute: home,
|
logoRoute: home,
|
||||||
supportCustomLogo: true
|
supportCustomLogo: true
|
||||||
@ -102,15 +102,17 @@ export function init($plugin: any, store: any) {
|
|||||||
[MANAGEMENT.CLUSTER_ROLE_TEMPLATE_BINDING]: 'management',
|
[MANAGEMENT.CLUSTER_ROLE_TEMPLATE_BINDING]: 'management',
|
||||||
[MANAGEMENT.PROJECT_ROLE_TEMPLATE_BINDING]: 'management'
|
[MANAGEMENT.PROJECT_ROLE_TEMPLATE_BINDING]: 'management'
|
||||||
},
|
},
|
||||||
supportRoute: { name: `${ PRODUCT_NAME }-c-cluster-support` },
|
supportRoute: { name: `${PRODUCT_NAME}-c-cluster-support` },
|
||||||
to: {
|
to: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: {
|
params: {
|
||||||
product: PRODUCT_NAME,
|
product: PRODUCT_NAME,
|
||||||
resource: HCI.DASHBOARD
|
resource: HCI.DASHBOARD
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
hideNamespaceLocation: true,
|
hideNamespaceLocation: true,
|
||||||
|
category: 'global',
|
||||||
|
icon: 'globe',
|
||||||
});
|
});
|
||||||
|
|
||||||
basicType([HCI.DASHBOARD]);
|
basicType([HCI.DASHBOARD]);
|
||||||
@ -120,7 +122,7 @@ export function init($plugin: any, store: any) {
|
|||||||
name: HCI.DASHBOARD,
|
name: HCI.DASHBOARD,
|
||||||
weight: 500,
|
weight: 500,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: {
|
params: {
|
||||||
product: PRODUCT_NAME,
|
product: PRODUCT_NAME,
|
||||||
resource: HCI.DASHBOARD
|
resource: HCI.DASHBOARD
|
||||||
@ -131,7 +133,7 @@ export function init($plugin: any, store: any) {
|
|||||||
|
|
||||||
configureType(HCI.HOST, {
|
configureType(HCI.HOST, {
|
||||||
location: {
|
location: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.HOST }
|
params: { resource: HCI.HOST }
|
||||||
},
|
},
|
||||||
resource: NODE,
|
resource: NODE,
|
||||||
@ -150,7 +152,7 @@ export function init($plugin: any, store: any) {
|
|||||||
namespaced: true,
|
namespaced: true,
|
||||||
weight: 399,
|
weight: 399,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.HOST }
|
params: { resource: HCI.HOST }
|
||||||
},
|
},
|
||||||
exact: false
|
exact: false
|
||||||
@ -165,7 +167,7 @@ export function init($plugin: any, store: any) {
|
|||||||
namespaced: false,
|
namespaced: false,
|
||||||
name: VIRTUAL_TYPES.CLUSTER_MEMBERS,
|
name: VIRTUAL_TYPES.CLUSTER_MEMBERS,
|
||||||
weight: 100,
|
weight: 100,
|
||||||
route: { name: `${ PRODUCT_NAME }-c-cluster-members` },
|
route: { name: `${PRODUCT_NAME}-c-cluster-members` },
|
||||||
exact: true,
|
exact: true,
|
||||||
ifHaveType: {
|
ifHaveType: {
|
||||||
type: MANAGEMENT.CLUSTER_ROLE_TEMPLATE_BINDING,
|
type: MANAGEMENT.CLUSTER_ROLE_TEMPLATE_BINDING,
|
||||||
@ -181,7 +183,7 @@ export function init($plugin: any, store: any) {
|
|||||||
namespaced: true,
|
namespaced: true,
|
||||||
weight: 299,
|
weight: 299,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.VM }
|
params: { resource: HCI.VM }
|
||||||
},
|
},
|
||||||
exact: false
|
exact: false
|
||||||
@ -190,7 +192,7 @@ export function init($plugin: any, store: any) {
|
|||||||
basicType([HCI.VOLUME]);
|
basicType([HCI.VOLUME]);
|
||||||
configureType(HCI.VOLUME, {
|
configureType(HCI.VOLUME, {
|
||||||
location: {
|
location: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.VOLUME }
|
params: { resource: HCI.VOLUME }
|
||||||
},
|
},
|
||||||
resource: PVC,
|
resource: PVC,
|
||||||
@ -205,7 +207,7 @@ export function init($plugin: any, store: any) {
|
|||||||
namespaced: true,
|
namespaced: true,
|
||||||
weight: 199,
|
weight: 199,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.VOLUME }
|
params: { resource: HCI.VOLUME }
|
||||||
},
|
},
|
||||||
exact: false
|
exact: false
|
||||||
@ -227,7 +229,7 @@ export function init($plugin: any, store: any) {
|
|||||||
namespaced: true,
|
namespaced: true,
|
||||||
weight: 198,
|
weight: 198,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.IMAGE }
|
params: { resource: HCI.IMAGE }
|
||||||
},
|
},
|
||||||
exact: false
|
exact: false
|
||||||
@ -241,7 +243,7 @@ export function init($plugin: any, store: any) {
|
|||||||
namespaced: true,
|
namespaced: true,
|
||||||
name: 'projects-namespaces',
|
name: 'projects-namespaces',
|
||||||
weight: 98,
|
weight: 98,
|
||||||
route: { name: `${ PRODUCT_NAME }-c-cluster-projectsnamespaces` },
|
route: { name: `${PRODUCT_NAME}-c-cluster-projectsnamespaces` },
|
||||||
exact: true,
|
exact: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -255,7 +257,7 @@ export function init($plugin: any, store: any) {
|
|||||||
namespaced: true,
|
namespaced: true,
|
||||||
weight: 89,
|
weight: 89,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: NAMESPACE }
|
params: { resource: NAMESPACE }
|
||||||
},
|
},
|
||||||
exact: false,
|
exact: false,
|
||||||
@ -290,7 +292,7 @@ export function init($plugin: any, store: any) {
|
|||||||
|
|
||||||
configureType(HCI.ALERTMANAGERCONFIG, {
|
configureType(HCI.ALERTMANAGERCONFIG, {
|
||||||
location: {
|
location: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.ALERTMANAGERCONFIG },
|
params: { resource: HCI.ALERTMANAGERCONFIG },
|
||||||
},
|
},
|
||||||
resource: MONITORING.ALERTMANAGERCONFIG,
|
resource: MONITORING.ALERTMANAGERCONFIG,
|
||||||
@ -305,7 +307,7 @@ export function init($plugin: any, store: any) {
|
|||||||
namespaced: true,
|
namespaced: true,
|
||||||
weight: 87,
|
weight: 87,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.ALERTMANAGERCONFIG }
|
params: { resource: HCI.ALERTMANAGERCONFIG }
|
||||||
},
|
},
|
||||||
exact: false,
|
exact: false,
|
||||||
@ -313,7 +315,7 @@ export function init($plugin: any, store: any) {
|
|||||||
|
|
||||||
configureType(HCI.CLUSTER_FLOW, {
|
configureType(HCI.CLUSTER_FLOW, {
|
||||||
location: {
|
location: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.CLUSTER_FLOW },
|
params: { resource: HCI.CLUSTER_FLOW },
|
||||||
},
|
},
|
||||||
resource: LOGGING.CLUSTER_FLOW,
|
resource: LOGGING.CLUSTER_FLOW,
|
||||||
@ -327,7 +329,7 @@ export function init($plugin: any, store: any) {
|
|||||||
namespaced: true,
|
namespaced: true,
|
||||||
weight: 79,
|
weight: 79,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.CLUSTER_FLOW }
|
params: { resource: HCI.CLUSTER_FLOW }
|
||||||
},
|
},
|
||||||
exact: false,
|
exact: false,
|
||||||
@ -335,7 +337,7 @@ export function init($plugin: any, store: any) {
|
|||||||
|
|
||||||
configureType(HCI.CLUSTER_OUTPUT, {
|
configureType(HCI.CLUSTER_OUTPUT, {
|
||||||
location: {
|
location: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.CLUSTER_OUTPUT },
|
params: { resource: HCI.CLUSTER_OUTPUT },
|
||||||
},
|
},
|
||||||
resource: LOGGING.CLUSTER_OUTPUT,
|
resource: LOGGING.CLUSTER_OUTPUT,
|
||||||
@ -349,7 +351,7 @@ export function init($plugin: any, store: any) {
|
|||||||
namespaced: true,
|
namespaced: true,
|
||||||
weight: 78,
|
weight: 78,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.CLUSTER_OUTPUT }
|
params: { resource: HCI.CLUSTER_OUTPUT }
|
||||||
},
|
},
|
||||||
exact: false,
|
exact: false,
|
||||||
@ -357,7 +359,7 @@ export function init($plugin: any, store: any) {
|
|||||||
|
|
||||||
configureType(HCI.FLOW, {
|
configureType(HCI.FLOW, {
|
||||||
location: {
|
location: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.FLOW },
|
params: { resource: HCI.FLOW },
|
||||||
},
|
},
|
||||||
resource: LOGGING.FLOW,
|
resource: LOGGING.FLOW,
|
||||||
@ -371,7 +373,7 @@ export function init($plugin: any, store: any) {
|
|||||||
namespaced: true,
|
namespaced: true,
|
||||||
weight: 77,
|
weight: 77,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.FLOW }
|
params: { resource: HCI.FLOW }
|
||||||
},
|
},
|
||||||
exact: false,
|
exact: false,
|
||||||
@ -379,7 +381,7 @@ export function init($plugin: any, store: any) {
|
|||||||
|
|
||||||
configureType(HCI.OUTPUT, {
|
configureType(HCI.OUTPUT, {
|
||||||
location: {
|
location: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.OUTPUT },
|
params: { resource: HCI.OUTPUT },
|
||||||
},
|
},
|
||||||
resource: LOGGING.OUTPUT,
|
resource: LOGGING.OUTPUT,
|
||||||
@ -393,7 +395,7 @@ export function init($plugin: any, store: any) {
|
|||||||
namespaced: true,
|
namespaced: true,
|
||||||
weight: 76,
|
weight: 76,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.OUTPUT }
|
params: { resource: HCI.OUTPUT }
|
||||||
},
|
},
|
||||||
exact: false,
|
exact: false,
|
||||||
@ -456,7 +458,7 @@ export function init($plugin: any, store: any) {
|
|||||||
namespaced: true,
|
namespaced: true,
|
||||||
weight: 289,
|
weight: 289,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: TEMPLATE }
|
params: { resource: TEMPLATE }
|
||||||
},
|
},
|
||||||
exact: false
|
exact: false
|
||||||
@ -469,7 +471,7 @@ export function init($plugin: any, store: any) {
|
|||||||
namespaced: true,
|
namespaced: true,
|
||||||
weight: 200,
|
weight: 200,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.BACKUP }
|
params: { resource: HCI.BACKUP }
|
||||||
},
|
},
|
||||||
exact: false
|
exact: false
|
||||||
@ -485,7 +487,7 @@ export function init($plugin: any, store: any) {
|
|||||||
namespaced: false,
|
namespaced: false,
|
||||||
weight: 189,
|
weight: 189,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.CLUSTER_NETWORK }
|
params: { resource: HCI.CLUSTER_NETWORK }
|
||||||
},
|
},
|
||||||
exact: false,
|
exact: false,
|
||||||
@ -493,7 +495,7 @@ export function init($plugin: any, store: any) {
|
|||||||
|
|
||||||
configureType(HCI.NETWORK_ATTACHMENT, {
|
configureType(HCI.NETWORK_ATTACHMENT, {
|
||||||
location: {
|
location: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.NETWORK_ATTACHMENT }
|
params: { resource: HCI.NETWORK_ATTACHMENT }
|
||||||
},
|
},
|
||||||
resource: NETWORK_ATTACHMENT,
|
resource: NETWORK_ATTACHMENT,
|
||||||
@ -507,7 +509,7 @@ export function init($plugin: any, store: any) {
|
|||||||
namespaced: true,
|
namespaced: true,
|
||||||
weight: 188,
|
weight: 188,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.NETWORK_ATTACHMENT }
|
params: { resource: HCI.NETWORK_ATTACHMENT }
|
||||||
},
|
},
|
||||||
exact: false
|
exact: false
|
||||||
@ -516,7 +518,7 @@ export function init($plugin: any, store: any) {
|
|||||||
configureType(HCI.SNAPSHOT, {
|
configureType(HCI.SNAPSHOT, {
|
||||||
isCreatable: false,
|
isCreatable: false,
|
||||||
location: {
|
location: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.SNAPSHOT },
|
params: { resource: HCI.SNAPSHOT },
|
||||||
},
|
},
|
||||||
resource: VOLUME_SNAPSHOT,
|
resource: VOLUME_SNAPSHOT,
|
||||||
@ -530,7 +532,7 @@ export function init($plugin: any, store: any) {
|
|||||||
namespaced: true,
|
namespaced: true,
|
||||||
weight: 190,
|
weight: 190,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.SNAPSHOT }
|
params: { resource: HCI.SNAPSHOT }
|
||||||
},
|
},
|
||||||
exact: false,
|
exact: false,
|
||||||
@ -539,7 +541,7 @@ export function init($plugin: any, store: any) {
|
|||||||
configureType(HCI.VM_SNAPSHOT, {
|
configureType(HCI.VM_SNAPSHOT, {
|
||||||
showListMasthead: false,
|
showListMasthead: false,
|
||||||
location: {
|
location: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.VM_SNAPSHOT }
|
params: { resource: HCI.VM_SNAPSHOT }
|
||||||
},
|
},
|
||||||
resource: HCI.BACKUP,
|
resource: HCI.BACKUP,
|
||||||
@ -553,7 +555,7 @@ export function init($plugin: any, store: any) {
|
|||||||
namespaced: true,
|
namespaced: true,
|
||||||
weight: 191,
|
weight: 191,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.VM_SNAPSHOT }
|
params: { resource: HCI.VM_SNAPSHOT }
|
||||||
},
|
},
|
||||||
exact: false
|
exact: false
|
||||||
@ -566,7 +568,7 @@ export function init($plugin: any, store: any) {
|
|||||||
namespaced: true,
|
namespaced: true,
|
||||||
weight: 170,
|
weight: 170,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.SSH }
|
params: { resource: HCI.SSH }
|
||||||
},
|
},
|
||||||
exact: false
|
exact: false
|
||||||
@ -574,7 +576,7 @@ export function init($plugin: any, store: any) {
|
|||||||
|
|
||||||
configureType(HCI.CLOUD_TEMPLATE, {
|
configureType(HCI.CLOUD_TEMPLATE, {
|
||||||
location: {
|
location: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.CLOUD_TEMPLATE }
|
params: { resource: HCI.CLOUD_TEMPLATE }
|
||||||
},
|
},
|
||||||
resource: CONFIG_MAP,
|
resource: CONFIG_MAP,
|
||||||
@ -588,7 +590,7 @@ export function init($plugin: any, store: any) {
|
|||||||
namespaced: true,
|
namespaced: true,
|
||||||
weight: 87,
|
weight: 87,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.CLOUD_TEMPLATE }
|
params: { resource: HCI.CLOUD_TEMPLATE }
|
||||||
},
|
},
|
||||||
exact: false
|
exact: false
|
||||||
@ -610,7 +612,7 @@ export function init($plugin: any, store: any) {
|
|||||||
|
|
||||||
configureType(HCI.SECRET, {
|
configureType(HCI.SECRET, {
|
||||||
location: {
|
location: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.SECRET }
|
params: { resource: HCI.SECRET }
|
||||||
},
|
},
|
||||||
resource: SECRET,
|
resource: SECRET,
|
||||||
@ -625,7 +627,7 @@ export function init($plugin: any, store: any) {
|
|||||||
namespaced: true,
|
namespaced: true,
|
||||||
weight: -999,
|
weight: -999,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.SECRET }
|
params: { resource: HCI.SECRET }
|
||||||
},
|
},
|
||||||
exact: false
|
exact: false
|
||||||
@ -641,7 +643,7 @@ export function init($plugin: any, store: any) {
|
|||||||
namespaced: true,
|
namespaced: true,
|
||||||
weight: -1000,
|
weight: -1000,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.SETTING }
|
params: { resource: HCI.SETTING }
|
||||||
},
|
},
|
||||||
exact: false
|
exact: false
|
||||||
@ -649,7 +651,7 @@ export function init($plugin: any, store: any) {
|
|||||||
|
|
||||||
configureType(HCI.STORAGE, {
|
configureType(HCI.STORAGE, {
|
||||||
location: {
|
location: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.STORAGE }
|
params: { resource: HCI.STORAGE }
|
||||||
},
|
},
|
||||||
resource: STORAGE_CLASS,
|
resource: STORAGE_CLASS,
|
||||||
@ -665,7 +667,7 @@ export function init($plugin: any, store: any) {
|
|||||||
namespaced: false,
|
namespaced: false,
|
||||||
weight: 79,
|
weight: 79,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.STORAGE }
|
params: { resource: HCI.STORAGE }
|
||||||
},
|
},
|
||||||
exact: false,
|
exact: false,
|
||||||
@ -678,7 +680,7 @@ export function init($plugin: any, store: any) {
|
|||||||
name: HCI.PCI_DEVICE,
|
name: HCI.PCI_DEVICE,
|
||||||
namespaced: false,
|
namespaced: false,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.PCI_DEVICE }
|
params: { resource: HCI.PCI_DEVICE }
|
||||||
},
|
},
|
||||||
exact: false,
|
exact: false,
|
||||||
@ -713,7 +715,7 @@ export function init($plugin: any, store: any) {
|
|||||||
name: HCI.SR_IOV,
|
name: HCI.SR_IOV,
|
||||||
namespaced: false,
|
namespaced: false,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.SR_IOV }
|
params: { resource: HCI.SR_IOV }
|
||||||
},
|
},
|
||||||
exact: false
|
exact: false
|
||||||
@ -732,7 +734,7 @@ export function init($plugin: any, store: any) {
|
|||||||
name: HCI.SR_IOVGPU_DEVICE,
|
name: HCI.SR_IOVGPU_DEVICE,
|
||||||
namespaced: false,
|
namespaced: false,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.SR_IOVGPU_DEVICE }
|
params: { resource: HCI.SR_IOVGPU_DEVICE }
|
||||||
},
|
},
|
||||||
exact: false,
|
exact: false,
|
||||||
@ -750,7 +752,7 @@ export function init($plugin: any, store: any) {
|
|||||||
name: HCI.VGPU_DEVICE,
|
name: HCI.VGPU_DEVICE,
|
||||||
namespaced: false,
|
namespaced: false,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.VGPU_DEVICE }
|
params: { resource: HCI.VGPU_DEVICE }
|
||||||
},
|
},
|
||||||
exact: false,
|
exact: false,
|
||||||
@ -784,7 +786,7 @@ export function init($plugin: any, store: any) {
|
|||||||
weight: -900,
|
weight: -900,
|
||||||
namespaced: false,
|
namespaced: false,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.ADD_ONS }
|
params: { resource: HCI.ADD_ONS }
|
||||||
},
|
},
|
||||||
exact: false,
|
exact: false,
|
||||||
@ -792,7 +794,7 @@ export function init($plugin: any, store: any) {
|
|||||||
|
|
||||||
configureType(HCI.LB, {
|
configureType(HCI.LB, {
|
||||||
location: {
|
location: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.LB }
|
params: { resource: HCI.LB }
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -802,7 +804,7 @@ export function init($plugin: any, store: any) {
|
|||||||
namespaced: true,
|
namespaced: true,
|
||||||
weight: 185,
|
weight: 185,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.LB }
|
params: { resource: HCI.LB }
|
||||||
},
|
},
|
||||||
exact: false,
|
exact: false,
|
||||||
@ -830,7 +832,7 @@ export function init($plugin: any, store: any) {
|
|||||||
|
|
||||||
configureType(HCI.IP_POOL, {
|
configureType(HCI.IP_POOL, {
|
||||||
location: {
|
location: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.IP_POOL }
|
params: { resource: HCI.IP_POOL }
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -840,7 +842,7 @@ export function init($plugin: any, store: any) {
|
|||||||
namespaced: false,
|
namespaced: false,
|
||||||
weight: 184,
|
weight: 184,
|
||||||
route: {
|
route: {
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
name: `${PRODUCT_NAME}-c-cluster-resource`,
|
||||||
params: { resource: HCI.IP_POOL }
|
params: { resource: HCI.IP_POOL }
|
||||||
},
|
},
|
||||||
exact: false,
|
exact: false,
|
||||||
|
|||||||
18
pkg/harvester/routing/harvester-routing.js
Normal file
18
pkg/harvester/routing/harvester-routing.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import { RouteRecordRaw } from 'vue-router';
|
||||||
|
import { PRODUCT_NAME } from '../config/harvester-manager';
|
||||||
|
|
||||||
|
import Root from '../pages/c/_cluster/index.vue';
|
||||||
|
import ListHarvesterMgrResource from '../pages/c/_cluster/_resource/index.vue';
|
||||||
|
import CreateHarvesterMgrResource from '../pages/c/_cluster/_resource/create.vue';
|
||||||
|
import ViewHarvesterMgrResource from '../pages/c/_cluster/_resource/_id.vue';
|
||||||
|
import ClusterListPage from '../list/harvesterhci.io.management.cluster.vue';
|
||||||
|
|
||||||
|
const routes = [
|
||||||
|
{
|
||||||
|
path: '/harvesterManager/clusters',
|
||||||
|
name: `${ PRODUCT_NAME }-c-cluster-list-page`,
|
||||||
|
component: ClusterListPage,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export default routes;
|
||||||
@ -1,83 +0,0 @@
|
|||||||
// eslint-disable-next-line import/named
|
|
||||||
// import { RouteRecordRaw } from 'vue-router';
|
|
||||||
import { PRODUCT_NAME } from '../config/harvester';
|
|
||||||
|
|
||||||
import Root from '../pages/c/_cluster/index.vue';
|
|
||||||
import HarvesterSupport from '../pages/c/_cluster/support/index.vue';
|
|
||||||
import HarvesterConsoleSerial from '../pages/c/_cluster/console/_uid/serial.vue';
|
|
||||||
import HarvesterConsoleVnc from '../pages/c/_cluster/console/_uid/vnc.vue';
|
|
||||||
import ListHarvesterResource from '../pages/c/_cluster/_resource/index.vue';
|
|
||||||
import HarvesterBrand from '../pages/c/_cluster/brand/index.vue';
|
|
||||||
import CreateHarvesterResource from '../pages/c/_cluster/_resource/create.vue';
|
|
||||||
import ViewHarvesterResource from '../pages/c/_cluster/_resource/_id.vue';
|
|
||||||
import ViewHarvesterNsResource from '../pages/c/_cluster/_resource/_namespace/_id.vue';
|
|
||||||
import HarvesterAirgapUpdgrade from '../pages/c/_cluster/airgapupgrade/index.vue';
|
|
||||||
import HarvesterMembers from '../pages/c/_cluster/members/index.vue';
|
|
||||||
import ProjectNamespaces from '../pages/c/_cluster/projectsnamespaces.vue';
|
|
||||||
import HarvesterAlertmanagerReceiver from '../pages/c/_cluster/alertmanagerconfig/_alertmanagerconfigid/receiver.vue';
|
|
||||||
|
|
||||||
const routes: any[] = [
|
|
||||||
{
|
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-support`,
|
|
||||||
path: `/:product/c/:cluster/support`,
|
|
||||||
component: HarvesterSupport,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-console-uid-serial`,
|
|
||||||
path: `/:product/c/:cluster/console/:uid/serial`,
|
|
||||||
component: HarvesterConsoleSerial,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-console-uid-vnc`,
|
|
||||||
path: `/:product/c/:cluster/console/:uid/vnc`,
|
|
||||||
component: HarvesterConsoleVnc,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-airgapupgrade`,
|
|
||||||
path: `/:product/c/:cluster/airgapupgrade`,
|
|
||||||
component: HarvesterAirgapUpdgrade,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-brand`,
|
|
||||||
path: `/:product/c/:cluster/brand`,
|
|
||||||
component: HarvesterBrand,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-alertmanagerconfig-alertmanagerconfigid-receiver`,
|
|
||||||
path: `/:product/c/:cluster/alertmanagerconfig/:alertmanagerconfigid/receiver`,
|
|
||||||
component: HarvesterAlertmanagerReceiver,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-members`,
|
|
||||||
path: `/:product/c/:cluster/members`,
|
|
||||||
component: HarvesterMembers,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: `${ PRODUCT_NAME }-c-cluster`,
|
|
||||||
path: `/:product/c/:cluster`,
|
|
||||||
component: Root,
|
|
||||||
}, {
|
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-projectsnamespaces`,
|
|
||||||
path: `/:product/c/:cluster/projectsnamespaces`,
|
|
||||||
component: ProjectNamespaces,
|
|
||||||
}, {
|
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
|
||||||
path: `/:product/c/:cluster/:resource`,
|
|
||||||
component: ListHarvesterResource,
|
|
||||||
}, {
|
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource-create`,
|
|
||||||
path: `/:product/c/:cluster/:resource/create`,
|
|
||||||
component: CreateHarvesterResource,
|
|
||||||
}, {
|
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource-id`,
|
|
||||||
path: `/:product/c/:cluster/:resource/:id`,
|
|
||||||
component: ViewHarvesterResource,
|
|
||||||
}, {
|
|
||||||
name: `${ PRODUCT_NAME }-c-cluster-resource-namespace-id`,
|
|
||||||
path: `/:product/c/:cluster/:resource/:namespace/:id`,
|
|
||||||
component: ViewHarvesterNsResource,
|
|
||||||
},
|
|
||||||
|
|
||||||
];
|
|
||||||
|
|
||||||
export default routes;
|
|
||||||
@ -30,7 +30,6 @@
|
|||||||
"./node_modules/@rancher/shell/types"
|
"./node_modules/@rancher/shell/types"
|
||||||
],
|
],
|
||||||
"types": [
|
"types": [
|
||||||
"@types/jest",
|
|
||||||
"@types/node",
|
"@types/node",
|
||||||
"cypress",
|
"cypress",
|
||||||
"rancher",
|
"rancher",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user