@rancher/shell 0.3.4 → 0.3.6
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/images/providers/outscale.svg +19 -0
- package/assets/styles/app.scss +1 -1
- package/assets/styles/base/_basic.scss +18 -0
- package/assets/styles/base/_mixins.scss +0 -11
- package/assets/styles/base/_variables.scss +2 -4
- package/assets/styles/fonts/_fontstack.scss +11 -11
- package/assets/styles/global/_button.scss +12 -2
- package/assets/styles/vendor/vue-js-modal.scss +3 -3
- package/assets/translations/en-us.yaml +113 -22
- package/assets/translations/zh-hans.yaml +113 -24
- package/babel.config.js +13 -0
- package/chart/gatekeeper.vue +78 -0
- package/chart/istio.vue +135 -112
- 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/BrandImage.vue +1 -4
- package/components/ButtonDropdown.vue +2 -3
- package/components/Carousel.vue +85 -37
- 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 +12 -7
- package/components/ExplorerMembers.vue +101 -6
- package/components/ExplorerProjectsNamespaces.vue +46 -3
- package/components/FileDiff.vue +6 -7
- package/components/GrafanaDashboard.vue +27 -23
- 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 +28 -13
- package/components/SortableTable/selection.js +58 -50
- package/components/Wizard.vue +4 -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/auth/RoleDetailEdit.vue +2 -2
- 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/HookOption.vue +14 -10
- package/components/form/LabeledSelect.vue +14 -11
- package/components/form/Labels.vue +32 -27
- package/components/form/MatchExpressions.vue +19 -4
- package/components/form/Members/ClusterPermissionsEditor.vue +32 -7
- package/components/form/NameNsDescription.vue +32 -46
- package/components/form/ProjectMemberEditor.vue +46 -21
- 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/Tolerations.vue +4 -1
- package/components/form/ValueFromResource.vue +14 -9
- package/components/form/WorkloadPorts.vue +2 -2
- package/components/form/__tests__/LabeledSelect.test.ts +138 -0
- package/components/form/__tests__/NameNsDescription.ts +59 -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/formatter/WorkloadHealthScale.vue +8 -2
- package/components/nav/Group.vue +2 -2
- package/components/nav/NamespaceFilter.vue +23 -11
- package/components/nav/TopLevelMenu.vue +2 -4
- package/components/nav/Type.vue +1 -1
- package/components/nav/WorkspaceSwitcher.vue +46 -5
- package/components/nuxt/nuxt-build-indicator.vue +143 -0
- package/components/nuxt/nuxt-child.js +122 -0
- package/components/nuxt/nuxt-error.vue +98 -0
- package/components/nuxt/nuxt-link.client.js +98 -0
- package/components/nuxt/nuxt-link.server.js +16 -0
- package/components/nuxt/nuxt-loading.vue +154 -0
- package/components/nuxt/nuxt.js +101 -0
- package/config/labels-annotations.js +17 -0
- package/config/middleware.js +12 -0
- package/config/product/auth.js +3 -2
- package/config/product/explorer.js +34 -6
- package/config/product/fleet.js +2 -0
- package/config/query-params.js +1 -0
- package/config/router.js +414 -0
- package/config/store.js +181 -0
- package/config/table-headers.js +54 -12
- package/config/types.js +18 -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/core/plugin.ts +4 -2
- package/core/types.ts +258 -1
- 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/tsconfig.json +0 -1
- package/creators/app/files/vue.config.js +6 -0
- package/creators/app/init +5 -5
- package/creators/pkg/files/.github/workflows/build-extension.yml +110 -0
- package/creators/pkg/files/tsconfig.json +0 -1
- package/creators/pkg/init +35 -4
- package/creators/pkg/pkg.package.json +3 -3
- package/creators/update/init +1 -1
- package/detail/constraints.gatekeeper.sh.constraint.vue +34 -17
- package/detail/fleet.cattle.io.clustergroup.vue +7 -1
- 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 +32 -4
- package/edit/helm.cattle.io.projecthelmchart.vue +5 -1
- package/edit/logging.banzaicloud.io.output/index.vue +18 -5
- package/edit/logging.banzaicloud.io.output/providers/loki.vue +1 -0
- 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 +14 -10
- 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 +21 -4
- 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/import.vue +23 -25
- package/edit/provisioning.cattle.io.cluster/rke2.vue +344 -102
- 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 +22 -7
- package/edit/workload/storage/Mount.vue +3 -3
- package/initialize/App.js +206 -0
- package/initialize/client.js +863 -0
- package/initialize/index.js +364 -0
- package/layouts/default.vue +7 -3
- package/layouts/standalone.vue +13 -0
- package/list/catalog.cattle.io.clusterrepo.vue +1 -0
- 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/list/rbac.authorization.k8s.io.clusterrolebinding.vue +48 -0
- package/list/workload.vue +6 -4
- package/machine-config/azure.vue +97 -38
- package/middleware/authenticated.js +34 -0
- package/mixins/chart.js +101 -2
- package/mixins/fetch.client.js +95 -0
- package/mixins/fetch.server.js +73 -0
- package/mixins/labeled-form-element.ts +2 -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 +46 -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/pod.js +4 -0
- package/models/provisioning.cattle.io.cluster.js +7 -5
- package/models/rbac.authorization.k8s.io.clusterrolebinding.js +16 -0
- package/models/rbac.authorization.k8s.io.rolebinding.js +16 -0
- package/package.json +13 -21
- 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 +98 -102
- 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/diagnostic.vue +32 -25
- package/pages/home.vue +9 -4
- package/pages/index.vue +10 -1
- package/pages/rio/mesh.vue +1 -2
- package/pkg/tsconfig.json +0 -1
- package/plugins/clean-html-directive.js +34 -0
- package/plugins/dashboard-store/actions.js +32 -9
- package/plugins/dashboard-store/index.js +1 -1
- package/plugins/dashboard-store/mutations.js +5 -2
- package/plugins/dashboard-store/resource-class.js +8 -1
- package/plugins/plugin.js +0 -14
- package/plugins/portal-vue.js +4 -0
- 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 +7 -1
- package/rancher-components/components/Banner/Banner.vue +2 -1
- package/rancher-components/components/Form/Checkbox/Checkbox.vue +2 -0
- package/rancher-components/components/Form/Radio/RadioButton.test.ts +31 -0
- package/rancher-components/components/Form/Radio/RadioButton.vue +14 -3
- 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 +333 -0
- package/scripts/serve-pkgs +6 -2
- 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 +6 -2
- package/tsconfig.default.json +36 -0
- package/tsconfig.json +23 -0
- package/types/rancher/index.d.ts +2 -0
- package/types/shell/index.d.ts +466 -320
- package/utils/__tests__/grafana.test.ts +44 -0
- package/utils/__tests__/string.test.ts +12 -0
- package/utils/auth.js +65 -0
- package/utils/axios.js +190 -0
- package/utils/cookie-universal-nuxt.js +10 -0
- package/utils/dom.js +15 -0
- package/utils/grafana.js +35 -16
- package/utils/monitoring.js +2 -1
- package/utils/nuxt.js +659 -0
- 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 +690 -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/plugins/dashboard-store/extensions.js +0 -22
|
@@ -143,8 +143,8 @@ export default {
|
|
|
143
143
|
<div>
|
|
144
144
|
<Banner
|
|
145
145
|
v-if="mode !== view"
|
|
146
|
+
v-clean-html="t('monitoringReceiver.webhook.banner', {}, raw=true)"
|
|
146
147
|
color="info"
|
|
147
|
-
v-html="t('monitoringReceiver.webhook.banner', {}, raw=true)"
|
|
148
148
|
/>
|
|
149
149
|
<div class="row mb-20">
|
|
150
150
|
<LabeledSelect
|
|
@@ -166,8 +166,8 @@ export default {
|
|
|
166
166
|
</div>
|
|
167
167
|
<Banner
|
|
168
168
|
v-if="showNamespaceBanner"
|
|
169
|
+
v-clean-html="t('monitoringReceiver.webhook.modifyNamespace', {}, raw=true)"
|
|
169
170
|
color="info"
|
|
170
|
-
v-html="t('monitoringReceiver.webhook.modifyNamespace', {}, raw=true)"
|
|
171
171
|
/>
|
|
172
172
|
<div class="row mb-20">
|
|
173
173
|
<div class="col span-12">
|
|
@@ -35,37 +35,37 @@ export default {
|
|
|
35
35
|
<div class="row">
|
|
36
36
|
<div class="col span-12">
|
|
37
37
|
<h3>{{ t('monitoring.receiver.tls.label') }}</h3>
|
|
38
|
-
<Banner
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
<Banner
|
|
39
|
+
v-clean-html="t('monitoring.receiver.tls.secretsBanner', {}, true)"
|
|
40
|
+
color="info"
|
|
41
41
|
/>
|
|
42
42
|
</div>
|
|
43
43
|
</div>
|
|
44
44
|
<div class="row mb-20">
|
|
45
45
|
<div class="col span-6">
|
|
46
|
-
<LabeledInput
|
|
47
|
-
v-model="value.tls_config.ca_file"
|
|
48
|
-
:mode="mode"
|
|
49
|
-
:label="t('monitoring.receiver.tls.caFilePath.label')"
|
|
50
|
-
:placeholder="t('monitoring.receiver.tls.caFilePath.placeholder')"
|
|
46
|
+
<LabeledInput
|
|
47
|
+
v-model="value.tls_config.ca_file"
|
|
48
|
+
:mode="mode"
|
|
49
|
+
:label="t('monitoring.receiver.tls.caFilePath.label')"
|
|
50
|
+
:placeholder="t('monitoring.receiver.tls.caFilePath.placeholder')"
|
|
51
51
|
/>
|
|
52
52
|
</div>
|
|
53
53
|
</div>
|
|
54
54
|
<div class="row mb-20">
|
|
55
55
|
<div class="col span-6">
|
|
56
|
-
<LabeledInput
|
|
57
|
-
v-model="value.tls_config.cert_file"
|
|
58
|
-
:mode="mode"
|
|
59
|
-
:label="t('monitoring.receiver.tls.certFilePath.label')"
|
|
60
|
-
:placeholder="t('monitoring.receiver.tls.certFilePath.placeholder')"
|
|
56
|
+
<LabeledInput
|
|
57
|
+
v-model="value.tls_config.cert_file"
|
|
58
|
+
:mode="mode"
|
|
59
|
+
:label="t('monitoring.receiver.tls.certFilePath.label')"
|
|
60
|
+
:placeholder="t('monitoring.receiver.tls.certFilePath.placeholder')"
|
|
61
61
|
/>
|
|
62
62
|
</div>
|
|
63
63
|
<div class="col span-6">
|
|
64
|
-
<LabeledInput
|
|
65
|
-
v-model="value.tls_config.key_file"
|
|
66
|
-
:mode="mode"
|
|
67
|
-
:label="t('monitoring.receiver.tls.keyFilePath.label')"
|
|
68
|
-
:placeholder="t('monitoring.receiver.tls.keyFilePath.placeholder')"
|
|
64
|
+
<LabeledInput
|
|
65
|
+
v-model="value.tls_config.key_file"
|
|
66
|
+
:mode="mode"
|
|
67
|
+
:label="t('monitoring.receiver.tls.keyFilePath.label')"
|
|
68
|
+
:placeholder="t('monitoring.receiver.tls.keyFilePath.placeholder')"
|
|
69
69
|
/>
|
|
70
70
|
</div>
|
|
71
71
|
</div>
|
|
@@ -20,9 +20,9 @@ export default {
|
|
|
20
20
|
};
|
|
21
21
|
</script>
|
|
22
22
|
<template>
|
|
23
|
-
<Banner
|
|
24
|
-
v-if="model.length === 0 && !isView"
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
<Banner
|
|
24
|
+
v-if="model.length === 0 && !isView"
|
|
25
|
+
v-clean-html="t('monitoringReceiver.webhook.banner', {}, raw=true)"
|
|
26
|
+
color="info"
|
|
27
27
|
/>
|
|
28
28
|
</template>
|
|
@@ -50,8 +50,8 @@ export default {
|
|
|
50
50
|
</div>
|
|
51
51
|
<Banner
|
|
52
52
|
v-if="showNamespaceBanner"
|
|
53
|
+
v-clean-html="t('monitoringReceiver.webhook.modifyNamespace', {}, raw=true)"
|
|
53
54
|
color="info"
|
|
54
|
-
v-html="t('monitoringReceiver.webhook.modifyNamespace', {}, raw=true)"
|
|
55
55
|
/>
|
|
56
56
|
<div class="row mb-20">
|
|
57
57
|
<div class="col span-12">
|
package/edit/namespace.vue
CHANGED
|
@@ -10,7 +10,7 @@ import PodSecurityAdmission from '@shell/components/PodSecurityAdmission';
|
|
|
10
10
|
import Tabbed from '@shell/components/Tabbed';
|
|
11
11
|
import Tab from '@shell/components/Tabbed/Tab';
|
|
12
12
|
import CruResource from '@shell/components/CruResource';
|
|
13
|
-
import { PROJECT_ID, _VIEW } from '@shell/config/query-params';
|
|
13
|
+
import { PROJECT_ID, _VIEW, FLAT_VIEW, _CREATE } from '@shell/config/query-params';
|
|
14
14
|
import MoveModal from '@shell/components/MoveModal';
|
|
15
15
|
import ResourceQuota from '@shell/components/form/ResourceQuota/Namespace';
|
|
16
16
|
import Loading from '@shell/components/Loading';
|
|
@@ -67,6 +67,10 @@ export default {
|
|
|
67
67
|
computed: {
|
|
68
68
|
...mapGetters(['isSingleProduct']),
|
|
69
69
|
|
|
70
|
+
isCreate() {
|
|
71
|
+
return this.mode === _CREATE;
|
|
72
|
+
},
|
|
73
|
+
|
|
70
74
|
isSingleHarvester() {
|
|
71
75
|
return this.$store.getters['currentProduct'].inStore === HARVESTER && this.isSingleProduct;
|
|
72
76
|
},
|
|
@@ -77,7 +81,6 @@ export default {
|
|
|
77
81
|
|
|
78
82
|
// Filter out projects not for the current cluster
|
|
79
83
|
projects = projects.filter(c => c.spec?.clusterName === clusterId);
|
|
80
|
-
|
|
81
84
|
const out = projects.map((project) => {
|
|
82
85
|
return {
|
|
83
86
|
label: project.nameDisplay,
|
|
@@ -86,7 +89,7 @@ export default {
|
|
|
86
89
|
});
|
|
87
90
|
|
|
88
91
|
out.unshift({
|
|
89
|
-
label: '
|
|
92
|
+
label: this.t('namespace.project.none'),
|
|
90
93
|
value: null,
|
|
91
94
|
});
|
|
92
95
|
|
|
@@ -105,11 +108,14 @@ export default {
|
|
|
105
108
|
return !this.isSingleHarvester;
|
|
106
109
|
},
|
|
107
110
|
|
|
111
|
+
flatView() {
|
|
112
|
+
return (this.$route.query[FLAT_VIEW] || false);
|
|
113
|
+
}
|
|
108
114
|
},
|
|
109
115
|
|
|
110
116
|
watch: {
|
|
111
|
-
project(
|
|
112
|
-
const limits = this.getDefaultContainerResourceLimits(
|
|
117
|
+
project() {
|
|
118
|
+
const limits = this.getDefaultContainerResourceLimits(this.projectName);
|
|
113
119
|
|
|
114
120
|
this.$set(this, 'containerResourceLimits', limits);
|
|
115
121
|
},
|
|
@@ -139,13 +145,11 @@ export default {
|
|
|
139
145
|
}
|
|
140
146
|
|
|
141
147
|
const projects = this.$store.getters['management/all'](MANAGEMENT.PROJECT);
|
|
142
|
-
|
|
143
148
|
const project = projects.find(p => p.id.includes(projectName));
|
|
144
149
|
|
|
145
150
|
return project?.spec?.containerDefaultResourceLimit || {};
|
|
146
151
|
}
|
|
147
|
-
}
|
|
148
|
-
|
|
152
|
+
},
|
|
149
153
|
};
|
|
150
154
|
</script>
|
|
151
155
|
|
|
@@ -169,9 +173,10 @@ export default {
|
|
|
169
173
|
:value="value"
|
|
170
174
|
:namespaced="false"
|
|
171
175
|
:mode="mode"
|
|
176
|
+
:extra-columns="['project-col']"
|
|
172
177
|
>
|
|
173
178
|
<template
|
|
174
|
-
v-if="
|
|
179
|
+
v-if="flatView && isCreate"
|
|
175
180
|
#project-col
|
|
176
181
|
>
|
|
177
182
|
<LabeledSelect
|
|
@@ -181,7 +186,6 @@ export default {
|
|
|
181
186
|
/>
|
|
182
187
|
</template>
|
|
183
188
|
</NameNsDescription>
|
|
184
|
-
|
|
185
189
|
<Tabbed :side-tabs="true">
|
|
186
190
|
<Tab
|
|
187
191
|
v-if="showResourceQuota"
|
|
@@ -11,9 +11,12 @@ import { Banner } from '@components/Banner';
|
|
|
11
11
|
import throttle from 'lodash/throttle';
|
|
12
12
|
import { isValidCIDR } from '@shell/utils/validators/cidr';
|
|
13
13
|
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const TARGET_OPTIONS = {
|
|
15
|
+
IP_BLOCK: 'ipBlock',
|
|
16
|
+
NAMESPACE_SELECTOR: 'namespaceSelector',
|
|
17
|
+
POD_SELECTOR: 'podSelector',
|
|
18
|
+
NAMESPACE_AND_POD_SELECTOR: 'namespaceAndPodSelector',
|
|
19
|
+
};
|
|
17
20
|
|
|
18
21
|
export default {
|
|
19
22
|
components: {
|
|
@@ -52,53 +55,48 @@ export default {
|
|
|
52
55
|
},
|
|
53
56
|
},
|
|
54
57
|
data() {
|
|
55
|
-
if (!this.value[
|
|
58
|
+
if (!this.value[TARGET_OPTIONS.IP_BLOCK] &&
|
|
59
|
+
!this.value[TARGET_OPTIONS.POD_SELECTOR] &&
|
|
60
|
+
!this.value[TARGET_OPTIONS.NAMESPACE_SELECTOR] &&
|
|
61
|
+
!this.value[TARGET_OPTIONS.NAMESPACE_AND_POD_SELECTOR]
|
|
62
|
+
) {
|
|
56
63
|
this.$nextTick(() => {
|
|
57
|
-
this.$set(this.value,
|
|
64
|
+
this.$set(this.value, TARGET_OPTIONS.IP_BLOCK, {});
|
|
58
65
|
});
|
|
59
66
|
}
|
|
60
67
|
|
|
61
|
-
const matchingPods = this.getMatchingPods();
|
|
62
|
-
const matchingNamespaces = this.getMatchingNamespaces();
|
|
63
|
-
|
|
64
68
|
return {
|
|
65
|
-
portOptions:
|
|
66
|
-
matchingPods,
|
|
67
|
-
matchingNamespaces,
|
|
68
|
-
invalidCidr:
|
|
69
|
-
invalidCidrs:
|
|
70
|
-
TARGET_OPTION_IP_BLOCK,
|
|
71
|
-
TARGET_OPTION_NAMESPACE_SELECTOR,
|
|
72
|
-
TARGET_OPTION_POD_SELECTOR,
|
|
69
|
+
portOptions: ['TCP', 'UDP'],
|
|
70
|
+
matchingPods: {},
|
|
71
|
+
matchingNamespaces: {},
|
|
72
|
+
invalidCidr: null,
|
|
73
|
+
invalidCidrs: [],
|
|
73
74
|
POD,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
TARGET_OPTION_NAMESPACE_SELECTOR,
|
|
77
|
-
TARGET_OPTION_POD_SELECTOR
|
|
78
|
-
],
|
|
75
|
+
TARGET_OPTIONS,
|
|
76
|
+
targetOptions: Object.values(TARGET_OPTIONS),
|
|
79
77
|
};
|
|
80
78
|
},
|
|
81
79
|
computed: {
|
|
82
80
|
podSelectorExpressions: {
|
|
83
81
|
get() {
|
|
84
82
|
return convert(
|
|
85
|
-
this.value[
|
|
86
|
-
this.value[
|
|
83
|
+
this.value[TARGET_OPTIONS.POD_SELECTOR]?.matchLabels || {},
|
|
84
|
+
this.value[TARGET_OPTIONS.POD_SELECTOR]?.matchExpressions || []
|
|
87
85
|
);
|
|
88
86
|
},
|
|
89
87
|
set(podSelectorExpressions) {
|
|
90
|
-
this.$set(this.value,
|
|
88
|
+
this.$set(this.value, TARGET_OPTIONS.POD_SELECTOR, simplify(podSelectorExpressions));
|
|
91
89
|
}
|
|
92
90
|
},
|
|
93
91
|
namespaceSelectorExpressions: {
|
|
94
92
|
get() {
|
|
95
93
|
return convert(
|
|
96
|
-
this.value[
|
|
97
|
-
this.value[
|
|
94
|
+
this.value[TARGET_OPTIONS.NAMESPACE_SELECTOR]?.matchLabels || {},
|
|
95
|
+
this.value[TARGET_OPTIONS.NAMESPACE_SELECTOR]?.matchExpressions || []
|
|
98
96
|
);
|
|
99
97
|
},
|
|
100
98
|
set(namespaceSelectorExpressions) {
|
|
101
|
-
this.$set(this.value,
|
|
99
|
+
this.$set(this.value, TARGET_OPTIONS.NAMESPACE_SELECTOR, simplify(namespaceSelectorExpressions));
|
|
102
100
|
}
|
|
103
101
|
},
|
|
104
102
|
selectTargetOptions() {
|
|
@@ -116,6 +114,9 @@ export default {
|
|
|
116
114
|
targetType: {
|
|
117
115
|
get() {
|
|
118
116
|
for (const option of this.targetOptions) {
|
|
117
|
+
if (this.value[TARGET_OPTIONS.NAMESPACE_AND_POD_SELECTOR] || (this.value[TARGET_OPTIONS.NAMESPACE_SELECTOR] && this.value[TARGET_OPTIONS.POD_SELECTOR])) {
|
|
118
|
+
return TARGET_OPTIONS.NAMESPACE_AND_POD_SELECTOR;
|
|
119
|
+
}
|
|
119
120
|
if (this.value[option]) {
|
|
120
121
|
return option;
|
|
121
122
|
}
|
|
@@ -124,13 +125,30 @@ export default {
|
|
|
124
125
|
return null;
|
|
125
126
|
},
|
|
126
127
|
set(targetType) {
|
|
127
|
-
this.$delete(this.value,
|
|
128
|
-
this.$delete(this.value,
|
|
129
|
-
this.$delete(this.value,
|
|
128
|
+
this.$delete(this.value, TARGET_OPTIONS.IP_BLOCK);
|
|
129
|
+
this.$delete(this.value, TARGET_OPTIONS.NAMESPACE_SELECTOR);
|
|
130
|
+
this.$delete(this.value, TARGET_OPTIONS.POD_SELECTOR);
|
|
131
|
+
this.$delete(this.value, TARGET_OPTIONS.NAMESPACE_AND_POD_SELECTOR);
|
|
130
132
|
this.$nextTick(() => {
|
|
131
133
|
this.$set(this.value, targetType, {});
|
|
132
134
|
});
|
|
133
135
|
}
|
|
136
|
+
},
|
|
137
|
+
updateMatches() {
|
|
138
|
+
return {
|
|
139
|
+
handler: throttle(function() {
|
|
140
|
+
this.matchingNamespaces = this.getMatchingNamespaces();
|
|
141
|
+
this.matchingPods = this.getMatchingPods();
|
|
142
|
+
}, 250, { leading: true }),
|
|
143
|
+
immediate: true
|
|
144
|
+
};
|
|
145
|
+
},
|
|
146
|
+
matchingNamespacesAndPods() {
|
|
147
|
+
return {
|
|
148
|
+
policyNamespace: this.namespace,
|
|
149
|
+
...Object.keys(this.matchingNamespaces).reduce((acc, k) => ({ ...acc, [`${ k }Namespaces`]: this.matchingNamespaces[k] }), {}),
|
|
150
|
+
...Object.keys(this.matchingPods).reduce((acc, k) => ({ ...acc, [`${ k }Pods`]: this.matchingPods[k] }), {}),
|
|
151
|
+
};
|
|
134
152
|
}
|
|
135
153
|
},
|
|
136
154
|
watch: {
|
|
@@ -144,24 +162,21 @@ export default {
|
|
|
144
162
|
},
|
|
145
163
|
methods: {
|
|
146
164
|
validateCIDR() {
|
|
147
|
-
const exceptCidrs = this.value[
|
|
165
|
+
const exceptCidrs = this.value[TARGET_OPTIONS.IP_BLOCK]?.except || [];
|
|
148
166
|
|
|
149
167
|
this.invalidCidrs = exceptCidrs
|
|
150
168
|
.filter(cidr => !isValidCIDR(cidr))
|
|
151
169
|
.map(invalidCidr => invalidCidr || '<blank>');
|
|
152
170
|
|
|
153
|
-
if (this.value[
|
|
154
|
-
this.invalidCidr = this.value[
|
|
171
|
+
if (this.value[TARGET_OPTIONS.IP_BLOCK]?.cidr && !isValidCIDR(this.value[TARGET_OPTIONS.IP_BLOCK].cidr)) {
|
|
172
|
+
this.invalidCidr = this.value[TARGET_OPTIONS.IP_BLOCK].cidr;
|
|
155
173
|
} else {
|
|
156
174
|
this.invalidCidr = null;
|
|
157
175
|
}
|
|
158
176
|
},
|
|
159
|
-
updateMatches: throttle(function() {
|
|
160
|
-
this.matchingPods = this.getMatchingPods();
|
|
161
|
-
this.matchingNamespaces = this.getMatchingNamespaces();
|
|
162
|
-
}, 250, { leading: true }),
|
|
163
177
|
getMatchingPods() {
|
|
164
|
-
const
|
|
178
|
+
const namespaces = this.targetType === TARGET_OPTIONS.NAMESPACE_AND_POD_SELECTOR ? this.matchingNamespaces.matches : [{ id: this.namespace }];
|
|
179
|
+
const allInNamespace = this.allPods.filter(pod => namespaces.some(ns => ns.id === pod.metadata.namespace));
|
|
165
180
|
const match = matching(allInNamespace, this.podSelectorExpressions);
|
|
166
181
|
const matched = match.length || 0;
|
|
167
182
|
const sample = match[0]?.nameDisplay;
|
|
@@ -199,17 +214,18 @@ export default {
|
|
|
199
214
|
<LabeledSelect
|
|
200
215
|
v-model="targetType"
|
|
201
216
|
:mode="mode"
|
|
217
|
+
:tooltip="targetType === TARGET_OPTIONS.NAMESPACE_AND_POD_SELECTOR ? t('networkpolicy.selectors.matchingNamespacesAndPods.tooltip') : null"
|
|
202
218
|
:options="selectTargetOptions"
|
|
203
219
|
:multiple="false"
|
|
204
220
|
:label="t('networkpolicy.rules.type')"
|
|
205
221
|
/>
|
|
206
222
|
</div>
|
|
207
223
|
</div>
|
|
208
|
-
<div v-if="targetType ===
|
|
224
|
+
<div v-if="targetType === TARGET_OPTIONS.IP_BLOCK">
|
|
209
225
|
<div class="row">
|
|
210
226
|
<div class="col span-6">
|
|
211
227
|
<LabeledInput
|
|
212
|
-
v-model="value[
|
|
228
|
+
v-model="value[TARGET_OPTIONS.IP_BLOCK].cidr"
|
|
213
229
|
:mode="mode"
|
|
214
230
|
:placeholder="t('networkpolicy.rules.ipBlock.cidr.placeholder')"
|
|
215
231
|
:label="t('networkpolicy.rules.ipBlock.cidr.label')"
|
|
@@ -229,7 +245,7 @@ export default {
|
|
|
229
245
|
<div class="row mt-20">
|
|
230
246
|
<div class="col span-12">
|
|
231
247
|
<ArrayList
|
|
232
|
-
v-model="value[
|
|
248
|
+
v-model="value[TARGET_OPTIONS.IP_BLOCK].except"
|
|
233
249
|
:add-label="t('networkpolicy.rules.ipBlock.addExcept')"
|
|
234
250
|
:mode="mode"
|
|
235
251
|
:show-header="true"
|
|
@@ -249,11 +265,11 @@ export default {
|
|
|
249
265
|
</div>
|
|
250
266
|
</div>
|
|
251
267
|
</div>
|
|
252
|
-
<div v-if="targetType ===
|
|
268
|
+
<div v-if="targetType === TARGET_OPTIONS.POD_SELECTOR">
|
|
253
269
|
<div class="row">
|
|
254
270
|
<div class="col span-12">
|
|
255
271
|
<Banner color="success">
|
|
256
|
-
<span v-html="t('networkpolicy.selectors.matchingPods.matchesSome', matchingPods)" />
|
|
272
|
+
<span v-clean-html="t('networkpolicy.selectors.matchingPods.matchesSome', matchingPods)" />
|
|
257
273
|
</Banner>
|
|
258
274
|
</div>
|
|
259
275
|
</div>
|
|
@@ -269,11 +285,11 @@ export default {
|
|
|
269
285
|
</div>
|
|
270
286
|
</div>
|
|
271
287
|
</div>
|
|
272
|
-
<div v-if="targetType ===
|
|
288
|
+
<div v-if="targetType === TARGET_OPTIONS.NAMESPACE_SELECTOR">
|
|
273
289
|
<div class="row">
|
|
274
290
|
<div class="col span-12">
|
|
275
291
|
<Banner color="success">
|
|
276
|
-
<span v-html="t('networkpolicy.selectors.matchingNamespaces.matchesSome', matchingNamespaces)" />
|
|
292
|
+
<span v-clean-html="t('networkpolicy.selectors.matchingNamespaces.matchesSome', matchingNamespaces)" />
|
|
277
293
|
</Banner>
|
|
278
294
|
</div>
|
|
279
295
|
</div>
|
|
@@ -289,5 +305,70 @@ export default {
|
|
|
289
305
|
</div>
|
|
290
306
|
</div>
|
|
291
307
|
</div>
|
|
308
|
+
<div v-if="targetType === TARGET_OPTIONS.NAMESPACE_AND_POD_SELECTOR">
|
|
309
|
+
<div class="row">
|
|
310
|
+
<div class="col span-12">
|
|
311
|
+
<Banner color="success">
|
|
312
|
+
<span
|
|
313
|
+
v-if="!namespaceSelectorExpressions.length"
|
|
314
|
+
v-clean-html="t('networkpolicy.selectors.matchingPods.matchesSome', matchingPods)"
|
|
315
|
+
/>
|
|
316
|
+
<span
|
|
317
|
+
v-else
|
|
318
|
+
v-clean-html="t('networkpolicy.selectors.matchingNamespacesAndPods.matchesSome', matchingNamespacesAndPods)"
|
|
319
|
+
/>
|
|
320
|
+
</Banner>
|
|
321
|
+
</div>
|
|
322
|
+
</div>
|
|
323
|
+
<div class="row mb-0">
|
|
324
|
+
<div class="col span-1 namespace-pod-rule">
|
|
325
|
+
<span class="label">
|
|
326
|
+
{{ t('networkpolicy.rules.namespace') }}
|
|
327
|
+
</span>
|
|
328
|
+
</div>
|
|
329
|
+
<div class="col span-11">
|
|
330
|
+
<MatchExpressions
|
|
331
|
+
v-model="namespaceSelectorExpressions"
|
|
332
|
+
:mode="mode"
|
|
333
|
+
:show-add-button="false"
|
|
334
|
+
:show-remove-button="false"
|
|
335
|
+
:show-remove="false"
|
|
336
|
+
:initial-empty-row="true"
|
|
337
|
+
:type="POD"
|
|
338
|
+
/>
|
|
339
|
+
</div>
|
|
340
|
+
</div>
|
|
341
|
+
<div class="row mb-0">
|
|
342
|
+
<div class="col span-1 namespace-pod-rule">
|
|
343
|
+
<span class="label">
|
|
344
|
+
{{ t('networkpolicy.rules.pod') }}
|
|
345
|
+
</span>
|
|
346
|
+
</div>
|
|
347
|
+
<div class="col span-11">
|
|
348
|
+
<MatchExpressions
|
|
349
|
+
v-model="podSelectorExpressions"
|
|
350
|
+
:mode="mode"
|
|
351
|
+
:show-add-button="false"
|
|
352
|
+
:show-remove-button="false"
|
|
353
|
+
:show-remove="false"
|
|
354
|
+
:initial-empty-row="true"
|
|
355
|
+
:type="POD"
|
|
356
|
+
/>
|
|
357
|
+
</div>
|
|
358
|
+
</div>
|
|
359
|
+
</div>
|
|
292
360
|
</div>
|
|
293
361
|
</template>
|
|
362
|
+
|
|
363
|
+
<style lang='scss' scoped>
|
|
364
|
+
.namespace-pod-rule {
|
|
365
|
+
width: 100px;
|
|
366
|
+
margin: 0;
|
|
367
|
+
text-align: center;
|
|
368
|
+
|
|
369
|
+
.label {
|
|
370
|
+
display: block;
|
|
371
|
+
margin-top: 32px;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
</style>
|
|
@@ -258,7 +258,7 @@ export default {
|
|
|
258
258
|
<div class="row">
|
|
259
259
|
<div class="col span-12">
|
|
260
260
|
<Banner color="success">
|
|
261
|
-
<span v-html="t('networkpolicy.selectors.matchingPods.matchesSome', matchingPods)" />
|
|
261
|
+
<span v-clean-html="t('networkpolicy.selectors.matchingPods.matchesSome', matchingPods)" />
|
|
262
262
|
</Banner>
|
|
263
263
|
</div>
|
|
264
264
|
</div>
|
|
@@ -158,6 +158,14 @@ export default {
|
|
|
158
158
|
// (only used on Elemental because it comes from "machineinventoryselectortemplate" machine-config)
|
|
159
159
|
updateMachineCount(val) {
|
|
160
160
|
this.value.pool.quantity = val || 1;
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
expandAdvanced() {
|
|
164
|
+
const advancedComponent = this.$refs.advanced;
|
|
165
|
+
|
|
166
|
+
if (advancedComponent && !advancedComponent.show) {
|
|
167
|
+
advancedComponent.toggle();
|
|
168
|
+
}
|
|
161
169
|
}
|
|
162
170
|
}
|
|
163
171
|
};
|
|
@@ -165,6 +173,14 @@ export default {
|
|
|
165
173
|
|
|
166
174
|
<template>
|
|
167
175
|
<div>
|
|
176
|
+
<Banner
|
|
177
|
+
v-if="value.pool.hostnameLengthLimit"
|
|
178
|
+
color="info"
|
|
179
|
+
>
|
|
180
|
+
<div class="text">
|
|
181
|
+
{{ t('cluster.machinePool.truncationPool', { limit: value.pool.hostnameLengthLimit }) }}
|
|
182
|
+
</div>
|
|
183
|
+
</Banner>
|
|
168
184
|
<div class="row">
|
|
169
185
|
<div class="col span-4">
|
|
170
186
|
<LabeledInput
|
|
@@ -192,19 +208,19 @@ export default {
|
|
|
192
208
|
<Checkbox
|
|
193
209
|
v-model="value.pool.etcdRole"
|
|
194
210
|
:mode="mode"
|
|
195
|
-
label="etcd"
|
|
211
|
+
:label="t('cluster.machinePool.role.etcd')"
|
|
196
212
|
:disabled="isWindows"
|
|
197
213
|
/>
|
|
198
214
|
<Checkbox
|
|
199
215
|
v-model="value.pool.controlPlaneRole"
|
|
200
216
|
:mode="mode"
|
|
201
|
-
label="
|
|
217
|
+
:label="t('cluster.machinePool.role.controlPlane')"
|
|
202
218
|
:disabled="isWindows"
|
|
203
219
|
/>
|
|
204
220
|
<Checkbox
|
|
205
221
|
v-model="value.pool.workerRole"
|
|
206
222
|
:mode="mode"
|
|
207
|
-
label="
|
|
223
|
+
:label="t('cluster.machinePool.role.worker')"
|
|
208
224
|
/>
|
|
209
225
|
</div>
|
|
210
226
|
</div>
|
|
@@ -223,6 +239,7 @@ export default {
|
|
|
223
239
|
:machine-pools="machinePools"
|
|
224
240
|
@error="e=>errors = e"
|
|
225
241
|
@updateMachineCount="updateMachineCount"
|
|
242
|
+
@expandAdvanced="expandAdvanced"
|
|
226
243
|
/>
|
|
227
244
|
<Banner
|
|
228
245
|
v-else-if="value.configMissing"
|
|
@@ -236,6 +253,7 @@ export default {
|
|
|
236
253
|
/>
|
|
237
254
|
|
|
238
255
|
<AdvancedSection
|
|
256
|
+
ref="advanced"
|
|
239
257
|
:mode="mode"
|
|
240
258
|
class="advanced"
|
|
241
259
|
>
|
|
@@ -284,7 +302,6 @@ export default {
|
|
|
284
302
|
:read-allowed="false"
|
|
285
303
|
:value-can-be-empty="true"
|
|
286
304
|
/>
|
|
287
|
-
|
|
288
305
|
<div class="spacer" />
|
|
289
306
|
|
|
290
307
|
<Taints
|