dashboard-shell-shell 1.0.114 → 1.0.116
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/ResourceTable.vue +68 -22
- package/components/SideNav.vue +3 -0
- package/components/SortableTable/THead.vue +25 -2
- package/components/SortableTable/index.vue +763 -356
- package/components/SortableTable/paging.js +36 -28
- package/components/nav/Group.vue +45 -25
- package/components/nav/Type.vue +2 -2
- package/package.json +1 -1
- package/public/index.html +3 -3
|
@@ -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
|
-
|
|
193
|
-
type:
|
|
194
|
-
default:
|
|
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
|
-
|
|
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.
|
|
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.
|
|
398
|
-
return
|
|
426
|
+
if (this._groupOptions.find((g) => g.value === this.groupDefault)) {
|
|
427
|
+
return this.groupDefault;
|
|
399
428
|
}
|
|
400
429
|
|
|
401
|
-
return this.
|
|
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
|
-
|
|
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
|
-
|
|
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="
|
|
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="
|
|
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="
|
|
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']"
|
package/components/SideNav.vue
CHANGED
|
@@ -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 {
|