dashboard-shell-shell 3.0.5-test.1 → 3.0.5-test.10

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.
Files changed (50) hide show
  1. package/assets/styles/base/_variables.scss +3 -3
  2. package/assets/styles/global/_button.scss +7 -7
  3. package/assets/styles/global/_tooltip.scss +4 -4
  4. package/assets/styles/themes/_light.scss +3 -1
  5. package/assets/translations/zh-hans.yaml +76 -0
  6. package/components/ActionDropdown.vue +1 -1
  7. package/components/CopyToClipboard.vue +15 -0
  8. package/components/Drawer/Chrome.vue +2 -2
  9. package/components/Drawer/ResourceDetailDrawer/ConfigTab.vue +22 -22
  10. package/components/Drawer/ResourceDetailDrawer/YamlTab.vue +1 -1
  11. package/components/Drawer/ResourceDetailDrawer/index.vue +2 -1
  12. package/components/ExplorerMembers.vue +18 -3
  13. package/components/PodSecurityAdmission.vue +1 -1
  14. package/components/Resource/Detail/Metadata/IdentifyingInformation/index.vue +1 -3
  15. package/components/Resource/Detail/Metadata/KeyValue.vue +8 -4
  16. package/components/Resource/Detail/Metadata/index.vue +3 -1
  17. package/components/Resource/Detail/TitleBar/Title.vue +4 -3
  18. package/components/Resource/Detail/TitleBar/Top.vue +2 -0
  19. package/components/Resource/Detail/TitleBar/index.vue +109 -24
  20. package/components/ResourceDetail/Masthead/legacy.vue +235 -164
  21. package/components/ResourceDetail/legacy.vue +29 -13
  22. package/components/ResourceList/Masthead.vue +22 -14
  23. package/components/SortableTable/index.vue +2 -2
  24. package/components/Tabbed/Tab.vue +1 -1
  25. package/components/Tabbed/index.vue +51 -32
  26. package/components/auth/Principal.vue +35 -11
  27. package/components/breadcrumb/index.vue +316 -0
  28. package/components/form/LabeledSelect.vue +3 -2
  29. package/components/form/NameNsDescription.vue +5 -5
  30. package/components/form/Taints.vue +2 -1
  31. package/components/form/WorkloadPorts.vue +143 -123
  32. package/components/nav/Header.vue +3 -4
  33. package/components/nav/NamespaceFilter.vue +1 -2
  34. package/edit/workload/index.vue +3 -3
  35. package/package.json +1 -1
  36. package/pages/account/index.vue +25 -79
  37. package/pages/c/_cluster/auth/roles/index.vue +38 -5
  38. package/pkg/tsconfig.json +9 -9
  39. package/pkg/vue.config.js +2 -2
  40. package/plugins/dashboard-store/resource-class.js +28 -27
  41. package/rancher-components/BadgeState/BadgeState.vue +33 -52
  42. package/rancher-components/Banner/Banner.vue +2 -2
  43. package/rancher-components/RcDropdown/RcDropdownMenu.vue +8 -7
  44. package/scripts/publish-shell.sh +1 -1
  45. package/store/i18n.js +3 -0
  46. package/store/type-map.js +1 -1
  47. package/types/shell/index.d.ts +4 -30
  48. package/utils/error.js +3 -1
  49. package/utils/errorTranslate.json +15 -0
  50. package/vue.config.js +5 -5
@@ -6,13 +6,14 @@ import {
6
6
  _VIEW, _EDIT, _CLONE, _IMPORT, _STAGE, _CREATE,
7
7
  AS, _YAML, _DETAIL, _CONFIG, _GRAPH, PREVIEW, MODE,
8
8
  } from '@shell/config/query-params';
9
- import { SCHEMA } from '@shell/config/types';
9
+ import { FLEET, SCHEMA } from '@shell/config/types';
10
10
  import { createYaml } from '@shell/utils/create-yaml';
11
11
  import Masthead from '@shell/components/ResourceDetail/Masthead';
12
12
  import DetailTop from '@shell/components/DetailTop';
13
13
  import { clone, diff } from '@shell/utils/object';
14
14
  import IconMessage from '@shell/components/IconMessage';
