{{ description }}
73 |{pattern}
.'
201 | stringFormat: '"{key}" must be a valid {format}.'
202 | uniqueItems: '"{key}" may not contain duplicate elements.'
203 | version: "Version format should be in the semver format prefixed with 'v'. Example: v1.9.3"
204 | name: Name is required and must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character.
205 | port: Port value must be a number.
206 | url: '"Value" must be a valid URL.'
207 | error:
208 | clusterClassNotFound: Could not find corresponding cluster class. Please check that cluster class exists and is valid.
209 |
--------------------------------------------------------------------------------
/pkg/capi/models/cluster.x-k8s.io.cluster.js:
--------------------------------------------------------------------------------
1 | import SteveModel from '@shell/plugins/steve/steve-class';
2 | import {
3 | _YAML,
4 | AS,
5 | } from '@shell/config/query-params';
6 |
7 | export default class CapiCluster extends SteveModel {
8 | get canEditYaml() {
9 | return false;
10 | }
11 |
12 | get canUpdate() {
13 | return false;
14 | }
15 |
16 | get detailLocation() {
17 | const location = super._detailLocation;
18 |
19 | return { ...location, query: { [AS]: _YAML } };
20 | }
21 |
22 | get _availableActions() {
23 | const out = super._availableActions;
24 |
25 | return out.filter((action) => action.action !== 'goToEdit' && action.action !== 'goToViewConfig');
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/pkg/capi/models/cluster.x-k8s.io.clusterclass.js:
--------------------------------------------------------------------------------
1 | import SteveModel from '@shell/plugins/steve/steve-class';
2 | import { CAPI, MANAGEMENT, LOCAL_CLUSTER } from '@shell/config/types';
3 | import { BLANK_CLUSTER, QUERY_PARAMS } from '../types/capi';
4 |
5 | export default class ClusterClass extends SteveModel {
6 | get _availableActions() {
7 | const out = super._availableActions;
8 |
9 | out.unshift({
10 | action: 'goToCreateCluster',
11 | label: this.t('action.createCluster'),
12 | icon: 'icon icon-plus',
13 | enabled: true
14 | });
15 |
16 | return out;
17 | }
18 |
19 | goToCreateCluster() {
20 | const escapedID = escape(this.id);
21 | const location = {
22 | name: 'c-cluster-product-resource-create',
23 | params: {
24 | cluster: BLANK_CLUSTER,
25 | product: 'manager',
26 | resource: CAPI.CAPI_CLUSTER
27 | },
28 | query: { [QUERY_PARAMS.CLASS]: escapedID }
29 | };
30 |
31 | this.currentRouter().push(location);
32 | }
33 |
34 | saveYaml(yaml) {
35 | const localCluster = this.$rootGetters['management/byId'](MANAGEMENT.CLUSTER, LOCAL_CLUSTER);
36 |
37 | return localCluster.doAction('apply', { yaml });
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/pkg/capi/models/turtles-capi.cattle.io.capiprovider.js:
--------------------------------------------------------------------------------
1 | import SteveModel from '@shell/plugins/steve/steve-class';
2 |
3 | export default class CapiProvider extends SteveModel {
4 | get canEditYaml() {
5 | return false;
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/pkg/capi/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "capi",
3 | "description": "UI for CAPI cluster provisioning",
4 | "version": "0.8.3-rc1",
5 | "private": false,
6 | "rancher": {
7 | "annotations": {
8 | "catalog.cattle.io/rancher-version": ">= 2.10.0-0",
9 | "catalog.cattle.io/display-name": "CAPI UI",
10 | "catalog.cattle.io/ui-extensions-version": ">= 3.0.0 < 4.0.0",
11 | "catalog.cattle.io/certified": "rancher"
12 | }
13 | },
14 | "scripts": {
15 | "dev": "./node_modules/.bin/nuxt dev",
16 | "nuxt": "./node_modules/.bin/nuxt"
17 | },
18 | "engines": {
19 | "node": ">=20"
20 | },
21 | "devDependencies": {
22 | "@vue/cli-plugin-babel": "5.0.8",
23 | "@vue/cli-service": "5.0.8",
24 | "@vue/cli-plugin-typescript": "5.0.8"
25 | },
26 | "browserslist": [
27 | "> 1%",
28 | "last 2 versions",
29 | "not dead"
30 | ]
31 | }
--------------------------------------------------------------------------------
/pkg/capi/pages/index.vue:
--------------------------------------------------------------------------------
1 |
41 |
42 |
43 |