mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-13 13:11:43 +00:00
Making harvester-manager load as an external extension
This commit is contained in:
parent
aba9c167e0
commit
40432c8261
34
package.json
34
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": {
|
||||||
|
|||||||
@ -43,14 +43,14 @@ export const IP_POOL_HEADERS = [
|
|||||||
STATE,
|
STATE,
|
||||||
NAME_COL,
|
NAME_COL,
|
||||||
{
|
{
|
||||||
name: 'subnet',
|
name: 'subnet',
|
||||||
labelKey: 'harvester.ipPool.subnet.label',
|
labelKey: 'harvester.ipPool.subnet.label',
|
||||||
value: 'subnetDisplay',
|
value: 'subnetDisplay',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'availableIP',
|
name: 'availableIP',
|
||||||
labelKey: 'harvester.ipPool.availableIP.label',
|
labelKey: 'harvester.ipPool.availableIP.label',
|
||||||
value: 'status.available',
|
value: 'status.available',
|
||||||
},
|
},
|
||||||
AGE
|
AGE
|
||||||
];
|
];
|
||||||
@ -70,59 +70,61 @@ 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
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
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
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
product({
|
product({
|
||||||
inStore: PRODUCT_NAME,
|
inStore: PRODUCT_NAME,
|
||||||
removable: false,
|
removable: false,
|
||||||
showNamespaceFilter: true,
|
showNamespaceFilter: true,
|
||||||
hideKubeShell: true,
|
hideKubeShell: true,
|
||||||
hideKubeConfig: true,
|
hideKubeConfig: true,
|
||||||
showClusterSwitcher: true,
|
showClusterSwitcher: true,
|
||||||
hideCopyConfig: true,
|
hideCopyConfig: true,
|
||||||
hideSystemResources: true,
|
hideSystemResources: true,
|
||||||
customNamespaceFilter: true,
|
customNamespaceFilter: true,
|
||||||
typeStoreMap: {
|
typeStoreMap: {
|
||||||
[MANAGEMENT.PROJECT]: 'management',
|
[MANAGEMENT.PROJECT]: 'management',
|
||||||
[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]);
|
||||||
virtualType({
|
virtualType({
|
||||||
labelKey: 'harvester.dashboard.label',
|
labelKey: 'harvester.dashboard.label',
|
||||||
group: 'Root',
|
group: 'Root',
|
||||||
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,12 +133,12 @@ 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,
|
||||||
resourceDetail: HCI.HOST,
|
resourceDetail: HCI.HOST,
|
||||||
resourceEdit: HCI.HOST
|
resourceEdit: HCI.HOST
|
||||||
});
|
});
|
||||||
|
|
||||||
configureType(HCI.HOST, { isCreatable: false, isEditable: true });
|
configureType(HCI.HOST, { isCreatable: false, isEditable: true });
|
||||||
@ -144,13 +146,13 @@ export function init($plugin: any, store: any) {
|
|||||||
|
|
||||||
virtualType({
|
virtualType({
|
||||||
ifHaveType: NODE,
|
ifHaveType: NODE,
|
||||||
labelKey: 'harvester.host.label',
|
labelKey: 'harvester.host.label',
|
||||||
group: 'Root',
|
group: 'Root',
|
||||||
name: HCI.HOST,
|
name: HCI.HOST,
|
||||||
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
|
||||||
@ -159,29 +161,29 @@ export function init($plugin: any, store: any) {
|
|||||||
// multiVirtualCluster
|
// multiVirtualCluster
|
||||||
basicType(['cluster-members'], 'rbac');
|
basicType(['cluster-members'], 'rbac');
|
||||||
virtualType({
|
virtualType({
|
||||||
ifHave: IF_HAVE.MULTI_CLUSTER,
|
ifHave: IF_HAVE.MULTI_CLUSTER,
|
||||||
labelKey: 'members.clusterMembers',
|
labelKey: 'members.clusterMembers',
|
||||||
group: 'root',
|
group: 'root',
|
||||||
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,
|
||||||
store: 'management'
|
store: 'management'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
basicType([HCI.VM]);
|
basicType([HCI.VM]);
|
||||||
virtualType({
|
virtualType({
|
||||||
labelKey: 'harvester.virtualMachine.label',
|
labelKey: 'harvester.virtualMachine.label',
|
||||||
group: 'root',
|
group: 'root',
|
||||||
name: HCI.VM,
|
name: HCI.VM,
|
||||||
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,22 +192,22 @@ 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,
|
||||||
resourceDetail: HCI.VOLUME,
|
resourceDetail: HCI.VOLUME,
|
||||||
resourceEdit: HCI.VOLUME
|
resourceEdit: HCI.VOLUME
|
||||||
});
|
});
|
||||||
virtualType({
|
virtualType({
|
||||||
labelKey: 'harvester.volume.label',
|
labelKey: 'harvester.volume.label',
|
||||||
group: 'root',
|
group: 'root',
|
||||||
ifHaveType: PVC,
|
ifHaveType: PVC,
|
||||||
name: HCI.VOLUME,
|
name: HCI.VOLUME,
|
||||||
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
|
||||||
@ -221,13 +223,13 @@ export function init($plugin: any, store: any) {
|
|||||||
AGE
|
AGE
|
||||||
]);
|
]);
|
||||||
virtualType({
|
virtualType({
|
||||||
labelKey: 'harvester.image.label',
|
labelKey: 'harvester.image.label',
|
||||||
group: 'root',
|
group: 'root',
|
||||||
name: HCI.IMAGE,
|
name: HCI.IMAGE,
|
||||||
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
|
||||||
@ -235,14 +237,14 @@ export function init($plugin: any, store: any) {
|
|||||||
|
|
||||||
basicType(['projects-namespaces']);
|
basicType(['projects-namespaces']);
|
||||||
virtualType({
|
virtualType({
|
||||||
ifHave: IF_HAVE.MULTI_CLUSTER,
|
ifHave: IF_HAVE.MULTI_CLUSTER,
|
||||||
labelKey: 'harvester.projectNamespace.label',
|
labelKey: 'harvester.projectNamespace.label',
|
||||||
group: 'root',
|
group: 'root',
|
||||||
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,
|
||||||
});
|
});
|
||||||
|
|
||||||
// singleVirtualCluster
|
// singleVirtualCluster
|
||||||
@ -250,12 +252,12 @@ export function init($plugin: any, store: any) {
|
|||||||
headers(NAMESPACE, [STATE, NAME_UNLINKED, AGE]);
|
headers(NAMESPACE, [STATE, NAME_UNLINKED, AGE]);
|
||||||
basicType([NAMESPACE]);
|
basicType([NAMESPACE]);
|
||||||
virtualType({
|
virtualType({
|
||||||
labelKey: 'harvester.namespace.label',
|
labelKey: 'harvester.namespace.label',
|
||||||
name: NAMESPACE,
|
name: NAMESPACE,
|
||||||
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,
|
||||||
@ -281,31 +283,31 @@ export function init($plugin: any, store: any) {
|
|||||||
NAME_COL,
|
NAME_COL,
|
||||||
NAMESPACE_COL,
|
NAMESPACE_COL,
|
||||||
{
|
{
|
||||||
name: 'receivers',
|
name: 'receivers',
|
||||||
labelKey: 'tableHeaders.receivers',
|
labelKey: 'tableHeaders.receivers',
|
||||||
formatter: 'ReceiverIcons',
|
formatter: 'ReceiverIcons',
|
||||||
value: 'name'
|
value: 'name'
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
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,
|
||||||
resourceDetail: HCI.ALERTMANAGERCONFIG,
|
resourceDetail: HCI.ALERTMANAGERCONFIG,
|
||||||
resourceEdit: HCI.ALERTMANAGERCONFIG
|
resourceEdit: HCI.ALERTMANAGERCONFIG
|
||||||
});
|
});
|
||||||
|
|
||||||
virtualType({
|
virtualType({
|
||||||
ifHaveType: MONITORING.ALERTMANAGERCONFIG,
|
ifHaveType: MONITORING.ALERTMANAGERCONFIG,
|
||||||
labelKey: 'harvester.monitoring.alertmanagerConfig.label',
|
labelKey: 'harvester.monitoring.alertmanagerConfig.label',
|
||||||
name: HCI.ALERTMANAGERCONFIG,
|
name: HCI.ALERTMANAGERCONFIG,
|
||||||
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,21 +315,21 @@ 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,
|
||||||
resourceDetail: HCI.CLUSTER_FLOW,
|
resourceDetail: HCI.CLUSTER_FLOW,
|
||||||
resourceEdit: HCI.CLUSTER_FLOW
|
resourceEdit: HCI.CLUSTER_FLOW
|
||||||
});
|
});
|
||||||
|
|
||||||
virtualType({
|
virtualType({
|
||||||
labelKey: 'harvester.logging.clusterFlow.label',
|
labelKey: 'harvester.logging.clusterFlow.label',
|
||||||
name: HCI.CLUSTER_FLOW,
|
name: HCI.CLUSTER_FLOW,
|
||||||
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,21 +337,21 @@ 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,
|
||||||
resourceDetail: HCI.CLUSTER_OUTPUT,
|
resourceDetail: HCI.CLUSTER_OUTPUT,
|
||||||
resourceEdit: HCI.CLUSTER_OUTPUT
|
resourceEdit: HCI.CLUSTER_OUTPUT
|
||||||
});
|
});
|
||||||
|
|
||||||
virtualType({
|
virtualType({
|
||||||
labelKey: 'harvester.logging.clusterOutput.label',
|
labelKey: 'harvester.logging.clusterOutput.label',
|
||||||
name: HCI.CLUSTER_OUTPUT,
|
name: HCI.CLUSTER_OUTPUT,
|
||||||
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,21 +359,21 @@ 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,
|
||||||
resourceDetail: HCI.FLOW,
|
resourceDetail: HCI.FLOW,
|
||||||
resourceEdit: HCI.FLOW
|
resourceEdit: HCI.FLOW
|
||||||
});
|
});
|
||||||
|
|
||||||
virtualType({
|
virtualType({
|
||||||
labelKey: 'harvester.logging.flow.label',
|
labelKey: 'harvester.logging.flow.label',
|
||||||
name: HCI.FLOW,
|
name: HCI.FLOW,
|
||||||
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,21 +381,21 @@ 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,
|
||||||
resourceDetail: HCI.OUTPUT,
|
resourceDetail: HCI.OUTPUT,
|
||||||
resourceEdit: HCI.OUTPUT
|
resourceEdit: HCI.OUTPUT
|
||||||
});
|
});
|
||||||
|
|
||||||
virtualType({
|
virtualType({
|
||||||
labelKey: 'harvester.logging.output.label',
|
labelKey: 'harvester.logging.output.label',
|
||||||
name: HCI.OUTPUT,
|
name: HCI.OUTPUT,
|
||||||
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,
|
||||||
@ -446,17 +448,17 @@ export function init($plugin: any, store: any) {
|
|||||||
|
|
||||||
configureType(HCI.CLUSTER_NETWORK, {
|
configureType(HCI.CLUSTER_NETWORK, {
|
||||||
realResource: HCI.SETTING,
|
realResource: HCI.SETTING,
|
||||||
showState: false
|
showState: false
|
||||||
});
|
});
|
||||||
|
|
||||||
virtualType({
|
virtualType({
|
||||||
labelKey: 'harvester.vmTemplate.label',
|
labelKey: 'harvester.vmTemplate.label',
|
||||||
group: 'root',
|
group: 'root',
|
||||||
name: TEMPLATE,
|
name: TEMPLATE,
|
||||||
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
|
||||||
@ -464,12 +466,12 @@ export function init($plugin: any, store: any) {
|
|||||||
|
|
||||||
configureType(HCI.BACKUP, { showListMasthead: false, showConfigView: false });
|
configureType(HCI.BACKUP, { showListMasthead: false, showConfigView: false });
|
||||||
virtualType({
|
virtualType({
|
||||||
labelKey: 'harvester.backup.label',
|
labelKey: 'harvester.backup.label',
|
||||||
name: HCI.BACKUP,
|
name: HCI.BACKUP,
|
||||||
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
|
||||||
@ -479,13 +481,13 @@ export function init($plugin: any, store: any) {
|
|||||||
|
|
||||||
configureType(HCI.CLUSTER_NETWORK, { showListMasthead: false });
|
configureType(HCI.CLUSTER_NETWORK, { showListMasthead: false });
|
||||||
virtualType({
|
virtualType({
|
||||||
labelKey: 'harvester.clusterNetwork.title',
|
labelKey: 'harvester.clusterNetwork.title',
|
||||||
name: HCI.CLUSTER_NETWORK,
|
name: HCI.CLUSTER_NETWORK,
|
||||||
ifHaveType: HCI.CLUSTER_NETWORK,
|
ifHaveType: HCI.CLUSTER_NETWORK,
|
||||||
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,21 +495,21 @@ 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,
|
||||||
resourceDetail: HCI.NETWORK_ATTACHMENT,
|
resourceDetail: HCI.NETWORK_ATTACHMENT,
|
||||||
resourceEdit: HCI.NETWORK_ATTACHMENT
|
resourceEdit: HCI.NETWORK_ATTACHMENT
|
||||||
});
|
});
|
||||||
|
|
||||||
virtualType({
|
virtualType({
|
||||||
labelKey: 'harvester.network.label',
|
labelKey: 'harvester.network.label',
|
||||||
name: HCI.NETWORK_ATTACHMENT,
|
name: HCI.NETWORK_ATTACHMENT,
|
||||||
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
|
||||||
@ -515,22 +517,22 @@ 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,
|
||||||
resourceDetail: HCI.SNAPSHOT,
|
resourceDetail: HCI.SNAPSHOT,
|
||||||
resourceEdit: HCI.SNAPSHOT,
|
resourceEdit: HCI.SNAPSHOT,
|
||||||
});
|
});
|
||||||
headers(HCI.SNAPSHOT, [STATE, NAME_COL, NAMESPACE_COL, SNAPSHOT_TARGET_VOLUME, AGE]);
|
headers(HCI.SNAPSHOT, [STATE, NAME_COL, NAMESPACE_COL, SNAPSHOT_TARGET_VOLUME, AGE]);
|
||||||
virtualType({
|
virtualType({
|
||||||
labelKey: 'harvester.snapshot.label',
|
labelKey: 'harvester.snapshot.label',
|
||||||
name: HCI.SNAPSHOT,
|
name: HCI.SNAPSHOT,
|
||||||
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,
|
||||||
@ -538,22 +540,22 @@ 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,
|
||||||
resourceDetail: HCI.VM_SNAPSHOT,
|
resourceDetail: HCI.VM_SNAPSHOT,
|
||||||
resourceEdit: HCI.VM_SNAPSHOT
|
resourceEdit: HCI.VM_SNAPSHOT
|
||||||
});
|
});
|
||||||
|
|
||||||
virtualType({
|
virtualType({
|
||||||
labelKey: 'harvester.vmSnapshot.label',
|
labelKey: 'harvester.vmSnapshot.label',
|
||||||
name: HCI.VM_SNAPSHOT,
|
name: HCI.VM_SNAPSHOT,
|
||||||
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
|
||||||
@ -561,12 +563,12 @@ export function init($plugin: any, store: any) {
|
|||||||
|
|
||||||
headers(HCI.SSH, [STATE, NAME_COL, NAMESPACE_COL, FINGERPRINT, AGE]);
|
headers(HCI.SSH, [STATE, NAME_COL, NAMESPACE_COL, FINGERPRINT, AGE]);
|
||||||
virtualType({
|
virtualType({
|
||||||
labelKey: 'harvester.sshKey.label',
|
labelKey: 'harvester.sshKey.label',
|
||||||
name: HCI.SSH,
|
name: HCI.SSH,
|
||||||
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,21 +576,21 @@ 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,
|
||||||
resourceDetail: HCI.CLOUD_TEMPLATE,
|
resourceDetail: HCI.CLOUD_TEMPLATE,
|
||||||
resourceEdit: HCI.CLOUD_TEMPLATE
|
resourceEdit: HCI.CLOUD_TEMPLATE
|
||||||
});
|
});
|
||||||
|
|
||||||
virtualType({
|
virtualType({
|
||||||
labelKey: 'harvester.cloudTemplate.label',
|
labelKey: 'harvester.cloudTemplate.label',
|
||||||
name: HCI.CLOUD_TEMPLATE,
|
name: HCI.CLOUD_TEMPLATE,
|
||||||
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
|
||||||
@ -600,9 +602,9 @@ export function init($plugin: any, store: any) {
|
|||||||
NAMESPACE_COL,
|
NAMESPACE_COL,
|
||||||
SUB_TYPE,
|
SUB_TYPE,
|
||||||
{
|
{
|
||||||
name: 'data',
|
name: 'data',
|
||||||
labelKey: 'tableHeaders.data',
|
labelKey: 'tableHeaders.data',
|
||||||
value: 'dataPreview',
|
value: 'dataPreview',
|
||||||
formatter: 'SecretData'
|
formatter: 'SecretData'
|
||||||
},
|
},
|
||||||
AGE
|
AGE
|
||||||
@ -610,22 +612,22 @@ 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,
|
||||||
resourceDetail: HCI.SECRET,
|
resourceDetail: HCI.SECRET,
|
||||||
resourceEdit: HCI.SECRET,
|
resourceEdit: HCI.SECRET,
|
||||||
notFilterNamespace: ['cattle-monitoring-system', 'cattle-logging-system']
|
notFilterNamespace: ['cattle-monitoring-system', 'cattle-logging-system']
|
||||||
});
|
});
|
||||||
|
|
||||||
virtualType({
|
virtualType({
|
||||||
labelKey: 'harvester.secret.label',
|
labelKey: 'harvester.secret.label',
|
||||||
name: HCI.SECRET,
|
name: HCI.SECRET,
|
||||||
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
|
||||||
@ -636,12 +638,12 @@ export function init($plugin: any, store: any) {
|
|||||||
virtualType({
|
virtualType({
|
||||||
ifHaveType: HCI.SETTING,
|
ifHaveType: HCI.SETTING,
|
||||||
ifHaveVerb: 'POST',
|
ifHaveVerb: 'POST',
|
||||||
labelKey: 'harvester.setting.label',
|
labelKey: 'harvester.setting.label',
|
||||||
name: HCI.SETTING,
|
name: HCI.SETTING,
|
||||||
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,56 +651,56 @@ 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,
|
||||||
resourceDetail: HCI.STORAGE,
|
resourceDetail: HCI.STORAGE,
|
||||||
resourceEdit: HCI.STORAGE,
|
resourceEdit: HCI.STORAGE,
|
||||||
isCreatable: true,
|
isCreatable: true,
|
||||||
});
|
});
|
||||||
virtualType({
|
virtualType({
|
||||||
labelKey: 'harvester.storage.title',
|
labelKey: 'harvester.storage.title',
|
||||||
group: 'root',
|
group: 'root',
|
||||||
ifHaveType: STORAGE_CLASS,
|
ifHaveType: STORAGE_CLASS,
|
||||||
name: HCI.STORAGE,
|
name: HCI.STORAGE,
|
||||||
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,
|
||||||
});
|
});
|
||||||
|
|
||||||
virtualType({
|
virtualType({
|
||||||
label: 'PCI Devices',
|
label: 'PCI Devices',
|
||||||
group: 'advanced',
|
group: 'advanced',
|
||||||
weight: 14,
|
weight: 14,
|
||||||
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,
|
||||||
});
|
});
|
||||||
|
|
||||||
configureType(HCI.PCI_DEVICE, {
|
configureType(HCI.PCI_DEVICE, {
|
||||||
isCreatable: false,
|
isCreatable: false,
|
||||||
hiddenNamespaceGroupButton: true,
|
hiddenNamespaceGroupButton: true,
|
||||||
listGroups: [
|
listGroups: [
|
||||||
{
|
{
|
||||||
icon: 'icon-list-grouped',
|
icon: 'icon-list-grouped',
|
||||||
value: 'description',
|
value: 'description',
|
||||||
field: 'groupByDevice',
|
field: 'groupByDevice',
|
||||||
hideColumn: 'description',
|
hideColumn: 'description',
|
||||||
tooltipKey: 'resourceTable.groupBy.device'
|
tooltipKey: 'resourceTable.groupBy.device'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: 'icon-cluster',
|
icon: 'icon-cluster',
|
||||||
value: 'node',
|
value: 'node',
|
||||||
field: 'groupByNode',
|
field: 'groupByNode',
|
||||||
hideColumn: 'node',
|
hideColumn: 'node',
|
||||||
tooltipKey: 'resourceTable.groupBy.node'
|
tooltipKey: 'resourceTable.groupBy.node'
|
||||||
}
|
}
|
||||||
@ -707,63 +709,63 @@ export function init($plugin: any, store: any) {
|
|||||||
|
|
||||||
virtualType({
|
virtualType({
|
||||||
ifHaveType: HCI.SR_IOV,
|
ifHaveType: HCI.SR_IOV,
|
||||||
labelKey: 'harvester.sriov.label',
|
labelKey: 'harvester.sriov.label',
|
||||||
group: 'advanced',
|
group: 'advanced',
|
||||||
weight: 15,
|
weight: 15,
|
||||||
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
|
||||||
});
|
});
|
||||||
|
|
||||||
configureType(HCI.SR_IOV, {
|
configureType(HCI.SR_IOV, {
|
||||||
isCreatable: false,
|
isCreatable: false,
|
||||||
hiddenNamespaceGroupButton: true,
|
hiddenNamespaceGroupButton: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
virtualType({
|
virtualType({
|
||||||
ifHaveType: HCI.SR_IOVGPU_DEVICE,
|
ifHaveType: HCI.SR_IOVGPU_DEVICE,
|
||||||
labelKey: 'harvester.sriovgpu.label',
|
labelKey: 'harvester.sriovgpu.label',
|
||||||
group: 'advanced',
|
group: 'advanced',
|
||||||
weight: 13,
|
weight: 13,
|
||||||
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,
|
||||||
});
|
});
|
||||||
|
|
||||||
configureType(HCI.SR_IOVGPU_DEVICE, {
|
configureType(HCI.SR_IOVGPU_DEVICE, {
|
||||||
isCreatable: false,
|
isCreatable: false,
|
||||||
hiddenNamespaceGroupButton: true,
|
hiddenNamespaceGroupButton: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
virtualType({
|
virtualType({
|
||||||
labelKey: 'harvester.vgpu.label',
|
labelKey: 'harvester.vgpu.label',
|
||||||
group: 'advanced',
|
group: 'advanced',
|
||||||
weight: 12,
|
weight: 12,
|
||||||
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,
|
||||||
});
|
});
|
||||||
|
|
||||||
configureType(HCI.VGPU_DEVICE, {
|
configureType(HCI.VGPU_DEVICE, {
|
||||||
isCreatable: false,
|
isCreatable: false,
|
||||||
hiddenNamespaceGroupButton: true,
|
hiddenNamespaceGroupButton: true,
|
||||||
listGroups: [
|
listGroups: [
|
||||||
{
|
{
|
||||||
icon: 'icon-cluster',
|
icon: 'icon-cluster',
|
||||||
value: 'node',
|
value: 'node',
|
||||||
field: 'groupByNode',
|
field: 'groupByNode',
|
||||||
hideColumn: 'node',
|
hideColumn: 'node',
|
||||||
tooltipKey: 'resourceTable.groupBy.node'
|
tooltipKey: 'resourceTable.groupBy.node'
|
||||||
}
|
}
|
||||||
@ -773,18 +775,18 @@ export function init($plugin: any, store: any) {
|
|||||||
configureType(HCI.ADD_ONS, {
|
configureType(HCI.ADD_ONS, {
|
||||||
isCreatable: false,
|
isCreatable: false,
|
||||||
isRemovable: false,
|
isRemovable: false,
|
||||||
showState: false,
|
showState: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
virtualType({
|
virtualType({
|
||||||
label: 'Addons',
|
label: 'Addons',
|
||||||
group: 'advanced',
|
group: 'advanced',
|
||||||
name: HCI.ADD_ONS,
|
name: HCI.ADD_ONS,
|
||||||
ifHaveType: HCI.ADD_ONS,
|
ifHaveType: HCI.ADD_ONS,
|
||||||
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,20 +794,20 @@ 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 }
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
virtualType({
|
virtualType({
|
||||||
labelKey: 'harvester.loadBalancer.label',
|
labelKey: 'harvester.loadBalancer.label',
|
||||||
name: HCI.LB,
|
name: HCI.LB,
|
||||||
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,
|
||||||
ifHaveType: HCI.LB,
|
ifHaveType: HCI.LB,
|
||||||
});
|
});
|
||||||
headers(HCI.LB, [
|
headers(HCI.LB, [
|
||||||
@ -816,34 +818,34 @@ export function init($plugin: any, store: any) {
|
|||||||
formatter: 'HarvesterListener',
|
formatter: 'HarvesterListener',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'workloadType',
|
name: 'workloadType',
|
||||||
labelKey: 'harvester.loadBalancer.workloadType.label',
|
labelKey: 'harvester.loadBalancer.workloadType.label',
|
||||||
value: 'workloadTypeDisplay',
|
value: 'workloadTypeDisplay',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'ipam',
|
name: 'ipam',
|
||||||
labelKey: 'harvester.loadBalancer.ipam.label',
|
labelKey: 'harvester.loadBalancer.ipam.label',
|
||||||
value: 'ipamDisplay',
|
value: 'ipamDisplay',
|
||||||
},
|
},
|
||||||
AGE
|
AGE
|
||||||
]);
|
]);
|
||||||
|
|
||||||
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 }
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
virtualType({
|
virtualType({
|
||||||
labelKey: 'harvester.ipPool.label',
|
labelKey: 'harvester.ipPool.label',
|
||||||
name: HCI.IP_POOL,
|
name: HCI.IP_POOL,
|
||||||
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,
|
||||||
ifHaveType: HCI.IP_POOL,
|
ifHaveType: HCI.IP_POOL,
|
||||||
});
|
});
|
||||||
headers(HCI.IP_POOL, IP_POOL_HEADERS);
|
headers(HCI.IP_POOL, IP_POOL_HEADERS);
|
||||||
|
|||||||
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;
|
|
||||||
@ -16,7 +16,7 @@
|
|||||||
"typeRoots": [
|
"typeRoots": [
|
||||||
"../../node_modules",
|
"../../node_modules",
|
||||||
"../../node_modules/@rancher/shell/types"
|
"../../node_modules/@rancher/shell/types"
|
||||||
],
|
],
|
||||||
"types": [
|
"types": [
|
||||||
"node",
|
"node",
|
||||||
"webpack-env",
|
"webpack-env",
|
||||||
@ -50,4 +50,4 @@
|
|||||||
"exclude": [
|
"exclude": [
|
||||||
"../../node_modules"
|
"../../node_modules"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -28,9 +28,8 @@
|
|||||||
"typeRoots": [
|
"typeRoots": [
|
||||||
"./node_modules",
|
"./node_modules",
|
||||||
"./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