dashboard-shell-shell 1.0.114 → 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.
@@ -77,11 +77,6 @@ export default {
77
77
  default: null,
78
78
  },
79
79
 
80
- groupBy: {
81
- type: String,
82
- default: null
83
- },
84
-
85
80
  namespaced: {
86
81
  type: Boolean,
87
82
  default: null, // Automatic from schema
@@ -117,11 +112,35 @@ export default {
117
112
  default: true,
118
113
  },
119
114
 
115
+ /**
116
+ * Field to group rows by, row[groupBy] must be something that can be a map key
117
+ */
118
+ groupBy: {
119
+ type: String,
120
+ default: null
121
+ },
122
+
123
+ /**
124
+ * Override any product based group options
125
+ */
126
+ groupOptions: {
127
+ type: Array,
128
+ default: null
129
+ },
130
+
120
131
  groupable: {
121
132
  type: Boolean,
122
133
  default: null, // Null: auto based on namespaced and type custom groupings
123
134
  },
124
135
 
136
+ /**
137
+ * If the current preference for group isn't applicable, or not set, use this instead
138
+ */
139
+ groupDefault: {
140
+ type: String,
141
+ default: DEFAULT_GROUP,
142
+ },
143
+
125
144
  groupTooltip: {
126
145
  type: String,
127
146
  default: 'resourceTable.groupBy.namespace',
@@ -188,11 +207,11 @@ export default {
188
207
  type: Number,
189
208
  default: null, // Default comes from the user preference
190
209
  },
191
-
192
- hideGroupingControls: {
193
- type: Boolean,
194
- default: false
195
- }
210
+ searchPlaceholder: {
211
+ // search框内的输入提示
212
+ type: String,
213
+ default: '名称'
214
+ },
196
215
  },
197
216
 
198
217
  data() {
@@ -328,8 +347,18 @@ export default {
328
347
  // If we are grouping by a custom group, it may specify that we hide a specific column
329
348
  const custom = this._listGroupMapped?.[this.group];
330
349
 
350
+ let hideColumn;
351
+
331
352
  if (custom?.hideColumn) {
332
- const idx = headers.findIndex((header) => header.name === custom.hideColumn);
353
+ hideColumn = custom.hideColumn;
354
+ } else {
355
+ const componentCustom = this.groupOptions?.find((go) => go.value === this.group);
356
+
357
+ hideColumn = componentCustom?.hideColumn;
358
+ }
359
+
360
+ if (hideColumn) {
361
+ const idx = headers.findIndex((header) => header.name === hideColumn);
333
362
 
334
363
  if ( idx >= 0 ) {
335
364
  headers.splice(idx, 1);
@@ -388,22 +417,24 @@ export default {
388
417
  group: {
389
418
  get() {
390
419
  // Check group is valid
391
- const exists = this.groupOptions.find((g) => g.value === this._group);
420
+ const exists = this._groupOptions.find((g) => g.value === this._group);
392
421
 
393
422
  if (!exists) {
394
423
  // Attempt to find the default option in available options...
395
424
  // if not use the first value in the options collection...
396
425
  // and if not that just fall back to the default
397
- if (this.groupOptions.find((g) => g.value === DEFAULT_GROUP)) {
398
- return DEFAULT_GROUP;
426
+ if (this._groupOptions.find((g) => g.value === this.groupDefault)) {
427
+ return this.groupDefault;
399
428
  }
400
429
 
401
- return this.groupOptions[0]?.value || DEFAULT_GROUP;
430
+ return this._groupOptions[0]?.value || this.groupDefault || DEFAULT_GROUP;
402
431
  }
403
432
 
404
433
  return this._group;
405
434
  },
406
435
  set(value) {
436
+ console.log('_group:===='+value);
437
+
407
438
  this._group = value;
408
439
  }
409
440
  },
@@ -413,9 +444,13 @@ export default {
413
444
  const namespaceGroupable = this.$store.getters['isMultipleNamespaces'] && this.isNamespaced;
414
445
  const customGroupable = !!this.options?.listGroups?.length;
415
446
 
416
- return namespaceGroupable || customGroupable;
447
+ // sshkey去掉分组按钮
448
+ if(this.parsedPagingParams.singularLabel === 'SSH Key' || this.parsedPagingParams.singularLabel === '负载均衡器'){
449
+ return false
417
450
  }
418
451
 
452
+ return namespaceGroupable || customGroupable || this.groupOptions?.length;
453
+ }
419
454
  return this.groupable || false;
420
455
  },
421
456
 
@@ -442,10 +477,20 @@ export default {
442
477
  return custom.field;
443
478
  }
444
479
 
480
+ const componentCustom = this.groupOptions?.find((go) => go.value === this.group);
481
+
482
+ if (componentCustom?.field) {
483
+ return componentCustom.field;
484
+ }
485
+
445
486
  return null;
446
487
  },
447
488
 
448
- groupOptions() {
489
+ _groupOptions() {
490
+ if (this.groupOptions) {
491
+ return this.groupOptions;
492
+ }
493
+
449
494
  // Ignore the defaults below, we have an override set of groups
450
495
  // REPLACE (instead of SUPPLEMENT) defaults with listGroups (given listGroupsWillOverride is true)
451
496
  if (this.options?.listGroupsWillOverride && !!this.options?.listGroups?.length) {
@@ -566,10 +611,11 @@ export default {
566
611
  :headers="_headers"
567
612
  :rows="filteredRows"
568
613
  :loading="loading"
614
+ :search-placeholder="searchPlaceholder"
569
615
  :alt-loading="altLoading"
570
616
  :group-by="computedGroupBy"
571
617
  :group="group"
572
- :group-options="groupOptions"
618
+ :group-options="_groupOptions"
573
619
  :search="search"
574
620
  :paging="true"
575
621
  :paging-params="parsedPagingParams"
@@ -596,14 +642,14 @@ export default {
596
642
  @enter="handleEnterKeyPress"
597
643
  >
598
644
  <template
599
- v-if="!hideGroupingControls && showGrouping"
645
+ v-if="showGrouping && _groupOptions.length > 1"
600
646
  #header-middle
601
647
  >
602
648
  <slot name="more-header-middle" />
603
649
 
604
650
  <ButtonGroup
605
651
  v-model:value="group"
606
- :options="groupOptions"
652
+ :options="_groupOptions"
607
653
  />
608
654
  </template>
609
655
 
@@ -639,11 +685,11 @@ export default {
639
685
  class="hide"
640
686
  @shortkey="keyAction('edit')"
641
687
  />
642
- <button
688
+ <!-- <button
643
689
  v-shortkey.once="['y']"
644
690
  class="hide"
645
691
  @shortkey="keyAction('yaml')"
646
- />
692
+ /> -->
647
693
  <button
648
694
  v-if="_showBulkActions"
649
695
  v-shortkey.once="['del']"
@@ -20,6 +20,7 @@ import { TYPE_MODES } from '@shell/store/type-map';
20
20
  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
+ import { cloud2harvesterhci, harvester2cloud } from '@shell/utils/router';
23
24
 
24
25
  export default {
25
26
  name: 'SideNav',
@@ -154,7 +155,7 @@ export default {
154
155
  },
155
156
 
156
157
  isVirtualProduct() {
157
- return this.rootProduct.name === HARVESTER;
158
+ return this.rootProduct.name === harvester2cloud(HARVESTER);
158
159
  },
159
160
 
160
161
  allNavLinks() {
@@ -236,7 +237,7 @@ export default {
236
237
 
237
238
  getProductsGroups(out, loadProducts, namespaceMode, productMap) {
238
239
  const clusterId = this.$store.getters['clusterId'];
239
- const currentType = this.$route.params.resource || '';
240
+ const currentType = cloud2harvesterhci(this.$route.params.resource) || '';
240
241
 
241
242
  for ( const productId of loadProducts ) {
242
243
  const modes = [TYPE_MODES.BASIC];
@@ -394,7 +395,14 @@ export default {
394
395
  </script>
395
396
 
396
397
  <template>
397
- <nav class="side-nav">
398
+ <nav
399
+ class="side-nav"
400
+ role="navigation"
401
+ :aria-label="t('nav.ariaLabel.sideNav')"
402
+ >
403
+ <div class="side-all-title">
404
+ 控制台
405
+ </div>
398
406
  <!-- Actual nav -->
399
407
  <div class="nav">
400
408
  <template
@@ -414,36 +422,36 @@ export default {
414
422
  </template>
415
423
  </div>
416
424
  <!-- SideNav footer area (seems to be tied to harvester) -->
417
- <div
425
+ <!-- <div
418
426
  v-if="showProductFooter"
419
427
  class="footer"
420
- >
428
+ > -->
421
429
  <!-- support link -->
422
- <router-link
430
+ <!-- <router-link
423
431
  :to="supportLink"
424
432
  class="pull-right"
425
433
  role="link"
426
434
  :aria-label="t('nav.support', {hasSupport: true})"
427
435
  >
428
436
  {{ t('nav.support', {hasSupport: true}) }}
429
- </router-link>
437
+ </router-link> -->
430
438
  <!-- version number -->
431
- <span
439
+ <!-- <span
432
440
  v-clean-tooltip="{content: displayVersion, placement: 'top'}"
433
441
  class="clip version text-muted"
434
442
  >
435
443
  {{ displayVersion }}
436
- </span>
444
+ </span> -->
437
445
 
438
446
  <!-- locale selector -->
439
- <LocaleSelector
447
+ <!-- <LocaleSelector
440
448
  v-if="isSingleProduct && hasMultipleLocales && !isStandaloneHarvester"
441
449
  mode="login"
442
450
  :show-icon="false"
443
- />
444
- </div>
451
+ /> -->
452
+ <!-- </div> -->
445
453
  <!-- SideNav footer alternative -->
446
- <div
454
+ <!-- <div
447
455
  v-else
448
456
  class="version text-muted flex"
449
457
  >
@@ -464,7 +472,7 @@ export default {
464
472
  (Harvester-{{ harvesterVersion }})
465
473
  </span>
466
474
  </template>
467
- </div>
475
+ </div> -->
468
476
  </nav>
469
477
  </template>
470
478
 
@@ -490,6 +498,10 @@ export default {
490
498
 
491
499
  A { padding-left: 0; }
492
500
  }
501
+ :deep() A{
502
+ height: 50px;
503
+ background-color: #fff;
504
+ }
493
505
 
494
506
  .tools {
495
507
  display: flex;
@@ -565,4 +577,13 @@ export default {
565
577
  display: flex;
566
578
  }
567
579
 
580
+
581
+ .side-all-title{
582
+ height: 50px;
583
+ line-height: 50px;
584
+ font-size: 16px;
585
+ color: #7f7f7f;
586
+ padding-left: 21px;
587
+ font-weight: bold;
588
+ }
568
589
  </style>
@@ -237,7 +237,7 @@ export default {
237
237
  v-if="subExpandColumn"
238
238
  :width="expandWidth"
239
239
  />
240
- <th
240
+ <!-- <th
241
241
  v-for="(col) in columns"
242
242
  v-show="!hasAdvancedFiltering || (hasAdvancedFiltering && col.isColVisible)"
243
243
  :key="col.name"
@@ -250,6 +250,20 @@ export default {
250
250
  @click.prevent="changeSort($event, col)"
251
251
  @keyup.enter="changeSort($event, col)"
252
252
  @keyup.space="changeSort($event, col)"
253
+ > -->
254
+ <th
255
+ v-for="(col) in columns"
256
+ v-show="!hasAdvancedFiltering || (hasAdvancedFiltering && col.isColVisible)"
257
+ :key="col.name"
258
+ :align="'left'"
259
+ :width="col.width"
260
+ :class="{ sortable: col.sort, [col.breakpoint]: !!col.breakpoint}"
261
+ :tabindex="col.sort ? 0 : -1"
262
+ class="sortable-table-head-element"
263
+ :aria-sort="ariaSort(col)"
264
+ @click.prevent="changeSort($event, col)"
265
+ @keyup.enter="changeSort($event, col)"
266
+ @keyup.space="changeSort($event, col)"
253
267
  >
254
268
  <div
255
269
  class="table-header-container"
@@ -352,10 +366,17 @@ export default {
352
366
  </div>
353
367
  </div>
354
368
  </th>
369
+ <!-- <th
370
+ v-else-if="rowActions"
371
+ :width="rowActionsWidth"
372
+ /> -->
355
373
  <th
356
374
  v-else-if="rowActions"
357
375
  :width="rowActionsWidth"
358
- />
376
+ :align="'left'"
377
+ >
378
+ 操作
379
+ </th>
359
380
  </tr>
360
381
  </thead>
361
382
  </template>
@@ -474,6 +495,8 @@ export default {
474
495
 
475
496
  &:last-child {
476
497
  padding-right: 10px;
498
+ padding-left: 12px;
499
+
477
500
  }
478
501
 
479
502
  &:not(.sortable) > SPAN {