dashboard-shell-shell 1.0.111 → 1.0.113
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/.DS_Store +0 -0
- package/assets/icons/demo.css +539 -0
- package/assets/icons/demo_index.html +1131 -0
- package/assets/icons/iconfont.css +200 -0
- package/assets/icons/iconfont.js +1 -0
- package/assets/icons/iconfont.json +296 -0
- package/assets/icons/iconfont.ttf +0 -0
- package/assets/icons/iconfont.woff +0 -0
- package/assets/icons/iconfont.woff2 +0 -0
- package/assets/images/API.svg +3 -0
- package/assets/images/login/password.svg +20 -0
- package/assets/images/login/user.svg +6 -0
- package/assets/images/login-bg.png +0 -0
- package/assets/images/login-left.png +0 -0
- package/assets/images/login-logo.svg +19 -0
- package/assets/images/logo.png +0 -0
- package/assets/images/pl/harvester.png +0 -0
- package/assets/images/promp-yellow.svg +5 -0
- package/assets/images/user.png +0 -0
- package/assets/styles/all.scss +63 -0
- package/assets/styles/app.scss +2 -0
- package/assets/styles/base/_basic.scss +8 -2
- package/assets/styles/base/_helpers.scss +4 -0
- package/assets/styles/base/_typography.scss +2 -1
- package/assets/styles/base/_variables.scss +10 -2
- package/assets/styles/global/_button.scss +37 -25
- package/assets/styles/global/_columns.scss +3 -1
- package/assets/styles/global/_form.scss +45 -13
- package/assets/styles/global/_labeled-input.scss +50 -25
- package/assets/styles/global/_layout.scss +9 -3
- package/assets/styles/global/_select.scss +20 -13
- package/assets/styles/global/_table.scss +1 -1
- package/assets/styles/global/_tooltip.scss +47 -6
- package/assets/styles/themes/_dark.scss +1 -0
- package/assets/styles/themes/_light.scss +59 -46
- package/assets/styles/themes/_suse.scss +1 -0
- package/assets/styles/vendor/vue-select.scss +18 -7
- package/assets/translations/en-us.yaml +93 -12
- package/assets/translations/zh-hans.yaml +278 -141
- package/components/ActionDropdown.vue +1 -1
- package/components/ActionDropdownShell.vue +71 -0
- package/components/ActionMenu.vue +2 -2
- package/components/ActionMenuShell.vue +1 -0
- package/components/AppModal.vue +78 -6
- package/components/AssignTo.vue +25 -11
- package/components/AsyncButton.vue +24 -7
- package/components/BannerGraphic.vue +1 -0
- package/components/ButtonDropdown.vue +26 -4
- package/components/ButtonGroup.vue +4 -0
- package/components/ButtonMultiAction.vue +1 -0
- package/components/CommunityLinks.vue +3 -3
- package/components/ConsumptionGauge.vue +24 -5
- package/components/CopyToClipboardText.vue +2 -1
- package/components/CruResource.vue +12 -7
- package/components/CruResourceFooter.vue +2 -2
- package/components/DashboardOptions.vue +21 -15
- package/components/DetailText.vue +5 -0
- package/components/DisableAuthProviderModal.vue +1 -0
- package/components/DotState.vue +84 -0
- package/components/ExplorerMembers.vue +1 -1
- package/components/ExplorerProjectsNamespaces.vue +56 -14
- package/components/FixedBanner.vue +19 -12
- package/components/GlobalRoleBindings.vue +5 -1
- package/components/GrafanaDashboard.vue +4 -4
- package/components/GrowlManager.vue +4 -1
- package/components/HardwareResourceGauge.vue +39 -3
- package/components/InfoBox.vue +3 -3
- package/components/InputOrDisplay.vue +28 -2
- package/components/LabelValue.vue +16 -1
- package/components/LandingPagePreference.vue +5 -3
- package/components/LocaleSelector.vue +39 -93
- package/components/ModalManager.vue +55 -0
- package/components/ModalWithCard.vue +2 -0
- package/components/MoveModal.vue +1 -0
- package/components/PromptChangePassword.vue +1 -1
- package/components/PromptModal.vue +15 -2
- package/components/PromptRemove.vue +28 -8
- package/components/PromptRestore.vue +1 -0
- package/components/ResourceCancelModal.vue +1 -0
- package/components/ResourceDetail/Masthead.vue +188 -43
- package/components/ResourceDetail/__tests__/Masthead.test.ts +5 -1
- package/components/ResourceDetail/index.vue +49 -14
- package/components/ResourceList/Masthead.vue +80 -18
- package/components/ResourceTable.vue +60 -19
- package/components/SideNav.vue +32 -12
- package/components/SlideInPanelManager.vue +126 -0
- package/components/SortableTable/THead.vue +34 -5
- package/components/SortableTable/actions.js +1 -1
- package/components/SortableTable/index.vue +649 -142
- package/components/SortableTable/paging.js +36 -28
- package/components/SortableTable/selection.js +0 -11
- package/components/StatusBadge.vue +77 -0
- package/components/Tabbed/Tab.vue +3 -3
- package/components/Tabbed/index.vue +44 -26
- package/components/Wizard.vue +2 -2
- package/components/__tests__/AsyncButton.test.ts +2 -2
- package/components/__tests__/FixedBanner.test.ts +3 -3
- package/components/__tests__/ModalManager.spec.ts +176 -0
- package/components/__tests__/SlideInPanelManager.spec.ts +166 -0
- package/components/auth/Principal.vue +10 -3
- package/components/auth/__tests__/RoleDetailEdit.test.ts +3 -2
- package/components/form/ArrayList.vue +123 -85
- package/components/form/ArrayListGrouped.vue +10 -2
- package/components/form/Command.vue +6 -15
- package/components/form/EnvVars.vue +16 -8
- package/components/form/Footer.vue +8 -5
- package/components/form/HealthCheck.vue +3 -3
- package/components/form/HookOption.vue +11 -16
- package/components/form/KeyValue.vue +16 -7
- package/components/form/LabeledSelect.vue +59 -76
- package/components/form/LifecycleHooks.vue +3 -3
- package/components/form/MatchExpressions.vue +35 -12
- package/components/form/NameNsDescription.vue +147 -115
- package/components/form/Networking.vue +20 -12
- package/components/form/NodeAffinity.vue +31 -23
- package/components/form/NodeScheduling.vue +13 -3
- package/components/form/Password.vue +11 -5
- package/components/form/PodAffinity.vue +43 -44
- package/components/form/Probe.vue +68 -66
- package/components/form/ResourceQuota/Project.vue +5 -1
- package/components/form/ResourceSelector.vue +7 -9
- package/components/form/SSHKnownHosts/KnownHostsEditDialog.vue +6 -3
- package/components/form/SSHKnownHosts/__tests__/KnownHostsEditDialog.test.ts +12 -1
- package/components/form/SSHKnownHosts/index.vue +16 -2
- package/components/form/Security.vue +54 -56
- package/components/form/Select.vue +41 -7
- package/components/form/ShellInput.vue +5 -1
- package/components/form/Tolerations.vue +5 -1
- package/components/form/UnitInput.vue +2 -2
- package/components/form/ValueFromResource.vue +134 -121
- package/components/form/WorkloadPorts.vue +18 -18
- package/components/form/__tests__/ArrayList.test.ts +5 -2
- package/components/form/__tests__/MatchExpressions.test.ts +12 -12
- package/components/form/__tests__/NameNsDescription.test.ts +115 -14
- package/components/form/__tests__/Probe.test.ts +12 -8
- package/components/form/__tests__/SSHKnownHosts.test.ts +11 -0
- package/components/form/__tests__/Select.test.ts +37 -0
- package/components/form/__tests__/UnitInput.test.ts +4 -5
- package/components/formatter/BadgeStateFormatter.vue +8 -5
- package/components/formatter/InternalExternalIP.vue +2 -0
- package/components/formatter/SecretData.vue +20 -7
- package/components/nav/Favorite.vue +5 -1
- package/components/nav/Group.vue +60 -27
- package/components/nav/Header.vue +39 -13
- package/components/nav/Jump.vue +7 -0
- package/components/nav/NamespaceFilter.vue +14 -8
- package/components/nav/Pinned.vue +1 -1
- package/components/nav/TopLevelMenu.vue +5 -17
- package/components/nav/Type.vue +32 -35
- package/components/nav/__tests__/TopLevelMenu.test.ts +0 -40
- package/components/templates/blank.vue +4 -1
- package/components/templates/default.vue +8 -0
- package/components/templates/home.vue +10 -1
- package/components/templates/plain.vue +10 -1
- package/package.json +1 -1
- package/rancher-components/Banner/Banner.vue +6 -4
- package/rancher-components/Card/Card.vue +6 -4
- package/rancher-components/Form/Checkbox/Checkbox.vue +20 -1
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +46 -5
- package/rancher-components/Form/Radio/RadioButton.vue +32 -8
- package/rancher-components/Form/Radio/RadioGroup.vue +31 -24
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.test.ts +17 -0
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +8 -3
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +15 -3
- package/rancher-components/RcButton/RcButton.vue +1 -0
- package/rancher-components/RcButton/types.ts +1 -0
- package/rancher-components/RcDropdown/RcDropdown.vue +54 -15
- package/rancher-components/RcDropdown/RcDropdownItem.vue +5 -4
- package/rancher-components/RcDropdown/RcDropdownMenu.vue +11 -7
- package/rancher-components/RcDropdown/RcDropdownTrigger.vue +12 -2
- package/rancher-components/RcDropdown/useDropdownCollection.ts +8 -0
- package/rancher-components/RcDropdown/useDropdownContext.ts +9 -3
- package/rancher-components/StringList/StringList.vue +1 -1
- package/store/type-map.js +29 -2
- package/utils/error.js +30 -8
- package/utils/errorTranslate.json +916 -0
- package/vue.config.js +1 -1
- package/components/formatter/ExtensionCache.vue +0 -74
- package/components/formatter/Port.vue +0 -24
- package/components/formatter/SecretType.vue +0 -41
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import {
|
|
2
|
+
import { computed, ref, toRef, watch } from 'vue';
|
|
3
|
+
import { mapActions, useStore } from 'vuex';
|
|
4
|
+
|
|
3
5
|
import { get, set } from '@shell/utils/object';
|
|
4
6
|
import { sortBy } from '@shell/utils/sort';
|
|
5
7
|
import { NAMESPACE } from '@shell/config/types';
|
|
@@ -8,6 +10,7 @@ import { _VIEW, _EDIT, _CREATE } from '@shell/config/query-params';
|
|
|
8
10
|
import { LabeledInput } from '@components/Form/LabeledInput';
|
|
9
11
|
import LabeledSelect from '@shell/components/form/LabeledSelect';
|
|
10
12
|
import { normalizeName } from '@shell/utils/kube';
|
|
13
|
+
import { useI18n } from '@shell/composables/useI18n';
|
|
11
14
|
|
|
12
15
|
export default {
|
|
13
16
|
name: 'NameNsDescription',
|
|
@@ -169,81 +172,74 @@ export default {
|
|
|
169
172
|
},
|
|
170
173
|
|
|
171
174
|
data() {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
let namespace, name, description;
|
|
175
|
+
return { createNamespace: false };
|
|
176
|
+
},
|
|
175
177
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
178
|
+
setup(props, { emit }) {
|
|
179
|
+
const v = toRef(props.value);
|
|
180
|
+
const metadata = v.value.metadata;
|
|
181
|
+
const namespace = ref(null);
|
|
182
|
+
const name = ref(null);
|
|
183
|
+
const description = ref(null);
|
|
181
184
|
|
|
182
|
-
|
|
183
|
-
if (
|
|
184
|
-
|
|
185
|
-
this.updateNamespace(namespace);
|
|
186
|
-
} else if (this.namespaceKey) {
|
|
187
|
-
namespace = get(v, this.namespaceKey);
|
|
188
|
-
} else {
|
|
189
|
-
namespace = metadata?.namespace;
|
|
185
|
+
watch(name, (val) => {
|
|
186
|
+
if (props.normalizeName) {
|
|
187
|
+
val = normalizeName(val);
|
|
190
188
|
}
|
|
191
189
|
|
|
192
|
-
if (
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}
|
|
190
|
+
if (props.nameKey) {
|
|
191
|
+
set(props.value, props.nameKey, val);
|
|
192
|
+
} else {
|
|
193
|
+
props.value.metadata['name'] = val;
|
|
197
194
|
}
|
|
198
|
-
|
|
195
|
+
emit('update:value', props.value);
|
|
196
|
+
});
|
|
199
197
|
|
|
200
|
-
if (
|
|
201
|
-
|
|
198
|
+
if (props.nameKey) {
|
|
199
|
+
name.value = get(v.value, props.nameKey);
|
|
202
200
|
} else {
|
|
203
|
-
|
|
201
|
+
name.value = metadata?.name || '';
|
|
204
202
|
}
|
|
205
203
|
|
|
206
|
-
const
|
|
207
|
-
|
|
204
|
+
const isCreate = computed(() => {
|
|
205
|
+
return props.mode === _CREATE;
|
|
206
|
+
});
|
|
208
207
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
nsSchema
|
|
215
|
-
};
|
|
216
|
-
},
|
|
208
|
+
const store = useStore();
|
|
209
|
+
const { t } = useI18n(store);
|
|
210
|
+
const allowedNamespaces = computed(() => store.getters.allowedNamespaces());
|
|
211
|
+
const storeNamespaces = computed(() => store.getters.namespaces());
|
|
212
|
+
const currentCluster = computed(() => store.getters.currentCluster);
|
|
217
213
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
namespaceReallyDisabled() {
|
|
222
|
-
return (
|
|
223
|
-
!!this.forceNamespace || this.namespaceDisabled || this.mode === _EDIT
|
|
224
|
-
); // namespace is never editable
|
|
225
|
-
},
|
|
214
|
+
const inStore = computed(() => {
|
|
215
|
+
return store.getters['currentStore']();
|
|
216
|
+
});
|
|
226
217
|
|
|
227
|
-
|
|
228
|
-
return
|
|
229
|
-
}
|
|
218
|
+
const nsSchema = computed(() => {
|
|
219
|
+
return store.getters[`${ inStore.value }/schemaFor`](NAMESPACE);
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
const canCreateNamespace = computed(() => {
|
|
223
|
+
// Check if user can push to namespaces... and as the ns is outside of a project restrict to admins and cluster owners
|
|
224
|
+
return (nsSchema.value?.collectionMethods || []).includes('POST') && currentCluster.value?.canUpdate;
|
|
225
|
+
});
|
|
230
226
|
|
|
231
227
|
/**
|
|
232
228
|
* Map namespaces from the store to options, adding divider and create button
|
|
233
229
|
*/
|
|
234
|
-
options() {
|
|
230
|
+
const options = computed(() => {
|
|
235
231
|
let namespaces;
|
|
236
232
|
|
|
237
|
-
if (
|
|
233
|
+
if (props.namespacesOverride) {
|
|
238
234
|
// Use the resources provided
|
|
239
|
-
namespaces =
|
|
235
|
+
namespaces = props.namespacesOverride;
|
|
240
236
|
} else {
|
|
241
|
-
if (
|
|
237
|
+
if (props.namespaceOptions) {
|
|
242
238
|
// Use the namespaces provided
|
|
243
|
-
namespaces = (
|
|
239
|
+
namespaces = (props.namespaceOptions.map((ns) => ns.name) || []).sort();
|
|
244
240
|
} else {
|
|
245
241
|
// Determine the namespaces
|
|
246
|
-
const namespaceObjs =
|
|
242
|
+
const namespaceObjs = isCreate.value ? allowedNamespaces.value : storeNamespaces.value;
|
|
247
243
|
|
|
248
244
|
namespaces = Object.keys(namespaceObjs);
|
|
249
245
|
}
|
|
@@ -251,22 +247,22 @@ export default {
|
|
|
251
247
|
|
|
252
248
|
const options = namespaces
|
|
253
249
|
.map((namespace) => ({ nameDisplay: namespace, id: namespace }))
|
|
254
|
-
.map(
|
|
250
|
+
.map(props.namespaceMapper || ((obj) => ({
|
|
255
251
|
label: obj.nameDisplay,
|
|
256
252
|
value: obj.id,
|
|
257
253
|
})));
|
|
258
254
|
|
|
259
255
|
const sortedByLabel = sortBy(options, 'label');
|
|
260
256
|
|
|
261
|
-
if (
|
|
257
|
+
if (props.forceNamespace) {
|
|
262
258
|
sortedByLabel.unshift({
|
|
263
|
-
label:
|
|
264
|
-
value:
|
|
259
|
+
label: props.forceNamespace,
|
|
260
|
+
value: props.forceNamespace,
|
|
265
261
|
});
|
|
266
262
|
}
|
|
267
263
|
|
|
268
264
|
const createButton = {
|
|
269
|
-
label:
|
|
265
|
+
label: t('namespace.createNamespace'),
|
|
270
266
|
value: '',
|
|
271
267
|
kind: 'highlighted'
|
|
272
268
|
};
|
|
@@ -276,20 +272,78 @@ export default {
|
|
|
276
272
|
kind: 'divider'
|
|
277
273
|
};
|
|
278
274
|
|
|
279
|
-
const createOverhead =
|
|
275
|
+
// const createOverhead = canCreateNamespace.value || props.createNamespaceOverride ? [createButton, divider] : [];
|
|
280
276
|
|
|
281
277
|
return [
|
|
282
|
-
...createOverhead,
|
|
278
|
+
// ...createOverhead,
|
|
283
279
|
...sortedByLabel
|
|
284
280
|
];
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
const updateNamespace = (val) => {
|
|
284
|
+
if (props.forceNamespace) {
|
|
285
|
+
val = props.forceNamespace;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
if (props.namespaced) {
|
|
289
|
+
emit('isNamespaceNew', !val || (options.value && !options.value.find((n) => n.value === val)));
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
if (props.namespaceKey) {
|
|
293
|
+
set(props.value, props.namespaceKey, val);
|
|
294
|
+
} else {
|
|
295
|
+
props.value.metadata.namespace = val;
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
if (props.namespaced) {
|
|
300
|
+
if (props.forceNamespace) {
|
|
301
|
+
namespace.value = toRef(props.forceNamespace);
|
|
302
|
+
updateNamespace(namespace);
|
|
303
|
+
} else if (props.namespaceKey) {
|
|
304
|
+
namespace.value = get(v, props.namespaceKey);
|
|
305
|
+
} else {
|
|
306
|
+
namespace.value = metadata?.namespace;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
if (!namespace.value && !props.noDefaultNamespace) {
|
|
310
|
+
namespace.value = store.getters['defaultNamespace'];
|
|
311
|
+
if (metadata) {
|
|
312
|
+
metadata.namespace = namespace;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
if (props.descriptionKey) {
|
|
318
|
+
description.value = get(v, props.descriptionKey);
|
|
319
|
+
} else {
|
|
320
|
+
description.value = metadata?.annotations?.[DESCRIPTION];
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
return {
|
|
324
|
+
namespace,
|
|
325
|
+
name,
|
|
326
|
+
description,
|
|
327
|
+
isCreate,
|
|
328
|
+
options,
|
|
329
|
+
updateNamespace,
|
|
330
|
+
};
|
|
331
|
+
},
|
|
332
|
+
|
|
333
|
+
computed: {
|
|
334
|
+
...mapActions('cru-resource', ['setCreateNamespace']),
|
|
335
|
+
namespaceReallyDisabled() {
|
|
336
|
+
return (
|
|
337
|
+
!!this.forceNamespace || this.namespaceDisabled || this.mode === _EDIT
|
|
338
|
+
); // namespace is never editable
|
|
285
339
|
},
|
|
286
340
|
|
|
287
|
-
|
|
288
|
-
return this.mode ===
|
|
341
|
+
nameReallyDisabled() {
|
|
342
|
+
return this.nameDisabled || (this.mode === _EDIT && !this.nameEditable);
|
|
289
343
|
},
|
|
290
344
|
|
|
291
|
-
|
|
292
|
-
return this.mode ===
|
|
345
|
+
isView() {
|
|
346
|
+
return this.mode === _VIEW;
|
|
293
347
|
},
|
|
294
348
|
|
|
295
349
|
showCustomize() {
|
|
@@ -298,37 +352,20 @@ export default {
|
|
|
298
352
|
|
|
299
353
|
colSpan() {
|
|
300
354
|
if (!this.horizontal) {
|
|
301
|
-
return `span-
|
|
355
|
+
return `span-6`;
|
|
302
356
|
}
|
|
303
357
|
// Name and namespace take up two columns.
|
|
304
|
-
let cols = (this.nameNsHidden ? 0 : 2) + (this.descriptionHidden ? 0 : 1) + this.extraColumns.length;
|
|
358
|
+
// let cols = (this.nameNsHidden ? 0 : 2) + (this.descriptionHidden ? 0 : 1) + this.extraColumns.length;
|
|
359
|
+
let cols = 2;
|
|
305
360
|
|
|
306
361
|
cols = Math.max(2, cols); // If there's only one column, make it render half-width as if there were two
|
|
307
362
|
const span = 12 / cols; // If there's 5, 7, or more columns this will break; don't do that.
|
|
308
363
|
|
|
309
364
|
return `span-${ span }`;
|
|
310
365
|
},
|
|
311
|
-
|
|
312
|
-
canCreateNamespace() {
|
|
313
|
-
// Check if user can push to namespaces... and as the ns is outside of a project restrict to admins and cluster owners
|
|
314
|
-
return (this.nsSchema?.collectionMethods || []).includes('POST') && this.currentCluster?.canUpdate;
|
|
315
|
-
}
|
|
316
366
|
},
|
|
317
367
|
|
|
318
368
|
watch: {
|
|
319
|
-
name(val) {
|
|
320
|
-
if (this.normalizeName) {
|
|
321
|
-
val = normalizeName(val);
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
if (this.nameKey) {
|
|
325
|
-
set(this.value, this.nameKey, val);
|
|
326
|
-
} else {
|
|
327
|
-
this.value.metadata['name'] = val;
|
|
328
|
-
}
|
|
329
|
-
this.$emit('update:value', this.value);
|
|
330
|
-
},
|
|
331
|
-
|
|
332
369
|
namespace(val) {
|
|
333
370
|
this.updateNamespace(val);
|
|
334
371
|
this.$emit('update:value', this.value);
|
|
@@ -346,29 +383,13 @@ export default {
|
|
|
346
383
|
|
|
347
384
|
mounted() {
|
|
348
385
|
this.$nextTick(() => {
|
|
349
|
-
if (this.$refs.
|
|
350
|
-
this.$refs.
|
|
386
|
+
if (this.$refs.nameInput) {
|
|
387
|
+
this.$refs.nameInput.focus();
|
|
351
388
|
}
|
|
352
389
|
});
|
|
353
390
|
},
|
|
354
391
|
|
|
355
392
|
methods: {
|
|
356
|
-
updateNamespace(val) {
|
|
357
|
-
if (this.forceNamespace) {
|
|
358
|
-
val = this.forceNamespace;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
if (this.namespaced) {
|
|
362
|
-
this.$emit('isNamespaceNew', !val || (this.options && !this.options.find((n) => n.value === val)));
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
if (this.namespaceKey) {
|
|
366
|
-
set(this.value, this.namespaceKey, val);
|
|
367
|
-
} else {
|
|
368
|
-
this.value.metadata.namespace = val;
|
|
369
|
-
}
|
|
370
|
-
},
|
|
371
|
-
|
|
372
393
|
changeNameAndNamespace(e) {
|
|
373
394
|
this.name = (e.text || '').toLowerCase();
|
|
374
395
|
this.namespace = e.selected;
|
|
@@ -389,7 +410,7 @@ export default {
|
|
|
389
410
|
true,
|
|
390
411
|
);
|
|
391
412
|
this.$emit('isNamespaceNew', true);
|
|
392
|
-
this.$nextTick(() => this.$refs.
|
|
413
|
+
this.$nextTick(() => this.$refs.namespaceInput.focus());
|
|
393
414
|
} else {
|
|
394
415
|
this.createNamespace = false;
|
|
395
416
|
this.$store.dispatch(
|
|
@@ -404,14 +425,14 @@ export default {
|
|
|
404
425
|
</script>
|
|
405
426
|
|
|
406
427
|
<template>
|
|
407
|
-
<div class="row
|
|
428
|
+
<div class="row">
|
|
408
429
|
<div
|
|
409
430
|
v-if="namespaced && !nameNsHidden && createNamespace"
|
|
410
431
|
:data-testid="componentTestid + '-namespace-create'"
|
|
411
|
-
class="col span-
|
|
432
|
+
class="col span-6"
|
|
412
433
|
>
|
|
413
434
|
<LabeledInput
|
|
414
|
-
ref="
|
|
435
|
+
ref="namespaceInput"
|
|
415
436
|
v-model:value="namespace"
|
|
416
437
|
:label="t('namespace.label')"
|
|
417
438
|
:placeholder="t('namespace.createNamespace')"
|
|
@@ -434,7 +455,7 @@ export default {
|
|
|
434
455
|
<div
|
|
435
456
|
v-if="namespaced && !nameNsHidden && !createNamespace"
|
|
436
457
|
:data-testid="componentTestid + '-namespace'"
|
|
437
|
-
class="col span-
|
|
458
|
+
class="col span-6"
|
|
438
459
|
>
|
|
439
460
|
<LabeledSelect
|
|
440
461
|
v-show="!createNamespace"
|
|
@@ -456,12 +477,13 @@ export default {
|
|
|
456
477
|
<div
|
|
457
478
|
v-if="!nameNsHidden"
|
|
458
479
|
:data-testid="componentTestid + '-name'"
|
|
459
|
-
class="col span-
|
|
480
|
+
class="col span-6"
|
|
460
481
|
>
|
|
461
482
|
<LabeledInput
|
|
462
|
-
ref="
|
|
483
|
+
ref="nameInput"
|
|
463
484
|
key="name"
|
|
464
485
|
v-model:value="name"
|
|
486
|
+
data-testid="NameNsDescriptionNameInput"
|
|
465
487
|
:label="t(nameLabel)"
|
|
466
488
|
:placeholder="t(namePlaceholder)"
|
|
467
489
|
:disabled="nameReallyDisabled"
|
|
@@ -473,11 +495,22 @@ export default {
|
|
|
473
495
|
</div>
|
|
474
496
|
|
|
475
497
|
<slot name="customize" />
|
|
476
|
-
<!--
|
|
477
|
-
<div
|
|
498
|
+
<!-- <div
|
|
478
499
|
v-show="!descriptionHidden"
|
|
479
500
|
:data-testid="componentTestid + '-description'"
|
|
480
501
|
:class="['col', extraColumns.length > 0 ? 'span-3' : 'span-6']"
|
|
502
|
+
> -->
|
|
503
|
+
<div
|
|
504
|
+
v-for="(slot, i) in extraColumns"
|
|
505
|
+
:key="i"
|
|
506
|
+
:class="{ col: true, [colSpan]: true }"
|
|
507
|
+
>
|
|
508
|
+
<slot :name="slot" />
|
|
509
|
+
</div>
|
|
510
|
+
<div
|
|
511
|
+
v-show="!descriptionHidden"
|
|
512
|
+
:data-testid="componentTestid + '-description'"
|
|
513
|
+
class="col span-6"
|
|
481
514
|
>
|
|
482
515
|
<LabeledInput
|
|
483
516
|
key="description"
|
|
@@ -492,11 +525,10 @@ export default {
|
|
|
492
525
|
</div>
|
|
493
526
|
|
|
494
527
|
<div
|
|
495
|
-
v-
|
|
496
|
-
|
|
497
|
-
:class="{ col: true, [colSpan]: true }"
|
|
528
|
+
v-if="$slots.bottom"
|
|
529
|
+
style="width: 100%;"
|
|
498
530
|
>
|
|
499
|
-
<slot
|
|
531
|
+
<slot name="bottom" />
|
|
500
532
|
</div>
|
|
501
533
|
<div
|
|
502
534
|
v-if="showSpacer"
|
|
@@ -29,6 +29,20 @@ export default {
|
|
|
29
29
|
|
|
30
30
|
data() {
|
|
31
31
|
const t = this.$store.getters['i18n/t'];
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
dnsPolicy: this.value.dnsPolicy || 'ClusterFirst',
|
|
35
|
+
networkMode: this.value.hostNetwork ? { label: t('workload.networking.networkMode.options.hostNetwork'), value: true } : { label: t('workload.networking.networkMode.options.normal'), value: false },
|
|
36
|
+
hostAliases: [],
|
|
37
|
+
nameservers: null,
|
|
38
|
+
searches: null,
|
|
39
|
+
hostname: null,
|
|
40
|
+
subdomain: null,
|
|
41
|
+
options: null,
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
created() {
|
|
32
46
|
const hostAliases = (this.value.hostAliases || []).map((entry) => {
|
|
33
47
|
return {
|
|
34
48
|
ip: entry.ip,
|
|
@@ -38,18 +52,12 @@ export default {
|
|
|
38
52
|
const { dnsConfig = {}, hostname, subdomain } = this.value;
|
|
39
53
|
const { nameservers, searches, options } = dnsConfig;
|
|
40
54
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
hostname,
|
|
48
|
-
subdomain,
|
|
49
|
-
options
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
return out;
|
|
55
|
+
this.hostAliases = hostAliases;
|
|
56
|
+
this.nameservers = nameservers;
|
|
57
|
+
this.searches = searches;
|
|
58
|
+
this.hostname = hostname;
|
|
59
|
+
this.subdomain = subdomain;
|
|
60
|
+
this.options = options;
|
|
53
61
|
},
|
|
54
62
|
|
|
55
63
|
computed: {
|
|
@@ -42,31 +42,18 @@ export default {
|
|
|
42
42
|
data() {
|
|
43
43
|
// VolumeNodeAffinity only has 'required' field
|
|
44
44
|
if (this.value.required) {
|
|
45
|
-
return { nodeSelectorTerms: this.value.required.nodeSelectorTerms };
|
|
46
45
|
} else {
|
|
47
|
-
const { preferredDuringSchedulingIgnoredDuringExecution = [], requiredDuringSchedulingIgnoredDuringExecution = {} } = this.value;
|
|
48
|
-
const { nodeSelectorTerms = [] } = requiredDuringSchedulingIgnoredDuringExecution;
|
|
49
|
-
const allSelectorTerms = [...preferredDuringSchedulingIgnoredDuringExecution, ...nodeSelectorTerms].map((term) => {
|
|
50
|
-
const neu = clone(term);
|
|
51
|
-
|
|
52
|
-
neu._id = randomStr(4);
|
|
53
|
-
if (term.preference) {
|
|
54
|
-
Object.assign(neu, term.preference);
|
|
55
|
-
delete neu.preference;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return neu;
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
return {
|
|
62
|
-
allSelectorTerms,
|
|
63
|
-
weightedNodeSelectorTerms: preferredDuringSchedulingIgnoredDuringExecution,
|
|
64
|
-
defaultWeight: 1,
|
|
65
|
-
// rules in MatchExpressions.vue can not catch changes what happens on parent component
|
|
66
|
-
// we need re-render it via key changing
|
|
67
|
-
rerenderNums: randomStr(4)
|
|
68
|
-
};
|
|
69
46
|
}
|
|
47
|
+
|
|
48
|
+
return {
|
|
49
|
+
nodeSelectorTerms: null,
|
|
50
|
+
allSelectorTerms: null,
|
|
51
|
+
weightedNodeSelectorTerms: null,
|
|
52
|
+
defaultWeight: 1,
|
|
53
|
+
// rules in MatchExpressions.vue can not catch changes what happens on parent component
|
|
54
|
+
// we need re-render it via key changing
|
|
55
|
+
rerenderNums: randomStr(4)
|
|
56
|
+
};
|
|
70
57
|
},
|
|
71
58
|
|
|
72
59
|
computed: {
|
|
@@ -88,6 +75,27 @@ export default {
|
|
|
88
75
|
},
|
|
89
76
|
|
|
90
77
|
created() {
|
|
78
|
+
if (this.value.required) {
|
|
79
|
+
this.nodeSelectorTerms = this.value.required.nodeSelectorTerms;
|
|
80
|
+
} else {
|
|
81
|
+
const { preferredDuringSchedulingIgnoredDuringExecution = [], requiredDuringSchedulingIgnoredDuringExecution = {} } = this.value;
|
|
82
|
+
const { nodeSelectorTerms = [] } = requiredDuringSchedulingIgnoredDuringExecution;
|
|
83
|
+
const allSelectorTerms = [...preferredDuringSchedulingIgnoredDuringExecution, ...nodeSelectorTerms].map((term) => {
|
|
84
|
+
const neu = clone(term);
|
|
85
|
+
|
|
86
|
+
neu._id = randomStr(4);
|
|
87
|
+
if (term.preference) {
|
|
88
|
+
Object.assign(neu, term.preference);
|
|
89
|
+
delete neu.preference;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return neu;
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
this.allSelectorTerms = allSelectorTerms;
|
|
96
|
+
this.weightedNodeSelectorTerms = preferredDuringSchedulingIgnoredDuringExecution;
|
|
97
|
+
}
|
|
98
|
+
|
|
91
99
|
this.queueUpdate = debounce(this.update, 500);
|
|
92
100
|
},
|
|
93
101
|
|
|
@@ -40,6 +40,15 @@ export default {
|
|
|
40
40
|
},
|
|
41
41
|
|
|
42
42
|
data() {
|
|
43
|
+
return {
|
|
44
|
+
selectNode: null,
|
|
45
|
+
nodeName: '',
|
|
46
|
+
nodeAffinity: {},
|
|
47
|
+
nodeSelector: {},
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
created() {
|
|
43
52
|
const isHarvester = this.$store.getters['currentProduct'].inStore === VIRTUAL;
|
|
44
53
|
|
|
45
54
|
let { nodeName = '' } = this.value;
|
|
@@ -65,9 +74,10 @@ export default {
|
|
|
65
74
|
nodeAffinity['preferredDuringSchedulingIgnoredDuringExecution'] = [];
|
|
66
75
|
}
|
|
67
76
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
77
|
+
this.selectNode = selectNode;
|
|
78
|
+
this.nodeName = nodeName;
|
|
79
|
+
this.nodeAffinity = nodeAffinity;
|
|
80
|
+
this.nodeSelector = nodeSelector;
|
|
71
81
|
},
|
|
72
82
|
|
|
73
83
|
computed: {
|
|
@@ -41,6 +41,10 @@ export default {
|
|
|
41
41
|
mode: {
|
|
42
42
|
type: String,
|
|
43
43
|
default: _CREATE,
|
|
44
|
+
},
|
|
45
|
+
placeholder: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: '',
|
|
44
48
|
}
|
|
45
49
|
},
|
|
46
50
|
data() {
|
|
@@ -116,6 +120,7 @@ export default {
|
|
|
116
120
|
:disabled="isRandom"
|
|
117
121
|
:ignore-password-managers="ignorePasswordManagers"
|
|
118
122
|
:mode="mode"
|
|
123
|
+
:placeholder="placeholder"
|
|
119
124
|
@blur="$emit('blur', $event)"
|
|
120
125
|
>
|
|
121
126
|
<template #suffix>
|
|
@@ -137,6 +142,7 @@ export default {
|
|
|
137
142
|
tabindex="0"
|
|
138
143
|
class="hide-show"
|
|
139
144
|
role="button"
|
|
145
|
+
:aria-label="reveal ? t('action.ariaLabel.hidePass', { area: label }) : t('action.ariaLabel.showPass', { area: label })"
|
|
140
146
|
@click.prevent.stop="hideShowFn"
|
|
141
147
|
@keyup.space.prevent.stop="hideShowFn"
|
|
142
148
|
>
|
|
@@ -160,20 +166,20 @@ export default {
|
|
|
160
166
|
<style lang="scss" scoped>
|
|
161
167
|
.password {
|
|
162
168
|
display: flex;
|
|
163
|
-
flex-direction: column;
|
|
169
|
+
/* flex-direction: column; */
|
|
164
170
|
|
|
165
171
|
.labeled-input {
|
|
166
172
|
.addon {
|
|
167
|
-
display: flex;
|
|
173
|
+
/* display: flex;
|
|
168
174
|
align-items: center;
|
|
169
175
|
justify-content: center;
|
|
170
176
|
padding-left: 12px;
|
|
171
|
-
min-width: 65px;
|
|
177
|
+
min-width: 65px; */
|
|
172
178
|
|
|
173
|
-
.hide-show:focus-visible {
|
|
179
|
+
/* .hide-show:focus-visible {
|
|
174
180
|
@include focus-outline;
|
|
175
181
|
outline-offset: 4px;
|
|
176
|
-
}
|
|
182
|
+
} */
|
|
177
183
|
}
|
|
178
184
|
}
|
|
179
185
|
.genPassword {
|