@rancher/shell 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/styles/app.scss +1 -1
- package/assets/styles/fonts/_fontstack.scss +11 -11
- package/assets/styles/vendor/vue-js-modal.scss +3 -3
- package/assets/translations/en-us.yaml +92 -22
- package/assets/translations/zh-hans.yaml +84 -15
- package/babel.config.js +13 -0
- package/chart/gatekeeper.vue +77 -0
- package/chart/istio.vue +108 -111
- package/chart/logging/index.vue +13 -4
- package/chart/monitoring/index.vue +15 -5
- package/chart/monitoring/steps/uninstall-v1.vue +2 -2
- package/chart/rancher-backup/index.vue +10 -3
- package/cloud-credential/aws.vue +1 -1
- package/cloud-credential/digitalocean.vue +1 -1
- package/cloud-credential/gcp.vue +1 -1
- package/cloud-credential/generic.vue +2 -2
- package/cloud-credential/linode.vue +1 -1
- package/cloud-credential/pnap.vue +1 -1
- package/components/ActionMenu.vue +3 -4
- package/components/AssignTo.vue +1 -1
- package/components/AsyncButton.vue +1 -1
- package/components/BannerGraphic.vue +1 -1
- package/components/ButtonDropdown.vue +2 -3
- package/components/ChartPsp.vue +76 -0
- package/components/CruResource.vue +6 -2
- package/components/DashboardMetrics.vue +12 -10
- package/components/DetailText.vue +1 -1
- package/components/DisableAuthProviderModal.vue +1 -1
- package/components/EmberPage.vue +1 -1
- package/components/EtcdInfoBanner.vue +5 -4
- package/components/ExplorerMembers.vue +1 -1
- package/components/ExplorerProjectsNamespaces.vue +14 -1
- package/components/FileDiff.vue +6 -7
- package/components/GrafanaDashboard.vue +18 -21
- package/components/LazyImage.vue +10 -12
- package/components/LogItem.vue +1 -1
- package/components/Markdown.vue +1 -1
- package/components/PromptRemove.vue +2 -2
- package/components/PromptRestore.vue +1 -1
- package/components/ResourceDetail/Masthead.vue +16 -0
- package/components/ResourceDetail/index.vue +21 -4
- package/components/ResourceList/index.vue +1 -1
- package/components/ResourceTable.vue +4 -1
- package/components/SingleClusterInfo.vue +2 -2
- package/components/SortableTable/THead.vue +1 -1
- package/components/SortableTable/index.vue +5 -2
- package/components/__tests__/AsyncButton.test.ts +3 -1
- package/components/__tests__/ChartPsp.test.ts +75 -0
- package/components/__tests__/CruResource.test.ts +3 -1
- package/components/auth/Principal.vue +1 -1
- package/components/fleet/FleetBundles.vue +3 -1
- package/components/fleet/FleetClusters.vue +1 -2
- package/components/fleet/FleetIntro.vue +9 -1
- package/components/fleet/FleetNoWorkspaces.vue +62 -0
- package/components/fleet/FleetSummary.vue +7 -1
- package/components/form/LabeledSelect.vue +14 -11
- package/components/form/MatchExpressions.vue +17 -2
- package/components/form/NameNsDescription.vue +31 -45
- package/components/form/ResourceSelector.vue +1 -1
- package/components/form/SecretSelector.vue +5 -1
- package/components/form/ServiceNameSelect.vue +1 -1
- package/components/form/SimpleSecretSelector.vue +9 -9
- package/components/form/__tests__/LabeledSelect.test.ts +138 -0
- package/components/form/__tests__/NameNsDescription.ts +32 -0
- package/components/formatter/InternalExternalIP.vue +6 -0
- package/components/formatter/InvolvedObjectLink.vue +54 -0
- package/components/formatter/Link.vue +20 -4
- package/components/formatter/LinkName.vue +6 -1
- package/components/formatter/ServiceTargets.vue +1 -1
- package/components/nav/Group.vue +2 -2
- package/components/nav/NamespaceFilter.vue +15 -11
- package/components/nav/TopLevelMenu.vue +2 -4
- package/components/nav/Type.vue +1 -1
- package/components/nav/WorkspaceSwitcher.vue +46 -5
- package/config/labels-annotations.js +17 -0
- package/config/product/auth.js +3 -2
- package/config/product/explorer.js +11 -4
- package/config/product/fleet.js +2 -0
- package/config/router.js +414 -0
- package/config/table-headers.js +10 -2
- package/config/types.js +11 -8
- package/config/uiplugins.js +30 -0
- package/content/docs/en-us/whats-new.md +10 -0
- package/content/docs/zh-hans/whats-new.md +11 -1
- package/core/plugin-routes.ts +23 -0
- package/creators/app/app.package.json +2 -1
- package/creators/app/files/.eslintrc.js +1 -1
- package/creators/app/files/babel.config.js +1 -18
- package/creators/app/files/vue.config.js +7 -0
- package/creators/app/init +5 -5
- package/creators/pkg/files/.github/workflows/build-extension.yml +111 -0
- package/creators/pkg/init +35 -4
- package/creators/update/init +1 -1
- package/detail/constraints.gatekeeper.sh.constraint.vue +20 -10
- package/detail/fleet.cattle.io.gitrepo.vue +19 -11
- package/detail/harvesterhci.io.management.cluster.vue +3 -3
- package/detail/provisioning.cattle.io.cluster.vue +54 -12
- package/detail/workload/index.vue +3 -3
- package/dialog/AddClusterMemberDialog.vue +1 -1
- package/dialog/AddProjectMemberDialog.vue +2 -2
- package/dialog/AddonConfigConfirmationDialog.vue +27 -15
- package/dialog/DiagnosticTimingsDialog.vue +1 -1
- package/dialog/ForceMachineRemoveDialog.vue +1 -1
- package/dialog/GenericPrompt.vue +18 -6
- package/dialog/RotateEncryptionKeyDialog.vue +1 -1
- package/dialog/SaveAsRKETemplateDialog.vue +1 -1
- package/dialog/ScaleMachineDownDialog.vue +1 -1
- package/edit/auth/github.vue +8 -8
- package/edit/auth/googleoauth.vue +5 -5
- package/edit/auth/ldap/index.vue +1 -1
- package/edit/auth/oidc.vue +1 -1
- package/edit/auth/saml.vue +1 -1
- package/edit/cis.cattle.io.clusterscan.vue +1 -1
- package/edit/fleet.cattle.io.clustergroup.vue +6 -4
- package/edit/fleet.cattle.io.gitrepo.vue +16 -3
- package/edit/helm.cattle.io.projecthelmchart.vue +5 -1
- package/edit/management.cattle.io.fleetworkspace.vue +141 -6
- package/edit/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +4 -1
- package/edit/management.cattle.io.setting.vue +1 -1
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/webhook.vue +2 -2
- package/edit/monitoring.coreos.com.receiver/tls.vue +18 -18
- package/edit/monitoring.coreos.com.receiver/types/webhook.banner.vue +4 -4
- package/edit/monitoring.coreos.com.receiver/types/webhook.vue +1 -1
- package/edit/namespace.vue +2 -2
- package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +126 -45
- package/edit/networking.k8s.io.networkpolicy/index.vue +1 -1
- package/edit/provisioning.cattle.io.cluster/MachinePool.vue +10 -0
- package/edit/provisioning.cattle.io.cluster/RegistryConfigs.vue +1 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +202 -2
- package/edit/provisioning.cattle.io.cluster/rke2.vue +248 -84
- package/edit/resources.cattle.io.backup.vue +1 -1
- package/edit/service.vue +1 -1
- package/edit/storage.k8s.io.storageclass/provisioners/driver.harvesterhci.io.vue +2 -2
- package/edit/workload/__tests__/Job.test.ts +3 -1
- package/edit/workload/index.vue +8 -3
- package/edit/workload/mixins/workload.js +16 -0
- package/layouts/default.vue +7 -3
- package/list/fleet.cattle.io.bundle.vue +6 -3
- package/list/fleet.cattle.io.clusterregistrationtoken.vue +3 -1
- package/list/fleet.cattle.io.gitrepo.vue +44 -5
- package/list/management.cattle.io.fleetworkspace.vue +45 -0
- package/list/node.vue +69 -16
- package/list/provisioning.cattle.io.cluster.vue +30 -1
- package/machine-config/azure.vue +97 -38
- package/middleware/authenticated.js +34 -0
- package/mixins/chart.js +73 -2
- package/mixins/resource-fetch.js +2 -2
- package/models/apps.statefulset.js +28 -0
- package/models/cluster/node.js +23 -2
- package/models/cluster.x-k8s.io.machine.js +4 -2
- package/models/clusterroletemplatebinding.js +7 -0
- package/models/constraints.gatekeeper.sh.constraint.js +9 -0
- package/models/fleet.cattle.io.cluster.js +19 -10
- package/models/fleet.cattle.io.gitrepo.js +7 -2
- package/models/management.cattle.io.cluster.js +1 -1
- package/models/management.cattle.io.fleetworkspace.js +12 -0
- package/models/management.cattle.io.gitreporestriction.js +5 -0
- package/models/management.cattle.io.podsecurityadmissionconfigurationtemplate.js +3 -0
- package/models/provisioning.cattle.io.cluster.js +7 -5
- package/nuxt/App.js +210 -0
- package/nuxt/axios.js +186 -0
- package/nuxt/client.js +817 -0
- package/nuxt/components/nuxt-build-indicator.vue +143 -0
- package/nuxt/components/nuxt-child.js +122 -0
- package/nuxt/components/nuxt-error.vue +98 -0
- package/nuxt/components/nuxt-link.client.js +98 -0
- package/nuxt/components/nuxt-link.server.js +16 -0
- package/nuxt/components/nuxt-loading.vue +154 -0
- package/nuxt/components/nuxt.js +101 -0
- package/nuxt/cookie-universal-nuxt.js +9 -0
- package/nuxt/empty.js +1 -0
- package/nuxt/index.js +365 -0
- package/nuxt/jsonp.js +82 -0
- package/nuxt/loading.html +39 -0
- package/nuxt/middleware.js +12 -0
- package/nuxt/mixins/fetch.client.js +90 -0
- package/nuxt/mixins/fetch.server.js +69 -0
- package/nuxt/portal-vue.js +4 -0
- package/nuxt/server.js +312 -0
- package/nuxt/store.js +178 -0
- package/nuxt/utils.js +630 -0
- package/nuxt/views/app.template.html +9 -0
- package/nuxt/views/error.html +23 -0
- package/package.json +5 -9
- package/pages/auth/setup.vue +2 -2
- package/pages/c/_cluster/apps/charts/__tests__/install.helper.test.ts +33 -0
- package/pages/c/_cluster/apps/charts/chart.vue +4 -4
- package/pages/c/_cluster/apps/charts/install.helpers.js +26 -0
- package/pages/c/_cluster/apps/charts/install.vue +40 -66
- package/pages/c/_cluster/explorer/EventsTable.vue +5 -19
- package/pages/c/_cluster/explorer/index.vue +29 -25
- package/pages/c/_cluster/explorer/tools/index.vue +8 -8
- package/pages/c/_cluster/fleet/index.vue +95 -34
- package/pages/c/_cluster/gatekeeper/index.vue +1 -1
- package/pages/c/_cluster/istio/index.vue +5 -5
- package/pages/c/_cluster/manager/cloudCredential/index.vue +1 -1
- package/pages/c/_cluster/monitoring/index.vue +7 -0
- package/pages/c/_cluster/uiplugins/InstallDialog.vue +8 -8
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +20 -7
- package/pages/c/_cluster/uiplugins/index.vue +49 -17
- package/pages/home.vue +9 -4
- package/pages/index.vue +10 -1
- package/plugins/clean-html-directive.js +31 -0
- package/plugins/dashboard-store/actions.js +32 -9
- package/plugins/dashboard-store/mutations.js +5 -2
- package/plugins/dashboard-store/resource-class.js +8 -1
- package/plugins/steve/mutations.js +3 -2
- package/plugins/steve/steve-description-class.js +5 -1
- package/plugins/steve/subscribe.js +63 -54
- package/plugins/steve-create-worker.js +14 -0
- package/promptRemove/management.cattle.io.globalrole.vue +2 -2
- package/promptRemove/management.cattle.io.project.vue +2 -2
- package/promptRemove/management.cattle.io.roletemplate.vue +2 -2
- package/promptRemove/pod.vue +1 -1
- package/public/index.html +65 -0
- package/rancher-components/components/Banner/Banner.test.ts +9 -1
- package/rancher-components/components/Banner/Banner.vue +1 -1
- package/rancher-components/components/Form/Checkbox/Checkbox.vue +2 -0
- package/rancher-components/components/Form/Radio/RadioButton.vue +1 -1
- package/scripts/build-pkg.sh +1 -0
- package/scripts/clean +6 -0
- package/scripts/extension/bundle +58 -0
- package/scripts/extension/helmpatch +89 -0
- package/scripts/extension/publish +314 -0
- package/scripts/test-plugins-build.sh +4 -0
- package/store/__tests__/index.test.ts +110 -0
- package/store/index.js +145 -58
- package/store/type-map.js +5 -1
- package/tsconfig.default.json +36 -0
- package/tsconfig.json +24 -0
- package/types/shell/index.d.ts +420 -343
- package/utils/__tests__/string.test.ts +12 -0
- package/utils/auth.js +65 -0
- package/utils/monitoring.js +2 -1
- package/utils/position.js +5 -8
- package/utils/router.scrollBehavior.js +80 -0
- package/utils/select.js +1 -3
- package/utils/socket.js +1 -0
- package/utils/string.js +13 -0
- package/utils/time.js +9 -0
- package/vue.config.js +679 -0
- package/chart/rancher-alerting-drivers.vue +0 -53
- package/chart/rancher-gatekeeper.vue +0 -37
- package/creators/app/files/nuxt.config.js +0 -6
- package/models/management.cattle.io.podsecurityadmissionconfigurationtemplate.ts +0 -4
- package/nuxt.config.js +0 -798
package/creators/app/init
CHANGED
|
@@ -4,14 +4,14 @@ const path = require('path');
|
|
|
4
4
|
const fs = require('fs-extra');
|
|
5
5
|
|
|
6
6
|
const targets = {
|
|
7
|
-
dev: './node_modules/.bin/
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
dev: 'NODE_ENV=dev ./node_modules/.bin/vue-cli-service serve',
|
|
8
|
+
build: './node_modules/.bin/vue-cli-service build',
|
|
9
|
+
clean: './node_modules/@rancher/shell/scripts/clean'
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
const files = [
|
|
13
13
|
'tsconfig.json',
|
|
14
|
-
'
|
|
14
|
+
'vue.config.js',
|
|
15
15
|
'.eslintignore',
|
|
16
16
|
'.eslintrc.js',
|
|
17
17
|
'babel.config.js',
|
|
@@ -24,7 +24,7 @@ console.log('Creating Skeleton Application');
|
|
|
24
24
|
const args = process.argv;
|
|
25
25
|
let appFolder = path.resolve('.');
|
|
26
26
|
|
|
27
|
-
if (args.length
|
|
27
|
+
if (args.length === 3) {
|
|
28
28
|
const name = args[2];
|
|
29
29
|
const folder = path.resolve('.');
|
|
30
30
|
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
name: Build and Release Extension
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
10
|
+
|
|
11
|
+
env:
|
|
12
|
+
ACTIONS_RUNNER_DEBUG: false
|
|
13
|
+
CI_COMMIT_MESSAGE: CI Build Artifacts
|
|
14
|
+
|
|
15
|
+
defaults:
|
|
16
|
+
run:
|
|
17
|
+
shell: bash
|
|
18
|
+
working-directory: ./
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
build:
|
|
22
|
+
name: Build extension artifact
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
permissions: write-all
|
|
25
|
+
steps:
|
|
26
|
+
- name: Checkout
|
|
27
|
+
uses: actions/checkout@v3
|
|
28
|
+
with:
|
|
29
|
+
fetch-depth: 0
|
|
30
|
+
|
|
31
|
+
- name: Configure Git
|
|
32
|
+
run: |
|
|
33
|
+
git config user.name "$GITHUB_ACTOR"
|
|
34
|
+
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
|
35
|
+
|
|
36
|
+
- name: Setup Helm
|
|
37
|
+
uses: azure/setup-helm@v3
|
|
38
|
+
with:
|
|
39
|
+
version: v3.8.0
|
|
40
|
+
|
|
41
|
+
- name: Setup yq
|
|
42
|
+
uses: chrisdickinson/setup-yq@v1.0.1
|
|
43
|
+
with:
|
|
44
|
+
yq-version: v4.28.2
|
|
45
|
+
|
|
46
|
+
- name: Setup Nodejs and npm
|
|
47
|
+
uses: actions/setup-node@v3
|
|
48
|
+
with:
|
|
49
|
+
node-version: '16'
|
|
50
|
+
|
|
51
|
+
- name: Setup yarn
|
|
52
|
+
run: npm install -g yarn
|
|
53
|
+
|
|
54
|
+
- name: Setup Nodejs with yarn caching
|
|
55
|
+
uses: actions/setup-node@v3
|
|
56
|
+
with:
|
|
57
|
+
node-version: '16'
|
|
58
|
+
cache: yarn
|
|
59
|
+
|
|
60
|
+
- name: Install dependencies
|
|
61
|
+
run: yarn
|
|
62
|
+
|
|
63
|
+
- name: Run build script
|
|
64
|
+
shell: bash
|
|
65
|
+
id: build_script
|
|
66
|
+
run: |
|
|
67
|
+
yarn publish-pkgs -s "${{ github.repository }}" -b main
|
|
68
|
+
|
|
69
|
+
- name: Upload charts artifact
|
|
70
|
+
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
|
|
71
|
+
uses: actions/upload-artifact@v3
|
|
72
|
+
with:
|
|
73
|
+
name: charts
|
|
74
|
+
path: tmp
|
|
75
|
+
|
|
76
|
+
release:
|
|
77
|
+
name: Release Build
|
|
78
|
+
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
|
|
79
|
+
needs: build
|
|
80
|
+
runs-on: ubuntu-latest
|
|
81
|
+
permissions: write-all
|
|
82
|
+
steps:
|
|
83
|
+
- name: Checkout
|
|
84
|
+
uses: actions/checkout@v3
|
|
85
|
+
with:
|
|
86
|
+
fetch-depth: 0
|
|
87
|
+
ref: main
|
|
88
|
+
|
|
89
|
+
- name: Configure Git
|
|
90
|
+
run: |
|
|
91
|
+
git config user.name "$GITHUB_ACTOR"
|
|
92
|
+
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
|
93
|
+
|
|
94
|
+
- name: Download build artifact
|
|
95
|
+
uses: actions/download-artifact@v3
|
|
96
|
+
with:
|
|
97
|
+
name: charts
|
|
98
|
+
|
|
99
|
+
- name: Commit build
|
|
100
|
+
run: |
|
|
101
|
+
git add ./{assets,charts,extensions,index.yaml}
|
|
102
|
+
git commit -a -m "${{ env.CI_COMMIT_MESSAGE }}"
|
|
103
|
+
git push
|
|
104
|
+
|
|
105
|
+
- name: Run chart-releaser
|
|
106
|
+
uses: helm/chart-releaser-action@v1.4.1
|
|
107
|
+
with:
|
|
108
|
+
charts_dir: ./charts
|
|
109
|
+
env:
|
|
110
|
+
CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
|
|
111
|
+
CR_SKIP_EXISTING: true
|
package/creators/pkg/init
CHANGED
|
@@ -16,12 +16,13 @@ const files = [
|
|
|
16
16
|
];
|
|
17
17
|
|
|
18
18
|
const topLevelScripts = {
|
|
19
|
-
'build-pkg':
|
|
20
|
-
'serve-pkgs':
|
|
19
|
+
'build-pkg': './node_modules/@rancher/shell/scripts/build-pkg.sh',
|
|
20
|
+
'serve-pkgs': './node_modules/@rancher/shell/scripts/serve-pkgs',
|
|
21
|
+
'publish-pkgs': './node_modules/@rancher/shell/scripts/extension/publish',
|
|
21
22
|
};
|
|
22
23
|
|
|
23
24
|
const typeFolders = [
|
|
24
|
-
'
|
|
25
|
+
'l10n',
|
|
25
26
|
'models',
|
|
26
27
|
'edit',
|
|
27
28
|
'list',
|
|
@@ -42,9 +43,21 @@ const folder = path.resolve('.');
|
|
|
42
43
|
const pkgFolder = path.join(folder, 'pkg', name);
|
|
43
44
|
|
|
44
45
|
let addTypeFolders = false;
|
|
46
|
+
let addWorkflowFolder = false;
|
|
45
47
|
|
|
46
48
|
if (args.length > 3) {
|
|
47
|
-
|
|
49
|
+
for (let i = 3; i < args.length; i++) {
|
|
50
|
+
switch (args[i]) {
|
|
51
|
+
case '-t':
|
|
52
|
+
addTypeFolders = true;
|
|
53
|
+
break;
|
|
54
|
+
case '-w':
|
|
55
|
+
addWorkflowFolder = true;
|
|
56
|
+
break;
|
|
57
|
+
default:
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
48
61
|
}
|
|
49
62
|
|
|
50
63
|
const isNodeModulesShell = !fs.existsSync(path.join(folder, 'shell'));
|
|
@@ -93,6 +106,24 @@ if (addTypeFolders) {
|
|
|
93
106
|
});
|
|
94
107
|
}
|
|
95
108
|
|
|
109
|
+
// Add workflow folder if needed
|
|
110
|
+
if (addWorkflowFolder) {
|
|
111
|
+
const workflowDir = path.join(folder, '.github/workflows');
|
|
112
|
+
|
|
113
|
+
if (!fs.existsSync(workflowDir)) {
|
|
114
|
+
fs.mkdirSync(workflowDir, { recursive: true });
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const workflowFile = path.join(workflowDir, 'build-extension.yml');
|
|
118
|
+
|
|
119
|
+
if (!fs.existsSync(workflowFile)) {
|
|
120
|
+
const src = path.join(__dirname, 'files/.github/workflows', 'build-extension.yml');
|
|
121
|
+
|
|
122
|
+
console.log(` Adding file 'build-extension.yml' to root workflows`);
|
|
123
|
+
fs.copySync(src, workflowFile);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
96
127
|
// Copy base files
|
|
97
128
|
files.forEach((file) => {
|
|
98
129
|
const src = path.join(__dirname, 'files', file);
|
package/creators/update/init
CHANGED
|
@@ -38,7 +38,7 @@ Object.keys(latestPackage._pkgs).forEach((key) => {
|
|
|
38
38
|
appPackage.dependencies[key] = latestPackage._pkgs[key];
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
-
// Add in the
|
|
41
|
+
// Add in the webpack resolution
|
|
42
42
|
appPackage.resolutions = appPackage.resolutions || {};
|
|
43
43
|
appPackage.resolutions['**/webpack'] = '4';
|
|
44
44
|
|
|
@@ -1,38 +1,48 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import CreateEditView from '@shell/mixins/create-edit-view';
|
|
3
3
|
import SortableTable from '@shell/components/SortableTable';
|
|
4
|
+
import Banner from '@components/Banner/Banner.vue';
|
|
4
5
|
import { CONSTRAINT_VIOLATION_RESOURCE_LINK, CONSTRAINT_VIOLATION_MESSAGE, CONSTRAINT_VIOLATION_TYPE } from '@shell/config/table-headers';
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
|
-
components: { SortableTable },
|
|
8
|
+
components: { Banner, SortableTable },
|
|
8
9
|
mixins: [CreateEditView],
|
|
9
|
-
data(
|
|
10
|
+
data() {
|
|
10
11
|
return {
|
|
11
12
|
headers: [
|
|
12
13
|
CONSTRAINT_VIOLATION_TYPE,
|
|
13
14
|
CONSTRAINT_VIOLATION_RESOURCE_LINK,
|
|
14
15
|
CONSTRAINT_VIOLATION_MESSAGE
|
|
15
16
|
],
|
|
16
|
-
violations: this.value.violations
|
|
17
|
-
.map((violation, i) => ({ ...violation, id: i }))
|
|
17
|
+
violations: this.value.violations.map((violation, i) => ({ ...violation, id: i }))
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
</script>
|
|
22
22
|
<template>
|
|
23
23
|
<div>
|
|
24
|
-
<div
|
|
25
|
-
v-if="value.spec.enforcementAction"
|
|
26
|
-
class="row mt-
|
|
24
|
+
<div
|
|
25
|
+
v-if="value.spec.enforcementAction"
|
|
26
|
+
class="row mt-20"
|
|
27
27
|
>
|
|
28
28
|
<div class="col span-12">
|
|
29
|
-
<h3>
|
|
29
|
+
<h3>
|
|
30
|
+
{{ t('gatekeeperConstraint.enforcement.action') }}
|
|
31
|
+
</h3>
|
|
30
32
|
{{ value.spec.enforcementAction }}
|
|
31
33
|
</div>
|
|
32
34
|
</div>
|
|
33
|
-
<div class="row mt-
|
|
35
|
+
<div class="row mt-20">
|
|
34
36
|
<div class="col span-12">
|
|
35
|
-
<h3
|
|
37
|
+
<h3 class="mb-20">
|
|
38
|
+
{{ t('gatekeeperConstraint.violations.title', { total: value.totalViolations }) }}
|
|
39
|
+
</h3>
|
|
40
|
+
<Banner
|
|
41
|
+
v-if="value.totalViolations !== value.violations.length"
|
|
42
|
+
color="info"
|
|
43
|
+
>
|
|
44
|
+
{{ t('gatekeeperConstraint.violations.notAll', { shown: value.violations.length }) }}
|
|
45
|
+
</Banner>
|
|
36
46
|
<SortableTable
|
|
37
47
|
:headers="headers"
|
|
38
48
|
:rows="violations"
|
|
@@ -8,7 +8,7 @@ import { FLEET } from '@shell/config/types';
|
|
|
8
8
|
import { isHarvesterCluster } from '@shell/utils/cluster';
|
|
9
9
|
import FleetBundles from '@shell/components/fleet/FleetBundles.vue';
|
|
10
10
|
import { resourceCounts } from '@shell/components/ResourceSummary.vue';
|
|
11
|
-
import {
|
|
11
|
+
import { checkSchemasForFindAllHash } from '@shell/utils/auth';
|
|
12
12
|
|
|
13
13
|
export default {
|
|
14
14
|
name: 'DetailGitRepo',
|
|
@@ -74,16 +74,23 @@ export default {
|
|
|
74
74
|
},
|
|
75
75
|
},
|
|
76
76
|
async fetch() {
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
77
|
+
const allDispatches = await checkSchemasForFindAllHash({
|
|
78
|
+
allBundles: {
|
|
79
|
+
inStoreType: 'management',
|
|
80
|
+
type: FLEET.BUNDLE
|
|
81
|
+
},
|
|
82
|
+
allFleet: {
|
|
83
|
+
inStoreType: 'management',
|
|
84
|
+
type: FLEET.CLUSTER
|
|
85
|
+
},
|
|
86
|
+
clusterGroups: {
|
|
87
|
+
inStoreType: 'management',
|
|
88
|
+
type: FLEET.CLUSTER_GROUP
|
|
89
|
+
}
|
|
90
|
+
}, this.$store);
|
|
91
|
+
|
|
92
|
+
this.allBundles = allDispatches.allBundles || [];
|
|
93
|
+
this.allFleet = allDispatches.allFleet || [];
|
|
87
94
|
},
|
|
88
95
|
|
|
89
96
|
};
|
|
@@ -111,6 +118,7 @@ export default {
|
|
|
111
118
|
:need-related="false"
|
|
112
119
|
>
|
|
113
120
|
<Tab
|
|
121
|
+
v-if="!!allBundles.length"
|
|
114
122
|
label="Bundles"
|
|
115
123
|
name="bundles"
|
|
116
124
|
:weight="30"
|
|
@@ -81,17 +81,17 @@ export default {
|
|
|
81
81
|
class="p-10"
|
|
82
82
|
>
|
|
83
83
|
<h4
|
|
84
|
-
v-html="t('cluster.harvester.registration.step1', null, true)"
|
|
84
|
+
v-clean-html="t('cluster.harvester.registration.step1', null, true)"
|
|
85
85
|
/>
|
|
86
86
|
|
|
87
87
|
<h4
|
|
88
|
+
v-clean-html="t('cluster.harvester.registration.step2', null, true)"
|
|
88
89
|
class="mt-10"
|
|
89
|
-
v-html="t('cluster.harvester.registration.step2', null, true)"
|
|
90
90
|
/>
|
|
91
91
|
|
|
92
92
|
<h4
|
|
93
|
+
v-clean-html="t('cluster.harvester.registration.step3', null, true)"
|
|
93
94
|
class="mt-10"
|
|
94
|
-
v-html="t('cluster.harvester.registration.step3', null, true)"
|
|
95
95
|
/>
|
|
96
96
|
<CopyCode class="m-10 p-10">
|
|
97
97
|
{{ registrationURL }}
|
|
@@ -11,6 +11,7 @@ import { CAPI, MANAGEMENT, NORMAN, SNAPSHOT } from '@shell/config/types';
|
|
|
11
11
|
import {
|
|
12
12
|
STATE, NAME as NAME_COL, AGE, AGE_NORMAN, INTERNAL_EXTERNAL_IP, STATE_NORMAN, ROLES, MACHINE_NODE_OS, MANAGEMENT_NODE_OS, NAME,
|
|
13
13
|
} from '@shell/config/table-headers';
|
|
14
|
+
import { STATES_ENUM } from '@shell/plugins/dashboard-store/resource-class';
|
|
14
15
|
import CustomCommand from '@shell/edit/provisioning.cattle.io.cluster/CustomCommand';
|
|
15
16
|
import AsyncButton from '@shell/components/AsyncButton.vue';
|
|
16
17
|
import AnsiUp from 'ansi_up';
|
|
@@ -30,6 +31,7 @@ import Socket, {
|
|
|
30
31
|
import { get } from '@shell/utils/object';
|
|
31
32
|
import CapiMachineDeployment from '@shell/models/cluster.x-k8s.io.machinedeployment';
|
|
32
33
|
import { isAlternate } from '@shell/utils/platform';
|
|
34
|
+
import { defaultTableSortGenerationFn } from '@shell/components/ResourceTable.vue';
|
|
33
35
|
|
|
34
36
|
let lastId = 1;
|
|
35
37
|
const ansiup = new AnsiUp();
|
|
@@ -248,15 +250,33 @@ export default {
|
|
|
248
250
|
},
|
|
249
251
|
|
|
250
252
|
fakeMachines() {
|
|
253
|
+
const machineNameFn = (clusterName, machinePoolName) => `${ clusterName }-${ machinePoolName }`;
|
|
254
|
+
|
|
251
255
|
// When we scale up, the quantity will change to N+1 - so from 0 to 1, the quantity changes,
|
|
252
256
|
// but it takes tiem for the machine to appear, so the pool is empty, but if we just go off on a non-zero quqntity
|
|
253
257
|
// then the pool would be hidden - so we find empty pool by checking the machines
|
|
254
258
|
const emptyPools = (this.value.spec.rkeConfig?.machinePools || []).filter((mp) => {
|
|
255
|
-
const
|
|
259
|
+
const machineFullName = machineNameFn(this.value.name, mp.name);
|
|
260
|
+
|
|
256
261
|
const machines = this.value.machines.filter((machine) => {
|
|
257
262
|
const isElementalCluster = machine.spec?.infrastructureRef?.apiVersion.startsWith('elemental.cattle.io');
|
|
263
|
+
const machinePoolInfName = machine.spec?.infrastructureRef?.name;
|
|
264
|
+
|
|
265
|
+
if (isElementalCluster) {
|
|
266
|
+
return machinePoolInfName.includes(machineFullName);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// if labels exist, then the machineFullName must unequivocally be equal to manchineLabelFullName (based on labels)
|
|
270
|
+
const machineLabelClusterName = machine.metadata?.labels?.['cluster.x-k8s.io/cluster-name'];
|
|
271
|
+
const machineLabelPoolName = machine.metadata?.labels?.['rke.cattle.io/rke-machine-pool-name'];
|
|
272
|
+
|
|
273
|
+
if (machineLabelClusterName && machineLabelPoolName) {
|
|
274
|
+
const manchineLabelFullName = machineNameFn(machineLabelClusterName, machineLabelPoolName);
|
|
275
|
+
|
|
276
|
+
return machineFullName === manchineLabelFullName;
|
|
277
|
+
}
|
|
258
278
|
|
|
259
|
-
return
|
|
279
|
+
return machinePoolInfName.startsWith(machineFullName);
|
|
260
280
|
});
|
|
261
281
|
|
|
262
282
|
return machines.length === 0;
|
|
@@ -335,7 +355,7 @@ export default {
|
|
|
335
355
|
},
|
|
336
356
|
|
|
337
357
|
showEksNodeGroupWarning() {
|
|
338
|
-
if ( this.value.provisioner === 'EKS' ) {
|
|
358
|
+
if ( this.value.provisioner === 'EKS' && this.value.state !== STATES_ENUM.ACTIVE) {
|
|
339
359
|
const desiredTotal = this.value.eksNodeGroups.filter(g => g.desiredSize === 0);
|
|
340
360
|
|
|
341
361
|
if ( desiredTotal.length === this.value.eksNodeGroups.length ) {
|
|
@@ -620,6 +640,26 @@ export default {
|
|
|
620
640
|
return day(time).format(this.dateTimeFormatStr);
|
|
621
641
|
}
|
|
622
642
|
},
|
|
643
|
+
|
|
644
|
+
machineSortGenerationFn() {
|
|
645
|
+
// The sort generation function creates a unique value and is used to create a key including sort details.
|
|
646
|
+
// The unique key determines if the list is redrawn or a cached version is shown.
|
|
647
|
+
// Because we ensure the 'not in a pool' group is there via a row, and timing issues, the unqiue key doesn't change
|
|
648
|
+
// after a machine is added/removed... so the list won't update... so we need to inject a string to ensure the key is fresh
|
|
649
|
+
const base = defaultTableSortGenerationFn(this.machineSchema, this.$store);
|
|
650
|
+
|
|
651
|
+
return base + (!!this.fakeMachines.length ? '-fake' : '');
|
|
652
|
+
},
|
|
653
|
+
|
|
654
|
+
nodeSortGenerationFn() {
|
|
655
|
+
// The sort generation function creates a unique value and is used to create a key including sort details.
|
|
656
|
+
// The unique key determines if the list is redrawn or a cached version is shown.
|
|
657
|
+
// Because we ensure the 'not in a pool' group is there via a row, and timing issues, the unqiue key doesn't change
|
|
658
|
+
// after a machine is added/removed... so the list won't update... so we need to inject a string to ensure the key is fresh
|
|
659
|
+
const base = defaultTableSortGenerationFn(this.mgmtNodeSchema, this.$store);
|
|
660
|
+
|
|
661
|
+
return base + (!!this.fakeNodes.length ? '-fake' : '');
|
|
662
|
+
},
|
|
623
663
|
}
|
|
624
664
|
};
|
|
625
665
|
</script>
|
|
@@ -663,6 +703,7 @@ export default {
|
|
|
663
703
|
:group-by="value.isCustom ? null : 'poolId'"
|
|
664
704
|
group-ref="pool"
|
|
665
705
|
:group-sort="['pool.nameDisplay']"
|
|
706
|
+
:sort-generation-fn="machineSortGenerationFn"
|
|
666
707
|
>
|
|
667
708
|
<template #main-row:isFake="{fullColspan}">
|
|
668
709
|
<tr class="main-row">
|
|
@@ -686,11 +727,11 @@ export default {
|
|
|
686
727
|
>
|
|
687
728
|
<div
|
|
688
729
|
v-if="group && group.ref"
|
|
689
|
-
v-html="group.ref.groupByPoolShortLabel"
|
|
730
|
+
v-clean-html="group.ref.groupByPoolShortLabel"
|
|
690
731
|
/>
|
|
691
732
|
<div
|
|
692
733
|
v-else
|
|
693
|
-
v-html="t('resourceTable.groupLabel.notInANodePool')"
|
|
734
|
+
v-clean-html="t('resourceTable.groupLabel.notInANodePool')"
|
|
694
735
|
/>
|
|
695
736
|
<div
|
|
696
737
|
v-if="group.ref && group.ref.template"
|
|
@@ -747,6 +788,7 @@ export default {
|
|
|
747
788
|
:group-by="value.isCustom ? null : 'spec.nodePoolName'"
|
|
748
789
|
group-ref="pool"
|
|
749
790
|
:group-sort="['pool.nameDisplay']"
|
|
791
|
+
:sort-generation-fn="nodeSortGenerationFn"
|
|
750
792
|
>
|
|
751
793
|
<template #main-row:isFake="{fullColspan}">
|
|
752
794
|
<tr class="main-row">
|
|
@@ -770,11 +812,11 @@ export default {
|
|
|
770
812
|
>
|
|
771
813
|
<div
|
|
772
814
|
v-if="group.ref"
|
|
773
|
-
v-html="t('resourceTable.groupLabel.nodePool', { name: group.ref.spec.hostnamePrefix}, true)"
|
|
815
|
+
v-clean-html="t('resourceTable.groupLabel.nodePool', { name: group.ref.spec.hostnamePrefix}, true)"
|
|
774
816
|
/>
|
|
775
817
|
<div
|
|
776
818
|
v-else
|
|
777
|
-
v-html="t('resourceTable.groupLabel.notInANodePool')"
|
|
819
|
+
v-clean-html="t('resourceTable.groupLabel.notInANodePool')"
|
|
778
820
|
/>
|
|
779
821
|
<div
|
|
780
822
|
v-if="group.ref && group.ref.nodeTemplate"
|
|
@@ -846,13 +888,13 @@ export default {
|
|
|
846
888
|
>
|
|
847
889
|
<td
|
|
848
890
|
:key="line.id + '-time'"
|
|
891
|
+
v-clean-html="format(line.time)"
|
|
849
892
|
class="time"
|
|
850
|
-
v-html="format(line.time)"
|
|
851
893
|
/>
|
|
852
894
|
<td
|
|
853
895
|
:key="line.id + '-msg'"
|
|
896
|
+
v-clean-html="line.msg"
|
|
854
897
|
class="msg"
|
|
855
|
-
v-html="line.msg"
|
|
856
898
|
/>
|
|
857
899
|
</tr>
|
|
858
900
|
</template>
|
|
@@ -890,22 +932,22 @@ export default {
|
|
|
890
932
|
@copied-windows="hasWindowsMachine ? null : showWindowsWarning = true"
|
|
891
933
|
/>
|
|
892
934
|
<template v-else>
|
|
893
|
-
<h4 v-html="t('cluster.import.commandInstructions', null, true)" />
|
|
935
|
+
<h4 v-clean-html="t('cluster.import.commandInstructions', null, true)" />
|
|
894
936
|
<CopyCode class="m-10 p-10">
|
|
895
937
|
{{ clusterToken.command }}
|
|
896
938
|
</CopyCode>
|
|
897
939
|
|
|
898
940
|
<h4
|
|
941
|
+
v-clean-html="t('cluster.import.commandInstructionsInsecure', null, true)"
|
|
899
942
|
class="mt-10"
|
|
900
|
-
v-html="t('cluster.import.commandInstructionsInsecure', null, true)"
|
|
901
943
|
/>
|
|
902
944
|
<CopyCode class="m-10 p-10">
|
|
903
945
|
{{ clusterToken.insecureCommand }}
|
|
904
946
|
</CopyCode>
|
|
905
947
|
|
|
906
948
|
<h4
|
|
949
|
+
v-clean-html="t('cluster.import.clusterRoleBindingInstructions', null, true)"
|
|
907
950
|
class="mt-10"
|
|
908
|
-
v-html="t('cluster.import.clusterRoleBindingInstructions', null, true)"
|
|
909
951
|
/>
|
|
910
952
|
<CopyCode class="m-10 p-10">
|
|
911
953
|
{{ t('cluster.import.clusterRoleBindingCommand', null, true) }}
|
|
@@ -108,8 +108,8 @@ export default {
|
|
|
108
108
|
computed: {
|
|
109
109
|
...mapGetters(['currentCluster']),
|
|
110
110
|
|
|
111
|
-
|
|
112
|
-
return this.value
|
|
111
|
+
isScalable() {
|
|
112
|
+
return this.value?.canUpdate;
|
|
113
113
|
},
|
|
114
114
|
|
|
115
115
|
isJob() {
|
|
@@ -335,7 +335,7 @@ export default {
|
|
|
335
335
|
class="text-right"
|
|
336
336
|
:label="t('tableHeaders.scale')"
|
|
337
337
|
:value="value.spec.replicas"
|
|
338
|
-
:disabled="!
|
|
338
|
+
:disabled="!isScalable"
|
|
339
339
|
@minus="scaleDown"
|
|
340
340
|
@plus="scaleUp"
|
|
341
341
|
/>
|
|
@@ -63,7 +63,7 @@ export default {
|
|
|
63
63
|
async principalProperty() {
|
|
64
64
|
const principal = await this.principal;
|
|
65
65
|
|
|
66
|
-
return principal
|
|
66
|
+
return principal?.principalType === 'group' ? 'groupPrincipalId' : 'userPrincipalId';
|
|
67
67
|
},
|
|
68
68
|
|
|
69
69
|
close() {
|
|
@@ -114,8 +114,8 @@ export default {
|
|
|
114
114
|
>
|
|
115
115
|
<h4
|
|
116
116
|
slot="title"
|
|
117
|
+
v-clean-html="t('addProjectMemberDialog.title')"
|
|
117
118
|
class="text-default-text"
|
|
118
|
-
v-html="t('addProjectMemberDialog.title')"
|
|
119
119
|
/>
|
|
120
120
|
|
|
121
121
|
<div
|
|
@@ -46,7 +46,7 @@ export default {
|
|
|
46
46
|
|
|
47
47
|
<template>
|
|
48
48
|
<Card
|
|
49
|
-
class="
|
|
49
|
+
class="prompt-restore"
|
|
50
50
|
:show-highlight-border="false"
|
|
51
51
|
>
|
|
52
52
|
<h4
|
|
@@ -66,24 +66,36 @@ export default {
|
|
|
66
66
|
slot="actions"
|
|
67
67
|
class="bottom"
|
|
68
68
|
>
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
69
|
+
<div class="buttons">
|
|
70
|
+
<button
|
|
71
|
+
type="button"
|
|
72
|
+
class="btn role-secondary mr-10"
|
|
73
|
+
@click="close"
|
|
74
|
+
>
|
|
75
|
+
{{ t('generic.cancel') }}
|
|
76
|
+
</button>
|
|
77
|
+
<AsyncButton
|
|
78
|
+
mode="continue"
|
|
79
|
+
@click="apply"
|
|
80
|
+
/>
|
|
81
|
+
</div>
|
|
80
82
|
</div>
|
|
81
83
|
</Card>
|
|
82
84
|
</template>
|
|
83
85
|
<style lang='scss' scoped>
|
|
84
|
-
|
|
86
|
+
.prompt-restore {
|
|
87
|
+
margin: 0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.bottom {
|
|
91
|
+
display: flex;
|
|
92
|
+
flex-direction: column;
|
|
93
|
+
flex: 1;
|
|
94
|
+
|
|
95
|
+
.buttons {
|
|
85
96
|
display: flex;
|
|
86
|
-
|
|
87
|
-
|
|
97
|
+
justify-content: flex-end;
|
|
98
|
+
width: 100%;
|
|
88
99
|
}
|
|
100
|
+
}
|
|
89
101
|
</style>
|
|
@@ -83,7 +83,7 @@ export default {
|
|
|
83
83
|
class="pl-10 pr-10"
|
|
84
84
|
>
|
|
85
85
|
<span
|
|
86
|
-
v-html="t('promptForceRemove.removeWarning', { nameToMatch }, true)"
|
|
86
|
+
v-clean-html="t('promptForceRemove.removeWarning', { nameToMatch }, true)"
|
|
87
87
|
/>
|
|
88
88
|
<div class="mt-10 mb-10">
|
|
89
89
|
{{ t('promptForceRemove.confirmName') }}
|