@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
|
@@ -766,9 +766,25 @@ export default {
|
|
|
766
766
|
|
|
767
767
|
this.fixNodeAffinity(nodeAffinity);
|
|
768
768
|
this.fixPodAffinity(podAffinity);
|
|
769
|
+
|
|
770
|
+
// The fields are being removed because they are not allowed to be editabble
|
|
771
|
+
if (this.mode === _EDIT) {
|
|
772
|
+
if (template?.spec?.affinity && Object.keys(template?.spec?.affinity).length === 0) {
|
|
773
|
+
delete template.spec.affinity;
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
// Removing `affinity` fixes the issue with setting the `imagePullSecrets`
|
|
777
|
+
// However, this field should not be set. Therefore this is explicitly removed.
|
|
778
|
+
if (template?.spec?.imagePullSecrets && template?.spec?.imagePullSecrets.length === 0) {
|
|
779
|
+
delete template.spec.imagePullSecrets;
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
|
|
769
783
|
this.fixPodAffinity(podAntiAffinity);
|
|
770
784
|
this.fixPodSecurityContext(this.podTemplateSpec);
|
|
771
785
|
|
|
786
|
+
template.metadata.namespace = this.value.metadata.namespace;
|
|
787
|
+
|
|
772
788
|
// delete this.value.kind;
|
|
773
789
|
if (this.container && !this.container.name) {
|
|
774
790
|
this.$set(this.container, 'name', this.value.metadata.name);
|
package/layouts/default.vue
CHANGED
|
@@ -35,8 +35,9 @@ import { getVersionInfo, markSeenReleaseNotes } from '@shell/utils/version';
|
|
|
35
35
|
import { sortBy } from '@shell/utils/sort';
|
|
36
36
|
import PageHeaderActions from '@shell/mixins/page-actions';
|
|
37
37
|
import BrowserTabVisibility from '@shell/mixins/browser-tab-visibility';
|
|
38
|
-
import { getProductFromRoute } from '@shell/middleware/authenticated';
|
|
38
|
+
import { getClusterFromRoute, getProductFromRoute } from '@shell/middleware/authenticated';
|
|
39
39
|
import { BOTTOM } from '@shell/utils/position';
|
|
40
|
+
import { BLANK_CLUSTER } from '@shell/store';
|
|
40
41
|
|
|
41
42
|
const SET_LOGIN_ACTION = 'set-as-login';
|
|
42
43
|
|
|
@@ -201,7 +202,7 @@ export default {
|
|
|
201
202
|
*/
|
|
202
203
|
clusterAndRouteReady() {
|
|
203
204
|
return this.clusterReady &&
|
|
204
|
-
this.clusterId === this.$route
|
|
205
|
+
this.clusterId === getClusterFromRoute(this.$route) &&
|
|
205
206
|
this.currentProduct?.name === getProductFromRoute(this.$route);
|
|
206
207
|
},
|
|
207
208
|
|
|
@@ -286,7 +287,7 @@ export default {
|
|
|
286
287
|
|
|
287
288
|
async currentProduct(a, b) {
|
|
288
289
|
if ( !isEqual(a, b) ) {
|
|
289
|
-
if (a.inStore !== b.inStore || a.inStore !== 'cluster' ) {
|
|
290
|
+
if ((a.inStore !== b.inStore || a.inStore !== 'cluster') && this.clusterId && a.name) {
|
|
290
291
|
const route = {
|
|
291
292
|
name: 'c-cluster-product',
|
|
292
293
|
params: {
|
|
@@ -333,6 +334,9 @@ export default {
|
|
|
333
334
|
|
|
334
335
|
methods: {
|
|
335
336
|
async setClusterAsLastRoute() {
|
|
337
|
+
if (!this.clusterId || this.clusterId === BLANK_CLUSTER) {
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
336
340
|
const route = {
|
|
337
341
|
name: this.$route.name,
|
|
338
342
|
params: {
|
|
@@ -31,7 +31,9 @@ export default {
|
|
|
31
31
|
|
|
32
32
|
async fetch() {
|
|
33
33
|
await this.$fetchType(this.resource);
|
|
34
|
-
|
|
34
|
+
if (this.$store.getters['management/schemaFor']( FLEET.CLUSTER )) {
|
|
35
|
+
this.allFleet = await this.$store.getters['management/all'](FLEET.CLUSTER);
|
|
36
|
+
}
|
|
35
37
|
},
|
|
36
38
|
|
|
37
39
|
data() {
|
|
@@ -113,11 +115,12 @@ export default {
|
|
|
113
115
|
>
|
|
114
116
|
<template #cell:deploymentsReady="{row}">
|
|
115
117
|
<span
|
|
116
|
-
v-if="row.status.summary.desiredReady
|
|
118
|
+
v-if="row.status && (row.status.summary.desiredReady !== row.status.summary.ready)"
|
|
117
119
|
class="text-warning"
|
|
118
120
|
>
|
|
119
121
|
{{ row.status.summary.ready }}/{{ row.status.summary.desiredReady }}</span>
|
|
120
|
-
<span v-else>{{ row.status.summary.desiredReady }}</span>
|
|
122
|
+
<span v-else-if="row.status">{{ row.status.summary.desiredReady }}</span>
|
|
123
|
+
<span v-else>-</span>
|
|
121
124
|
</template>
|
|
122
125
|
</ResourceTable>
|
|
123
126
|
</div>
|
|
@@ -26,7 +26,9 @@ export default {
|
|
|
26
26
|
|
|
27
27
|
async fetch() {
|
|
28
28
|
await this.$fetchType(this.resource);
|
|
29
|
-
|
|
29
|
+
if (this.$store.getters['management/schemaFor']( FLEET.CLUSTER )) {
|
|
30
|
+
this.allFleet = await this.$store.getters['management/all'](FLEET.CLUSTER);
|
|
31
|
+
}
|
|
30
32
|
},
|
|
31
33
|
|
|
32
34
|
data() {
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import FleetRepos from '@shell/components/fleet/FleetRepos';
|
|
3
3
|
import Masthead from '@shell/components/ResourceList/Masthead';
|
|
4
|
+
import FleetNoWorkspaces from '@shell/components/fleet/FleetNoWorkspaces.vue';
|
|
4
5
|
import { FLEET } from '@shell/config/types';
|
|
5
6
|
import ResourceFetch from '@shell/mixins/resource-fetch';
|
|
7
|
+
import { checkPermissions, checkSchemasForFindAllHash } from '@shell/utils/auth';
|
|
6
8
|
|
|
7
9
|
export default {
|
|
8
10
|
name: 'ListGitRepo',
|
|
9
11
|
components: {
|
|
10
12
|
FleetRepos,
|
|
11
13
|
Masthead,
|
|
14
|
+
FleetNoWorkspaces,
|
|
12
15
|
},
|
|
13
16
|
mixins: [ResourceFetch],
|
|
14
17
|
props: {
|
|
@@ -39,17 +42,50 @@ export default {
|
|
|
39
42
|
},
|
|
40
43
|
|
|
41
44
|
async fetch() {
|
|
42
|
-
|
|
45
|
+
try {
|
|
46
|
+
const hash = await checkSchemasForFindAllHash({
|
|
47
|
+
cluster: {
|
|
48
|
+
inStoreType: 'management',
|
|
49
|
+
type: FLEET.CLUSTER
|
|
50
|
+
},
|
|
51
|
+
clusterGroups: {
|
|
52
|
+
inStoreType: 'management',
|
|
53
|
+
type: FLEET.CLUSTER_GROUP
|
|
54
|
+
},
|
|
43
55
|
|
|
44
|
-
|
|
45
|
-
|
|
56
|
+
gitRepos: {
|
|
57
|
+
inStoreType: 'management',
|
|
58
|
+
type: FLEET.GIT_REPO
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
workspaces: {
|
|
62
|
+
inStoreType: 'management',
|
|
63
|
+
type: FLEET.WORKSPACE
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
}, this.$store);
|
|
67
|
+
|
|
68
|
+
this.hasWorkspaces = !!hash.workspaces;
|
|
69
|
+
} catch (e) {
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
try {
|
|
73
|
+
const permissions = await checkPermissions({ workspaces: { type: FLEET.WORKSPACE }, gitRepos: { type: FLEET.GIT_REPO } }, this.$store.getters);
|
|
74
|
+
|
|
75
|
+
this.permissions = permissions;
|
|
76
|
+
} catch (e) {
|
|
77
|
+
}
|
|
46
78
|
await this.$fetchType(this.resource);
|
|
47
|
-
}
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
data() {
|
|
82
|
+
return { hasWorkspaces: false, permissions: {} };
|
|
83
|
+
},
|
|
48
84
|
};
|
|
49
85
|
</script>
|
|
50
86
|
|
|
51
87
|
<template>
|
|
52
|
-
<div>
|
|
88
|
+
<div v-if="hasWorkspaces">
|
|
53
89
|
<Masthead
|
|
54
90
|
:schema="schema"
|
|
55
91
|
:resource="resource"
|
|
@@ -66,4 +102,7 @@ export default {
|
|
|
66
102
|
:force-update-live-and-delayed="forceUpdateLiveAndDelayed"
|
|
67
103
|
/>
|
|
68
104
|
</div>
|
|
105
|
+
<div v-else>
|
|
106
|
+
<FleetNoWorkspaces :can-view="permissions.workspaces" />
|
|
107
|
+
</div>
|
|
69
108
|
</template>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import ResourceTable from '@shell/components/ResourceTable';
|
|
3
|
+
import resourceFetch from '@shell/mixins/resource-fetch';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: 'ListWorkspace',
|
|
7
|
+
components: { ResourceTable },
|
|
8
|
+
mixins: [resourceFetch],
|
|
9
|
+
props: {
|
|
10
|
+
resource: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
schema: {
|
|
15
|
+
type: Object,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
useQueryParamsForSimpleFiltering: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
async fetch() {
|
|
25
|
+
try {
|
|
26
|
+
await this.$fetchType(this.resource);
|
|
27
|
+
} catch (e) {}
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
$loadingResources() {
|
|
31
|
+
return { loadIndeterminate: true };
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<template>
|
|
37
|
+
<ResourceTable
|
|
38
|
+
v-bind="$attrs"
|
|
39
|
+
:rows="rows"
|
|
40
|
+
:schema="schema"
|
|
41
|
+
:loading="loading"
|
|
42
|
+
:use-query-params-for-simple-filtering="useQueryParamsForSimpleFiltering"
|
|
43
|
+
v-on="$listeners"
|
|
44
|
+
/>
|
|
45
|
+
</template>
|
package/list/node.vue
CHANGED
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
MANAGEMENT, METRIC, NODE, NORMAN, POD
|
|
13
13
|
} from '@shell/config/types';
|
|
14
14
|
import { allHash } from '@shell/utils/promise';
|
|
15
|
-
import { get } from '@shell/utils/object';
|
|
16
15
|
import { GROUP_RESOURCES, mapPref } from '@shell/store/prefs';
|
|
17
16
|
import { COLUMN_BREAKPOINTS } from '@shell/components/SortableTable/index.vue';
|
|
18
17
|
import ResourceFetch from '@shell/mixins/resource-fetch';
|
|
@@ -84,8 +83,17 @@ export default {
|
|
|
84
83
|
hasWindowsNodes() {
|
|
85
84
|
return (this.rows || []).some(node => node.status.nodeInfo.operatingSystem === 'windows');
|
|
86
85
|
},
|
|
86
|
+
|
|
87
87
|
tableGroup: mapPref(GROUP_RESOURCES),
|
|
88
88
|
|
|
89
|
+
parsedRows() {
|
|
90
|
+
this.rows.forEach((row) => {
|
|
91
|
+
row.displayTaintsAndLabels = (row.spec.taints && row.spec.taints.length) || !!row.customLabelCount;
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
return this.rows;
|
|
95
|
+
},
|
|
96
|
+
|
|
89
97
|
headers() {
|
|
90
98
|
const headers = [
|
|
91
99
|
STATE,
|
|
@@ -119,7 +127,6 @@ export default {
|
|
|
119
127
|
|
|
120
128
|
return headers;
|
|
121
129
|
},
|
|
122
|
-
|
|
123
130
|
},
|
|
124
131
|
|
|
125
132
|
methods: {
|
|
@@ -136,8 +143,9 @@ export default {
|
|
|
136
143
|
}
|
|
137
144
|
},
|
|
138
145
|
|
|
139
|
-
|
|
140
|
-
|
|
146
|
+
toggleLabels(row) {
|
|
147
|
+
this.$set(row, 'displayLabels', !row.displayLabels);
|
|
148
|
+
},
|
|
141
149
|
}
|
|
142
150
|
|
|
143
151
|
};
|
|
@@ -154,7 +162,7 @@ export default {
|
|
|
154
162
|
v-bind="$attrs"
|
|
155
163
|
:schema="schema"
|
|
156
164
|
:headers="headers"
|
|
157
|
-
:rows="
|
|
165
|
+
:rows="parsedRows"
|
|
158
166
|
:sub-rows="true"
|
|
159
167
|
:loading="loading"
|
|
160
168
|
:use-query-params-for-simple-filtering="useQueryParamsForSimpleFiltering"
|
|
@@ -164,22 +172,54 @@ export default {
|
|
|
164
172
|
<template #sub-row="{fullColspan, row, onRowMouseEnter, onRowMouseLeave}">
|
|
165
173
|
<tr
|
|
166
174
|
class="taints sub-row"
|
|
167
|
-
:class="{'empty-taints': !
|
|
175
|
+
:class="{'empty-taints': ! row.displayTaintsAndLabels}"
|
|
168
176
|
@mouseenter="onRowMouseEnter"
|
|
169
177
|
@mouseleave="onRowMouseLeave"
|
|
170
178
|
>
|
|
171
|
-
<template v-if="row.
|
|
179
|
+
<template v-if="row.displayTaintsAndLabels">
|
|
172
180
|
<td> </td>
|
|
173
181
|
<td> </td>
|
|
174
182
|
<td :colspan="fullColspan-2">
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
+
<span v-if="row.spec.taints && row.spec.taints.length">
|
|
184
|
+
{{ t('node.list.nodeTaint') }}:
|
|
185
|
+
<Tag
|
|
186
|
+
v-for="taint in row.spec.taints"
|
|
187
|
+
:key="taint.key + taint.value + taint.effect"
|
|
188
|
+
class="mr-5 mt-2"
|
|
189
|
+
>
|
|
190
|
+
{{ taint.key }}={{ taint.value }}:{{ taint.effect }}
|
|
191
|
+
</Tag>
|
|
192
|
+
</span>
|
|
193
|
+
<span
|
|
194
|
+
v-if="!!row.customLabelCount"
|
|
195
|
+
class="mt-5"
|
|
196
|
+
> {{ t('node.list.nodeLabels') }}:
|
|
197
|
+
<span
|
|
198
|
+
v-for="(label, i) in row.customLabels"
|
|
199
|
+
:key="i"
|
|
200
|
+
class="mt-5 labels"
|
|
201
|
+
>
|
|
202
|
+
<Tag
|
|
203
|
+
v-if="i < 7"
|
|
204
|
+
class="mr-2 label"
|
|
205
|
+
>
|
|
206
|
+
{{ label }}
|
|
207
|
+
</Tag>
|
|
208
|
+
<Tag
|
|
209
|
+
v-else-if="i > 6 && row.displayLabels"
|
|
210
|
+
class="mr-2 label"
|
|
211
|
+
>
|
|
212
|
+
{{ label }}
|
|
213
|
+
</Tag>
|
|
214
|
+
</span>
|
|
215
|
+
<a
|
|
216
|
+
v-if="row.customLabelCount > 7"
|
|
217
|
+
href="#"
|
|
218
|
+
@click.prevent="toggleLabels(row)"
|
|
219
|
+
>
|
|
220
|
+
{{ t(`node.list.${row.displayLabels? 'hideLabels' : 'showLabels'}`) }}
|
|
221
|
+
</a>
|
|
222
|
+
</span>
|
|
183
223
|
</td>
|
|
184
224
|
</template>
|
|
185
225
|
<td
|
|
@@ -195,11 +235,24 @@ export default {
|
|
|
195
235
|
</template>
|
|
196
236
|
|
|
197
237
|
<style lang='scss' scoped>
|
|
238
|
+
|
|
239
|
+
.labels {
|
|
240
|
+
display: inline;
|
|
241
|
+
flex-wrap: wrap;
|
|
242
|
+
|
|
243
|
+
.label {
|
|
244
|
+
display: inline-block;
|
|
245
|
+
margin-top: 2px;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
}
|
|
198
249
|
.taints {
|
|
199
250
|
td {
|
|
200
251
|
padding-top:0;
|
|
201
252
|
.tag {
|
|
202
|
-
margin-right: 5px
|
|
253
|
+
margin-right: 5px;
|
|
254
|
+
display: inline-block;
|
|
255
|
+
margin-top: 2px;
|
|
203
256
|
}
|
|
204
257
|
}
|
|
205
258
|
&.empty-taints {
|
|
@@ -9,10 +9,11 @@ import { filterOnlyKubernetesClusters, filterHiddenLocalCluster } from '@shell/u
|
|
|
9
9
|
import { mapFeature, HARVESTER as HARVESTER_FEATURE } from '@shell/store/features';
|
|
10
10
|
import { NAME as EXPLORER } from '@shell/config/product/explorer';
|
|
11
11
|
import ResourceFetch from '@shell/mixins/resource-fetch';
|
|
12
|
+
import { BadgeState } from '@components/BadgeState';
|
|
12
13
|
|
|
13
14
|
export default {
|
|
14
15
|
components: {
|
|
15
|
-
Banner, ResourceTable, Masthead
|
|
16
|
+
Banner, ResourceTable, Masthead, BadgeState
|
|
16
17
|
},
|
|
17
18
|
mixins: [ResourceFetch],
|
|
18
19
|
props: {
|
|
@@ -187,6 +188,34 @@ export default {
|
|
|
187
188
|
:data-testid="'cluster-list'"
|
|
188
189
|
:force-update-live-and-delayed="forceUpdateLiveAndDelayed"
|
|
189
190
|
>
|
|
191
|
+
<!-- Why are state column and subrow overwritten here? -->
|
|
192
|
+
<!-- for rke1 clusters, where they try to use the mgmt cluster stateObj instead of prov cluster stateObj, -->
|
|
193
|
+
<!-- updates were getting lost. This isn't performant as normal columns, but the list shouldn't grow -->
|
|
194
|
+
<!-- big enough for the performance to matter -->
|
|
195
|
+
<template #cell:state="{row}">
|
|
196
|
+
<BadgeState
|
|
197
|
+
:color="row.stateBackground"
|
|
198
|
+
:label="row.stateDisplay"
|
|
199
|
+
/>
|
|
200
|
+
</template>
|
|
201
|
+
<template #sub-row="{fullColspan, row, keyField, componentTestid, i, onRowMouseEnter, onRowMouseLeave}">
|
|
202
|
+
<tr
|
|
203
|
+
v-if="row.stateDescription"
|
|
204
|
+
:key="row[keyField] + '-description'"
|
|
205
|
+
:data-testid="componentTestid + '-' + i + '-row-description'"
|
|
206
|
+
class="state-description sub-row"
|
|
207
|
+
@mouseenter="onRowMouseEnter"
|
|
208
|
+
@mouseleave="onRowMouseLeave"
|
|
209
|
+
>
|
|
210
|
+
<td> </td>
|
|
211
|
+
<td
|
|
212
|
+
:colspan="fullColspan - 1"
|
|
213
|
+
:class="{ 'text-error' : row.stateObj.error }"
|
|
214
|
+
>
|
|
215
|
+
{{ row.stateDescription }}
|
|
216
|
+
</td>
|
|
217
|
+
</tr>
|
|
218
|
+
</template>
|
|
190
219
|
<template #cell:summary="{row}">
|
|
191
220
|
<span v-if="!row.stateParts.length">{{ row.nodes.length }}</span>
|
|
192
221
|
</template>
|
package/machine-config/azure.vue
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import Loading from '@shell/components/Loading';
|
|
3
3
|
import CreateEditView from '@shell/mixins/create-edit-view';
|
|
4
|
+
import FormValidation from '@shell/mixins/form-validation';
|
|
4
5
|
import { stringify, exceptionToErrorsArray } from '@shell/utils/error';
|
|
5
6
|
import { Banner } from '@components/Banner';
|
|
6
7
|
import merge from 'lodash/merge';
|
|
@@ -13,7 +14,7 @@ import { randomStr } from '@shell/utils/string';
|
|
|
13
14
|
import { addParam, addParams } from '@shell/utils/url';
|
|
14
15
|
import KeyValue from '@shell/components/form/KeyValue';
|
|
15
16
|
import { RadioGroup } from '@components/Form/Radio';
|
|
16
|
-
import { _CREATE } from '@shell/config/query-params';
|
|
17
|
+
import { _CREATE, _EDIT } from '@shell/config/query-params';
|
|
17
18
|
|
|
18
19
|
export const azureEnvironments = [
|
|
19
20
|
{ value: 'AzurePublicCloud' },
|
|
@@ -105,7 +106,7 @@ export default {
|
|
|
105
106
|
RadioGroup
|
|
106
107
|
},
|
|
107
108
|
|
|
108
|
-
mixins: [CreateEditView],
|
|
109
|
+
mixins: [CreateEditView, FormValidation],
|
|
109
110
|
|
|
110
111
|
props: {
|
|
111
112
|
credentialId: {
|
|
@@ -162,6 +163,17 @@ export default {
|
|
|
162
163
|
|
|
163
164
|
if (this.mode === _CREATE) {
|
|
164
165
|
this.value.location = DEFAULT_REGION;
|
|
166
|
+
|
|
167
|
+
// when you edit an Azure cluster and add a new machine pool (edit)
|
|
168
|
+
// the location field doesn't come populated which causes the vmSizes request
|
|
169
|
+
// to return 200 but with a null response (also a bunch of other fields are undefined...)
|
|
170
|
+
// so let's prefill them with the defaults
|
|
171
|
+
} else if (this.mode === _EDIT && !this.value?.location) {
|
|
172
|
+
for (const key in this.defaultConfig) {
|
|
173
|
+
if (this.value[key] === undefined) {
|
|
174
|
+
this.$set(this.value, key, this.defaultConfig[key]);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
165
177
|
}
|
|
166
178
|
|
|
167
179
|
this.vmSizes = await this.$store.dispatch('management/request', {
|
|
@@ -171,30 +183,29 @@ export default {
|
|
|
171
183
|
}),
|
|
172
184
|
method: 'GET',
|
|
173
185
|
});
|
|
186
|
+
|
|
187
|
+
// set correct option for useAvailabilitySet (will consider correct state for UI form based on availabilitySet)
|
|
188
|
+
if (this.mode === _CREATE) {
|
|
189
|
+
this.useAvailabilitySet = true;
|
|
190
|
+
} else {
|
|
191
|
+
this.useAvailabilitySet = !!this.value.availabilitySet;
|
|
192
|
+
}
|
|
174
193
|
} catch (e) {
|
|
175
194
|
this.errors = exceptionToErrorsArray(e);
|
|
176
195
|
}
|
|
177
196
|
},
|
|
178
197
|
|
|
179
198
|
data() {
|
|
180
|
-
let useAvailabilitySet = false;
|
|
181
|
-
|
|
182
|
-
if (this.mode === _CREATE) {
|
|
183
|
-
useAvailabilitySet = true;
|
|
184
|
-
} else {
|
|
185
|
-
useAvailabilitySet = !!this.value.availabilitySet;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
199
|
return {
|
|
189
200
|
azureEnvironments,
|
|
190
201
|
defaultConfig,
|
|
191
202
|
storageTypes,
|
|
192
|
-
credential:
|
|
193
|
-
locationOptions:
|
|
194
|
-
loading:
|
|
195
|
-
useAvailabilitySet,
|
|
196
|
-
vmSizes:
|
|
197
|
-
valueCopy:
|
|
203
|
+
credential: null,
|
|
204
|
+
locationOptions: [],
|
|
205
|
+
loading: false,
|
|
206
|
+
useAvailabilitySet: false,
|
|
207
|
+
vmSizes: [],
|
|
208
|
+
valueCopy: this.value,
|
|
198
209
|
};
|
|
199
210
|
},
|
|
200
211
|
|
|
@@ -202,6 +213,12 @@ export default {
|
|
|
202
213
|
credentialId() {
|
|
203
214
|
this.$fetch();
|
|
204
215
|
},
|
|
216
|
+
|
|
217
|
+
'value.availabilityZone'(neu) {
|
|
218
|
+
if (neu && (!this.value.managedDisks || !this.value.enablePublicIpStandardSku || !this.value.staticPublicIp)) {
|
|
219
|
+
this.$emit('expandAdvanced');
|
|
220
|
+
}
|
|
221
|
+
}
|
|
205
222
|
},
|
|
206
223
|
|
|
207
224
|
computed: {
|
|
@@ -368,7 +385,7 @@ export default {
|
|
|
368
385
|
}
|
|
369
386
|
|
|
370
387
|
return [];
|
|
371
|
-
}
|
|
388
|
+
},
|
|
372
389
|
},
|
|
373
390
|
|
|
374
391
|
created() {
|
|
@@ -610,7 +627,7 @@ export default {
|
|
|
610
627
|
|
|
611
628
|
<portal :to="'advanced-' + uuid">
|
|
612
629
|
<div v-if="useAvailabilitySet">
|
|
613
|
-
<h2>
|
|
630
|
+
<h2>{{ t('cluster.machineConfig.azure.sections.availabilitySetConfiguration') }}</h2>
|
|
614
631
|
<div class="row mt-20">
|
|
615
632
|
<div class="col span-6">
|
|
616
633
|
<LabeledInput
|
|
@@ -633,7 +650,7 @@ export default {
|
|
|
633
650
|
</div>
|
|
634
651
|
</div>
|
|
635
652
|
<hr class="mt-20 mb-20">
|
|
636
|
-
<h2>
|
|
653
|
+
<h2>{{ t('cluster.machineConfig.azure.sections.purchasePlan') }}</h2>
|
|
637
654
|
<div class="row mt-20">
|
|
638
655
|
<div class="col span-6">
|
|
639
656
|
<LabeledInput
|
|
@@ -645,9 +662,9 @@ export default {
|
|
|
645
662
|
/>
|
|
646
663
|
</div>
|
|
647
664
|
</div>
|
|
648
|
-
<hr class="mt-20
|
|
649
|
-
<h2>
|
|
650
|
-
<div class="row mt-20">
|
|
665
|
+
<hr class="mt-20">
|
|
666
|
+
<h2>{{ t('cluster.machineConfig.azure.sections.network') }}</h2>
|
|
667
|
+
<div class="row mt-20 mb-20">
|
|
651
668
|
<div class="col span-6">
|
|
652
669
|
<LabeledInput
|
|
653
670
|
v-model="value.subnet"
|
|
@@ -666,18 +683,20 @@ export default {
|
|
|
666
683
|
</div>
|
|
667
684
|
</div>
|
|
668
685
|
<div class="row mt-20">
|
|
669
|
-
<
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
686
|
+
<div class="col span-6">
|
|
687
|
+
<Checkbox
|
|
688
|
+
v-model="value.acceleratedNetworking"
|
|
689
|
+
:disabled="(!value.acceleratedNetworking && !selectedVmSizeSupportsAN)"
|
|
690
|
+
:mode="mode"
|
|
691
|
+
:label="t('cluster.machineConfig.azure.acceleratedNetworking.label')"
|
|
692
|
+
/>
|
|
693
|
+
<Banner
|
|
694
|
+
v-if="!selectedVmSizeSupportsAN && value.acceleratedNetworking"
|
|
695
|
+
color="error"
|
|
696
|
+
:label="t('cluster.machineConfig.azure.size.selectedSizeAcceleratedNetworkingWarning')"
|
|
697
|
+
/>
|
|
698
|
+
</div>
|
|
675
699
|
</div>
|
|
676
|
-
<Banner
|
|
677
|
-
v-if="!selectedVmSizeSupportsAN && value.acceleratedNetworking"
|
|
678
|
-
color="error"
|
|
679
|
-
:label="t('cluster.machineConfig.azure.size.selectedSizeAcceleratedNetworkingWarning')"
|
|
680
|
-
/>
|
|
681
700
|
<div class="row mt-20">
|
|
682
701
|
<div class="col span-6">
|
|
683
702
|
<LabeledInput
|
|
@@ -688,7 +707,7 @@ export default {
|
|
|
688
707
|
:disabled="disabled"
|
|
689
708
|
/>
|
|
690
709
|
</div>
|
|
691
|
-
<div class="col span-6">
|
|
710
|
+
<div class="col span-6 inline-banner-container">
|
|
692
711
|
<h3><t k="cluster.machineConfig.azure.publicIpOptions.header" /></h3>
|
|
693
712
|
<Checkbox
|
|
694
713
|
v-model="value.noPublicIp"
|
|
@@ -700,6 +719,31 @@ export default {
|
|
|
700
719
|
:mode="mode"
|
|
701
720
|
:label="t('cluster.machineConfig.azure.publicIpOptions.staticPublicIp.label')"
|
|
702
721
|
/>
|
|
722
|
+
<Checkbox
|
|
723
|
+
v-model="value.enablePublicIpStandardSku"
|
|
724
|
+
:mode="mode"
|
|
725
|
+
:label="t('cluster.machineConfig.azure.publicIpOptions.standardSKU.label')"
|
|
726
|
+
/>
|
|
727
|
+
<div
|
|
728
|
+
v-if="value.availabilityZone && (!value.staticPublicIp || !value.enablePublicIpStandardSku)"
|
|
729
|
+
class="inline-error-banner"
|
|
730
|
+
>
|
|
731
|
+
<Banner
|
|
732
|
+
v-if="!value.staticPublicIp && !value.enablePublicIpStandardSku"
|
|
733
|
+
color="error"
|
|
734
|
+
:label="t('cluster.machineConfig.azure.availabilityZone.publicIpAndSKUWarning')"
|
|
735
|
+
/>
|
|
736
|
+
<Banner
|
|
737
|
+
v-else-if="!value.staticPublicIp"
|
|
738
|
+
color="error"
|
|
739
|
+
:label="t('cluster.machineConfig.azure.availabilityZone.publicIpWarning')"
|
|
740
|
+
/>
|
|
741
|
+
<Banner
|
|
742
|
+
v-else
|
|
743
|
+
color="error"
|
|
744
|
+
:label="t('cluster.machineConfig.azure.availabilityZone.standardSKUWarning')"
|
|
745
|
+
/>
|
|
746
|
+
</div>
|
|
703
747
|
</div>
|
|
704
748
|
</div>
|
|
705
749
|
<div class="row mt-20">
|
|
@@ -741,8 +785,8 @@ export default {
|
|
|
741
785
|
</div>
|
|
742
786
|
</div>
|
|
743
787
|
<hr class="mt-20 mb-20">
|
|
744
|
-
<h2>
|
|
745
|
-
<div class="row mt-20">
|
|
788
|
+
<h2>{{ t('cluster.machineConfig.azure.sections.disks') }}</h2>
|
|
789
|
+
<div class="row mt-20 mb-20">
|
|
746
790
|
<div class="col span-6">
|
|
747
791
|
<LabeledSelect
|
|
748
792
|
v-model="value.storageType"
|
|
@@ -761,16 +805,21 @@ export default {
|
|
|
761
805
|
:label="t('cluster.machineConfig.azure.storageType.warning')"
|
|
762
806
|
/>
|
|
763
807
|
</div>
|
|
764
|
-
<div class="col span-6">
|
|
808
|
+
<div class="col span-6 inline-banner-container">
|
|
765
809
|
<Checkbox
|
|
766
810
|
v-model="value.managedDisks"
|
|
767
811
|
:mode="mode"
|
|
768
812
|
:label="t('cluster.machineConfig.azure.managedDisks.label')"
|
|
769
813
|
:disabled="disabled"
|
|
770
814
|
/>
|
|
815
|
+
<Banner
|
|
816
|
+
v-if="value.availabilityZone && !value.managedDisks"
|
|
817
|
+
color="error"
|
|
818
|
+
:label="t('cluster.machineConfig.azure.availabilityZone.managedDisksWarning')"
|
|
819
|
+
/>
|
|
771
820
|
</div>
|
|
772
821
|
</div>
|
|
773
|
-
<div class="row
|
|
822
|
+
<div class="row">
|
|
774
823
|
<div class="col span-6">
|
|
775
824
|
<LabeledInput
|
|
776
825
|
v-model="value.diskSize"
|
|
@@ -821,3 +870,13 @@ export default {
|
|
|
821
870
|
</portal>
|
|
822
871
|
</div>
|
|
823
872
|
</template>
|
|
873
|
+
|
|
874
|
+
<style scoped>
|
|
875
|
+
.inline-banner-container{
|
|
876
|
+
position: relative;
|
|
877
|
+
}
|
|
878
|
+
.inline-error-banner {
|
|
879
|
+
position: absolute;
|
|
880
|
+
width:100%
|
|
881
|
+
}
|
|
882
|
+
</style>
|