dashboard-shell-shell 3.0.5-test.2 → 3.0.5-test.21
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/icons/iconfont.css +4 -1
- package/assets/images/pl/dark/logo.png +0 -0
- package/assets/styles/all.scss +3 -1
- package/assets/styles/base/_variables.scss +5 -5
- package/assets/styles/global/_button.scss +8 -8
- package/assets/styles/global/_select.scss +1 -1
- package/assets/styles/global/_tooltip.scss +9 -5
- package/assets/styles/themes/_light.scss +3 -1
- package/assets/styles/vendor/vue-select.scss +2 -1
- package/assets/translations/zh-hans.yaml +140 -11
- package/components/ActionDropdown.vue +1 -1
- package/components/ButtonDropdown.vue +3 -1
- package/components/CodeMirror.vue +6 -4
- package/components/ContainerResourceLimit.vue +2 -2
- package/components/CopyToClipboard.vue +15 -0
- package/components/Drawer/Chrome.vue +2 -2
- package/components/Drawer/ResourceDetailDrawer/ConfigTab.vue +30 -27
- package/components/Drawer/ResourceDetailDrawer/YamlTab.vue +1 -1
- package/components/Drawer/ResourceDetailDrawer/index.vue +5 -4
- package/components/ExplorerMembers.vue +28 -4
- package/components/GlobalRoleBindings.vue +48 -112
- package/components/PodSecurityAdmission.vue +1 -1
- package/components/Resource/Detail/Metadata/IdentifyingInformation/index.vue +1 -3
- package/components/Resource/Detail/Metadata/KeyValue.vue +8 -4
- package/components/Resource/Detail/Metadata/index.vue +3 -1
- package/components/Resource/Detail/TitleBar/Title.vue +4 -3
- package/components/Resource/Detail/TitleBar/Top.vue +2 -0
- package/components/Resource/Detail/TitleBar/composables.ts +16 -1
- package/components/Resource/Detail/TitleBar/index.vue +113 -25
- package/components/ResourceDetail/Masthead/index.vue +1 -1
- package/components/ResourceDetail/Masthead/latest.vue +1 -1
- package/components/ResourceDetail/Masthead/legacy.vue +236 -165
- package/components/ResourceDetail/legacy.vue +44 -28
- package/components/ResourceList/Masthead.vue +11 -15
- package/components/SideNav.vue +1 -1
- package/components/SortableTable/index.vue +9 -4
- package/components/Tabbed/index.vue +6 -1
- package/components/auth/Principal.vue +42 -13
- package/components/auth/RoleDetailEdit.vue +11 -7
- package/components/breadcrumb/index.vue +124 -0
- package/components/form/ArrayList.vue +164 -147
- package/components/form/ArrayListGrouped.vue +3 -1
- package/components/form/ChangePassword.vue +1 -1
- package/components/form/Command.vue +4 -5
- package/components/form/Footer.vue +1 -0
- package/components/form/HealthCheck.vue +0 -2
- package/components/form/HookOption.vue +87 -58
- package/components/form/InputWithSelect.vue +8 -7
- package/components/form/KeyValue.vue +20 -2
- package/components/form/LabeledSelect.vue +6 -3
- package/components/form/Labels.vue +2 -2
- package/components/form/MatchExpressions.vue +3 -4
- package/components/form/Members/ClusterMembershipEditor.vue +1 -1
- package/components/form/Members/ClusterPermissionsEditor.vue +5 -5
- package/components/form/Members/MembershipEditor.vue +2 -2
- package/components/form/NameNsDescription.vue +1 -1
- package/components/form/Networking.vue +6 -9
- package/components/form/NodeAffinity.vue +29 -28
- package/components/form/PodAffinity.vue +23 -23
- package/components/form/Probe.vue +15 -11
- package/components/form/ResourceQuota/Namespace.vue +4 -4
- package/components/form/ResourceQuota/NamespaceRow.vue +11 -9
- package/components/form/ResourceQuota/Project.vue +4 -4
- package/components/form/ResourceQuota/ProjectRow.vue +36 -30
- package/components/form/ResourceSelector.vue +1 -1
- package/components/form/Security.vue +1 -3
- package/components/form/Select.vue +6 -1
- package/components/form/ServiceNameSelect.vue +2 -5
- package/components/form/ServicePorts.vue +149 -75
- package/components/form/Taints.vue +2 -1
- package/components/form/Tolerations.vue +12 -9
- package/components/form/ValueFromResource.vue +110 -96
- package/components/form/WorkloadPorts.vue +143 -123
- package/components/nav/Header.vue +3 -4
- package/components/nav/NamespaceFilter.vue +15 -21
- package/components/nav/TopLevelMenu.vue +99 -125
- package/components/nav/Type.vue +3 -3
- package/config/product/explorer.js +4 -1
- package/config/router/navigation-guards/index.js +52 -3
- package/detail/node.vue +28 -23
- package/dialog/AddCustomBadgeDialog.vue +17 -9
- package/edit/autoscaling.horizontalpodautoscaler/external-metric.vue +1 -1
- package/edit/autoscaling.horizontalpodautoscaler/hpa-scaling-rule.vue +9 -6
- package/edit/autoscaling.horizontalpodautoscaler/index.vue +3 -1
- package/edit/autoscaling.horizontalpodautoscaler/metric-identifier.vue +2 -2
- package/edit/autoscaling.horizontalpodautoscaler/metric-object-reference.vue +7 -5
- package/edit/autoscaling.horizontalpodautoscaler/metric-target.vue +5 -3
- package/edit/autoscaling.horizontalpodautoscaler/metrics-row.vue +2 -2
- package/edit/autoscaling.horizontalpodautoscaler/object-metric.vue +2 -2
- package/edit/autoscaling.horizontalpodautoscaler/pod-metric.vue +1 -1
- package/edit/autoscaling.horizontalpodautoscaler/resource-metric.vue +2 -2
- package/edit/networking.k8s.io.ingress/Certificate.vue +7 -5
- package/edit/networking.k8s.io.ingress/DefaultBackend.vue +2 -2
- package/edit/networking.k8s.io.ingress/Rule.vue +5 -11
- package/edit/networking.k8s.io.ingress/RulePath.vue +105 -96
- package/edit/networking.k8s.io.networkpolicy/PolicyRule.vue +3 -3
- package/edit/networking.k8s.io.networkpolicy/PolicyRulePort.vue +4 -2
- package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +12 -11
- package/edit/networking.k8s.io.networkpolicy/index.vue +1 -1
- package/edit/persistentvolume/index.vue +3 -1
- package/edit/persistentvolumeclaim.vue +2 -0
- package/edit/secret/index.vue +2 -2
- package/edit/service.vue +4 -1
- package/edit/storage.k8s.io.storageclass/index.vue +10 -8
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/aws-ebs.vue +34 -27
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/gce-pd.vue +15 -13
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/vsphere-volume.vue +41 -39
- package/edit/workload/Job.vue +31 -34
- package/edit/workload/Upgrading.vue +5 -5
- package/edit/workload/index.vue +21 -17
- package/edit/workload/storage/Mount.vue +1 -0
- package/edit/workload/storage/awsElasticBlockStore.vue +9 -7
- package/edit/workload/storage/azureDisk.vue +14 -10
- package/edit/workload/storage/azureFile.vue +9 -7
- package/edit/workload/storage/csi/index.vue +6 -9
- package/edit/workload/storage/emptyDir.vue +7 -5
- package/edit/workload/storage/gcePersistentDisk.vue +9 -7
- package/edit/workload/storage/hostPath.vue +7 -5
- package/edit/workload/storage/nfs.vue +8 -6
- package/edit/workload/storage/persistentVolumeClaim/index.vue +12 -10
- package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +20 -15
- package/edit/workload/storage/secret.vue +9 -6
- package/edit/workload/storage/vsphereVolume.vue +11 -7
- package/initialize/app-extended.js +7 -1
- package/package.json +1 -1
- package/pages/account/index.vue +95 -115
- package/pages/auth/setup.vue +35 -16
- package/pages/c/_cluster/auth/roles/index.vue +38 -5
- package/pages/c/_cluster/explorer/ConfigBadge.vue +1 -1
- package/pages/c/_cluster/explorer/tools/index.vue +6 -6
- package/pages/home.vue +3 -4
- package/pkg/tsconfig.json +9 -9
- package/pkg/vue.config.js +1 -1
- package/plugins/dashboard-store/resource-class.js +28 -27
- package/rancher-components/BadgeState/BadgeState.vue +33 -52
- package/rancher-components/Banner/Banner.vue +6 -3
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +31 -2
- package/rancher-components/RcDropdown/RcDropdownMenu.vue +8 -7
- package/scripts/publish-shell.sh +1 -1
- package/store/i18n.js +4 -0
- package/store/type-map.js +1 -1
- package/types/shell/index.d.ts +4 -30
- package/utils/error.js +3 -1
- package/utils/errorTranslate.json +247 -2
- package/vue.config.js +1 -1
|
@@ -115,6 +115,10 @@ export default {
|
|
|
115
115
|
labelKey: 'tableHeaders.role',
|
|
116
116
|
value: 'roleTemplate.nameDisplay'
|
|
117
117
|
},
|
|
118
|
+
{
|
|
119
|
+
name: '操作',
|
|
120
|
+
labelKey: 'tableHeaders.action',
|
|
121
|
+
},
|
|
118
122
|
],
|
|
119
123
|
loadingProjectBindings: true,
|
|
120
124
|
loadingClusterBindings: true
|
|
@@ -293,6 +297,7 @@ export default {
|
|
|
293
297
|
:create-button-label="t('members.createActionLabel')"
|
|
294
298
|
:is-creatable="false"
|
|
295
299
|
:type-display="t('members.clusterAndProject')"
|
|
300
|
+
|
|
296
301
|
/>
|
|
297
302
|
<Banner
|
|
298
303
|
v-if="isLocal"
|
|
@@ -304,7 +309,7 @@ export default {
|
|
|
304
309
|
name="cluster-membership"
|
|
305
310
|
:label="t('members.clusterMembership')"
|
|
306
311
|
>
|
|
307
|
-
<div
|
|
312
|
+
<!-- <div
|
|
308
313
|
v-if="canEditClusterMembers"
|
|
309
314
|
class="row mb-10 cluster-add"
|
|
310
315
|
>
|
|
@@ -314,7 +319,7 @@ export default {
|
|
|
314
319
|
>
|
|
315
320
|
{{ t('members.createActionLabel') }}
|
|
316
321
|
</router-link>
|
|
317
|
-
</div>
|
|
322
|
+
</div> -->
|
|
318
323
|
<ResourceTable
|
|
319
324
|
:schema="schema"
|
|
320
325
|
:headers="headers"
|
|
@@ -325,7 +330,21 @@ export default {
|
|
|
325
330
|
:loading="$fetchState.pending || !currentCluster || loadingClusterBindings"
|
|
326
331
|
sub-search="subSearch"
|
|
327
332
|
:sub-fields="['nameDisplay']"
|
|
328
|
-
|
|
333
|
+
>
|
|
334
|
+
<template #header-right>
|
|
335
|
+
<div
|
|
336
|
+
v-if="canEditClusterMembers"
|
|
337
|
+
class="row mb-10 mr-10 cluster-add"
|
|
338
|
+
>
|
|
339
|
+
<router-link
|
|
340
|
+
:to="createLocation"
|
|
341
|
+
class="btn role-primary pull-right"
|
|
342
|
+
>
|
|
343
|
+
{{ t('members.createActionLabel') }}
|
|
344
|
+
</router-link>
|
|
345
|
+
</div>
|
|
346
|
+
</template>
|
|
347
|
+
</ResourceTable>
|
|
329
348
|
</Tab>
|
|
330
349
|
<Tab
|
|
331
350
|
v-if="canManageProjectMembers && !isHarvester"
|
|
@@ -346,12 +365,13 @@ export default {
|
|
|
346
365
|
v-trim-whitespace
|
|
347
366
|
class="group-tab"
|
|
348
367
|
>
|
|
368
|
+
|
|
349
369
|
<div
|
|
350
370
|
v-clean-html="getProjectLabel(group)"
|
|
351
371
|
class="project-name"
|
|
352
372
|
/>
|
|
353
373
|
</div>
|
|
354
|
-
<div class="right">
|
|
374
|
+
<div class="right" style="margin-right: 80px;">
|
|
355
375
|
<button
|
|
356
376
|
v-if="canEditProjectMembers"
|
|
357
377
|
type="button"
|
|
@@ -445,8 +465,12 @@ export default {
|
|
|
445
465
|
& :deep() .group-bar{
|
|
446
466
|
display: flex;
|
|
447
467
|
justify-content: space-between;
|
|
468
|
+
align-items: center;
|
|
448
469
|
}
|
|
449
470
|
}
|
|
471
|
+
.role-secondary.btn-sm:focus, .role-secondary.btn-sm.focused{
|
|
472
|
+
border: 1px solid #d7d7d7;
|
|
473
|
+
}
|
|
450
474
|
.cluster-add {
|
|
451
475
|
justify-content: flex-end;
|
|
452
476
|
}
|
|
@@ -108,12 +108,7 @@ export default {
|
|
|
108
108
|
} catch (e) { }
|
|
109
109
|
},
|
|
110
110
|
data() {
|
|
111
|
-
|
|
112
|
-
const topLevelPermissions = sessionStorage.getItem('TOPLEVELPERMISSIONS') || ''
|
|
113
|
-
|
|
114
111
|
return {
|
|
115
|
-
topLevelPermissions,
|
|
116
|
-
|
|
117
112
|
// This not only identifies global roles but the order here is the order we want to display them in the UI
|
|
118
113
|
globalPermissions: [
|
|
119
114
|
'admin',
|
|
@@ -333,119 +328,60 @@ export default {
|
|
|
333
328
|
|
|
334
329
|
<div v-else>
|
|
335
330
|
<form v-if="selectedRoles">
|
|
336
|
-
<
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
:show-actions="false"
|
|
346
|
-
>
|
|
347
|
-
<template v-slot:title>
|
|
348
|
-
<div class="type-title">
|
|
349
|
-
<h3>{{ t(`rbac.globalRoles.types.${roleType}.label`) }}</h3>
|
|
350
|
-
<div class="type-description">
|
|
351
|
-
{{ t(`rbac.globalRoles.types.${roleType}.description`, { isUser }) }}
|
|
352
|
-
</div>
|
|
353
|
-
</div>
|
|
354
|
-
</template>
|
|
355
|
-
<template v-slot:body>
|
|
356
|
-
<div
|
|
357
|
-
class="checkbox-section"
|
|
358
|
-
:class="'checkbox-section--' + roleType"
|
|
359
|
-
>
|
|
360
|
-
<div
|
|
361
|
-
v-for="(role, i) in sortedRoles[roleType]"
|
|
362
|
-
:key="i"
|
|
363
|
-
class="checkbox mb-10 mr-10"
|
|
364
|
-
>
|
|
365
|
-
<Checkbox
|
|
366
|
-
v-model:value="selectedRoles"
|
|
367
|
-
:value-when-true="role.id"
|
|
368
|
-
:disabled="!!assignOnlyRoles[role.id]"
|
|
369
|
-
:label="role.nameDisplay"
|
|
370
|
-
:description="role.descriptionDisplay"
|
|
371
|
-
:mode="mode"
|
|
372
|
-
:data-testId="'grb-checkbox-' + role.id"
|
|
373
|
-
@update:value="checkboxChanged"
|
|
374
|
-
>
|
|
375
|
-
<template #label>
|
|
376
|
-
<div class="checkbox-label-slot">
|
|
377
|
-
<span class="checkbox-label">{{ role.nameDisplay }}</span>
|
|
378
|
-
<i
|
|
379
|
-
v-if="!!assignOnlyRoles[role.id]"
|
|
380
|
-
v-clean-tooltip="t('rbac.globalRoles.assignOnlyRole')"
|
|
381
|
-
class="checkbox-info icon icon-info icon-lg"
|
|
382
|
-
/>
|
|
383
|
-
</div>
|
|
384
|
-
</template>
|
|
385
|
-
</Checkbox>
|
|
386
|
-
</div>
|
|
387
|
-
</div>
|
|
388
|
-
</template>
|
|
389
|
-
</Card>
|
|
390
|
-
</div>
|
|
391
|
-
</template>
|
|
392
|
-
|
|
393
|
-
<template v-else>
|
|
394
|
-
<div
|
|
395
|
-
v-for="(sortedRole, roleType) in { global: sortedRoles['global'] }"
|
|
396
|
-
:key="roleType"
|
|
397
|
-
class="role-group mb-10"
|
|
331
|
+
<div
|
|
332
|
+
v-for="(sortedRole, roleType) in sortedRoles"
|
|
333
|
+
:key="roleType"
|
|
334
|
+
class="role-group mb-10"
|
|
335
|
+
>
|
|
336
|
+
<Card
|
|
337
|
+
v-if="Object.keys(sortedRole).length"
|
|
338
|
+
:show-highlight-border="false"
|
|
339
|
+
:show-actions="false"
|
|
398
340
|
>
|
|
399
|
-
<
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
<template v-slot:title>
|
|
405
|
-
<div class="type-title">
|
|
406
|
-
<h3>{{ t(`rbac.globalRoles.types.${roleType}.label`) }}</h3>
|
|
407
|
-
<div class="type-description">
|
|
408
|
-
{{ t(`rbac.globalRoles.types.${roleType}.description`, { isUser }) }}
|
|
409
|
-
</div>
|
|
341
|
+
<template v-slot:title>
|
|
342
|
+
<div class="type-title">
|
|
343
|
+
<h3>{{ t(`rbac.globalRoles.types.${roleType}.label`) }}</h3>
|
|
344
|
+
<div class="type-description">
|
|
345
|
+
{{ t(`rbac.globalRoles.types.${roleType}.description`, { isUser }) }}
|
|
410
346
|
</div>
|
|
411
|
-
</
|
|
412
|
-
|
|
347
|
+
</div>
|
|
348
|
+
</template>
|
|
349
|
+
<template v-slot:body>
|
|
350
|
+
<div
|
|
351
|
+
class="checkbox-section"
|
|
352
|
+
:class="'checkbox-section--' + roleType"
|
|
353
|
+
>
|
|
413
354
|
<div
|
|
414
|
-
|
|
415
|
-
:
|
|
355
|
+
v-for="(role, i) in sortedRoles[roleType]"
|
|
356
|
+
:key="i"
|
|
357
|
+
class="checkbox mb-10 mr-10"
|
|
416
358
|
>
|
|
417
|
-
<
|
|
418
|
-
v-
|
|
419
|
-
:
|
|
420
|
-
|
|
359
|
+
<Checkbox
|
|
360
|
+
v-model:value="selectedRoles"
|
|
361
|
+
:value-when-true="role.id"
|
|
362
|
+
:disabled="!!assignOnlyRoles[role.id]"
|
|
363
|
+
:label="role.nameDisplay"
|
|
364
|
+
:description="role.descriptionDisplay"
|
|
365
|
+
:mode="mode"
|
|
366
|
+
:data-testId="'grb-checkbox-' + role.id"
|
|
367
|
+
@update:value="checkboxChanged"
|
|
421
368
|
>
|
|
422
|
-
<
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
>
|
|
432
|
-
|
|
433
|
-
<div class="checkbox-label-slot">
|
|
434
|
-
<span class="checkbox-label">{{ role.nameDisplay }}</span>
|
|
435
|
-
<i
|
|
436
|
-
v-if="!!assignOnlyRoles[role.id]"
|
|
437
|
-
v-clean-tooltip="t('rbac.globalRoles.assignOnlyRole')"
|
|
438
|
-
class="checkbox-info icon icon-info icon-lg"
|
|
439
|
-
/>
|
|
440
|
-
</div>
|
|
441
|
-
</template>
|
|
442
|
-
</Checkbox>
|
|
443
|
-
</div>
|
|
369
|
+
<template #label>
|
|
370
|
+
<div class="checkbox-label-slot">
|
|
371
|
+
<span class="checkbox-label">{{ role.nameDisplay }}</span>
|
|
372
|
+
<i
|
|
373
|
+
v-if="!!assignOnlyRoles[role.id]"
|
|
374
|
+
v-clean-tooltip="t('rbac.globalRoles.assignOnlyRole')"
|
|
375
|
+
class="checkbox-info icon icon-info icon-lg"
|
|
376
|
+
/>
|
|
377
|
+
</div>
|
|
378
|
+
</template>
|
|
379
|
+
</Checkbox>
|
|
444
380
|
</div>
|
|
445
|
-
</
|
|
446
|
-
</
|
|
447
|
-
</
|
|
448
|
-
</
|
|
381
|
+
</div>
|
|
382
|
+
</template>
|
|
383
|
+
</Card>
|
|
384
|
+
</div>
|
|
449
385
|
</form>
|
|
450
386
|
</div>
|
|
451
387
|
</template>
|
|
@@ -89,12 +89,10 @@ const getRowValueId = (row:Row): string => `value-${ row.label }:${ row.value }`
|
|
|
89
89
|
flex-direction: column;
|
|
90
90
|
|
|
91
91
|
.row {
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
min-height: 40px;
|
|
94
93
|
.value {
|
|
95
94
|
display: flex;
|
|
96
95
|
flex-direction: row;
|
|
97
|
-
align-items: center;
|
|
98
96
|
|
|
99
97
|
&, & * {
|
|
100
98
|
max-width: 100%;
|
|
@@ -53,13 +53,13 @@ const showConfigurationMoreFocusSelector = computed(() => `[data-testid="${ show
|
|
|
53
53
|
|
|
54
54
|
<template>
|
|
55
55
|
<div class="key-value">
|
|
56
|
-
<div class="heading">
|
|
56
|
+
<div class="heading h40">
|
|
57
57
|
<span class="title text-deemphasized">{{ propertyName }}</span>
|
|
58
58
|
<span class="count">{{ rows.length }}</span>
|
|
59
59
|
</div>
|
|
60
60
|
<div
|
|
61
61
|
v-if="visibleRows.length === 0"
|
|
62
|
-
class="empty
|
|
62
|
+
class="empty text-deemphasized"
|
|
63
63
|
>
|
|
64
64
|
<div class="no-rows">
|
|
65
65
|
{{ i18n.t('component.resource.detail.metadata.keyValue.noRows', {propertyName: lowercasePropertyName}) }}
|
|
@@ -78,7 +78,7 @@ const showConfigurationMoreFocusSelector = computed(() => `[data-testid="${ show
|
|
|
78
78
|
<div
|
|
79
79
|
v-for="row in visibleRows"
|
|
80
80
|
:key="displayValue(row)"
|
|
81
|
-
class="row"
|
|
81
|
+
class="row h40"
|
|
82
82
|
>
|
|
83
83
|
<Rectangle
|
|
84
84
|
v-clean-tooltip="displayValue(row)"
|
|
@@ -104,18 +104,22 @@ const showConfigurationMoreFocusSelector = computed(() => `[data-testid="${ show
|
|
|
104
104
|
display: flex;
|
|
105
105
|
flex-direction: column;
|
|
106
106
|
align-items: flex-start;
|
|
107
|
+
|
|
108
|
+
.h40 {
|
|
109
|
+
min-height: 40px;
|
|
110
|
+
}
|
|
107
111
|
|
|
108
112
|
.count {
|
|
109
113
|
margin-left: 24px;
|
|
110
114
|
}
|
|
111
115
|
|
|
112
116
|
.heading {
|
|
113
|
-
margin-bottom: 8px;
|
|
114
117
|
}
|
|
115
118
|
|
|
116
119
|
.row {
|
|
117
120
|
display: block;
|
|
118
121
|
width: 100%;
|
|
122
|
+
line-height: 40px;
|
|
119
123
|
|
|
120
124
|
&:not(:nth-child(2)) {
|
|
121
125
|
margin-top: 4px;
|
|
@@ -31,10 +31,12 @@ const showBothEmpty = computed(() => labels.length === 0 && annotations.length =
|
|
|
31
31
|
|
|
32
32
|
<template>
|
|
33
33
|
<SpacedRow
|
|
34
|
-
|
|
34
|
+
v-if="false"
|
|
35
|
+
class="metadata ppb-5"
|
|
35
36
|
v-bind="$attrs"
|
|
36
37
|
>
|
|
37
38
|
<div
|
|
39
|
+
v-if="identifyingInformation?.length > 0"
|
|
38
40
|
class="identifying-info"
|
|
39
41
|
>
|
|
40
42
|
<IdentifyingInformation :rows="identifyingInformation" />
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<div class="title">
|
|
3
3
|
<slot name="default" />
|
|
4
|
-
</
|
|
4
|
+
</div>
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<style lang="scss" scoped>
|
|
8
|
-
|
|
8
|
+
.title {
|
|
9
9
|
display: inline-block;
|
|
10
10
|
align-items: center;
|
|
11
11
|
display: flex;
|
|
12
12
|
flex-direction: row;
|
|
13
|
+
font-size: 14px;
|
|
13
14
|
}
|
|
14
15
|
</style>
|
|
@@ -14,7 +14,22 @@ export const useDefaultTitleBarProps = (resource: any, resourceSubtype?: Ref<str
|
|
|
14
14
|
const resourceSubtypeValue = toValue(resourceSubtype);
|
|
15
15
|
const currentStore = store.getters['currentStore'](resourceValue.type);
|
|
16
16
|
const schema = store.getters[`${ currentStore }/schemaFor`](resourceValue.type);
|
|
17
|
-
|
|
17
|
+
let resourceTypeLabel = resourceValue.parentNameOverride || store.getters['type-map/labelFor'](schema);
|
|
18
|
+
|
|
19
|
+
// 转换为中文
|
|
20
|
+
const displayName_zh_hans: Record<string, string> = {
|
|
21
|
+
'GlobalRole': '全局角色',
|
|
22
|
+
'RoleTemplate': '集群角色',
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (displayName_zh_hans[resourceTypeLabel]) {
|
|
26
|
+
resourceTypeLabel = displayName_zh_hans[resourceTypeLabel]
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (resourceTypeLabel == '集群角色' && (route.query?.roleContext == 'NAMESPACE' || resource?.parentLocationOverride?.hash == '#NAMESPACE')) {
|
|
30
|
+
resourceTypeLabel = '项目或资源组角色'
|
|
31
|
+
}
|
|
32
|
+
|
|
18
33
|
const resourceName = resourceSubtypeValue ? `${ resourceSubtypeValue } - ${ resourceValue.nameDisplay }` : resourceValue.nameDisplay;
|
|
19
34
|
const resourceTo = resourceValue.listLocation || {
|
|
20
35
|
name: 'c-cluster-product-resource',
|
|
@@ -13,6 +13,8 @@ import { _CONFIG, _GRAPH, AS } from '@shell/config/query-params';
|
|
|
13
13
|
import ButtonGroup from '@shell/components/ButtonGroup';
|
|
14
14
|
import { ExtensionPoint, PanelLocation } from '@shell/core/types';
|
|
15
15
|
import ExtensionPanel from '@shell/components/ExtensionPanel.vue';
|
|
16
|
+
import breadcrumb from '@shell/components/breadcrumb/index.vue'
|
|
17
|
+
import { useDefaultConfigTabProps } from '@shell/components/Drawer/ResourceDetailDrawer/composables';
|
|
16
18
|
|
|
17
19
|
export interface Badge {
|
|
18
20
|
color: 'bg-success' | 'bg-error' | 'bg-warning' | 'bg-info';
|
|
@@ -36,6 +38,7 @@ export interface TitleBarProps {
|
|
|
36
38
|
showViewOptions?: boolean;
|
|
37
39
|
|
|
38
40
|
onShowConfiguration?: (returnFocusSelector: string) => void;
|
|
41
|
+
parentRouteOverride?: string;
|
|
39
42
|
}
|
|
40
43
|
|
|
41
44
|
const showConfigurationIcon = require(`@shell/assets/images/icons/document.svg`);
|
|
@@ -43,9 +46,10 @@ const showConfigurationIcon = require(`@shell/assets/images/icons/document.svg`)
|
|
|
43
46
|
|
|
44
47
|
<script setup lang="ts">
|
|
45
48
|
const {
|
|
46
|
-
resource, resourceTypeLabel, resourceTo, resourceName, description, badge, showViewOptions, onShowConfiguration,
|
|
49
|
+
parentRouteOverride, resource, resourceTypeLabel, resourceTo, resourceName, description, badge, showViewOptions, onShowConfiguration,
|
|
47
50
|
} = defineProps<TitleBarProps>();
|
|
48
51
|
|
|
52
|
+
|
|
49
53
|
const store = useStore();
|
|
50
54
|
const i18n = useI18n(store);
|
|
51
55
|
const router = useRouter();
|
|
@@ -54,6 +58,10 @@ const emit = defineEmits(['show-configuration']);
|
|
|
54
58
|
const showConfigurationDataTestId = 'show-configuration-cta';
|
|
55
59
|
const showConfigurationReturnFocusSelector = computed(() => `[data-testid="${ showConfigurationDataTestId }"]`);
|
|
56
60
|
|
|
61
|
+
|
|
62
|
+
const configTabProps = useDefaultConfigTabProps(resource);
|
|
63
|
+
|
|
64
|
+
|
|
57
65
|
const currentView = ref(router?.currentRoute?.value?.query?.as || _CONFIG);
|
|
58
66
|
const viewOptions = computed(() => {
|
|
59
67
|
if (!showViewOptions) {
|
|
@@ -72,6 +80,35 @@ const viewOptions = computed(() => {
|
|
|
72
80
|
];
|
|
73
81
|
});
|
|
74
82
|
|
|
83
|
+
const Svg = require('~shell/assets/images/API.svg')
|
|
84
|
+
|
|
85
|
+
const parent = computed(() => {
|
|
86
|
+
|
|
87
|
+
const product = store.getters['currentProduct'].name;
|
|
88
|
+
|
|
89
|
+
const defaultLocation = {
|
|
90
|
+
name: 'c-cluster-product-resource',
|
|
91
|
+
params: {
|
|
92
|
+
resource,
|
|
93
|
+
product,
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const location = resource?.parentLocationOverride || defaultLocation;
|
|
98
|
+
|
|
99
|
+
if (parentRouteOverride) {
|
|
100
|
+
location.name = parentRouteOverride;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return { location };
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
const menuIcon = computed(() => {
|
|
107
|
+
const product = store.getters['productId'];
|
|
108
|
+
const resources = parent.value.location?.params?.resource || '';
|
|
109
|
+
return store.getters['type-map/groupsForVirTypes'](product, resources) || 'default menuIcon';
|
|
110
|
+
});
|
|
111
|
+
|
|
75
112
|
watch(
|
|
76
113
|
() => currentView.value,
|
|
77
114
|
() => {
|
|
@@ -82,33 +119,58 @@ watch(
|
|
|
82
119
|
|
|
83
120
|
<template>
|
|
84
121
|
<div class="title-bar">
|
|
122
|
+
<breadcrumb :resourceTypeLabel="resourceTypeLabel" :resource="resource"/>
|
|
85
123
|
<Top>
|
|
86
124
|
<Title class="title">
|
|
125
|
+
<span class="detailIcon-span">
|
|
126
|
+
<img
|
|
127
|
+
v-if="parentRouteOverride === 'account' && resource=== 'token'"
|
|
128
|
+
:src="Svg"
|
|
129
|
+
style="margin-top: 4px; margin-left: 5px;"
|
|
130
|
+
>
|
|
131
|
+
<i
|
|
132
|
+
v-else
|
|
133
|
+
:class="'icon-'+ menuIcon + ' detailIcon'"
|
|
134
|
+
/>
|
|
135
|
+
</span>
|
|
136
|
+
<div class="resourceTypeLabelCls">
|
|
137
|
+
{{ resourceTypeLabel }}名称:
|
|
138
|
+
</div>
|
|
139
|
+
<span class="resource-name masthead-resource-title">
|
|
140
|
+
{{ resourceName }}
|
|
141
|
+
</span>
|
|
142
|
+
<BadgeState
|
|
143
|
+
v-if="badge"
|
|
144
|
+
class="badge-state"
|
|
145
|
+
:color="badge.color"
|
|
146
|
+
:label="badge.label"
|
|
147
|
+
/>
|
|
148
|
+
<span
|
|
149
|
+
class="valid"
|
|
150
|
+
>|</span>
|
|
87
151
|
<TabTitle :show-child="false">
|
|
88
|
-
|
|
152
|
+
返回
|
|
89
153
|
</TabTitle>
|
|
90
154
|
<router-link
|
|
91
155
|
v-if="resourceTo"
|
|
92
156
|
:to="resourceTo"
|
|
93
157
|
class="resource-link"
|
|
94
158
|
>
|
|
95
|
-
|
|
159
|
+
返回
|
|
96
160
|
</router-link>
|
|
97
161
|
<span
|
|
98
162
|
v-else
|
|
99
163
|
class="resource-text"
|
|
100
164
|
>
|
|
101
|
-
|
|
102
|
-
</span>
|
|
103
|
-
<span class="resource-name masthead-resource-title">
|
|
104
|
-
{{ resourceName }}
|
|
165
|
+
返回
|
|
105
166
|
</span>
|
|
106
|
-
<
|
|
107
|
-
v-if="
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
167
|
+
<div
|
|
168
|
+
v-if="description"
|
|
169
|
+
style="font-size: 12px;margin-left: 16px;"
|
|
170
|
+
class="bottom description text-deemphasized"
|
|
171
|
+
>
|
|
172
|
+
( {{ description }} )
|
|
173
|
+
</div>
|
|
112
174
|
</Title>
|
|
113
175
|
<div class="actions">
|
|
114
176
|
<!-- Please don't expand this pattern, this was a quick fix to resolve a conflict between the new masthead and fleet. -->
|
|
@@ -118,7 +180,7 @@ watch(
|
|
|
118
180
|
:options="viewOptions"
|
|
119
181
|
/>
|
|
120
182
|
<RcButton
|
|
121
|
-
v-if="onShowConfiguration"
|
|
183
|
+
v-if="onShowConfiguration && configTabProps"
|
|
122
184
|
:data-testid="showConfigurationDataTestId"
|
|
123
185
|
class="show-configuration"
|
|
124
186
|
:primary="true"
|
|
@@ -134,6 +196,7 @@ watch(
|
|
|
134
196
|
</RcButton>
|
|
135
197
|
<ActionMenu
|
|
136
198
|
v-if="actionMenuResource"
|
|
199
|
+
:showIcon="true"
|
|
137
200
|
button-role="multiAction"
|
|
138
201
|
:resource="actionMenuResource"
|
|
139
202
|
data-testid="masthead-action-menu"
|
|
@@ -141,12 +204,6 @@ watch(
|
|
|
141
204
|
/>
|
|
142
205
|
</div>
|
|
143
206
|
</Top>
|
|
144
|
-
<div
|
|
145
|
-
v-if="description"
|
|
146
|
-
class="bottom description text-deemphasized"
|
|
147
|
-
>
|
|
148
|
-
{{ description }}
|
|
149
|
-
</div>
|
|
150
207
|
<ExtensionPanel
|
|
151
208
|
:resource="resource"
|
|
152
209
|
:type="ExtensionPoint.PANEL"
|
|
@@ -156,12 +213,39 @@ watch(
|
|
|
156
213
|
</template>
|
|
157
214
|
|
|
158
215
|
<style lang="scss" scoped>
|
|
216
|
+
|
|
217
|
+
.detailIcon-span{
|
|
218
|
+
width: 24px;
|
|
219
|
+
height: 24px;
|
|
220
|
+
display: inline-block;
|
|
221
|
+
position: relative;
|
|
222
|
+
background: var(--primary);
|
|
223
|
+
margin-right: 10px;
|
|
224
|
+
}
|
|
225
|
+
.detailIcon{
|
|
226
|
+
position: absolute;
|
|
227
|
+
color: #fff;
|
|
228
|
+
font-size: 38px;
|
|
229
|
+
left: 4px;
|
|
230
|
+
top: -2px;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.detailIcon-span-title{
|
|
234
|
+
font-weight: bold;
|
|
235
|
+
}
|
|
236
|
+
.resourceTypeLabelCls {
|
|
237
|
+
font-weight: 700;
|
|
238
|
+
}
|
|
239
|
+
.valid{
|
|
240
|
+
color: #d7d7d7;
|
|
241
|
+
margin: 0px 10px;
|
|
242
|
+
}
|
|
159
243
|
.title-bar {
|
|
160
244
|
min-width: 740px;
|
|
161
245
|
|
|
162
246
|
.badge-state {
|
|
163
247
|
font-size: 16px;
|
|
164
|
-
margin-left:
|
|
248
|
+
margin-left: 5px;
|
|
165
249
|
position: relative;
|
|
166
250
|
}
|
|
167
251
|
|
|
@@ -170,15 +254,19 @@ watch(
|
|
|
170
254
|
}
|
|
171
255
|
|
|
172
256
|
&:deep() button[data-testid="masthead-action-menu"] {
|
|
173
|
-
border-radius:
|
|
174
|
-
width:
|
|
175
|
-
height:
|
|
176
|
-
margin-left:
|
|
257
|
+
border-radius: 2px;
|
|
258
|
+
width: 32px;
|
|
259
|
+
height: 32px;
|
|
260
|
+
margin-left: 10px;
|
|
177
261
|
|
|
178
262
|
display: inline-flex;
|
|
179
263
|
flex-direction: row;
|
|
180
264
|
justify-content: center;
|
|
181
265
|
align-items: center;
|
|
266
|
+
|
|
267
|
+
a{
|
|
268
|
+
color: #fff;
|
|
269
|
+
}
|
|
182
270
|
}
|
|
183
271
|
|
|
184
272
|
.description {
|