@rancher/shell 0.1.21 → 0.2.1
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/styles/global/_button.scss +1 -0
- package/assets/translations/en-us.yaml +48 -6
- package/assets/translations/zh-hans.yaml +18 -0
- package/components/HarvesterServiceAddOnConfig.vue +10 -10
- package/components/ResourceList/index.vue +34 -14
- package/components/ResourceTable.vue +19 -0
- package/components/SortableTable/THead.vue +311 -70
- package/components/SortableTable/advanced-filtering.js +272 -0
- package/components/SortableTable/filtering.js +90 -29
- package/components/SortableTable/index.vue +474 -271
- package/components/form/WorkloadPorts.vue +2 -2
- package/config/product/settings.js +1 -0
- package/config/product/uiplugins.js +1 -0
- package/config/uiplugins.js +13 -0
- package/creators/app/init +2 -2
- package/creators/app/package.json +1 -1
- package/creators/pkg/package.json +1 -1
- package/detail/provisioning.cattle.io.cluster.vue +1 -1
- package/edit/provisioning.cattle.io.cluster/ACE.vue +2 -1
- package/edit/provisioning.cattle.io.cluster/DrainOptions.vue +0 -1
- package/edit/provisioning.cattle.io.cluster/rke2.vue +25 -24
- package/edit/service.vue +1 -1
- package/models/management.cattle.io.cluster.js +9 -1
- package/package.json +1 -1
- package/pages/c/_cluster/apps/charts/install.vue +119 -31
- package/pages/c/_cluster/uiplugins/InstallDialog.vue +1 -1
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +5 -2
- package/pages/c/_cluster/uiplugins/UninstallDialog.vue +1 -1
- package/pages/c/_cluster/uiplugins/index.vue +48 -11
- package/promptRemove/mixin/roleDeletionCheck.js +15 -1
- package/scripts/record-deps.js +3 -3
- package/store/type-map.js +2 -0
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { Checkbox } from '@components/Form/Checkbox';
|
|
3
3
|
import { SOME, NONE } from './selection';
|
|
4
|
+
import { AUTO, CENTER, fitOnScreen } from '@shell/utils/position';
|
|
5
|
+
import LabeledSelect from '@shell/components/form/LabeledSelect';
|
|
4
6
|
|
|
5
7
|
export default {
|
|
6
|
-
components: { Checkbox },
|
|
8
|
+
components: { Checkbox, LabeledSelect },
|
|
7
9
|
props: {
|
|
8
10
|
columns: {
|
|
9
11
|
type: Array,
|
|
@@ -17,10 +19,26 @@ export default {
|
|
|
17
19
|
type: String,
|
|
18
20
|
default: ''
|
|
19
21
|
},
|
|
22
|
+
group: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: ''
|
|
25
|
+
},
|
|
26
|
+
groupOptions: {
|
|
27
|
+
type: Array,
|
|
28
|
+
default: () => []
|
|
29
|
+
},
|
|
20
30
|
descending: {
|
|
21
31
|
type: Boolean,
|
|
22
32
|
required: true
|
|
23
33
|
},
|
|
34
|
+
hasAdvancedFiltering: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
required: false
|
|
37
|
+
},
|
|
38
|
+
tableColsOptions: {
|
|
39
|
+
type: Array,
|
|
40
|
+
default: () => [],
|
|
41
|
+
},
|
|
24
42
|
tableActions: {
|
|
25
43
|
type: Boolean,
|
|
26
44
|
required: true,
|
|
@@ -67,6 +85,31 @@ export default {
|
|
|
67
85
|
},
|
|
68
86
|
},
|
|
69
87
|
|
|
88
|
+
data() {
|
|
89
|
+
return {
|
|
90
|
+
tableColsOptionsVisibility: false,
|
|
91
|
+
tableColsMenuPosition: null
|
|
92
|
+
};
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
watch: {
|
|
96
|
+
advancedFilteringValues() {
|
|
97
|
+
// passing different dummy args to make sure update is triggered
|
|
98
|
+
this.watcherUpdateLiveAndDelayed(true, false);
|
|
99
|
+
},
|
|
100
|
+
tableColsOptionsVisibility(neu) {
|
|
101
|
+
if (neu) {
|
|
102
|
+
// check if user clicked outside the table cols options box
|
|
103
|
+
window.addEventListener('click', this.onClickOutside);
|
|
104
|
+
|
|
105
|
+
// update filtering options and toggable cols every time dropdown is open
|
|
106
|
+
this.$emit('update-cols-options');
|
|
107
|
+
} else {
|
|
108
|
+
// unregister click event
|
|
109
|
+
window.removeEventListener('click', this.onClickOutside);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
},
|
|
70
113
|
computed: {
|
|
71
114
|
isAll: {
|
|
72
115
|
get() {
|
|
@@ -77,10 +120,22 @@ export default {
|
|
|
77
120
|
this.$emit('on-toggle-all', value);
|
|
78
121
|
}
|
|
79
122
|
},
|
|
123
|
+
hasAdvGrouping() {
|
|
124
|
+
return this.group?.length && this.groupOptions?.length;
|
|
125
|
+
},
|
|
126
|
+
advGroup: {
|
|
127
|
+
get() {
|
|
128
|
+
return this.group || this.advGroup;
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
set(val) {
|
|
132
|
+
this.$emit('group-value-change', val);
|
|
133
|
+
}
|
|
134
|
+
},
|
|
80
135
|
|
|
81
136
|
isIndeterminate() {
|
|
82
137
|
return this.howMuchSelected === SOME;
|
|
83
|
-
}
|
|
138
|
+
},
|
|
84
139
|
},
|
|
85
140
|
|
|
86
141
|
methods: {
|
|
@@ -101,7 +156,43 @@ export default {
|
|
|
101
156
|
isCurrent(col) {
|
|
102
157
|
return col.name === this.sortBy;
|
|
103
158
|
},
|
|
159
|
+
|
|
160
|
+
tableColsOptionsClick(ev) {
|
|
161
|
+
// set menu position
|
|
162
|
+
const menu = document.querySelector('.table-options-container');
|
|
163
|
+
const elem = document.querySelector('.table-options-btn');
|
|
164
|
+
|
|
165
|
+
if (!this.tableColsMenuPosition) {
|
|
166
|
+
this.tableColsMenuPosition = fitOnScreen(menu, ev || elem, {
|
|
167
|
+
overlapX: true,
|
|
168
|
+
fudgeX: 26,
|
|
169
|
+
fudgeY: -22,
|
|
170
|
+
positionX: CENTER,
|
|
171
|
+
positionY: AUTO,
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// toggle visibility
|
|
176
|
+
this.tableColsOptionsVisibility = !this.tableColsOptionsVisibility;
|
|
177
|
+
},
|
|
178
|
+
|
|
179
|
+
onClickOutside(event) {
|
|
180
|
+
const tableOpts = this.$refs['table-options'];
|
|
181
|
+
|
|
182
|
+
if (!tableOpts || tableOpts.contains(event.target)) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
this.tableColsOptionsVisibility = false;
|
|
186
|
+
},
|
|
187
|
+
|
|
188
|
+
tableOptionsCheckbox(value, label) {
|
|
189
|
+
this.$emit('col-visibility-change', {
|
|
190
|
+
label,
|
|
191
|
+
value
|
|
192
|
+
});
|
|
193
|
+
},
|
|
104
194
|
}
|
|
195
|
+
|
|
105
196
|
};
|
|
106
197
|
</script>
|
|
107
198
|
|
|
@@ -119,103 +210,253 @@ export default {
|
|
|
119
210
|
<th v-if="subExpandColumn" :width="expandWidth"></th>
|
|
120
211
|
<th
|
|
121
212
|
v-for="col in columns"
|
|
213
|
+
v-show="!hasAdvancedFiltering || (hasAdvancedFiltering && col.isColVisible)"
|
|
122
214
|
:key="col.name"
|
|
123
215
|
:align="col.align || 'left'"
|
|
124
216
|
:width="col.width"
|
|
125
217
|
:class="{ sortable: col.sort, [col.breakpoint]: !!col.breakpoint}"
|
|
126
218
|
@click.prevent="changeSort($event, col)"
|
|
127
219
|
>
|
|
128
|
-
<
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
<
|
|
220
|
+
<div
|
|
221
|
+
class="table-header-container"
|
|
222
|
+
:class="{ 'not-filterable': hasAdvancedFiltering && !col.isFilter }"
|
|
223
|
+
>
|
|
224
|
+
<span v-if="col.sort" v-tooltip="col.tooltip">
|
|
225
|
+
<span v-html="labelFor(col)" />
|
|
226
|
+
<i
|
|
227
|
+
v-show="hasAdvancedFiltering && !col.isFilter"
|
|
228
|
+
v-tooltip="t('sortableTable.tableHeader.noFilter')"
|
|
229
|
+
class="icon icon-info not-filter-icon"
|
|
230
|
+
/>
|
|
231
|
+
<span class="icon-stack">
|
|
232
|
+
<i class="icon icon-sort icon-stack-1x faded" />
|
|
233
|
+
<i v-if="isCurrent(col) && !descending" class="icon icon-sort-down icon-stack-1x" />
|
|
234
|
+
<i v-if="isCurrent(col) && descending" class="icon icon-sort-up icon-stack-1x" />
|
|
235
|
+
</span>
|
|
134
236
|
</span>
|
|
135
|
-
|
|
136
|
-
|
|
237
|
+
<span v-else v-tooltip="col.tooltip">{{ labelFor(col) }}</span>
|
|
238
|
+
</div>
|
|
239
|
+
</th>
|
|
240
|
+
<th
|
|
241
|
+
v-if="rowActions && hasAdvancedFiltering && tableColsOptions.length"
|
|
242
|
+
:width="rowActionsWidth"
|
|
243
|
+
>
|
|
244
|
+
<div
|
|
245
|
+
ref="table-options"
|
|
246
|
+
class="table-options-group"
|
|
247
|
+
>
|
|
248
|
+
<button
|
|
249
|
+
aria-haspopup="true"
|
|
250
|
+
aria-expanded="false"
|
|
251
|
+
type="button"
|
|
252
|
+
class="btn btn-sm role-multi-action table-options-btn"
|
|
253
|
+
@click="tableColsOptionsClick"
|
|
254
|
+
>
|
|
255
|
+
<i class="icon icon-actions" />
|
|
256
|
+
</button>
|
|
257
|
+
<div
|
|
258
|
+
v-show="tableColsOptionsVisibility"
|
|
259
|
+
class="table-options-container"
|
|
260
|
+
:style="tableColsMenuPosition"
|
|
261
|
+
>
|
|
262
|
+
<div
|
|
263
|
+
v-if="hasAdvGrouping"
|
|
264
|
+
class="table-options-grouping"
|
|
265
|
+
>
|
|
266
|
+
<span class="table-options-col-subtitle">{{ t('sortableTable.tableHeader.groupBy') }}:</span>
|
|
267
|
+
<LabeledSelect
|
|
268
|
+
v-model="advGroup"
|
|
269
|
+
class="table-options-grouping-select"
|
|
270
|
+
:clearable="true"
|
|
271
|
+
:options="groupOptions"
|
|
272
|
+
:disabled="false"
|
|
273
|
+
:searchable="false"
|
|
274
|
+
mode="edit"
|
|
275
|
+
:multiple="false"
|
|
276
|
+
:taggable="false"
|
|
277
|
+
/>
|
|
278
|
+
</div>
|
|
279
|
+
<p class="table-options-col-subtitle mb-20">
|
|
280
|
+
{{ t('sortableTable.tableHeader.show') }}:
|
|
281
|
+
</p>
|
|
282
|
+
<ul>
|
|
283
|
+
<li
|
|
284
|
+
v-for="(col, index) in tableColsOptions"
|
|
285
|
+
v-show="col.isTableOption"
|
|
286
|
+
:key="index"
|
|
287
|
+
:class="{ 'visible': !col.preventColToggle }"
|
|
288
|
+
>
|
|
289
|
+
<Checkbox
|
|
290
|
+
v-show="!col.preventColToggle"
|
|
291
|
+
v-model="col.isColVisible"
|
|
292
|
+
class="table-options-checkbox"
|
|
293
|
+
:label="col.label"
|
|
294
|
+
@input="tableOptionsCheckbox($event, col.label)"
|
|
295
|
+
/>
|
|
296
|
+
</li>
|
|
297
|
+
</ul>
|
|
298
|
+
</div>
|
|
299
|
+
</div>
|
|
137
300
|
</th>
|
|
138
|
-
<th v-if="rowActions" :width="rowActionsWidth">
|
|
301
|
+
<th v-else-if="rowActions" :width="rowActionsWidth">
|
|
139
302
|
</th>
|
|
140
303
|
</tr>
|
|
141
304
|
</thead>
|
|
142
305
|
</template>
|
|
143
306
|
|
|
144
|
-
<style lang="scss" scoped>
|
|
145
|
-
|
|
146
|
-
cursor: pointer;
|
|
147
|
-
user-select: none;
|
|
148
|
-
white-space: nowrap;
|
|
149
|
-
&:hover,
|
|
150
|
-
&:active {
|
|
151
|
-
text-decoration: underline;
|
|
152
|
-
color: var(--body-text);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
thead {
|
|
157
|
-
tr {
|
|
158
|
-
background-color: var(--sortable-table-header-bg);
|
|
159
|
-
color: var(--body-text);
|
|
160
|
-
text-align: left;
|
|
307
|
+
<style lang="scss" scoped>
|
|
308
|
+
.table-options-group {
|
|
161
309
|
|
|
162
|
-
|
|
163
|
-
|
|
310
|
+
.table-options-btn.role-multi-action {
|
|
311
|
+
background-color: transparent;
|
|
312
|
+
border: none;
|
|
313
|
+
font-size: 18px;
|
|
314
|
+
&:hover, &:focus {
|
|
315
|
+
background-color: var(--accent-btn);
|
|
316
|
+
box-shadow: none;
|
|
317
|
+
}
|
|
164
318
|
}
|
|
165
|
-
|
|
166
|
-
|
|
319
|
+
.table-options-container {
|
|
320
|
+
width: 320px;
|
|
321
|
+
border: 1px solid var(--primary);
|
|
322
|
+
background-color: var(--body-bg);
|
|
323
|
+
padding: 20px;
|
|
324
|
+
z-index: 1;
|
|
325
|
+
|
|
326
|
+
.table-options-grouping {
|
|
327
|
+
display: flex;
|
|
328
|
+
align-items: center;
|
|
329
|
+
margin-bottom: 20px;
|
|
330
|
+
|
|
331
|
+
span {
|
|
332
|
+
white-space: nowrap;
|
|
333
|
+
margin-right: 10px;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
ul {
|
|
338
|
+
list-style: none;
|
|
339
|
+
margin: 0;
|
|
340
|
+
padding: 0;
|
|
341
|
+
display: flex;
|
|
342
|
+
flex-wrap: wrap;
|
|
167
343
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
color: var(--body-text);
|
|
344
|
+
li {
|
|
345
|
+
flex: 1 1 136px;
|
|
346
|
+
margin: 0;
|
|
347
|
+
padding: 0;
|
|
173
348
|
|
|
174
|
-
|
|
175
|
-
|
|
349
|
+
&.visible {
|
|
350
|
+
margin: 0 0 10px 0;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
176
355
|
}
|
|
177
356
|
|
|
178
|
-
|
|
179
|
-
|
|
357
|
+
.sortable > SPAN {
|
|
358
|
+
cursor: pointer;
|
|
359
|
+
user-select: none;
|
|
360
|
+
white-space: nowrap;
|
|
361
|
+
&:hover,
|
|
362
|
+
&:active {
|
|
363
|
+
text-decoration: underline;
|
|
364
|
+
color: var(--body-text);
|
|
365
|
+
}
|
|
180
366
|
}
|
|
181
367
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
368
|
+
thead {
|
|
369
|
+
tr {
|
|
370
|
+
background-color: var(--sortable-table-header-bg);
|
|
371
|
+
color: var(--body-text);
|
|
372
|
+
text-align: left;
|
|
373
|
+
|
|
374
|
+
&:not(.loading) {
|
|
375
|
+
border-bottom: 1px solid var(--sortable-table-top-divider);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
185
378
|
}
|
|
186
379
|
|
|
187
|
-
|
|
380
|
+
th {
|
|
381
|
+
padding: 8px 5px;
|
|
382
|
+
font-weight: normal;
|
|
383
|
+
border: 0;
|
|
188
384
|
color: var(--body-text);
|
|
189
|
-
}
|
|
190
385
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
386
|
+
.table-header-container {
|
|
387
|
+
display: flex;
|
|
388
|
+
align-items: center;
|
|
389
|
+
|
|
390
|
+
&.not-filterable {
|
|
391
|
+
margin-top: -2px;
|
|
392
|
+
|
|
393
|
+
.icon-stack {
|
|
394
|
+
margin-top: -2px;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.not-filter-icon {
|
|
399
|
+
font-size: 16px;
|
|
400
|
+
color: var(--primary);
|
|
401
|
+
vertical-align: super;
|
|
402
|
+
}
|
|
196
403
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
&.laptop, &.desktop {
|
|
201
|
-
display: none;
|
|
404
|
+
|
|
405
|
+
&:first-child {
|
|
406
|
+
padding-left: 10px;
|
|
202
407
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
408
|
+
|
|
409
|
+
&:last-child {
|
|
410
|
+
padding-right: 10px;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
&:not(.sortable) > SPAN {
|
|
414
|
+
display: block;
|
|
415
|
+
margin-bottom: 2px;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
& A {
|
|
419
|
+
color: var(--body-text);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
// Aligns with COLUMN_BREAKPOINTS
|
|
423
|
+
@media only screen and (max-width: map-get($breakpoints, '--viewport-4')) {
|
|
424
|
+
// HIDE column on sizes below 480px
|
|
425
|
+
&.tablet, &.laptop, &.desktop {
|
|
426
|
+
display: none;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
@media only screen and (max-width: map-get($breakpoints, '--viewport-9')) {
|
|
430
|
+
// HIDE column on sizes below 992px
|
|
431
|
+
&.laptop, &.desktop {
|
|
432
|
+
display: none;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
@media only screen and (max-width: map-get($breakpoints, '--viewport-12')) {
|
|
436
|
+
// HIDE column on sizes below 1281px
|
|
437
|
+
&.desktop {
|
|
438
|
+
display: none;
|
|
439
|
+
}
|
|
208
440
|
}
|
|
209
441
|
}
|
|
210
|
-
}
|
|
211
442
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
443
|
+
.icon-stack {
|
|
444
|
+
width: 12px;
|
|
445
|
+
}
|
|
215
446
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
447
|
+
.icon-sort {
|
|
448
|
+
&.faded {
|
|
449
|
+
opacity: .3;
|
|
450
|
+
}
|
|
219
451
|
}
|
|
220
|
-
|
|
221
|
-
|
|
452
|
+
</style>
|
|
453
|
+
<style lang="scss">
|
|
454
|
+
.table-options-checkbox .checkbox-label {
|
|
455
|
+
color: var(--body-text);
|
|
456
|
+
text-overflow: ellipsis;
|
|
457
|
+
width: 100px;
|
|
458
|
+
display: inline-block;
|
|
459
|
+
white-space: nowrap;
|
|
460
|
+
overflow: hidden;
|
|
461
|
+
}
|
|
462
|
+
</style>
|