dashboard-shell-shell 1.0.1000000116 → 1.0.1000000117
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/images/action.svg +6 -0
- package/assets/images/pl/logo.png +0 -0
- package/assets/styles/base/_functions.scss +0 -0
- package/assets/styles/base/_mixins.scss +1 -1
- package/assets/styles/global/_button.scss +17 -10
- package/assets/styles/global/_form.scss +2 -2
- package/assets/styles/global/_labeled-input.scss +6 -2
- package/assets/styles/global/_select.scss +6 -7
- package/assets/styles/global/_table.scss +3 -2
- package/assets/styles/global/_tooltip.scss +8 -1
- package/assets/styles/themes/_dark.scss +2 -0
- package/assets/styles/themes/_light.scss +5 -2
- package/assets/styles/vendor/vue-select.scss +2 -1
- package/assets/translations/en-us.yaml +1 -3
- package/assets/translations/zh-hans.yaml +51 -28
- package/components/ActionDropdown.vue +1 -0
- package/components/ActionMenuShell.vue +6 -3
- package/components/BrandImage.vue +22 -0
- package/components/ClusterIconMenu.vue +1 -1
- package/components/CodeMirror.vue +1 -0
- package/components/CruResource.vue +1 -1
- package/components/CruResourceFooter.vue +1 -1
- package/components/ExplorerProjectsNamespaces.vue +4 -24
- package/components/GlobalRoleBindings.vue +112 -48
- package/components/IndentedPanel.vue +4 -10
- package/components/PromptRemove.vue +3 -3
- package/components/ResourceDetail/Masthead.vue +190 -242
- package/components/ResourceDetail/index.vue +20 -5
- package/components/ResourceList/Masthead.vue +146 -84
- package/components/ResourceList/ResourceLoadingIndicator.vue +5 -2
- package/components/ResourceTable.vue +76 -1
- package/components/SideNav.vue +66 -29
- package/components/SortableTable/THead.vue +6 -0
- package/components/SortableTable/index.vue +481 -388
- package/components/Tabbed/index.vue +4 -5
- package/components/auth/Principal.vue +3 -2
- package/components/auth/RoleDetailEdit.vue +58 -5
- package/components/auth/SelectPrincipal.vue +1 -0
- package/components/form/BannerSettings.vue +18 -16
- package/components/form/ChangePassword.vue +4 -4
- package/components/form/ColorInput.vue +32 -8
- package/components/form/Footer.vue +1 -1
- package/components/form/InputWithSelect.vue +2 -0
- package/components/form/KeyValue.vue +31 -7
- package/components/form/LabeledSelect.vue +178 -178
- package/components/form/Members/ClusterPermissionsEditor.vue +1 -2
- package/components/form/Members/MembershipEditor.vue +1 -1
- package/components/form/NameNsDescription.vue +24 -11
- package/components/form/Password.vue +6 -2
- package/components/form/ResourceQuota/Namespace.vue +1 -1
- package/components/form/ResourceQuota/NamespaceRow.vue +13 -10
- package/components/form/ResourceQuota/ProjectRow.vue +0 -1
- package/components/form/Select.vue +2 -2
- package/components/nav/Favorite.vue +5 -1
- package/components/nav/Group.vue +69 -23
- package/components/nav/Header.vue +82 -17
- package/components/nav/HeaderPageActionMenu.vue +1 -0
- package/components/nav/NamespaceFilter.vue +0 -3
- package/components/nav/TopLevelMenu.vue +182 -119
- package/components/nav/Type.vue +48 -11
- package/composables/useClickOutside.ts +1 -1
- package/config/product/auth.js +16 -7
- package/config/product/explorer.js +1 -1
- package/config/product/settings.js +17 -8
- package/config/settings.ts +28 -0
- package/edit/management.cattle.io.user.vue +17 -4
- package/edit/networking.k8s.io.ingress/RulePath.vue +1 -1
- package/edit/token.vue +1 -1
- package/list/harvesterhci.io.management.cluster.vue +17 -0
- package/list/management.cattle.io.setting.vue +22 -13
- package/list/management.cattle.io.user.vue +25 -14
- package/list/provisioning.cattle.io.cluster.vue +6 -7
- package/mixins/brand.js +17 -0
- package/package.json +1 -1
- package/pages/auth/login.vue +84 -29
- package/pages/c/_cluster/auth/roles/index.vue +61 -14
- package/pages/c/_cluster/settings/banners.vue +174 -101
- package/pages/c/_cluster/settings/brand.vue +348 -301
- package/pages/c/_cluster/settings/performance.vue +61 -38
- package/pages/home.vue +70 -21
- package/pages/prefs.vue +25 -23
- package/pkg/tsconfig.json +9 -9
- package/pkg/vue.config.js +1 -1
- package/promptRemove/mixin/roleDeletionCheck.js +2 -2
- package/scripts/clean +0 -0
- package/scripts/extension/bundle +0 -0
- package/scripts/extension/helm/scripts/package +0 -0
- package/scripts/extension/helm/scripts/patch +0 -0
- package/scripts/extension/helm/scripts/version +0 -0
- package/scripts/extension/helmpatch +0 -0
- package/scripts/extension/parse-tag-name +0 -0
- package/scripts/extension/publish +0 -0
- package/scripts/publish-shell.sh +86 -60
- package/scripts/serve-pkgs +0 -0
- package/scripts/sync-shell-deps +0 -0
- package/scripts/typegen.sh +44 -28
- package/store/i18n.js +5 -5
- package/store/prefs.js +17 -5
- package/store/type-map.js +2 -1
- package/types/shell/index.d.ts +1 -1
- package/utils/error.js +4 -0
- package/utils/router.js +3 -3
- package/vue.config.js +1 -6
- package/components/rancherResourceDetail/Masthead.vue +0 -769
- package/components/rancherResourceDetail/__tests__/Masthead.test.ts +0 -65
- package/components/rancherResourceDetail/index.vue +0 -591
- package/components/rancherResourceList/Masthead.vue +0 -375
- package/components/rancherResourceList/ResourceLoadingIndicator.vue +0 -140
- package/components/rancherResourceList/index.vue +0 -307
- package/components/rancherResourceList/resource-list.config.js +0 -7
- package/components/rancherResourceTable.vue +0 -783
- package/components/rancherSortableTable/THead.vue +0 -561
- package/components/rancherSortableTable/actions.js +0 -153
- package/components/rancherSortableTable/advanced-filtering.js +0 -272
- package/components/rancherSortableTable/debug.js +0 -117
- package/components/rancherSortableTable/filtering.js +0 -290
- package/components/rancherSortableTable/grouping.js +0 -48
- package/components/rancherSortableTable/index.vue +0 -2712
- package/components/rancherSortableTable/paging.js +0 -155
- package/components/rancherSortableTable/selection.js +0 -629
- package/components/rancherSortableTable/sortable-config.ts +0 -4
- package/components/rancherSortableTable/sorting.js +0 -129
- package/types/cloud-shell/index.d.ts +0 -11014
- /package/components/{rancherResourceList → ResourceList}/Masthead-btn.vue +0 -0
|
@@ -80,7 +80,12 @@ export default {
|
|
|
80
80
|
componentTestid: {
|
|
81
81
|
type: String,
|
|
82
82
|
default: 'masthead'
|
|
83
|
-
}
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
mainButtonVisible: {
|
|
86
|
+
type: Boolean,
|
|
87
|
+
default: true
|
|
88
|
+
},
|
|
84
89
|
},
|
|
85
90
|
|
|
86
91
|
data() {
|
|
@@ -99,11 +104,14 @@ export default {
|
|
|
99
104
|
};
|
|
100
105
|
|
|
101
106
|
const tabList = ['集群配置'];
|
|
107
|
+
|
|
108
|
+
const description = ''
|
|
102
109
|
return {
|
|
103
110
|
formRoute,
|
|
104
111
|
yamlRoute,
|
|
105
112
|
hasEditComponent,
|
|
106
113
|
tabList,
|
|
114
|
+
description
|
|
107
115
|
};
|
|
108
116
|
},
|
|
109
117
|
|
|
@@ -128,31 +136,61 @@ export default {
|
|
|
128
136
|
return '?';
|
|
129
137
|
}
|
|
130
138
|
|
|
131
|
-
// console.log(this.$store.getters['type-map/labelFor'](this.schema, 99), ' type-map/labelFor---------------')
|
|
132
|
-
|
|
133
139
|
return this.$store.getters['type-map/labelFor'](this.schema, 99);
|
|
134
140
|
},
|
|
135
141
|
_descriptionDisplay() {
|
|
136
|
-
const key = this.$route.path.split('/'.pop()
|
|
142
|
+
const key = this.$route.path.split('/').pop();
|
|
137
143
|
|
|
138
144
|
return this.$store.getters['i18n/t'](`typeDescription."${ key.toLowerCase() }"`);
|
|
139
145
|
},
|
|
140
146
|
demoDisplay() {
|
|
141
|
-
const product = this.$store.getters['productId'];
|
|
142
|
-
const productId = this.$store.getters['type-map/groupForBasicType'](this.$store.getters['productId'], this._createLocation.params.resource);
|
|
143
|
-
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
147
|
+
// const product = this.$store.getters['productId'];
|
|
148
|
+
// const productId = this.$store.getters['type-map/groupForBasicType'](this.$store.getters['productId'], this._createLocation.params.resource);
|
|
149
|
+
|
|
150
|
+
// const parts = productId?.split('::') || [];
|
|
151
|
+
// const newString = 'root';
|
|
152
|
+
|
|
153
|
+
// if (!parts.includes(newString)) {
|
|
154
|
+
// parts.unshift(newString); // 将字符串添加到数组第一位
|
|
155
|
+
// }
|
|
156
|
+
|
|
157
|
+
// const partsEn = parts.map((item) => {
|
|
158
|
+
// return this.$store.getters['i18n/t'](`typeLabel."${ item.toLowerCase() }"`);
|
|
159
|
+
// });
|
|
160
|
+
|
|
161
|
+
// return partsEn;
|
|
162
|
+
|
|
163
|
+
const breadcrumbList = {
|
|
164
|
+
'harvesterhci.io.management.cluster': {
|
|
165
|
+
origin: 'Harvester 集群',
|
|
166
|
+
bread: ['虚拟化管理'],
|
|
167
|
+
description: '提供虚拟化集群的实时健康状态监控、版本号管理及资源负载管理,支持批量导入/删除集群、配置调优与权限分级功能,实现高效运维管控。'
|
|
168
|
+
},
|
|
169
|
+
'management.cattle.io.user': {
|
|
170
|
+
origin: '用户',
|
|
171
|
+
bread: ['用户 & 认证'],
|
|
172
|
+
description: '用于管理用户账号,支持创建、维护用户信息,可设置用户权限、管理密码等,保障系统资源仅由授权用户访问,提升系统安全性。'
|
|
173
|
+
},
|
|
174
|
+
'management.cattle.io.setting':{
|
|
175
|
+
origin: '基础设置',
|
|
176
|
+
bread: ['全局设置'],
|
|
177
|
+
description: '统一配置平台基础选项与全局设置,支持CA证书、密码规则、域名、Token时效等核心配置。'
|
|
178
|
+
},
|
|
179
|
+
'management.cattle.io.feature':{
|
|
180
|
+
origin: '功能开关',
|
|
181
|
+
bread: ['全局设置'],
|
|
182
|
+
description: '还没有添加描述。。。。'
|
|
183
|
+
},
|
|
184
|
+
}
|
|
185
|
+
const resourcePath = this.$route.params.resource || ''
|
|
186
|
+
|
|
187
|
+
const breadcrumb = []
|
|
188
|
+
if (breadcrumbList[resourcePath] && Object.keys(breadcrumbList[resourcePath]).length > 0) {
|
|
189
|
+
breadcrumb.push(...breadcrumbList[resourcePath].bread)
|
|
190
|
+
this.description = breadcrumbList[resourcePath].description
|
|
148
191
|
}
|
|
149
192
|
|
|
150
|
-
|
|
151
|
-
return this.$store.getters['i18n/t'](`typeLabel."${ item.toLowerCase() }"`);
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
return partsEn;
|
|
155
|
-
// return this.$store.getters['i18n/t'](`typeLabel."${ productId.toLowerCase() }"`)
|
|
193
|
+
return breadcrumb
|
|
156
194
|
},
|
|
157
195
|
|
|
158
196
|
_isYamlCreatable() {
|
|
@@ -193,80 +231,95 @@ export default {
|
|
|
193
231
|
</script>
|
|
194
232
|
|
|
195
233
|
<template>
|
|
234
|
+
<!-- 顶部 header,带有子标题(subheader)样式类 -->
|
|
196
235
|
<header class="with-subheader">
|
|
197
|
-
|
|
198
|
-
<
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
236
|
+
<div style="display: flex;width: 100%;">
|
|
237
|
+
<div style="flex: 1;">
|
|
238
|
+
<!-- 标题区域 -->
|
|
239
|
+
<div class="title">
|
|
240
|
+
<div class="excram-list">
|
|
241
|
+
<span
|
|
242
|
+
v-for="(item,index) in demoDisplay"
|
|
243
|
+
:key="index"
|
|
244
|
+
>
|
|
245
|
+
<span v-if="item">{{ item }}</span>
|
|
246
|
+
<span v-if="item">/</span>
|
|
247
|
+
</span>
|
|
248
|
+
<span class="excram-last-name">{{ _typeDisplay }}</span>
|
|
249
|
+
</div>
|
|
250
|
+
<h1 style="display: flex;align-items: center;" class="m-0 descrip-name">
|
|
251
|
+
<TabTitle>{{ _typeDisplay }}</TabTitle>
|
|
252
|
+
<!-- 子标题区域 -->
|
|
253
|
+
<div class="sub-header">
|
|
254
|
+
<slot name="subHeader">
|
|
255
|
+
<!--Slot content-->
|
|
256
|
+
</slot>
|
|
257
|
+
</div>
|
|
258
|
+
|
|
259
|
+
<!-- <Favorite
|
|
260
|
+
v-if="isExplorer"
|
|
261
|
+
:resource="favoriteResource || resource"
|
|
262
|
+
/> -->
|
|
263
|
+
|
|
264
|
+
<ResourceLoadingIndicator
|
|
265
|
+
style="margin-left: 10px;"
|
|
266
|
+
v-if="showIncrementalLoadingIndicator"
|
|
267
|
+
:resources="loadResources"
|
|
268
|
+
:indeterminate="loadIndeterminate"
|
|
269
|
+
/>
|
|
270
|
+
</h1>
|
|
271
|
+
|
|
272
|
+
<!-- 插槽:typeDescription,用于插入类型描述组件 -->
|
|
273
|
+
<div v-if="description" class="masthod-title-description">
|
|
274
|
+
{{ description }}
|
|
275
|
+
</div>
|
|
276
|
+
|
|
277
|
+
</div>
|
|
278
|
+
|
|
279
|
+
|
|
210
280
|
</div>
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
281
|
+
|
|
282
|
+
<!-- 操作按钮区域 -->
|
|
283
|
+
<div
|
|
284
|
+
v-if="!(tabList.includes(_typeDisplay)) && mainButtonVisible"
|
|
285
|
+
class="actions-container"
|
|
286
|
+
style="min-height: 32px;align-self: flex-end;"
|
|
287
|
+
>
|
|
288
|
+
<slot name="actions">
|
|
289
|
+
<div class="actions">
|
|
290
|
+
<slot name="extraActions" />
|
|
291
|
+
|
|
292
|
+
<slot name="createButton">
|
|
293
|
+
<router-link
|
|
294
|
+
v-if="hasEditComponent && _isCreatable"
|
|
295
|
+
:to="_createLocation"
|
|
296
|
+
class="btn role-primary"
|
|
297
|
+
:data-testid="componentTestid+'-create'"
|
|
298
|
+
>
|
|
299
|
+
{{ _createButtonlabel }}
|
|
300
|
+
</router-link>
|
|
301
|
+
<router-link
|
|
302
|
+
v-else-if="_isYamlCreatable"
|
|
303
|
+
:to="_yamlCreateLocation"
|
|
304
|
+
class="btn role-primary"
|
|
305
|
+
:data-testid="componentTestid+'-create-yaml'"
|
|
306
|
+
>
|
|
307
|
+
{{ t("resourceList.head.createFromYaml") }}
|
|
308
|
+
</router-link>
|
|
309
|
+
</slot>
|
|
310
|
+
</div>
|
|
311
|
+
</slot>
|
|
220
312
|
</div>
|
|
221
|
-
<ResourceLoadingIndicator
|
|
222
|
-
v-if="showIncrementalLoadingIndicator"
|
|
223
|
-
:resources="loadResources"
|
|
224
|
-
:indeterminate="loadIndeterminate"
|
|
225
|
-
/>
|
|
226
|
-
</div>
|
|
227
|
-
<div class="sub-header">
|
|
228
|
-
<slot name="subHeader">
|
|
229
|
-
<!--Slot content-->
|
|
230
|
-
</slot>
|
|
231
313
|
</div>
|
|
232
314
|
<div
|
|
233
315
|
v-if="!(tabList.includes(_typeDisplay))"
|
|
234
|
-
style="width: 110%;height: 1px;background-color: #D7D7D7;margin-top:
|
|
316
|
+
style="width: 110%;height: 1px;background-color: #D7D7D7;margin-top: 16px;margin-left: -20px;margin-right: -20px;"
|
|
235
317
|
/>
|
|
236
|
-
<div
|
|
237
|
-
v-if="!(tabList.includes(_typeDisplay))"
|
|
238
|
-
class="actions-container"
|
|
239
|
-
style="width: 100%;min-height: 32px;text-align: left"
|
|
240
|
-
>
|
|
241
|
-
<slot name="actions">
|
|
242
|
-
<div class="actions">
|
|
243
|
-
<slot name="extraActions" />
|
|
244
|
-
|
|
245
|
-
<slot name="createButton">
|
|
246
|
-
<router-link
|
|
247
|
-
v-if="hasEditComponent && _isCreatable"
|
|
248
|
-
:to="_createLocation"
|
|
249
|
-
class="btn role-primary"
|
|
250
|
-
:data-testid="componentTestid+'-create'"
|
|
251
|
-
>
|
|
252
|
-
{{ _createButtonlabel }}
|
|
253
|
-
</router-link>
|
|
254
|
-
<!-- <router-link
|
|
255
|
-
v-else-if="_isYamlCreatable"
|
|
256
|
-
:to="_yamlCreateLocation"
|
|
257
|
-
class="btn role-primary"
|
|
258
|
-
:data-testid="componentTestid+'-create-yaml'"
|
|
259
|
-
>
|
|
260
|
-
{{ t("resourceList.head.createFromYaml") }}
|
|
261
|
-
</router-link> -->
|
|
262
|
-
</slot>
|
|
263
|
-
</div>
|
|
264
|
-
</slot>
|
|
265
|
-
</div>
|
|
266
318
|
</header>
|
|
267
319
|
</template>
|
|
268
320
|
|
|
269
321
|
<style lang="scss" scoped>
|
|
322
|
+
|
|
270
323
|
.title {
|
|
271
324
|
/* align-items: center;
|
|
272
325
|
display: flex; */
|
|
@@ -285,8 +338,10 @@ export default {
|
|
|
285
338
|
'title actions'
|
|
286
339
|
'sub-header sub-header'
|
|
287
340
|
'state-banner state-banner'; */
|
|
288
|
-
|
|
289
|
-
|
|
341
|
+
position: relative;
|
|
342
|
+
display: flex;
|
|
343
|
+
margin-bottom: 16px;
|
|
344
|
+
flex-direction: column;
|
|
290
345
|
}
|
|
291
346
|
.excram-list{
|
|
292
347
|
font-size: 14px;
|
|
@@ -303,11 +358,18 @@ export default {
|
|
|
303
358
|
}
|
|
304
359
|
.masthod-title-description{
|
|
305
360
|
font-family: 'Microsoft YaHei';
|
|
306
|
-
margin: 20px
|
|
361
|
+
margin-top: 20px;
|
|
307
362
|
}
|
|
308
363
|
.actions-container{
|
|
309
364
|
/* display: flex; */
|
|
310
365
|
/* margin-left: 0px; */
|
|
311
|
-
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.sub-header {
|
|
369
|
+
font-size: 16px;
|
|
370
|
+
margin-left: 5px;
|
|
371
|
+
.btn {
|
|
372
|
+
text-align: left !important;
|
|
373
|
+
}
|
|
312
374
|
}
|
|
313
375
|
</style>
|
|
@@ -77,7 +77,7 @@ export default {
|
|
|
77
77
|
<template>
|
|
78
78
|
<div
|
|
79
79
|
v-if="count && !haveAll"
|
|
80
|
-
class="
|
|
80
|
+
class="resource-loading-indicator"
|
|
81
81
|
>
|
|
82
82
|
<div class="inner">
|
|
83
83
|
<div class="resource-loader">
|
|
@@ -118,10 +118,12 @@ export default {
|
|
|
118
118
|
.resource-loader {
|
|
119
119
|
padding: 1px 10px;
|
|
120
120
|
width: max-content;
|
|
121
|
+
height: 20px;
|
|
121
122
|
|
|
122
123
|
.rl-fg, .rl-bg {
|
|
123
|
-
align-content: center;
|
|
124
124
|
display: flex;
|
|
125
|
+
align-content: center;
|
|
126
|
+
font-size: 12px;
|
|
125
127
|
|
|
126
128
|
> i {
|
|
127
129
|
font-size: 18px;
|
|
@@ -129,6 +131,7 @@ export default {
|
|
|
129
131
|
}
|
|
130
132
|
|
|
131
133
|
> span {
|
|
134
|
+
margin-top: 2px;
|
|
132
135
|
margin-left: 5px;
|
|
133
136
|
}
|
|
134
137
|
}
|
|
@@ -4,6 +4,7 @@ import { get } from '@shell/utils/object';
|
|
|
4
4
|
import { mapPref, GROUP_RESOURCES } from '@shell/store/prefs';
|
|
5
5
|
import ButtonGroup from '@shell/components/ButtonGroup';
|
|
6
6
|
import SortableTable from '@shell/components/SortableTable';
|
|
7
|
+
import MastheadBtn from '@shell/components/ResourceList/Masthead-btn.vue';
|
|
7
8
|
import { NAMESPACE, AGE } from '@shell/config/table-headers';
|
|
8
9
|
import { findBy } from '@shell/utils/array';
|
|
9
10
|
import { ExtensionPoint, TableColumnLocation } from '@shell/core/types';
|
|
@@ -43,7 +44,7 @@ export default {
|
|
|
43
44
|
|
|
44
45
|
emits: ['clickedActionButton'],
|
|
45
46
|
|
|
46
|
-
components: { ButtonGroup, SortableTable },
|
|
47
|
+
components: { ButtonGroup, SortableTable, MastheadBtn },
|
|
47
48
|
|
|
48
49
|
props: {
|
|
49
50
|
schema: {
|
|
@@ -51,6 +52,11 @@ export default {
|
|
|
51
52
|
default: null,
|
|
52
53
|
},
|
|
53
54
|
|
|
55
|
+
schemaBtn: {
|
|
56
|
+
type: Object,
|
|
57
|
+
default: null,
|
|
58
|
+
},
|
|
59
|
+
|
|
54
60
|
rows: {
|
|
55
61
|
type: Array,
|
|
56
62
|
required: true
|
|
@@ -212,6 +218,49 @@ export default {
|
|
|
212
218
|
type: String,
|
|
213
219
|
default: '名称'
|
|
214
220
|
},
|
|
221
|
+
|
|
222
|
+
resource: {
|
|
223
|
+
type: String,
|
|
224
|
+
required: true,
|
|
225
|
+
},
|
|
226
|
+
|
|
227
|
+
typeDisplay: {
|
|
228
|
+
type: String,
|
|
229
|
+
default: null,
|
|
230
|
+
},
|
|
231
|
+
isCreatable: {
|
|
232
|
+
type: Boolean,
|
|
233
|
+
default: null,
|
|
234
|
+
},
|
|
235
|
+
isYamlCreatable: {
|
|
236
|
+
type: Boolean,
|
|
237
|
+
default: null,
|
|
238
|
+
},
|
|
239
|
+
createLocation: {
|
|
240
|
+
type: Object,
|
|
241
|
+
default: null,
|
|
242
|
+
},
|
|
243
|
+
yamlCreateLocation: {
|
|
244
|
+
type: Object,
|
|
245
|
+
default: null,
|
|
246
|
+
},
|
|
247
|
+
createButtonLabel: {
|
|
248
|
+
type: String,
|
|
249
|
+
default: null
|
|
250
|
+
},
|
|
251
|
+
/**
|
|
252
|
+
* Inherited global identifier prefix for tests
|
|
253
|
+
* Define a term based on the parent component to avoid conflicts on multiple components
|
|
254
|
+
*/
|
|
255
|
+
componentTestid: {
|
|
256
|
+
type: String,
|
|
257
|
+
default: 'masthead'
|
|
258
|
+
},
|
|
259
|
+
|
|
260
|
+
mainButtonVisible: {
|
|
261
|
+
type: Boolean,
|
|
262
|
+
default: false
|
|
263
|
+
},
|
|
215
264
|
},
|
|
216
265
|
|
|
217
266
|
data() {
|
|
@@ -641,6 +690,32 @@ export default {
|
|
|
641
690
|
@group-value-change="group = $event"
|
|
642
691
|
@enter="handleEnterKeyPress"
|
|
643
692
|
>
|
|
693
|
+
|
|
694
|
+
<template #search-main-button>
|
|
695
|
+
<MastheadBtn
|
|
696
|
+
v-if="mainButtonVisible"
|
|
697
|
+
:schema="schemaBtn"
|
|
698
|
+
:resource="resource"
|
|
699
|
+
:create-button-label="createButtonLabel"
|
|
700
|
+
:yaml-create-button-label="yamlCreateLocation"
|
|
701
|
+
:create-location="createLocation"
|
|
702
|
+
:is-yaml-creatable="isYamlCreatable"
|
|
703
|
+
:is-creatable="isCreatable"
|
|
704
|
+
:type-display="typeDisplay"
|
|
705
|
+
:component-testid="componentTestid"
|
|
706
|
+
>
|
|
707
|
+
|
|
708
|
+
<template #extraActions>
|
|
709
|
+
<slot name="extraActions" />
|
|
710
|
+
</template>
|
|
711
|
+
|
|
712
|
+
<template #createButton>
|
|
713
|
+
<slot name="createButton" />
|
|
714
|
+
</template>
|
|
715
|
+
|
|
716
|
+
</ MastheadBtn>
|
|
717
|
+
</template>
|
|
718
|
+
|
|
644
719
|
<template
|
|
645
720
|
v-if="showGrouping && _groupOptions.length > 1"
|
|
646
721
|
#header-middle
|
package/components/SideNav.vue
CHANGED
|
@@ -21,6 +21,8 @@ import { NAME as NAVLINKS } from '@shell/config/product/navlinks';
|
|
|
21
21
|
import Group from '@shell/components/nav/Group';
|
|
22
22
|
import LocaleSelector from '@shell/components/LocaleSelector';
|
|
23
23
|
import { cloud2harvesterhci, harvester2cloud } from '@shell/utils/router';
|
|
24
|
+
import { NORMAN } from '@shell/config/types';
|
|
25
|
+
|
|
24
26
|
|
|
25
27
|
export default {
|
|
26
28
|
name: 'SideNav',
|
|
@@ -113,10 +115,14 @@ export default {
|
|
|
113
115
|
|
|
114
116
|
computed: {
|
|
115
117
|
...mapState(['managementReady', 'clusterReady']),
|
|
116
|
-
...mapGetters(['isStandaloneHarvester', 'productId', 'clusterId', 'currentProduct', 'rootProduct', 'isSingleProduct', 'namespaceMode', 'isExplorer', 'isVirtualCluster']),
|
|
118
|
+
...mapGetters(['isStandaloneHarvester', 'productId', 'clusterId', 'currentProduct', 'rootProduct', 'currentCluster', 'isSingleProduct', 'namespaceMode', 'isExplorer', 'isVirtualCluster']),
|
|
117
119
|
...mapGetters({ locale: 'i18n/selectedLocaleLabel', hasMultipleLocales: 'i18n/hasMultipleLocales' }),
|
|
118
120
|
...mapGetters('type-map', ['activeProducts']),
|
|
119
121
|
|
|
122
|
+
principal() {
|
|
123
|
+
return this.$store.getters['rancher/byId'](NORMAN.PRINCIPAL, this.$store.getters['auth/principalId']) || {};
|
|
124
|
+
},
|
|
125
|
+
|
|
120
126
|
favoriteTypes: mapPref(FAVORITE_TYPES),
|
|
121
127
|
|
|
122
128
|
supportLink() {
|
|
@@ -185,6 +191,12 @@ export default {
|
|
|
185
191
|
allNavLinksIds() {
|
|
186
192
|
return this.allNavLinks.map((a) => a.id);
|
|
187
193
|
},
|
|
194
|
+
|
|
195
|
+
prod() {
|
|
196
|
+
const name = this.rootProduct.name;
|
|
197
|
+
|
|
198
|
+
return this.$store.getters['i18n/withFallback'](`product."${ name }"`, null, ucFirst(name));
|
|
199
|
+
},
|
|
188
200
|
},
|
|
189
201
|
|
|
190
202
|
methods: {
|
|
@@ -232,9 +244,32 @@ export default {
|
|
|
232
244
|
|
|
233
245
|
replaceWith(this.groups, ...sortBy(out, ['weight:desc', 'label']));
|
|
234
246
|
|
|
247
|
+
// if (this.principal.loginName !== 'admin') {
|
|
248
|
+
// // 递归过滤函数(根据 label)
|
|
249
|
+
// this.groups = this.filterMenus(this.groups);
|
|
250
|
+
// }
|
|
251
|
+
|
|
252
|
+
|
|
235
253
|
this.gettingGroups = false;
|
|
236
254
|
},
|
|
237
255
|
|
|
256
|
+
// filterMenus(menus) {
|
|
257
|
+
// return menus
|
|
258
|
+
// .filter(item => item.label !== 'RBAC') // 过滤掉顶层 RBAC
|
|
259
|
+
// .map(item => {
|
|
260
|
+
// let newItem = { ...item };
|
|
261
|
+
// if (newItem.children) {
|
|
262
|
+
// // 过滤掉 children 里的 "资源大盘"
|
|
263
|
+
// newItem.children = newItem.children.filter(
|
|
264
|
+
// child => child.label !== '资源大盘'
|
|
265
|
+
// );
|
|
266
|
+
// // 递归处理剩下的 children
|
|
267
|
+
// newItem.children = filterMenus(newItem.children);
|
|
268
|
+
// }
|
|
269
|
+
// return newItem;
|
|
270
|
+
// });
|
|
271
|
+
// },
|
|
272
|
+
|
|
238
273
|
getProductsGroups(out, loadProducts, namespaceMode, productMap) {
|
|
239
274
|
const clusterId = this.$store.getters['clusterId'];
|
|
240
275
|
const currentType = this.$route.params.resource || '';
|
|
@@ -400,56 +435,58 @@ export default {
|
|
|
400
435
|
role="navigation"
|
|
401
436
|
:aria-label="t('nav.ariaLabel.sideNav')"
|
|
402
437
|
>
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
438
|
+
<div class="side-all-title">
|
|
439
|
+
{{ prod == 'Cloud' && currentCluster ? '控制台' : prod }}
|
|
440
|
+
</div>
|
|
441
|
+
|
|
406
442
|
<!-- Actual nav -->
|
|
407
443
|
<div class="nav">
|
|
408
444
|
<template
|
|
409
|
-
|
|
410
|
-
|
|
445
|
+
v-for="(g) in groups"
|
|
446
|
+
:key="g.name"
|
|
411
447
|
>
|
|
412
|
-
<
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
448
|
+
<template v-if="principal.loginName && principal.loginName !== 'admin' && g.label === 'RBAC'">
|
|
449
|
+
</template>
|
|
450
|
+
<template v-else>
|
|
451
|
+
<Group
|
|
452
|
+
ref="groups"
|
|
453
|
+
id-prefix=""
|
|
454
|
+
class="package"
|
|
455
|
+
:group="g"
|
|
456
|
+
:can-collapse="!g.isRoot"
|
|
457
|
+
:show-header="!g.isRoot"
|
|
458
|
+
@selected="groupSelected($event)"
|
|
459
|
+
@expand="groupSelected($event)"
|
|
460
|
+
/>
|
|
461
|
+
</template>
|
|
422
462
|
</template>
|
|
423
463
|
</div>
|
|
424
464
|
<!-- SideNav footer area (seems to be tied to harvester) -->
|
|
425
465
|
<!-- <div
|
|
426
466
|
v-if="showProductFooter"
|
|
427
467
|
class="footer"
|
|
428
|
-
>
|
|
429
|
-
|
|
430
|
-
<!-- <router-link
|
|
468
|
+
>
|
|
469
|
+
<router-link
|
|
431
470
|
:to="supportLink"
|
|
432
471
|
class="pull-right"
|
|
433
472
|
role="link"
|
|
434
473
|
:aria-label="t('nav.support', {hasSupport: true})"
|
|
435
474
|
>
|
|
436
475
|
{{ t('nav.support', {hasSupport: true}) }}
|
|
437
|
-
</router-link>
|
|
438
|
-
|
|
439
|
-
<!-- <span
|
|
476
|
+
</router-link>
|
|
477
|
+
<span
|
|
440
478
|
v-clean-tooltip="{content: displayVersion, placement: 'top'}"
|
|
441
479
|
class="clip version text-muted"
|
|
442
480
|
>
|
|
443
481
|
{{ displayVersion }}
|
|
444
|
-
</span>
|
|
482
|
+
</span>
|
|
445
483
|
|
|
446
|
-
|
|
447
|
-
<!-- <LocaleSelector
|
|
484
|
+
<LocaleSelector
|
|
448
485
|
v-if="isSingleProduct && hasMultipleLocales && !isStandaloneHarvester"
|
|
449
486
|
mode="login"
|
|
450
487
|
:show-icon="false"
|
|
451
|
-
/>
|
|
452
|
-
|
|
488
|
+
/>
|
|
489
|
+
</div> -->
|
|
453
490
|
<!-- SideNav footer alternative -->
|
|
454
491
|
<!-- <div
|
|
455
492
|
v-else
|
|
@@ -479,6 +516,7 @@ export default {
|
|
|
479
516
|
<style lang="scss" scoped>
|
|
480
517
|
.side-nav {
|
|
481
518
|
display: flex;
|
|
519
|
+
z-index: 10;
|
|
482
520
|
flex-direction: column;
|
|
483
521
|
.nav {
|
|
484
522
|
flex: 1;
|
|
@@ -498,9 +536,8 @@ export default {
|
|
|
498
536
|
|
|
499
537
|
A { padding-left: 0; }
|
|
500
538
|
}
|
|
501
|
-
:deep() A{
|
|
539
|
+
:deep() A:not(.menuRouterLink){
|
|
502
540
|
height: 50px;
|
|
503
|
-
background-color: #fff;
|
|
504
541
|
}
|
|
505
542
|
|
|
506
543
|
.tools {
|
|
@@ -274,6 +274,12 @@ export default {
|
|
|
274
274
|
class="content"
|
|
275
275
|
>
|
|
276
276
|
<span
|
|
277
|
+
v-if="(col.name === 'harvester' || col.name === 'explorer') && col.label === ' '"
|
|
278
|
+
>
|
|
279
|
+
管理
|
|
280
|
+
</span>
|
|
281
|
+
<span
|
|
282
|
+
v-if="!((col.name === 'harvester' || col.name === 'explorer') && col.label === ' ')"
|
|
277
283
|
v-clean-html="labelFor(col)"
|
|
278
284
|
class="text-no-break"
|
|
279
285
|
/>
|