15
15
  import ForceDirectedTreeChart from '@shell/components/ForceDirectedTreeChart';
16
+ import { checkSchemasForFindAllHash } from '@shell/utils/auth';
16
17
  import { stringify } from '@shell/utils/error';
17
18
  import { Banner } from '@components/Banner';
18
19
 
@@ -171,6 +172,28 @@ export default {
171
172
  yaml = createYaml(schemas, resourceType, data);
172
173
  }
173
174
  } else {
175
+ if ( as === _GRAPH ) {
176
+ const graphSchema = await checkSchemasForFindAllHash({
177
+ cluster: {
178
+ inStoreType: 'management',
179
+ type: FLEET.CLUSTER
180
+ },
181
+ bundle: {
182
+ inStoreType: 'management',
183
+ type: FLEET.BUNDLE,
184
+ opt: { excludeFields: ['metadata.managedFields', 'spec.resources'] },
185
+ },
186
+
187
+ bundleDeployment: {
188
+ inStoreType: 'management',
189
+ type: FLEET.BUNDLE_DEPLOYMENT
190
+ }
191
+
192
+ }, this.$store);
193
+
194
+ this.canViewChart = graphSchema.cluster && graphSchema.bundle && graphSchema.bundleDeployment;
195
+ }
196
+
174
197
  let fqid = id;
175
198
 
176
199
  if ( schema.attributes?.namespaced && namespace ) {
@@ -273,6 +296,7 @@ export default {
273
296
  value: null,
274
297
  model: null,
275
298
  notFound: null,
299
+ canViewChart: true,
276
300
  canViewYaml: null,
277
301
  errors: []
278
302
  };
@@ -451,17 +475,16 @@ export default {
451
475
  :has-graph="hasGraph"
452
476
  :has-detail="hasCustomDetail"
453
477
  :has-edit="hasCustomEdit"
454
- :can-view-yaml="canViewYaml"
455
478
  :resource-subtype="resourceSubtype"
456
479
  :parent-route-override="parentRouteOverride"
457
480
  :store-override="storeOverride"
458
481
 
459
482
  :isManuallyHide="false"
460
483
  >
461
- <DetailTop
484
+ <!-- <DetailTop
462
485
  v-if="isView && isDetail"
463
486
  :value="liveModel"
464
- />
487
+ /> -->
465
488
  </Masthead>
466
489
  <div
467
490
  v-if="hasErrors"
@@ -481,7 +504,7 @@ export default {
481
504
  </div>
482
505
 
483
506
  <ForceDirectedTreeChart
484
- v-if="isGraph"
507
+ v-if="isGraph && canViewChart"
485
508
  :data="chartData"
486
509
  :fdc-config="getGraphConfig"
487
510
  />
@@ -495,9 +518,8 @@ export default {
495
518
  :offer-preview="offerPreview"
496
519
  :done-route="doneRoute"
497
520
  :done-override="value ? value.doneOverride : null"
498
- :show-errors="false"
499
521
  @update:value="$emit('input', $event)"
500
- @error="onYamlError"
522
+ @error="e=>errors.push(e)"
501
523
  />
502
524
 
503
525
  <component
@@ -555,10 +577,4 @@ export default {
555
577
  flex-direction: column;
556
578
  flex-grow: 1;
557
579
  }
558
- .cru__errors {
559
- position: sticky;
560
- top: 0;
561
- z-index: 1;
562
- background-color: var(--header-bg);
563
- }
564
580
  </style>
@@ -154,21 +154,18 @@ export default {
154
154
  return this.$store.getters['i18n/t'](`typeDescription."${ key.toLowerCase() }"`);
155
155
  },
156
156
  demoDisplay() {
157
+
158
+ const product = this.$store.getters['productId'];
159
+ const productId = this.$store.getters['type-map/groupForBasicType'](this.$store.getters['productId'], this._createLocation.params.resource);
160
+ const parts = productId?.split('::');
161
+ const newString = 'root';
162
+
157
163
  // const product = this.$store.getters['productId'];
158
164
  // const productId = this.$store.getters['type-map/groupForBasicType'](this.$store.getters['productId'], this._createLocation.params.resource);
159
165
 
160
166
  // const parts = productId?.split('::') || [];
161
167
  // const newString = 'root';
162
168
 
163
- // if (!parts.includes(newString)) {
164
- // parts.unshift(newString); // 将字符串添加到数组第一位
165
- // }
166
-
167
- // const partsEn = parts.map((item) => {
168
- // return this.$store.getters['i18n/t'](`typeLabel."${ item.toLowerCase() }"`);
169
- // });
170
-
171
- // return partsEn;
172
169
 
173
170
  const breadcrumbList = {
174
171
  'harvesterhci.io.management.cluster': {
@@ -198,9 +195,19 @@ export default {
198
195
  if (breadcrumbList[resourcePath] && Object.keys(breadcrumbList[resourcePath]).length > 0) {
199
196
  breadcrumb.push(...breadcrumbList[resourcePath].bread)
200
197
  this.description = breadcrumbList[resourcePath].description
198
+ return breadcrumb
199
+ } else {
200
+ if (!parts?.includes(newString)) {
201
+ parts?.unshift(newString); // 将字符串添加到数组第一位
202
+ }
203
+
204
+ const partsEn = parts?.map((item) => {
205
+ return this.$store.getters['i18n/t'](`typeLabel."${ item.toLowerCase() }"`);
206
+ });
207
+
208
+ return partsEn;
201
209
  }
202
210
 
203
- return breadcrumb
204
211
  },
205
212
 
206
213
  _isYamlCreatable() {
@@ -253,6 +260,9 @@ export default {
253
260
  this.resizeObserver = new ResizeObserver((entries) => {
254
261
  for (const entry of entries) {
255
262
  const width = entry?.contentRect?.width && entry.contentRect.width > 0 ? entry.contentRect.width + 10 : 0
263
+
264
+ console.log(width, ' width----------------------------')
265
+
256
266
  this.$store.commit('type-map/setActionsWidth', width)
257
267
  }
258
268
  })
@@ -265,7 +275,6 @@ export default {
265
275
  </script>
266
276
 
267
277
  <template>
268
- <!-- 顶部 header,带有子标题(subheader)样式类 -->
269
278
  <header class="with-subheader">
270
279
  <div style="display: flex;width: 100%;">
271
280
  <div style="flex: 1;">
@@ -316,7 +325,7 @@ export default {
316
325
  <!-- 操作按钮区域 -->
317
326
  <div
318
327
  ref="actionsContainer"
319
- v-if="!(tabList.includes(_typeDisplay)) && mainButtonVisible"
328
+ v-if="!(tabList.includes(_typeDisplay))"
320
329
  class="actions-container actions-positioning"
321
330
  style="min-height: 32px;align-self: flex-end;"
322
331
  >
@@ -354,7 +363,6 @@ export default {
354
363
  </template>
355
364
 
356
365
  <style lang="scss" scoped>
357
-
358
366
  .title {
359
367
  /* align-items: center;
360
368
  display: flex; */
@@ -411,6 +419,6 @@ export default {
411
419
  .actions-positioning {
412
420
  position: absolute;
413
421
  bottom: -48px;
414
- z-index: 20;
422
+ z-index: 15;
415
423
  }
416
424
  </style>
@@ -2186,7 +2186,7 @@ export default {
2186
2186
  border-collapse: collapse;
2187
2187
  min-width: 400px;
2188
2188
  border-radius: 5px 5px 0 0;
2189
- border-bottom: 1px solid var(--border);
2189
+ border-bottom: 1px solid var(--border) !important;
2190
2190
  /* outline: 1px solid var(--border); */
2191
2191
  background: var(--sortable-table-bg);
2192
2192
  border-radius: 4px;
@@ -2664,7 +2664,7 @@ export default {
2664
2664
  .sort-table-div{
2665
2665
  width:100%;
2666
2666
  white-space:nowrap;
2667
- overflow-x: auto;
2667
+ // overflow-x: auto;
2668
2668
  }
2669
2669
 
2670
2670
  /* 滚动阴影左边 */
@@ -118,7 +118,7 @@ export default {
118
118
  .tab-header {
119
119
  display: flex;
120
120
  justify-content: space-between;
121
- // margin-bottom: 15px;
121
+ /* margin-bottom: 15px; */
122
122
  align-items: center;
123
123
 
124
124
  h2 {
@@ -293,7 +293,7 @@ export default {
293
293
  :aria-controls="tab.name"
294
294
  :aria-selected="tab.active"
295
295
  :aria-label="tab.labelDisplay || ''"
296
- role="tab"
296
+ role="tab"
297
297
  >
298
298
  <span>{{ tab.labelDisplay }}</span>
299
299
  <span
@@ -382,22 +382,14 @@ export default {
382
382
  margin: 0;
383
383
  padding: 0;
384
384
 
385
- &:focus-visible {
386
- outline: none;
387
-
388
- .tab.active {
389
- @include focus-outline;
390
- outline-offset: -2px;
391
- }
392
- }
393
-
394
385
  &.horizontal {
395
- border-bottom: solid 1px var(--border);
386
+ border: solid thin var(--border);
387
+ border-bottom: 0;
396
388
  display: flex;
397
389
  flex-direction: row;
398
390
 
399
391
  + .tab-container {
400
- // border: solid thin var(--border);
392
+ border: solid thin var(--border);
401
393
  }
402
394
 
403
395
  .tab.active {
@@ -405,13 +397,18 @@ export default {
405
397
  }
406
398
  }
407
399
 
408
- &:focus .tab.active a span {
409
- text-decoration: underline;
400
+ &:focus {
401
+ outline: none;
402
+
403
+ & .tab.active a span {
404
+ text-decoration: none;
405
+ }
410
406
  }
411
407
 
412
408
  .tab {
413
409
  position: relative;
414
410
  float: left;
411
+ padding: 0 8px 0 0;
415
412
  cursor: pointer;
416
413
 
417
414
  A {
@@ -422,7 +419,7 @@ export default {
422
419
  &:hover {
423
420
  text-decoration: none;
424
421
  span {
425
- text-decoration: underline;
422
+ text-decoration: none;
426
423
  }
427
424
  }
428
425
  }
@@ -461,7 +458,7 @@ export default {
461
458
  }
462
459
 
463
460
  .tab-container {
464
- padding: 20px 0;
461
+ padding: 20px;
465
462
 
466
463
  &.no-content {
467
464
  padding: 0 0 3px 0;
@@ -492,49 +489,71 @@ export default {
492
489
 
493
490
  .side-tabs {
494
491
  display: flex;
495
- border: 1px solid var(--border);
496
-
492
+ flex-direction: column;
493
+ /* box-shadow: 0 0 20px var(--shadow);
494
+ border-radius: calc(var(--border-radius) * 2);
495
+ background-color: var(--tabbed-sidebar-bg); */
496
+ margin: 0px -20px;
497
497
  .tab-container {
498
498
  padding: 20px;
499
499
  }
500
500
 
501
501
  & .tabs {
502
- width: $sideways-tabs-width;
503
- min-width: $sideways-tabs-width;
502
+ /* width: $sideways-tabs-width; */
503
+ /* min-width: $sideways-tabs-width; */
504
504
  display: flex;
505
- flex: 1 0;
506
- flex-direction: column;
507
- border-right: 1px solid var(--border);
505
+ border-bottom:1px solid #d7d7d7;
506
+ padding: 0 0 0 20px;
507
+ /* flex: 1 0; */
508
+ /* flex-direction: column; */
508
509
 
509
510
  // &.vertical {
510
511
  // .tab.active {
511
512
  // background-color: var(--tabbed-container-bg);
512
513
  // }
513
514
  // }
514
-
515
515
  & .tab {
516
- min-width: 130px !important;
516
+ /* width: 100%; */
517
+ min-width: 120px;
518
+ height: 36px;
519
+ /* border-top: solid 5px transparent; */
520
+ display: flex;
521
+ justify-content: center;
522
+ padding: 8px 16px;
523
+ box-sizing: border-box;
524
+ border: 1px solid #d7d7d7;
525
+ border-bottom: 0px;
526
+ margin-right: 5px;
527
+ border-radius: 2px;
517
528
 
518
529
  &.toggle A {
519
530
  color: var(--primary);
531
+ padding: 0px;
520
532
  }
521
533
 
522
534
  A {
523
- color: var(--primary);
535
+ color: var(--input-label);
536
+ padding: 0px;
524
537
  }
525
538
 
526
539
  &.active {
527
- background-color: var(--nav-active);
540
+ background-color: var(--body-bg);
541
+ border-top: solid 2px var(--primary);
542
+ position: relative;
543
+ &.active::before{
544
+ position: absolute;
545
+ right: 0;
546
+ left: 0;
547
+ top: 34px;
548
+ border-bottom: 1px solid #fff;
549
+ content: '';
528
550
 
551
+ }
529
552
  & A {
530
553
  color: var(--primary);
531
554
  }
532
555
  }
533
556
 
534
- :hover {
535
- background-color: var(--nav-active);
536
- }
537
-
538
557
  &.disabled {
539
558
  background-color: var(--disabled-bg);
540
559
 
@@ -575,7 +594,7 @@ export default {
575
594
  &
576
595
 
577
596
  .tab-container {
578
- width: calc(100% - #{$sideways-tabs-width});
597
+ /* width: calc(100% - #{$sideways-tabs-width}); */
579
598
  flex-grow: 1;
580
599
  background-color: var(--body-bg);
581
600
  }
@@ -16,6 +16,10 @@ export default {
16
16
  showLabels: {
17
17
  type: Boolean,
18
18
  default: false,
19
+ },
20
+ isShowPass: {
21
+ type: Boolean,
22
+ default: false,
19
23
  }
20
24
  },
21
25
 
@@ -88,7 +92,7 @@ export default {
88
92
  <template v-else-if="principal">
89
93
  <div class="avatar">
90
94
  <img
91
- :src="principal.avatarSrc"
95
+ src="@shell/assets/images/user.png"
92
96
  :class="{'round': principal.roundAvatar}"
93
97
  :alt="t('principal.alt.avatar')"
94
98
  >
@@ -98,11 +102,19 @@ export default {
98
102
  class="name"
99
103
  >
100
104
  <table>
101
- <tbody>
102
- <tr><th>{{ t('principal.name') }}: </th><td>{{ principal.name || principal.loginName }}</td></tr>
103
- <tr><th>{{ t('principal.loginName') }}: </th><td>{{ principal.loginName }}</td></tr>
104
- <tr><th>{{ t('principal.type') }}: </th><td>{{ principal.displayType }}</td></tr>
105
- </tbody>
105
+ <tr class="mb-10">
106
+ <td>{{ t('principal.name') }}: </td><td>{{ principal.name || principal.loginName }}</td>
107
+ </tr>
108
+ <tr class="mb-10">
109
+ <td>{{ t('principal.loginName') }}: </td><td>{{ principal.loginName }}</td>
110
+ </tr>
111
+ <tr
112
+ v-if="isShowPass"
113
+ class="mb-10"
114
+ >
115
+ <td>修改密码: </td><td>****** <slot name="edit" /></td>
116
+ </tr>
117
+ <tr><td>{{ t('principal.type') }}: </td><td>{{ principal.displayType }}</td></tr>
106
118
  </table>
107
119
  </div>
108
120
  <template v-else>
@@ -172,23 +184,35 @@ export default {
172
184
  }
173
185
 
174
186
  &.showLabels {
175
- grid-template-areas:
187
+ /* grid-template-areas:
176
188
  "avatar name";
177
189
  grid-template-columns: 60px auto;
178
190
  grid-template-rows: 60px;
179
- column-gap: 0;
191
+ column-gap: 0; */
192
+ display: flex;
193
+ column-gap:0;
180
194
  .name {
195
+ display: flex;
181
196
  line-height: unset;
182
197
  }
183
-
198
+ table tr {
199
+ display: block;
200
+ }
184
201
  table tr td:not(:first-of-type) {
185
202
  padding-left: 10px;
186
203
  }
204
+ table tr td:not(:last-of-type) {
205
+ width: 100px;
206
+ }
187
207
  }
188
208
 
189
209
  .avatar {
190
- grid-area: avatar;
191
- text-align: center;
210
+ /* grid-area: avatar;
211
+ text-align: center; */
212
+ width: 287px;
213
+ display: flex;
214
+ justify-content: center;
215
+ align-items: center;
192
216
 
193
217
  DIV.empty {
194
218
  border: 1px solid var(--border);