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