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
|
@@ -65,7 +65,6 @@ export default {
|
|
|
65
65
|
v-bind="$attrs"
|
|
66
66
|
class="modal"
|
|
67
67
|
data-testid="mvc__card"
|
|
68
|
-
:trigger-focus-trap="true"
|
|
69
68
|
@close="$emit('finish', $event)"
|
|
70
69
|
>
|
|
71
70
|
<Card
|
|
@@ -133,7 +132,6 @@ export default {
|
|
|
133
132
|
|
|
134
133
|
&.card-container {
|
|
135
134
|
box-shadow: none;
|
|
136
|
-
padding: 14px;
|
|
137
135
|
}
|
|
138
136
|
}
|
|
139
137
|
</style>
|
package/components/MoveModal.vue
CHANGED
|
@@ -13,11 +13,7 @@ export default {
|
|
|
13
13
|
components: { AppModal },
|
|
14
14
|
|
|
15
15
|
data() {
|
|
16
|
-
return {
|
|
17
|
-
opened: false,
|
|
18
|
-
backgroundClosing: null,
|
|
19
|
-
componentRendered: false
|
|
20
|
-
};
|
|
16
|
+
return { opened: false, backgroundClosing: null };
|
|
21
17
|
},
|
|
22
18
|
|
|
23
19
|
computed: {
|
|
@@ -58,15 +54,10 @@ export default {
|
|
|
58
54
|
watch: {
|
|
59
55
|
showModal(show) {
|
|
60
56
|
this.opened = show;
|
|
61
|
-
}
|
|
57
|
+
},
|
|
62
58
|
},
|
|
63
59
|
|
|
64
60
|
methods: {
|
|
65
|
-
onSlotComponentMounted() {
|
|
66
|
-
// variable for the watcher based focus-trap
|
|
67
|
-
// so that we know when the component is rendered
|
|
68
|
-
this.componentRendered = true;
|
|
69
|
-
},
|
|
70
61
|
close() {
|
|
71
62
|
if (!this.opened) {
|
|
72
63
|
return;
|
|
@@ -78,7 +69,6 @@ export default {
|
|
|
78
69
|
this.backgroundClosing();
|
|
79
70
|
}
|
|
80
71
|
|
|
81
|
-
this.componentRendered = false;
|
|
82
72
|
this.opened = false;
|
|
83
73
|
},
|
|
84
74
|
|
|
@@ -95,8 +85,6 @@ export default {
|
|
|
95
85
|
v-if="opened && component"
|
|
96
86
|
:click-to-close="closeOnClickOutside"
|
|
97
87
|
:width="modalWidth"
|
|
98
|
-
:trigger-focus-trap-watcher-based="true"
|
|
99
|
-
:focus-trap-watcher-based-variable="componentRendered"
|
|
100
88
|
@close="close()"
|
|
101
89
|
>
|
|
102
90
|
<component
|
|
@@ -104,7 +92,6 @@ export default {
|
|
|
104
92
|
:is="component"
|
|
105
93
|
:resources="resources"
|
|
106
94
|
:register-background-closing="registerBackgroundClosing"
|
|
107
|
-
@vue:mounted="onSlotComponentMounted"
|
|
108
95
|
@close="close()"
|
|
109
96
|
/>
|
|
110
97
|
</app-modal>
|
|
@@ -12,7 +12,6 @@ import { CATALOG as CATALOG_ANNOTATIONS } from '@shell/config/labels-annotations
|
|
|
12
12
|
import { CATALOG } from '@shell/config/types';
|
|
13
13
|
import { LabeledInput } from '@components/Form/LabeledInput';
|
|
14
14
|
import AppModal from '@shell/components/AppModal.vue';
|
|
15
|
-
import { translateError } from '@shell/utils/error';
|
|
16
15
|
|
|
17
16
|
export default {
|
|
18
17
|
name: 'PromptRemove',
|
|
@@ -214,7 +213,6 @@ export default {
|
|
|
214
213
|
},
|
|
215
214
|
|
|
216
215
|
methods: {
|
|
217
|
-
translateError,
|
|
218
216
|
resourceNames,
|
|
219
217
|
escapeHtml,
|
|
220
218
|
close() {
|
|
@@ -338,10 +336,9 @@ export default {
|
|
|
338
336
|
v-if="showModal"
|
|
339
337
|
custom-class="remove-modal"
|
|
340
338
|
name="promptRemove"
|
|
341
|
-
:width="
|
|
339
|
+
:width="400"
|
|
342
340
|
height="auto"
|
|
343
341
|
styles="max-height: 100vh;"
|
|
344
|
-
:trigger-focus-trap="true"
|
|
345
342
|
@close="close"
|
|
346
343
|
>
|
|
347
344
|
<Card
|
|
@@ -350,11 +347,6 @@ export default {
|
|
|
350
347
|
>
|
|
351
348
|
<template #title>
|
|
352
349
|
<h4 class="text-default-text">
|
|
353
|
-
<img
|
|
354
|
-
src="@shell/assets/images/promp-yellow.svg"
|
|
355
|
-
class="img-span"
|
|
356
|
-
alt=""
|
|
357
|
-
>
|
|
358
350
|
{{ t('promptRemove.title') }}
|
|
359
351
|
</h4>
|
|
360
352
|
</template>
|
|
@@ -362,7 +354,7 @@ export default {
|
|
|
362
354
|
<div class="mb-10">
|
|
363
355
|
<template v-if="!hasCustomRemove">
|
|
364
356
|
{{ t('promptRemove.attemptingToRemove', { type }) }} <span
|
|
365
|
-
v-clean-html="resourceNames(names,
|
|
357
|
+
v-clean-html="resourceNames(names, t)"
|
|
366
358
|
/>
|
|
367
359
|
</template>
|
|
368
360
|
|
|
@@ -403,14 +395,14 @@ export default {
|
|
|
403
395
|
{{ warning }}
|
|
404
396
|
</div>
|
|
405
397
|
<div class="text-error mb-10 mt-10">
|
|
406
|
-
{{
|
|
398
|
+
{{ error }}
|
|
407
399
|
</div>
|
|
408
|
-
|
|
400
|
+
<div
|
|
409
401
|
v-if="!needsConfirm"
|
|
410
402
|
class="text-info mt-20"
|
|
411
403
|
>
|
|
412
404
|
{{ protip }}
|
|
413
|
-
</div>
|
|
405
|
+
</div>
|
|
414
406
|
</LabeledInput>
|
|
415
407
|
<div v-else-if="!hasCustomRemove">
|
|
416
408
|
<div
|
|
@@ -444,7 +436,7 @@ export default {
|
|
|
444
436
|
<div class="spacer" />
|
|
445
437
|
<AsyncButton
|
|
446
438
|
mode="delete"
|
|
447
|
-
class="btn ml-10"
|
|
439
|
+
class="btn bg-error ml-10"
|
|
448
440
|
:disabled="deleteDisabled"
|
|
449
441
|
:data-testid="componentTestid + '-confirm-button'"
|
|
450
442
|
@click="remove"
|
|
@@ -468,24 +460,12 @@ export default {
|
|
|
468
460
|
text-align: right;
|
|
469
461
|
}
|
|
470
462
|
|
|
471
|
-
|
|
463
|
+
.card-actions {
|
|
472
464
|
display: flex;
|
|
473
465
|
|
|
474
466
|
.spacer {
|
|
475
467
|
flex: 1;
|
|
476
468
|
}
|
|
477
|
-
}
|
|
469
|
+
}
|
|
478
470
|
}
|
|
479
471
|
</style>
|
|
480
|
-
|
|
481
|
-
<style scoped>
|
|
482
|
-
.text-default-text{
|
|
483
|
-
line-height: 20px;
|
|
484
|
-
margin: 0px;
|
|
485
|
-
display: flex;
|
|
486
|
-
align-items: center;
|
|
487
|
-
}
|
|
488
|
-
.img-span{
|
|
489
|
-
margin-right: 8px;
|
|
490
|
-
}
|
|
491
|
-
</style>
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
import { KUBERNETES, PROJECT } from '@shell/config/labels-annotations';
|
|
3
3
|
import { FLEET, NAMESPACE, MANAGEMENT, HELM } from '@shell/config/types';
|
|
4
4
|
import ButtonGroup from '@shell/components/ButtonGroup';
|
|
5
|
-
|
|
6
|
-
import DotState from '@shell/components/DotState.vue';
|
|
5
|
+
import { BadgeState } from '@components/BadgeState';
|
|
7
6
|
import { Banner } from '@components/Banner';
|
|
8
7
|
import { get } from '@shell/utils/object';
|
|
9
8
|
import { NAME as FLEET_NAME } from '@shell/config/product/fleet';
|
|
@@ -14,9 +13,6 @@ import {
|
|
|
14
13
|
import { ExtensionPoint, PanelLocation } from '@shell/core/types';
|
|
15
14
|
import ExtensionPanel from '@shell/components/ExtensionPanel';
|
|
16
15
|
import TabTitle from '@shell/components/TabTitle';
|
|
17
|
-
import ActionMenu from '@shell/components/ActionMenuShell.vue';
|
|
18
|
-
import { useRuntimeFlag } from '@shell/composables/useRuntimeFlag';
|
|
19
|
-
import { useStore } from 'vuex';
|
|
20
16
|
|
|
21
17
|
// i18n-uses resourceDetail.header.*
|
|
22
18
|
|
|
@@ -30,13 +26,7 @@ export default {
|
|
|
30
26
|
name: 'MastheadResourceDetail',
|
|
31
27
|
|
|
32
28
|
components: {
|
|
33
|
-
|
|
34
|
-
DotState,
|
|
35
|
-
Banner,
|
|
36
|
-
ButtonGroup,
|
|
37
|
-
ExtensionPanel,
|
|
38
|
-
TabTitle,
|
|
39
|
-
ActionMenu,
|
|
29
|
+
BadgeState, Banner, ButtonGroup, ExtensionPanel, TabTitle
|
|
40
30
|
},
|
|
41
31
|
props: {
|
|
42
32
|
value: {
|
|
@@ -102,19 +92,11 @@ export default {
|
|
|
102
92
|
}
|
|
103
93
|
},
|
|
104
94
|
|
|
105
|
-
setup() {
|
|
106
|
-
const store = useStore();
|
|
107
|
-
const { featureDropdownMenu } = useRuntimeFlag(store);
|
|
108
|
-
|
|
109
|
-
return { featureDropdownMenu };
|
|
110
|
-
},
|
|
111
|
-
|
|
112
95
|
data() {
|
|
113
96
|
return {
|
|
114
97
|
DETAIL_VIEW: _DETAIL,
|
|
115
98
|
extensionType: ExtensionPoint.PANEL,
|
|
116
99
|
extensionLocation: PanelLocation.DETAILS_MASTHEAD,
|
|
117
|
-
Svg: require('~shell/assets/images/API.svg')
|
|
118
100
|
};
|
|
119
101
|
},
|
|
120
102
|
|
|
@@ -396,33 +378,6 @@ export default {
|
|
|
396
378
|
return this.shouldHifenize ? ` - ${ displayName }` : displayName;
|
|
397
379
|
},
|
|
398
380
|
|
|
399
|
-
demoDisplay() {
|
|
400
|
-
const product = this.$store.getters['productId'];
|
|
401
|
-
|
|
402
|
-
const productId = this.$store.getters['type-map/groupForBasicType'](this.$store.getters['productId'], this.location.params.resource);
|
|
403
|
-
|
|
404
|
-
if (productId === undefined) {
|
|
405
|
-
return '';
|
|
406
|
-
}
|
|
407
|
-
const parts = productId.split('::');
|
|
408
|
-
const newString = 'root';
|
|
409
|
-
|
|
410
|
-
if (!parts?.includes(newString)) {
|
|
411
|
-
parts.unshift(newString); // 将字符串添加到数组第一位
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
const partsEn = parts.map((item) => {
|
|
415
|
-
return this.$store.getters['i18n/t'](`typeLabel."${ item.toLowerCase() }"`);
|
|
416
|
-
});
|
|
417
|
-
|
|
418
|
-
return partsEn;
|
|
419
|
-
},
|
|
420
|
-
menuIcon() {
|
|
421
|
-
const product = this.$store.getters['productId'];
|
|
422
|
-
|
|
423
|
-
return this.$store.getters['type-map/groupsForVirTypes'](product, this.location.params.resource);
|
|
424
|
-
},
|
|
425
|
-
|
|
426
381
|
location() {
|
|
427
382
|
const { parent } = this;
|
|
428
383
|
|
|
@@ -469,81 +424,10 @@ export default {
|
|
|
469
424
|
|
|
470
425
|
<template>
|
|
471
426
|
<div class="masthead">
|
|
472
|
-
<div class="title">
|
|
473
|
-
<!-- 创建api密钥不需要面包屑 -->
|
|
474
|
-
<div
|
|
475
|
-
v-if="!(parentRouteOverride === 'account' && resource=== 'token')"
|
|
476
|
-
class="excram-list"
|
|
477
|
-
>
|
|
478
|
-
<span
|
|
479
|
-
v-for="(item,index) in demoDisplay"
|
|
480
|
-
:key="index"
|
|
481
|
-
>
|
|
482
|
-
<span>{{ item }}</span>
|
|
483
|
-
<span>/</span>
|
|
484
|
-
</span>
|
|
485
|
-
<span class="excram-last-name">
|
|
486
|
-
{{ (realMode === 'view'? '查看': realMode === 'edit' ? '编辑':'创建') + parent.displayName }}
|
|
487
|
-
</span>
|
|
488
|
-
</div>
|
|
489
427
|
<header>
|
|
490
428
|
<div class="title">
|
|
491
429
|
<div class="primaryheader">
|
|
492
|
-
<
|
|
493
|
-
<!-- <nuxt-link
|
|
494
|
-
v-if="location"
|
|
495
|
-
:to="location"
|
|
496
|
-
>
|
|
497
|
-
{{ parent.displayName }}:
|
|
498
|
-
</nuxt-link> -->
|
|
499
|
-
<span class="detailIcon-span">
|
|
500
|
-
<img
|
|
501
|
-
v-if="parentRouteOverride === 'account' && resource=== 'token'"
|
|
502
|
-
:src="Svg"
|
|
503
|
-
style="margin-top: 4px; margin-left: 5px;"
|
|
504
|
-
>
|
|
505
|
-
<i
|
|
506
|
-
v-else
|
|
507
|
-
:class="'icon-'+ menuIcon + ' detailIcon'"
|
|
508
|
-
/>
|
|
509
|
-
</span>
|
|
510
|
-
<span class="detailIcon-span-title">{{ realMode=== 'create'? '创建': '' }}{{ parent.displayName }}{{ realMode=== 'create'? '': '名称:' }}</span>
|
|
511
|
-
<span v-if="realMode !== 'create'">
|
|
512
|
-
<span v-if="value.detailPageHeaderActionOverride && value.detailPageHeaderActionOverride(realMode)">{{ value.detailPageHeaderActionOverride(realMode) }}</span>
|
|
513
|
-
<t
|
|
514
|
-
v-else
|
|
515
|
-
:k="'resourceDetail.header.' + realMode"
|
|
516
|
-
:subtype="resourceSubtype"
|
|
517
|
-
:name="displayName"
|
|
518
|
-
:escapehtml="false"
|
|
519
|
-
/>
|
|
520
|
-
</span>
|
|
521
|
-
<DotState
|
|
522
|
-
v-if="!isCreate && parent.showState"
|
|
523
|
-
class="masthead-state"
|
|
524
|
-
:value="value"
|
|
525
|
-
/>
|
|
526
|
-
<span
|
|
527
|
-
v-if="!isCreate && value.injectionEnabled"
|
|
528
|
-
class="masthead-istio"
|
|
529
|
-
>
|
|
530
|
-
<i
|
|
531
|
-
v-clean-tooltip="t('projectNamespaces.isIstioInjectionEnabled')"
|
|
532
|
-
class="icon icon-sm icon-istio"
|
|
533
|
-
/>
|
|
534
|
-
</span>
|
|
535
|
-
</span>
|
|
536
|
-
<span
|
|
537
|
-
v-if="location"
|
|
538
|
-
class="valid"
|
|
539
|
-
>|</span>
|
|
540
|
-
<router-link
|
|
541
|
-
v-if="location"
|
|
542
|
-
:to="location"
|
|
543
|
-
>
|
|
544
|
-
返回
|
|
545
|
-
</router-link>
|
|
546
|
-
<!-- <h1>
|
|
430
|
+
<h1>
|
|
547
431
|
<TabTitle
|
|
548
432
|
v-if="isCreate"
|
|
549
433
|
:showChild="false"
|
|
@@ -599,9 +483,9 @@ export default {
|
|
|
599
483
|
>
|
|
600
484
|
<i class="icon icon-external-link" />
|
|
601
485
|
</a>
|
|
602
|
-
</h1>
|
|
486
|
+
</h1>
|
|
603
487
|
</div>
|
|
604
|
-
|
|
488
|
+
<div
|
|
605
489
|
v-if="!isCreate"
|
|
606
490
|
class="subheader"
|
|
607
491
|
>
|
|
@@ -647,7 +531,7 @@ export default {
|
|
|
647
531
|
</span>
|
|
648
532
|
</span>
|
|
649
533
|
<span v-if="value.showPodRestarts">{{ t("resourceDetail.masthead.restartCount") }}:<span class="live-data"> {{ value.restartCount }}</span></span>
|
|
650
|
-
</div>
|
|
534
|
+
</div>
|
|
651
535
|
</div>
|
|
652
536
|
<slot name="right">
|
|
653
537
|
<div class="actions-container align-start">
|
|
@@ -677,28 +561,17 @@ export default {
|
|
|
677
561
|
class="mr-10"
|
|
678
562
|
/>
|
|
679
563
|
|
|
680
|
-
<
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
v-if="isView"
|
|
692
|
-
ref="actions"
|
|
693
|
-
data-testid="masthead-action-menu"
|
|
694
|
-
aria-haspopup="true"
|
|
695
|
-
type="button"
|
|
696
|
-
class="btn role-multi-action actions"
|
|
697
|
-
@click="showActions"
|
|
698
|
-
>
|
|
699
|
-
<i class="icon icon-actions" />
|
|
700
|
-
</button>
|
|
701
|
-
</template>
|
|
564
|
+
<button
|
|
565
|
+
v-if="isView"
|
|
566
|
+
ref="actions"
|
|
567
|
+
data-testid="masthead-action-menu"
|
|
568
|
+
aria-haspopup="true"
|
|
569
|
+
type="button"
|
|
570
|
+
class="btn role-multi-action actions"
|
|
571
|
+
@click="showActions"
|
|
572
|
+
>
|
|
573
|
+
<i class="icon icon-actions" />
|
|
574
|
+
</button>
|
|
702
575
|
</div>
|
|
703
576
|
</div>
|
|
704
577
|
</slot>
|
|
@@ -725,30 +598,42 @@ export default {
|
|
|
725
598
|
/>
|
|
726
599
|
|
|
727
600
|
<slot />
|
|
728
|
-
</div>
|
|
729
601
|
</div>
|
|
730
602
|
</template>
|
|
731
603
|
|
|
732
604
|
<style lang='scss' scoped>
|
|
733
605
|
.masthead {
|
|
734
606
|
padding-bottom: 10px;
|
|
735
|
-
|
|
607
|
+
border-bottom: 1px solid var(--border);
|
|
736
608
|
margin-bottom: 10px;
|
|
737
609
|
}
|
|
738
610
|
|
|
739
611
|
HEADER {
|
|
740
612
|
margin: 0;
|
|
613
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
741
614
|
}
|
|
742
615
|
|
|
743
616
|
.primaryheader {
|
|
744
617
|
display: flex;
|
|
745
618
|
flex-direction: row;
|
|
746
619
|
align-items: center;
|
|
747
|
-
font-size:14px;
|
|
748
|
-
height: 50px;
|
|
749
620
|
|
|
750
621
|
h1 {
|
|
751
|
-
margin: 0;
|
|
622
|
+
margin: 0 0 0 -5px;
|
|
623
|
+
overflow-x: hidden;
|
|
624
|
+
display: flex;
|
|
625
|
+
flex-direction: row;
|
|
626
|
+
align-items: center;
|
|
627
|
+
|
|
628
|
+
.masthead-resource-title {
|
|
629
|
+
text-overflow: ellipsis;
|
|
630
|
+
overflow: hidden;
|
|
631
|
+
white-space: nowrap;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
.masthead-resource-list-link {
|
|
635
|
+
margin: 5px;
|
|
636
|
+
}
|
|
752
637
|
}
|
|
753
638
|
}
|
|
754
639
|
|
|
@@ -761,7 +646,8 @@ export default {
|
|
|
761
646
|
}
|
|
762
647
|
|
|
763
648
|
.live-data {
|
|
764
|
-
color: var(--body-text)
|
|
649
|
+
color: var(--body-text);
|
|
650
|
+
margin-left: 3px;
|
|
765
651
|
}
|
|
766
652
|
}
|
|
767
653
|
|
|
@@ -770,12 +656,8 @@ export default {
|
|
|
770
656
|
}
|
|
771
657
|
|
|
772
658
|
.masthead-state {
|
|
659
|
+
margin-left: 8px;
|
|
773
660
|
font-size: initial;
|
|
774
|
-
display: inline-block;
|
|
775
|
-
position: relative;
|
|
776
|
-
/* top: -2px; */
|
|
777
|
-
font-size: 12px;
|
|
778
|
-
margin-left: 5px;
|
|
779
661
|
}
|
|
780
662
|
|
|
781
663
|
.masthead-istio {
|
|
@@ -798,40 +680,13 @@ export default {
|
|
|
798
680
|
}
|
|
799
681
|
}
|
|
800
682
|
|
|
801
|
-
.
|
|
802
|
-
font-size: 18px;
|
|
803
|
-
}
|
|
804
|
-
.excram-list{
|
|
805
|
-
font-size: 14px;
|
|
806
|
-
margin-bottom: 20px;
|
|
807
|
-
}
|
|
808
|
-
.excram-last-name{
|
|
809
|
-
color: var(--link);
|
|
810
|
-
}
|
|
811
|
-
.valid{
|
|
812
|
-
color: #d7d7d7;
|
|
813
|
-
margin: 0px 10px;
|
|
814
|
-
}
|
|
815
|
-
.detailIcon-span{
|
|
816
|
-
width: 24px;
|
|
817
|
-
height: 24px;
|
|
818
|
-
display: inline-block;
|
|
819
|
-
position: relative;
|
|
820
|
-
background: var(--primary);
|
|
821
|
-
margin-right: 10px;
|
|
822
|
-
}
|
|
823
|
-
.detailIcon{
|
|
824
|
-
position: absolute;
|
|
825
|
-
color: #fff;
|
|
826
|
-
font-size: 38px;
|
|
827
|
-
left: 4px;
|
|
828
|
-
top: -2px;
|
|
829
|
-
}
|
|
830
|
-
.primary-title{
|
|
683
|
+
div.actions-container > div.actions {
|
|
831
684
|
display: flex;
|
|
832
|
-
|
|
685
|
+
flex-direction: row;
|
|
686
|
+
justify-content: flex-end;
|
|
833
687
|
}
|
|
834
|
-
|
|
835
|
-
|
|
688
|
+
|
|
689
|
+
.resource-external {
|
|
690
|
+
font-size: 18px;
|
|
836
691
|
}
|
|
837
692
|
</style>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { mount, RouterLinkStub } from '@vue/test-utils';
|
|
2
2
|
import { _VIEW } from '@shell/config/query-params';
|
|
3
3
|
import Masthead from '@shell/components/ResourceDetail/Masthead.vue';
|
|
4
|
-
import { createStore } from 'vuex';
|
|
5
4
|
|
|
6
5
|
const mockedStore = () => {
|
|
7
6
|
return {
|
|
@@ -18,15 +17,12 @@ const mockedStore = () => {
|
|
|
18
17
|
};
|
|
19
18
|
|
|
20
19
|
const requiredSetup = () => {
|
|
21
|
-
const store = createStore({ getters: { 'management/byId': () => jest.fn() } });
|
|
22
|
-
|
|
23
20
|
return {
|
|
24
21
|
stubs: {
|
|
25
22
|
'router-link': RouterLinkStub,
|
|
26
23
|
LiveDate: true
|
|
27
24
|
},
|
|
28
|
-
|
|
29
|
-
mocks: { $store: mockedStore() }
|
|
25
|
+
mocks: { $store: mockedStore() }
|
|
30
26
|
};
|
|
31
27
|
};
|
|
32
28
|
|
|
@@ -384,7 +384,18 @@ export default {
|
|
|
384
384
|
},
|
|
385
385
|
|
|
386
386
|
created() {
|
|
387
|
-
|
|
387
|
+
// eslint-disable-next-line prefer-const
|
|
388
|
+
const id = this.$route.params.id;
|
|
389
|
+
const resource = this.resourceOverride || this.$route.params.resource;
|
|
390
|
+
const options = this.$store.getters[`type-map/optionsFor`](resource);
|
|
391
|
+
|
|
392
|
+
const detailResource = options.resourceDetail || options.resource || resource;
|
|
393
|
+
const editResource = options.resourceEdit || options.resource || resource;
|
|
394
|
+
|
|
395
|
+
// FIXME: These aren't right... signature is (rawType, subType).. not (rawType, resourceId)
|
|
396
|
+
// Remove id? How does subtype get in (cluster/node)
|
|
397
|
+
this.detailComponent = this.$store.getters['type-map/importDetail'](detailResource, id);
|
|
398
|
+
this.editComponent = this.$store.getters['type-map/importEdit'](editResource, id);
|
|
388
399
|
},
|
|
389
400
|
|
|
390
401
|
methods: {
|
|
@@ -403,51 +414,6 @@ export default {
|
|
|
403
414
|
closeError(index) {
|
|
404
415
|
this.errors = this.errors.filter((_, i) => i !== index);
|
|
405
416
|
},
|
|
406
|
-
/**
|
|
407
|
-
* Initializes the resource components based on the provided user and
|
|
408
|
-
* resource override.
|
|
409
|
-
*
|
|
410
|
-
* Configures the detail and edit components for a resource based on the
|
|
411
|
-
* user's ID and the specified resource.
|
|
412
|
-
*
|
|
413
|
-
* @param {Object} user - The user object containing user-specific
|
|
414
|
-
* information.
|
|
415
|
-
* @param {string|null} resourceOverride - An optional resource override
|
|
416
|
-
* string. If not provided, the method will use the default resource from
|
|
417
|
-
* the route parameters or the instance's resourceOverride property.
|
|
418
|
-
*/
|
|
419
|
-
configureResource(userId = '', resourceOverride = null) {
|
|
420
|
-
const id = userId || this.$route.params.id;
|
|
421
|
-
const resource = resourceOverride || this.resourceOverride || this.$route.params.resource;
|
|
422
|
-
const options = this.$store.getters[`type-map/optionsFor`](resource);
|
|
423
|
-
|
|
424
|
-
const detailResource = options.resourceDetail || options.resource || resource;
|
|
425
|
-
const editResource = options.resourceEdit || options.resource || resource;
|
|
426
|
-
|
|
427
|
-
// FIXME: These aren't right... signature is (rawType, subType).. not (rawType, resourceId)
|
|
428
|
-
// Remove id? How does subtype get in (cluster/node)
|
|
429
|
-
this.detailComponent = this.$store.getters['type-map/importDetail'](detailResource, id);
|
|
430
|
-
this.editComponent = this.$store.getters['type-map/importEdit'](editResource, id);
|
|
431
|
-
},
|
|
432
|
-
/**
|
|
433
|
-
* Sets the mode and initializes the resource components.
|
|
434
|
-
*
|
|
435
|
-
* This method sets the mode of the component and configures the resource
|
|
436
|
-
* components based on the provided user and resource.
|
|
437
|
-
*
|
|
438
|
-
* @param {Object} payload - An object containing the mode, user, and
|
|
439
|
-
* resource properties.
|
|
440
|
-
* @param {string} payload.mode - The mode to set.
|
|
441
|
-
* @param {Object} payload.user - The user object containing user-specific
|
|
442
|
-
* information.
|
|
443
|
-
* @param {string} payload.resource - The resource string to use for
|
|
444
|
-
* initialization.
|
|
445
|
-
*/
|
|
446
|
-
setMode({ mode, userId, resource }) {
|
|
447
|
-
this.mode = mode;
|
|
448
|
-
this.value.id = userId;
|
|
449
|
-
this.configureResource(userId, resource);
|
|
450
|
-
}
|
|
451
417
|
}
|
|
452
418
|
};
|
|
453
419
|
</script>
|
|
@@ -470,10 +436,10 @@ export default {
|
|
|
470
436
|
:parent-route-override="parentRouteOverride"
|
|
471
437
|
:store-override="storeOverride"
|
|
472
438
|
>
|
|
473
|
-
|
|
439
|
+
<DetailTop
|
|
474
440
|
v-if="isView && isDetail"
|
|
475
441
|
:value="liveModel"
|
|
476
|
-
/>
|
|
442
|
+
/>
|
|
477
443
|
</Masthead>
|
|
478
444
|
<div
|
|
479
445
|
v-if="hasErrors"
|
|
@@ -525,7 +491,6 @@ export default {
|
|
|
525
491
|
:real-mode="realMode"
|
|
526
492
|
:class="{'flex-content': flexContent}"
|
|
527
493
|
@update:value="$emit('input', $event)"
|
|
528
|
-
@update:mode="setMode"
|
|
529
494
|
@set-subtype="setSubtype"
|
|
530
495
|
/>
|
|
531
496
|
|