@rancher/shell 0.3.8 → 0.3.10
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/translations/en-us.yaml +47 -26
- package/assets/translations/zh-hans.yaml +82 -16
- package/babel.config.js +17 -4
- package/chart/istio.vue +11 -11
- package/chart/rancher-backup/S3.vue +1 -1
- package/components/AsyncButton.vue +2 -2
- package/components/ButtonGroup.vue +1 -1
- package/components/CodeMirror.vue +146 -14
- package/components/CompoundStatusBadge.vue +1 -1
- package/components/ContainerResourceLimit.vue +14 -1
- package/components/CopyCode.vue +1 -1
- package/components/CruResource.vue +21 -5
- package/components/DetailTop.vue +1 -1
- package/components/ExplorerProjectsNamespaces.vue +8 -4
- package/components/GlobalRoleBindings.vue +1 -1
- package/components/GroupPanel.vue +57 -0
- package/components/HarvesterServiceAddOnConfig.vue +2 -117
- package/components/ResourceDetail/Masthead.vue +1 -1
- package/components/ResourceList/Masthead.vue +0 -6
- package/components/ResourceList/ResourceLoadingIndicator.vue +1 -9
- package/components/ResourceList/index.vue +7 -6
- package/components/ResourceTable.vue +13 -3
- package/components/SortableTable/THead.vue +3 -3
- package/components/SortableTable/index.vue +3 -3
- package/components/Tabbed/Tab.vue +1 -1
- package/components/Tabbed/index.vue +1 -1
- package/components/Wizard.vue +9 -6
- package/components/YamlEditor.vue +2 -2
- package/components/__tests__/NamespaceFilter.test.ts +26 -7
- package/components/auth/RoleDetailEdit.vue +1 -1
- package/components/auth/SelectPrincipal.vue +1 -1
- package/components/fleet/FleetRepos.vue +1 -1
- package/components/form/ArrayList.vue +2 -2
- package/components/form/KeyValue.vue +37 -3
- package/components/form/Labels.vue +34 -14
- package/components/form/MatchExpressions.vue +120 -21
- package/components/form/Members/ClusterPermissionsEditor.vue +1 -1
- package/components/form/NameNsDescription.vue +1 -1
- package/components/form/NodeAffinity.vue +54 -4
- package/components/form/PlusMinus.vue +2 -2
- package/components/form/PodAffinity.vue +160 -47
- package/components/form/Probe.vue +1 -1
- package/components/form/ProjectMemberEditor.vue +8 -4
- package/components/form/ResourceQuota/NamespaceRow.vue +1 -1
- package/components/form/ServicePorts.vue +2 -2
- package/components/form/Tolerations.vue +70 -7
- package/components/form/WorkloadPorts.vue +2 -1
- package/components/form/__tests__/ArrayList.test.ts +3 -3
- package/components/form/__tests__/KeyValue.test.ts +17 -0
- package/components/form/__tests__/MatchExpressions.test.ts +1 -1
- package/components/formatter/ClusterLink.vue +3 -3
- package/components/formatter/LiveDate.vue +1 -1
- package/components/formatter/PodImages.vue +1 -1
- package/components/formatter/RKETemplateName.vue +1 -1
- package/components/formatter/Shortened.vue +1 -1
- package/components/nav/Header.vue +9 -7
- package/components/nav/NamespaceFilter.vue +103 -54
- package/config/labels-annotations.js +8 -5
- package/config/settings.ts +8 -6
- package/config/types.js +6 -4
- package/core/plugin-routes.ts +26 -7
- package/detail/provisioning.cattle.io.cluster.vue +4 -4
- package/edit/cis.cattle.io.clusterscan.vue +1 -1
- package/edit/configmap.vue +33 -6
- package/edit/k8s.cni.cncf.io.networkattachmentdefinition.vue +19 -149
- package/edit/logging-flow/index.vue +2 -2
- package/edit/logging.banzaicloud.io.output/providers/elasticsearch.vue +12 -0
- package/edit/logging.banzaicloud.io.output/providers/opensearch.vue +12 -0
- package/edit/management.cattle.io.project.vue +7 -0
- package/edit/monitoring.coreos.com.alertmanagerconfig/index.vue +1 -1
- package/edit/monitoring.coreos.com.alertmanagerconfig/routeConfig.vue +2 -2
- package/edit/monitoring.coreos.com.prometheusrule/GroupRules.vue +11 -8
- package/edit/networking.k8s.io.networkpolicy/PolicyRule.vue +2 -2
- package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +12 -4
- package/edit/networking.k8s.io.networkpolicy/__tests__/PolicyRuleTarget.spec.ts +140 -0
- package/edit/networking.k8s.io.networkpolicy/__tests__/utils/mock.json +158 -0
- package/edit/networking.k8s.io.networkpolicy/__tests__/utils/selectors.ts +45 -0
- package/edit/networking.k8s.io.networkpolicy/index.vue +1 -1
- package/edit/provisioning.cattle.io.cluster/AgentConfiguration.vue +326 -0
- package/edit/provisioning.cattle.io.cluster/MachinePool.vue +1 -1
- package/edit/provisioning.cattle.io.cluster/RegistryConfigs.vue +1 -1
- package/edit/provisioning.cattle.io.cluster/RegistryMirrors.vue +2 -2
- package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +143 -169
- package/edit/provisioning.cattle.io.cluster/index.vue +1 -0
- package/edit/provisioning.cattle.io.cluster/rke2.vue +75 -6
- package/edit/resources.cattle.io.restore.vue +2 -2
- package/edit/service.vue +22 -3
- package/edit/storage.k8s.io.storageclass/index.vue +1 -1
- package/edit/workload/Job.vue +2 -2
- package/edit/workload/index.vue +1 -1
- package/edit/workload/mixins/workload.js +7 -1
- package/edit/workload/storage/__tests__/Storage.test.ts +84 -5
- package/initialize/index.js +1 -0
- package/layouts/default.vue +1 -1
- package/mixins/chart.js +1 -1
- package/mixins/resource-fetch-namespaced.js +19 -27
- package/mixins/resource-fetch.js +0 -5
- package/models/__tests__/namespace.test.ts +125 -0
- package/models/batch.cronjob.js +18 -3
- package/models/management.cattle.io.project.js +6 -1
- package/models/persistentvolume.js +1 -1
- package/models/workload.js +1 -1
- package/models/workload.service.js +22 -7
- package/package.json +17 -6
- package/pages/auth/login.vue +47 -49
- package/pages/c/_cluster/apps/charts/chart.vue +1 -1
- package/pages/c/_cluster/apps/charts/install.vue +42 -51
- package/pages/c/_cluster/explorer/index.vue +1 -1
- package/pages/c/_cluster/monitoring/index.vue +1 -1
- package/pages/c/_cluster/settings/performance.vue +53 -18
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +1 -1
- package/pages/c/_cluster/uiplugins/index.vue +16 -5
- package/pages/home.vue +1 -1
- package/pages/prefs.vue +18 -2
- package/plugins/clean-html-directive.js +1 -1
- package/plugins/clean-tooltip-directive.js +33 -0
- package/plugins/codemirror.js +158 -0
- package/plugins/dashboard-store/actions.js +4 -2
- package/plugins/dashboard-store/getters.js +6 -0
- package/plugins/dashboard-store/mutations.js +2 -2
- package/plugins/plugin.js +6 -1
- package/plugins/steve/actions.js +1 -1
- package/plugins/steve/getters.js +14 -3
- package/plugins/steve/resourceWatcher.js +36 -62
- package/plugins/steve/subscribe.js +137 -21
- package/plugins/steve/worker/index.js +7 -1
- package/plugins/steve/worker/web-worker.advanced.js +26 -8
- package/plugins/steve/worker/web-worker.basic.js +23 -4
- package/public/index.html +1 -1
- package/rancher-components/components/Form/Checkbox/Checkbox.vue +2 -2
- package/rancher-components/components/Form/Radio/RadioGroup.vue +2 -2
- package/rancher-components/components/LabeledTooltip/LabeledTooltip.vue +1 -1
- package/store/index.js +16 -61
- package/store/store-types.js +5 -0
- package/store/type-map.js +1 -1
- package/types/shell/index.d.ts +42 -7
- package/utils/__tests__/create-yaml.test.ts +63 -0
- package/utils/array.ts +4 -0
- package/utils/create-yaml.js +105 -8
- package/utils/namespace-filter.js +17 -5
- package/utils/projectAndNamespaceFiltering.utils.ts +62 -0
- package/utils/selector.js +6 -5
- package/utils/settings.ts +17 -7
- package/vue.config.js +2 -2
- package/models/k8s.cni.cncf.io.networkattachmentdefinition.js +0 -93
package/core/plugin-routes.ts
CHANGED
|
@@ -153,20 +153,39 @@ export class PluginRoutes {
|
|
|
153
153
|
// Using the existing router and adding routes to it will force nuxt middleware (specifically authenticated on default layout) to
|
|
154
154
|
// execute many times (nuxt middleware boils down to router.beforeEach). This issue was seen refreshing in a harvester cluster with a
|
|
155
155
|
// dynamically loaded cluster
|
|
156
|
-
const newRouter: Router = new Router({
|
|
157
|
-
mode: 'history',
|
|
158
|
-
routes: allRoutes
|
|
159
|
-
});
|
|
160
156
|
|
|
157
|
+
const pluginRoutesWithParents: any[] = [];
|
|
158
|
+
const orderedPluginRoutes: any[] = [];
|
|
159
|
+
|
|
160
|
+
// separate plugin routes that have parent and not
|
|
161
161
|
newRoutes.forEach((r: any) => {
|
|
162
|
+
let foundParentRoute;
|
|
163
|
+
|
|
162
164
|
if (r.parent) {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
165
|
+
foundParentRoute = allRoutes.find(route => route.name === r.parent);
|
|
166
|
+
|
|
167
|
+
if (foundParentRoute) {
|
|
168
|
+
pluginRoutesWithParents.push(r);
|
|
169
|
+
}
|
|
166
170
|
}
|
|
171
|
+
|
|
172
|
+
if (!foundParentRoute) {
|
|
173
|
+
orderedPluginRoutes.push(r.route);
|
|
174
|
+
}
|
|
175
|
+
|
|
167
176
|
this.pluginRoutes.push(r.route);
|
|
168
177
|
});
|
|
169
178
|
|
|
179
|
+
const newRouter: Router = new Router({
|
|
180
|
+
mode: 'history',
|
|
181
|
+
routes: [...orderedPluginRoutes, ...allRoutes]
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
// handle plugin routes with parent
|
|
185
|
+
pluginRoutesWithParents.forEach((r: any) => {
|
|
186
|
+
newRouter.addRoute(r.parent, r.route);
|
|
187
|
+
});
|
|
188
|
+
|
|
170
189
|
// Typing is incorrect
|
|
171
190
|
(this.router as any).matcher = (newRouter as any).matcher;
|
|
172
191
|
}
|
|
@@ -751,7 +751,7 @@ export default {
|
|
|
751
751
|
/>
|
|
752
752
|
<template v-if="value.hasLink('update') && group.ref.showScalePool">
|
|
753
753
|
<button
|
|
754
|
-
v-tooltip="t('node.list.scaleDown')"
|
|
754
|
+
v-clean-tooltip="t('node.list.scaleDown')"
|
|
755
755
|
:disabled="!group.ref.canScaleDownPool()"
|
|
756
756
|
type="button"
|
|
757
757
|
class="btn btn-sm role-secondary"
|
|
@@ -760,7 +760,7 @@ export default {
|
|
|
760
760
|
<i class="icon icon-sm icon-minus" />
|
|
761
761
|
</button>
|
|
762
762
|
<button
|
|
763
|
-
v-tooltip="t('node.list.scaleUp')"
|
|
763
|
+
v-clean-tooltip="t('node.list.scaleUp')"
|
|
764
764
|
:disabled="!group.ref.canScaleUpPool()"
|
|
765
765
|
type="button"
|
|
766
766
|
class="btn btn-sm role-secondary ml-10"
|
|
@@ -836,7 +836,7 @@ export default {
|
|
|
836
836
|
/>
|
|
837
837
|
<template v-if="group.ref.hasLink('update')">
|
|
838
838
|
<button
|
|
839
|
-
v-tooltip="t('node.list.scaleDown')"
|
|
839
|
+
v-clean-tooltip="t('node.list.scaleDown')"
|
|
840
840
|
:disabled="group.ref.spec.quantity < 2"
|
|
841
841
|
type="button"
|
|
842
842
|
class="btn btn-sm role-secondary"
|
|
@@ -845,7 +845,7 @@ export default {
|
|
|
845
845
|
<i class="icon icon-sm icon-minus" />
|
|
846
846
|
</button>
|
|
847
847
|
<button
|
|
848
|
-
v-tooltip="t('node.list.scaleUp')"
|
|
848
|
+
v-clean-tooltip="t('node.list.scaleUp')"
|
|
849
849
|
type="button"
|
|
850
850
|
class="btn btn-sm role-secondary ml-10"
|
|
851
851
|
@click="group.ref.scalePool(1)"
|
package/edit/configmap.vue
CHANGED
|
@@ -31,40 +31,65 @@ export default {
|
|
|
31
31
|
computed: {
|
|
32
32
|
hasBinaryData() {
|
|
33
33
|
return Object.keys(this.binaryData).length > 0;
|
|
34
|
-
}
|
|
34
|
+
},
|
|
35
|
+
/**
|
|
36
|
+
* Keep all newlines from end, see: https://yaml-multiline.info
|
|
37
|
+
* Apply to 'data' field
|
|
38
|
+
*/
|
|
39
|
+
yamlModifiers() {
|
|
40
|
+
return {
|
|
41
|
+
data: Object.keys(this.data).reduce((acc, key) => ({
|
|
42
|
+
...acc,
|
|
43
|
+
[key]: { chomping: '+' },
|
|
44
|
+
}), {}),
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
validationPassed() {
|
|
49
|
+
return !!this.value.name;
|
|
50
|
+
},
|
|
35
51
|
},
|
|
36
52
|
|
|
37
53
|
watch: {
|
|
38
|
-
data(neu
|
|
54
|
+
data(neu) {
|
|
39
55
|
this.updateValue(neu, 'data');
|
|
40
56
|
},
|
|
41
|
-
binaryData(neu
|
|
57
|
+
binaryData(neu) {
|
|
42
58
|
this.updateValue(neu, 'binaryData');
|
|
43
59
|
},
|
|
44
60
|
},
|
|
45
61
|
|
|
46
62
|
methods: {
|
|
63
|
+
async saveConfigMap() {
|
|
64
|
+
const yaml = this.$refs.cru.createResourceYaml(this.yamlModifiers);
|
|
65
|
+
|
|
66
|
+
await this.value.saveYaml(yaml);
|
|
67
|
+
this.done();
|
|
68
|
+
},
|
|
69
|
+
|
|
47
70
|
updateValue(val, type) {
|
|
48
71
|
this.$set(this.value, type, {});
|
|
49
72
|
|
|
50
73
|
Object.keys(val).forEach((key) => {
|
|
51
74
|
this.$set(this.value[type], key, val[key]);
|
|
52
75
|
});
|
|
53
|
-
}
|
|
76
|
+
},
|
|
54
77
|
}
|
|
55
78
|
};
|
|
56
79
|
</script>
|
|
57
80
|
|
|
58
81
|
<template>
|
|
59
82
|
<CruResource
|
|
83
|
+
ref="cru"
|
|
60
84
|
:done-route="doneRoute"
|
|
61
85
|
:mode="mode"
|
|
62
86
|
:resource="value"
|
|
63
87
|
:subtypes="[]"
|
|
64
|
-
:validation-passed="
|
|
88
|
+
:validation-passed="validationPassed"
|
|
89
|
+
:yaml-modifiers="yamlModifiers"
|
|
65
90
|
:errors="errors"
|
|
66
91
|
@error="e=>errors = e"
|
|
67
|
-
@finish="
|
|
92
|
+
@finish="saveConfigMap"
|
|
68
93
|
@cancel="done"
|
|
69
94
|
>
|
|
70
95
|
<NameNsDescription
|
|
@@ -86,6 +111,8 @@ export default {
|
|
|
86
111
|
:protip="t('configmap.tabs.data.protip')"
|
|
87
112
|
:initial-empty-row="true"
|
|
88
113
|
:value-can-be-empty="true"
|
|
114
|
+
:value-trim="false"
|
|
115
|
+
:value-markdown-multiline="true"
|
|
89
116
|
:read-multiple="true"
|
|
90
117
|
:read-accept="'*'"
|
|
91
118
|
/>
|
|
@@ -2,24 +2,20 @@
|
|
|
2
2
|
import Tabbed from '@shell/components/Tabbed';
|
|
3
3
|
import Tab from '@shell/components/Tabbed/Tab';
|
|
4
4
|
import CruResource from '@shell/components/CruResource';
|
|
5
|
-
import { LabeledInput } from '@components/Form/LabeledInput';
|
|
6
|
-
import { RadioGroup } from '@components/Form/Radio';
|
|
7
5
|
import NameNsDescription from '@shell/components/form/NameNsDescription';
|
|
6
|
+
import KeyValue from '@shell/components/form/KeyValue';
|
|
8
7
|
|
|
9
|
-
import { HCI } from '@shell/config/labels-annotations';
|
|
10
8
|
import CreateEditView from '@shell/mixins/create-edit-view';
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
const MANUAL = 'manual';
|
|
10
|
+
import { set } from '@shell/utils/object';
|
|
14
11
|
|
|
15
12
|
export default {
|
|
16
13
|
components: {
|
|
17
14
|
Tab,
|
|
18
15
|
Tabbed,
|
|
19
16
|
CruResource,
|
|
20
|
-
LabeledInput,
|
|
21
17
|
NameNsDescription,
|
|
22
|
-
|
|
18
|
+
KeyValue,
|
|
23
19
|
},
|
|
24
20
|
|
|
25
21
|
mixins: [CreateEditView],
|
|
@@ -31,83 +27,24 @@ export default {
|
|
|
31
27
|
}
|
|
32
28
|
},
|
|
33
29
|
|
|
34
|
-
data() {
|
|
35
|
-
const config = JSON.parse(this.value.spec.config);
|
|
36
|
-
const annotations = this.value?.metadata?.annotations || {};
|
|
37
|
-
const layer3Network = JSON.parse(annotations[HCI.NETWORK_ROUTE] || '{}');
|
|
38
|
-
|
|
39
|
-
return {
|
|
40
|
-
config,
|
|
41
|
-
type: 'L2VlanNetwork',
|
|
42
|
-
layer3Network: {
|
|
43
|
-
mode: layer3Network.mode || AUTO,
|
|
44
|
-
serverIPAddr: layer3Network.serverIPAddr || '',
|
|
45
|
-
cidr: layer3Network.cidr || '',
|
|
46
|
-
gateway: layer3Network.gateway || '',
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
},
|
|
50
|
-
|
|
51
30
|
created() {
|
|
52
31
|
if (this.registerBeforeHook) {
|
|
53
|
-
this.registerBeforeHook(this.
|
|
32
|
+
this.registerBeforeHook(this.willSave);
|
|
54
33
|
}
|
|
55
34
|
},
|
|
56
35
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
value: AUTO,
|
|
62
|
-
}, {
|
|
63
|
-
label: this.t('harvester.network.layer3Network.mode.manual'),
|
|
64
|
-
value: MANUAL,
|
|
65
|
-
}];
|
|
66
|
-
},
|
|
36
|
+
data() {
|
|
37
|
+
const config = JSON.parse(this.value?.spec?.config || '{}');
|
|
38
|
+
|
|
39
|
+
return { config };
|
|
67
40
|
},
|
|
68
41
|
|
|
69
42
|
methods: {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if (!this.config.vlan) {
|
|
74
|
-
errors.push(this.$store.getters['i18n/t']('validation.required', { key: this.t('tableHeaders.networkVlan') }));
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (this.layer3Network.mode === MANUAL) {
|
|
78
|
-
if (!this.layer3Network.gateway) {
|
|
79
|
-
errors.push(this.$store.getters['i18n/t']('validation.required', { key: this.t('harvester.network.layer3Network.gateway.label') }));
|
|
80
|
-
}
|
|
81
|
-
if (!this.layer3Network.cidr) {
|
|
82
|
-
errors.push(this.$store.getters['i18n/t']('validation.required', { key: this.t('harvester.network.layer3Network.cidr.label') }));
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if (errors.length > 0) {
|
|
87
|
-
buttonCb(false);
|
|
88
|
-
this.errors = errors;
|
|
89
|
-
|
|
90
|
-
return false;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
this.value.setAnnotation(HCI.NETWORK_ROUTE, JSON.stringify(this.layer3Network));
|
|
43
|
+
willSave() {
|
|
44
|
+
set(this.value, 'spec.config', JSON.stringify(this.config));
|
|
94
45
|
|
|
95
|
-
|
|
46
|
+
return Promise.resolve();
|
|
96
47
|
},
|
|
97
|
-
|
|
98
|
-
input(neu) {
|
|
99
|
-
const pattern = /^([1-9]|[1-9][0-9]{1,2}|[1-3][0-9]{3}|40[0-9][0-4])$/;
|
|
100
|
-
|
|
101
|
-
if (!pattern.test(neu) && neu !== '') {
|
|
102
|
-
this.config.vlan = neu > 4094 ? 4094 : 1;
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
updateBeforeSave() {
|
|
107
|
-
this.value.setLabel(HCI.NETWORK_TYPE, this.type);
|
|
108
|
-
this.config.name = this.value.metadata.name;
|
|
109
|
-
this.value.spec.config = JSON.stringify(this.config);
|
|
110
|
-
}
|
|
111
48
|
}
|
|
112
49
|
};
|
|
113
50
|
</script>
|
|
@@ -119,7 +56,7 @@ export default {
|
|
|
119
56
|
:mode="mode"
|
|
120
57
|
:errors="errors"
|
|
121
58
|
:apply-hooks="applyHooks"
|
|
122
|
-
@finish="
|
|
59
|
+
@finish="save"
|
|
123
60
|
>
|
|
124
61
|
<NameNsDescription
|
|
125
62
|
ref="nd"
|
|
@@ -134,86 +71,19 @@ export default {
|
|
|
134
71
|
>
|
|
135
72
|
<Tab
|
|
136
73
|
name="basics"
|
|
137
|
-
:label="t('
|
|
74
|
+
:label="t('networkAttachmentDefinition.tabs.config')"
|
|
138
75
|
:weight="99"
|
|
139
76
|
class="bordered-table"
|
|
140
77
|
>
|
|
141
|
-
<
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
:label="t('harvester.fields.type')"
|
|
145
|
-
:disabled="true"
|
|
146
|
-
required
|
|
147
|
-
/>
|
|
148
|
-
|
|
149
|
-
<LabeledInput
|
|
150
|
-
v-model.number="config.vlan"
|
|
151
|
-
v-int-number
|
|
152
|
-
class="mb-20"
|
|
153
|
-
required
|
|
154
|
-
type="number"
|
|
155
|
-
placeholder="e.g. 1-4094"
|
|
156
|
-
:label="t('tableHeaders.networkVlan')"
|
|
78
|
+
<KeyValue
|
|
79
|
+
key="config"
|
|
80
|
+
v-model="config"
|
|
157
81
|
:mode="mode"
|
|
158
|
-
|
|
82
|
+
:read-allowed="false"
|
|
83
|
+
:value-multiline="false"
|
|
84
|
+
:initialEmptyRow="true"
|
|
159
85
|
/>
|
|
160
86
|
</Tab>
|
|
161
|
-
<Tab
|
|
162
|
-
name="layer3Network"
|
|
163
|
-
:label="t('harvester.network.tabs.layer3Network')"
|
|
164
|
-
:weight="98"
|
|
165
|
-
class="bordered-table"
|
|
166
|
-
>
|
|
167
|
-
<div class="row mt-10">
|
|
168
|
-
<div class="col span-6">
|
|
169
|
-
<RadioGroup
|
|
170
|
-
v-model="layer3Network.mode"
|
|
171
|
-
name="layer3NetworkMode"
|
|
172
|
-
:label="t('harvester.network.layer3Network.mode.label')"
|
|
173
|
-
:mode="mode"
|
|
174
|
-
:options="modeOptions"
|
|
175
|
-
/>
|
|
176
|
-
</div>
|
|
177
|
-
</div>
|
|
178
|
-
<div
|
|
179
|
-
v-if="layer3Network.mode === 'auto'"
|
|
180
|
-
class="row mt-10"
|
|
181
|
-
>
|
|
182
|
-
<div class="col span-6">
|
|
183
|
-
<LabeledInput
|
|
184
|
-
v-model="layer3Network.serverIPAddr"
|
|
185
|
-
class="mb-20"
|
|
186
|
-
:label="t('harvester.network.layer3Network.serverIPAddr.label')"
|
|
187
|
-
:mode="mode"
|
|
188
|
-
/>
|
|
189
|
-
</div>
|
|
190
|
-
</div>
|
|
191
|
-
<div
|
|
192
|
-
v-else
|
|
193
|
-
class="row mt-10"
|
|
194
|
-
>
|
|
195
|
-
<div class="col span-6">
|
|
196
|
-
<LabeledInput
|
|
197
|
-
v-model="layer3Network.cidr"
|
|
198
|
-
class="mb-20"
|
|
199
|
-
:label="t('harvester.network.layer3Network.cidr.label')"
|
|
200
|
-
:placeholder="t('harvester.network.layer3Network.cidr.placeholder')"
|
|
201
|
-
:mode="mode"
|
|
202
|
-
required
|
|
203
|
-
/>
|
|
204
|
-
</div>
|
|
205
|
-
<div class="col span-6">
|
|
206
|
-
<LabeledInput
|
|
207
|
-
v-model="layer3Network.gateway"
|
|
208
|
-
class="mb-20"
|
|
209
|
-
:label="t('harvester.network.layer3Network.gateway.label')"
|
|
210
|
-
:placeholder="t('harvester.network.layer3Network.gateway.placeholder')"
|
|
211
|
-
:mode="mode"
|
|
212
|
-
required
|
|
213
|
-
/>
|
|
214
|
-
</div>
|
|
215
|
-
</div>
|
|
216
|
-
</Tab>
|
|
217
87
|
</Tabbed>
|
|
218
88
|
</CruResource>
|
|
219
89
|
</template>
|
|
@@ -433,7 +433,7 @@ export default {
|
|
|
433
433
|
<template #selected-option="option">
|
|
434
434
|
<i
|
|
435
435
|
v-if="isTag(clusterOutputChoices, option)"
|
|
436
|
-
v-tooltip="t('logging.flow.clusterOutputs.doesntExistTooltip')"
|
|
436
|
+
v-clean-tooltip="t('logging.flow.clusterOutputs.doesntExistTooltip')"
|
|
437
437
|
class="icon icon-info status-icon text-warning"
|
|
438
438
|
/>
|
|
439
439
|
{{ option.label }}
|
|
@@ -454,7 +454,7 @@ export default {
|
|
|
454
454
|
<template #selected-option="option">
|
|
455
455
|
<i
|
|
456
456
|
v-if="isTag(outputChoices, option)"
|
|
457
|
-
v-tooltip="t('logging.flow.outputs.doesntExistTooltip')"
|
|
457
|
+
v-clean-tooltip="t('logging.flow.outputs.doesntExistTooltip')"
|
|
458
458
|
class="icon icon-info status-icon text-warning"
|
|
459
459
|
/>
|
|
460
460
|
{{ option.label }}
|
|
@@ -45,6 +45,11 @@ export default {
|
|
|
45
45
|
if (typeof this.value.ssl_version === 'undefined') {
|
|
46
46
|
this.$set(this.value, 'ssl_version', sslVersions[0]);
|
|
47
47
|
}
|
|
48
|
+
|
|
49
|
+
// Suppress type name by default
|
|
50
|
+
if (typeof this.value.suppress_type_name === 'undefined') {
|
|
51
|
+
this.$set(this.value, 'suppress_type_name', true);
|
|
52
|
+
}
|
|
48
53
|
}
|
|
49
54
|
|
|
50
55
|
return { protocolOptions: protocol, sslVersions };
|
|
@@ -208,6 +213,13 @@ export default {
|
|
|
208
213
|
:disabled="disabled"
|
|
209
214
|
:mode="mode"
|
|
210
215
|
/>
|
|
216
|
+
<Checkbox
|
|
217
|
+
v-model="value.suppress_type_name"
|
|
218
|
+
:label="t('logging.elasticsearch.suppressTypeName.label')"
|
|
219
|
+
:tooltip="t('logging.elasticsearch.suppressTypeName.elasticSearchTips')"
|
|
220
|
+
:disabled="disabled"
|
|
221
|
+
:mode="mode"
|
|
222
|
+
/>
|
|
211
223
|
</div>
|
|
212
224
|
</div>
|
|
213
225
|
</div>
|
|
@@ -45,6 +45,11 @@ export default {
|
|
|
45
45
|
if (typeof this.value.ssl_version === 'undefined') {
|
|
46
46
|
this.$set(this.value, 'ssl_version', sslVersions[0]);
|
|
47
47
|
}
|
|
48
|
+
|
|
49
|
+
// Suppress type name by default
|
|
50
|
+
if (typeof this.value.suppress_type_name === 'undefined') {
|
|
51
|
+
this.$set(this.value, 'suppress_type_name', true);
|
|
52
|
+
}
|
|
48
53
|
}
|
|
49
54
|
|
|
50
55
|
return { protocolOptions: protocol, sslVersions };
|
|
@@ -199,6 +204,13 @@ export default {
|
|
|
199
204
|
:disabled="disabled"
|
|
200
205
|
:mode="mode"
|
|
201
206
|
/>
|
|
207
|
+
<Checkbox
|
|
208
|
+
v-model="value.suppress_type_name"
|
|
209
|
+
:label="t('logging.elasticsearch.suppressTypeName.label')"
|
|
210
|
+
:tooltip="t('logging.elasticsearch.suppressTypeName.openSearchTips')"
|
|
211
|
+
:disabled="disabled"
|
|
212
|
+
:mode="mode"
|
|
213
|
+
/>
|
|
202
214
|
</div>
|
|
203
215
|
</div>
|
|
204
216
|
</div>
|
|
@@ -29,6 +29,11 @@ export default {
|
|
|
29
29
|
if ( this.$store.getters['management/canList'](MANAGEMENT.POD_SECURITY_POLICY_TEMPLATE) ) {
|
|
30
30
|
this.allPSPs = await this.$store.dispatch('management/findAll', { type: MANAGEMENT.POD_SECURITY_POLICY_TEMPLATE });
|
|
31
31
|
}
|
|
32
|
+
|
|
33
|
+
// User can only change the PSP if the user has permissions to see the binding schema for PSP Templates
|
|
34
|
+
const pspBindingSchema = this.$store.getters['management/schemaFor'](MANAGEMENT.PSP_TEMPLATE_BINDING);
|
|
35
|
+
|
|
36
|
+
this.canEditPSPBindings = !!pspBindingSchema;
|
|
32
37
|
},
|
|
33
38
|
data() {
|
|
34
39
|
this.$set(this.value, 'spec', this.value.spec || {});
|
|
@@ -52,6 +57,7 @@ export default {
|
|
|
52
57
|
HARVESTER_TYPES,
|
|
53
58
|
RANCHER_TYPES,
|
|
54
59
|
fvFormRuleSets: [{ path: 'spec.displayName', rules: ['required'] }],
|
|
60
|
+
canEditPSPBindings: true,
|
|
55
61
|
};
|
|
56
62
|
},
|
|
57
63
|
computed: {
|
|
@@ -225,6 +231,7 @@ export default {
|
|
|
225
231
|
class="psp"
|
|
226
232
|
:mode="mode"
|
|
227
233
|
:options="pspOptions"
|
|
234
|
+
:disabled="!canEditPSPBindings"
|
|
228
235
|
:label="t('project.psp.label')"
|
|
229
236
|
/>
|
|
230
237
|
</div>
|
|
@@ -236,7 +236,7 @@ export default {
|
|
|
236
236
|
{{ t('monitoring.receiver.addReceiver') }}
|
|
237
237
|
<i
|
|
238
238
|
v-if="mode === create"
|
|
239
|
-
v-tooltip="t('monitoring.alertmanagerConfig.disabledReceiverButton')"
|
|
239
|
+
v-clean-tooltip="t('monitoring.alertmanagerConfig.disabledReceiverButton')"
|
|
240
240
|
class="icon icon-info"
|
|
241
241
|
/>
|
|
242
242
|
</button>
|
|
@@ -49,7 +49,7 @@ export default {
|
|
|
49
49
|
<h3>
|
|
50
50
|
Receiver
|
|
51
51
|
<i
|
|
52
|
-
v-tooltip="t('monitoring.alertmanagerConfig.receiverTooltip')"
|
|
52
|
+
v-clean-tooltip="t('monitoring.alertmanagerConfig.receiverTooltip')"
|
|
53
53
|
class="icon icon-info"
|
|
54
54
|
/>
|
|
55
55
|
</h3>
|
|
@@ -72,7 +72,7 @@ export default {
|
|
|
72
72
|
<span class="label">
|
|
73
73
|
{{ t("monitoringRoute.groups.addGroupByLabel'") }}
|
|
74
74
|
<i
|
|
75
|
-
v-tooltip="t('monitoringRoute.groups.groupByTooltip')"
|
|
75
|
+
v-clean-tooltip="t('monitoringRoute.groups.groupByTooltip')"
|
|
76
76
|
class="icon icon-info"
|
|
77
77
|
/>
|
|
78
78
|
</span>
|
|
@@ -33,9 +33,10 @@ export default {
|
|
|
33
33
|
expr: '',
|
|
34
34
|
for: '0s',
|
|
35
35
|
labels: {
|
|
36
|
-
severity:
|
|
37
|
-
namespace:
|
|
38
|
-
cluster_id:
|
|
36
|
+
severity: 'none',
|
|
37
|
+
namespace: 'default',
|
|
38
|
+
cluster_id: this.$store.getters['clusterId'],
|
|
39
|
+
cluster_name: this.$store.getters['currentCluster'].spec.displayName
|
|
39
40
|
},
|
|
40
41
|
};
|
|
41
42
|
|
|
@@ -95,9 +96,11 @@ export default {
|
|
|
95
96
|
record: '',
|
|
96
97
|
expr: '',
|
|
97
98
|
labels: {
|
|
98
|
-
severity:
|
|
99
|
-
namespace:
|
|
100
|
-
cluster_id:
|
|
99
|
+
severity: 'none',
|
|
100
|
+
namespace: 'default',
|
|
101
|
+
cluster_id: this.$store.getters['clusterId'],
|
|
102
|
+
cluster_name: this.$store.getters['currentCluster'].spec.displayName
|
|
103
|
+
|
|
101
104
|
},
|
|
102
105
|
});
|
|
103
106
|
break;
|
|
@@ -122,7 +125,7 @@ export default {
|
|
|
122
125
|
<t k="prometheusRule.recordingRules.label" />
|
|
123
126
|
<i
|
|
124
127
|
v-if="disableAddRecord"
|
|
125
|
-
v-tooltip="t('validation.prometheusRule.groups.singleAlert')"
|
|
128
|
+
v-clean-tooltip="t('validation.prometheusRule.groups.singleAlert')"
|
|
126
129
|
class="icon icon-info"
|
|
127
130
|
/>
|
|
128
131
|
</h3>
|
|
@@ -165,7 +168,7 @@ export default {
|
|
|
165
168
|
<t k="prometheusRule.alertingRules.label" />
|
|
166
169
|
<i
|
|
167
170
|
v-if="disableAddAlert"
|
|
168
|
-
v-tooltip="t('validation.prometheusRule.groups.singleAlert')"
|
|
171
|
+
v-clean-tooltip="t('validation.prometheusRule.groups.singleAlert')"
|
|
169
172
|
class="icon icon-info"
|
|
170
173
|
/>
|
|
171
174
|
</h3>
|
|
@@ -54,7 +54,7 @@ export default {
|
|
|
54
54
|
<h2>
|
|
55
55
|
{{ t(`networkpolicy.${type}.ruleLabel`) }}
|
|
56
56
|
<i
|
|
57
|
-
v-tooltip="t(`networkpolicy.${type}.ruleHint`)"
|
|
57
|
+
v-clean-tooltip="t(`networkpolicy.${type}.ruleHint`)"
|
|
58
58
|
class="icon icon-info"
|
|
59
59
|
/>
|
|
60
60
|
</h2>
|
|
@@ -83,7 +83,7 @@ export default {
|
|
|
83
83
|
<h2>
|
|
84
84
|
{{ t('networkpolicy.rules.ports.label') }}
|
|
85
85
|
<i
|
|
86
|
-
v-tooltip="t(`networkpolicy.${type}.portHint`)"
|
|
86
|
+
v-clean-tooltip="t(`networkpolicy.${type}.portHint`)"
|
|
87
87
|
class="icon icon-info"
|
|
88
88
|
/>
|
|
89
89
|
</h2>
|
|
@@ -74,6 +74,7 @@ export default {
|
|
|
74
74
|
POD,
|
|
75
75
|
TARGET_OPTIONS,
|
|
76
76
|
targetOptions: Object.values(TARGET_OPTIONS),
|
|
77
|
+
throttleTime: 250,
|
|
77
78
|
};
|
|
78
79
|
},
|
|
79
80
|
computed: {
|
|
@@ -139,7 +140,7 @@ export default {
|
|
|
139
140
|
handler: throttle(function() {
|
|
140
141
|
this.matchingNamespaces = this.getMatchingNamespaces();
|
|
141
142
|
this.matchingPods = this.getMatchingPods();
|
|
142
|
-
},
|
|
143
|
+
}, this.throttle, { leading: true }),
|
|
143
144
|
immediate: true
|
|
144
145
|
};
|
|
145
146
|
},
|
|
@@ -213,6 +214,7 @@ export default {
|
|
|
213
214
|
<div class="col span-6">
|
|
214
215
|
<LabeledSelect
|
|
215
216
|
v-model="targetType"
|
|
217
|
+
data-testid="labeled-select-type-selector"
|
|
216
218
|
:mode="mode"
|
|
217
219
|
:tooltip="targetType === TARGET_OPTIONS.NAMESPACE_AND_POD_SELECTOR ? t('networkpolicy.selectors.matchingNamespacesAndPods.tooltip') : null"
|
|
218
220
|
:options="selectTargetOptions"
|
|
@@ -226,6 +228,7 @@ export default {
|
|
|
226
228
|
<div class="col span-6">
|
|
227
229
|
<LabeledInput
|
|
228
230
|
v-model="value[TARGET_OPTIONS.IP_BLOCK].cidr"
|
|
231
|
+
data-testid="labeled-input-ip-block-selector"
|
|
229
232
|
:mode="mode"
|
|
230
233
|
:placeholder="t('networkpolicy.rules.ipBlock.cidr.placeholder')"
|
|
231
234
|
:label="t('networkpolicy.rules.ipBlock.cidr.label')"
|
|
@@ -277,6 +280,7 @@ export default {
|
|
|
277
280
|
<div class="col span-12">
|
|
278
281
|
<MatchExpressions
|
|
279
282
|
v-model="podSelectorExpressions"
|
|
283
|
+
data-testid="match-expression-pod-selector"
|
|
280
284
|
:mode="mode"
|
|
281
285
|
:show-remove="false"
|
|
282
286
|
:initial-empty-row="true"
|
|
@@ -297,6 +301,7 @@ export default {
|
|
|
297
301
|
<div class="col span-12">
|
|
298
302
|
<MatchExpressions
|
|
299
303
|
v-model="namespaceSelectorExpressions"
|
|
304
|
+
data-testid="match-expression-namespace-selector"
|
|
300
305
|
:mode="mode"
|
|
301
306
|
:show-remove="false"
|
|
302
307
|
:initial-empty-row="true"
|
|
@@ -329,6 +334,7 @@ export default {
|
|
|
329
334
|
<div class="col span-11">
|
|
330
335
|
<MatchExpressions
|
|
331
336
|
v-model="namespaceSelectorExpressions"
|
|
337
|
+
data-testid="match-expression-namespace-and-pod-selector-ns-rule"
|
|
332
338
|
:mode="mode"
|
|
333
339
|
:show-add-button="false"
|
|
334
340
|
:show-remove-button="false"
|
|
@@ -347,6 +353,7 @@ export default {
|
|
|
347
353
|
<div class="col span-11">
|
|
348
354
|
<MatchExpressions
|
|
349
355
|
v-model="podSelectorExpressions"
|
|
356
|
+
data-testid="match-expression-namespace-and-pod-selector-pod-rule"
|
|
350
357
|
:mode="mode"
|
|
351
358
|
:show-add-button="false"
|
|
352
359
|
:show-remove-button="false"
|
|
@@ -362,13 +369,14 @@ export default {
|
|
|
362
369
|
|
|
363
370
|
<style lang='scss' scoped>
|
|
364
371
|
.namespace-pod-rule {
|
|
372
|
+
display: table;
|
|
365
373
|
width: 100px;
|
|
366
|
-
|
|
374
|
+
padding: 0, 10px, 0, 0;
|
|
367
375
|
text-align: center;
|
|
368
376
|
|
|
369
377
|
.label {
|
|
370
|
-
display:
|
|
371
|
-
|
|
378
|
+
display:table-cell;
|
|
379
|
+
vertical-align:middle;
|
|
372
380
|
}
|
|
373
381
|
}
|
|
374
382
|
</style>
|