@rancher/shell 3.0.1-rc.3 → 3.0.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/data/aws-regions.json +1 -0
- package/assets/styles/base/_basic.scss +5 -0
- package/assets/styles/base/_mixins.scss +8 -0
- package/assets/styles/global/_button.scss +5 -0
- package/assets/styles/themes/_dark.scss +2 -0
- package/assets/styles/themes/_light.scss +2 -0
- package/assets/translations/en-us.yaml +40 -22
- package/assets/translations/zh-hans.yaml +1 -7
- package/chart/monitoring/StorageClassSelector.vue +1 -1
- package/components/AssignTo.vue +1 -0
- package/components/AsyncButton.vue +1 -0
- package/components/BackLink.vue +8 -2
- package/components/PaginatedResourceTable.vue +135 -0
- package/components/ResourceDetail/Masthead.vue +1 -1
- package/components/ResourceDetail/index.vue +66 -11
- package/components/ResourceList/index.vue +0 -1
- package/components/ResourceTable.vue +6 -1
- package/components/ResourceYaml.vue +0 -53
- package/components/SortableTable/index.vue +8 -6
- package/components/Tabbed/index.vue +35 -2
- package/components/form/ResourceLabeledSelect.vue +2 -2
- package/components/form/ResourceTabs/index.vue +0 -23
- package/components/form/Taints.vue +1 -1
- package/components/form/UnitInput.vue +1 -1
- package/components/form/__tests__/UnitInput.test.ts +1 -1
- package/components/nav/TopLevelMenu.helper.ts +546 -0
- package/components/nav/TopLevelMenu.vue +125 -160
- package/components/nav/WindowManager/ContainerShell.vue +13 -4
- package/components/nav/WindowManager/__tests__/ContainerShell.test.ts +20 -18
- package/components/nav/__tests__/TopLevelMenu.test.ts +338 -326
- package/composables/useLabeledFormElement.ts +6 -2
- package/config/pagination-table-headers.js +4 -4
- package/config/product/explorer.js +2 -0
- package/config/router/navigation-guards/index.js +1 -2
- package/config/router/routes.js +1 -1
- package/config/settings.ts +15 -8
- package/core/plugin.ts +8 -1
- package/core/types-provisioning.ts +5 -0
- package/core/types.ts +26 -1
- package/dialog/DrainNode.vue +6 -6
- package/edit/catalog.cattle.io.clusterrepo.vue +95 -52
- package/edit/provisioning.cattle.io.cluster/index.vue +8 -3
- package/edit/workload/index.vue +1 -1
- package/edit/workload/storage/csi/index.vue +29 -1
- package/edit/workload/storage/index.vue +1 -0
- package/initialize/App.vue +3 -10
- package/initialize/install-plugins.js +1 -2
- package/list/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +6 -2
- package/list/node.vue +8 -5
- package/mixins/resource-fetch-api-pagination.js +40 -5
- package/mixins/resource-fetch.js +48 -5
- package/models/management.cattle.io.nodepool.js +5 -4
- package/models/nodedriver.js +2 -2
- package/models/provisioning.cattle.io.cluster.js +3 -11
- package/package.json +7 -8
- package/pages/about.vue +22 -0
- package/pages/auth/setup.vue +7 -28
- package/pages/c/_cluster/explorer/__tests__/index.test.ts +36 -24
- package/pages/c/_cluster/explorer/index.vue +100 -59
- package/pages/home.vue +308 -123
- package/plugins/dashboard-store/__tests__/mutations.test.ts +2 -0
- package/plugins/dashboard-store/actions.js +29 -19
- package/plugins/dashboard-store/getters.js +5 -2
- package/plugins/dashboard-store/mutations.js +4 -2
- package/plugins/steve/__tests__/mutations.test.ts +2 -1
- package/plugins/steve/steve-pagination-utils.ts +25 -2
- package/plugins/steve/subscribe.js +22 -8
- package/rancher-components/Banner/Banner.vue +1 -0
- package/rancher-components/Form/Checkbox/Checkbox.vue +2 -0
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +2 -0
- package/rancher-components/Form/Radio/RadioButton.vue +2 -0
- package/rancher-components/Form/Radio/RadioGroup.vue +2 -0
- package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +2 -0
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +3 -0
- package/rancher-components/StringList/StringList.test.ts +15 -15
- package/rancher-components/StringList/StringList.vue +3 -0
- package/scripts/extension/helm/charts/ui-plugin-server/Chart.yaml +0 -2
- package/scripts/extension/parse-tag-name +2 -0
- package/scripts/test-plugins-build.sh +4 -2
- package/store/index.js +31 -9
- package/tsconfig.json +7 -1
- package/types/resources/settings.d.ts +1 -1
- package/types/shell/index.d.ts +1107 -1276
- package/types/store/dashboard-store.types.ts +4 -0
- package/types/store/pagination.types.ts +13 -0
- package/types/store/vuex.d.ts +8 -0
- package/types/vue-shim.d.ts +6 -31
- package/utils/cluster.js +92 -1
- package/utils/pagination-utils.ts +17 -8
- package/utils/pagination-wrapper.ts +70 -0
- package/utils/uiplugins.ts +307 -0
- package/components/templates/error.vue +0 -131
- package/config/router/navigation-guards/history.js +0 -13
- package/plugins/back-button.js +0 -3
|
@@ -205,58 +205,6 @@ export default {
|
|
|
205
205
|
cm.getMode().fold = saved;
|
|
206
206
|
},
|
|
207
207
|
|
|
208
|
-
onChanges(cm, changes) {
|
|
209
|
-
if ( changes.length !== 1 ) {
|
|
210
|
-
return;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
const change = changes[0];
|
|
214
|
-
|
|
215
|
-
if ( change.from.line !== change.to.line ) {
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
let line = change.from.line;
|
|
220
|
-
let str = cm.getLine(line);
|
|
221
|
-
let maxIndent = indentChars(str);
|
|
222
|
-
|
|
223
|
-
if ( maxIndent === null ) {
|
|
224
|
-
return;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
cm.replaceRange('', { line, ch: 0 }, { line, ch: 1 }, '+input');
|
|
228
|
-
|
|
229
|
-
while ( line > 0 ) {
|
|
230
|
-
line--;
|
|
231
|
-
str = cm.getLine(line);
|
|
232
|
-
const indent = indentChars(str);
|
|
233
|
-
|
|
234
|
-
if ( indent === null ) {
|
|
235
|
-
break;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
if ( indent < maxIndent ) {
|
|
239
|
-
cm.replaceRange('', { line, ch: 0 }, { line, ch: 1 }, '+input');
|
|
240
|
-
|
|
241
|
-
if ( indent === 0 ) {
|
|
242
|
-
break;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
maxIndent = indent;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
function indentChars(str) {
|
|
250
|
-
const match = str.match(/^#(\s+)/);
|
|
251
|
-
|
|
252
|
-
if ( match ) {
|
|
253
|
-
return match[1].length;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
return null;
|
|
257
|
-
}
|
|
258
|
-
},
|
|
259
|
-
|
|
260
208
|
updateValue(value) {
|
|
261
209
|
this.$refs.yamleditor.updateValue(value);
|
|
262
210
|
},
|
|
@@ -354,7 +302,6 @@ export default {
|
|
|
354
302
|
class="yaml-editor flex-content"
|
|
355
303
|
:editor-mode="editorMode"
|
|
356
304
|
@onReady="onReady"
|
|
357
|
-
@onChanges="onChanges"
|
|
358
305
|
/>
|
|
359
306
|
<slot
|
|
360
307
|
name="yamlFooter"
|
|
@@ -361,7 +361,13 @@ export default {
|
|
|
361
361
|
externalPaginationResult: {
|
|
362
362
|
type: Object,
|
|
363
363
|
default: null
|
|
364
|
+
},
|
|
365
|
+
|
|
366
|
+
manualRefreshButtonSize: {
|
|
367
|
+
type: String,
|
|
368
|
+
default: ''
|
|
364
369
|
}
|
|
370
|
+
|
|
365
371
|
},
|
|
366
372
|
|
|
367
373
|
data() {
|
|
@@ -1140,8 +1146,8 @@ export default {
|
|
|
1140
1146
|
<slot name="header-right" />
|
|
1141
1147
|
<AsyncButton
|
|
1142
1148
|
v-if="isTooManyItemsToAutoUpdate"
|
|
1143
|
-
class="manual-refresh"
|
|
1144
1149
|
mode="manual-refresh"
|
|
1150
|
+
:size="manualRefreshButtonSize"
|
|
1145
1151
|
:current-phase="refreshButtonPhase"
|
|
1146
1152
|
@click="debouncedRefreshTableData"
|
|
1147
1153
|
/>
|
|
@@ -1568,10 +1574,6 @@ export default {
|
|
|
1568
1574
|
opacity: 0.5;
|
|
1569
1575
|
pointer-events: none;
|
|
1570
1576
|
}
|
|
1571
|
-
|
|
1572
|
-
.manual-refresh {
|
|
1573
|
-
height: 40px;
|
|
1574
|
-
}
|
|
1575
1577
|
.advanced-filter-group {
|
|
1576
1578
|
position: relative;
|
|
1577
1579
|
margin-left: 10px;
|
|
@@ -1672,7 +1674,7 @@ export default {
|
|
|
1672
1674
|
margin-right: 10px;
|
|
1673
1675
|
font-size: 11px;
|
|
1674
1676
|
}
|
|
1675
|
-
|
|
1677
|
+
.cross {
|
|
1676
1678
|
font-size: 12px;
|
|
1677
1679
|
font-weight: bold;
|
|
1678
1680
|
cursor: pointer;
|
|
@@ -4,10 +4,15 @@ import isEmpty from 'lodash/isEmpty';
|
|
|
4
4
|
import { addObject, removeObject, findBy } from '@shell/utils/array';
|
|
5
5
|
import { sortBy } from '@shell/utils/sort';
|
|
6
6
|
import findIndex from 'lodash/findIndex';
|
|
7
|
+
import { ExtensionPoint, TabLocation } from '@shell/core/types';
|
|
8
|
+
import { getApplicableExtensionEnhancements } from '@shell/core/plugin-helpers';
|
|
9
|
+
import Tab from '@shell/components/Tabbed/Tab';
|
|
7
10
|
|
|
8
11
|
export default {
|
|
9
12
|
name: 'Tabbed',
|
|
10
13
|
|
|
14
|
+
components: { Tab },
|
|
15
|
+
|
|
11
16
|
emits: ['changed', 'addTab', 'removeTab'],
|
|
12
17
|
|
|
13
18
|
props: {
|
|
@@ -82,9 +87,19 @@ export default {
|
|
|
82
87
|
},
|
|
83
88
|
|
|
84
89
|
data() {
|
|
90
|
+
const extensionTabs = getApplicableExtensionEnhancements(this, ExtensionPoint.TAB, TabLocation.RESOURCE_DETAIL, this.$route, this, this.extensionParams) || [];
|
|
91
|
+
|
|
92
|
+
const parsedExtTabs = extensionTabs.map((item) => {
|
|
93
|
+
return {
|
|
94
|
+
...item,
|
|
95
|
+
active: false
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
|
|
85
99
|
return {
|
|
86
|
-
tabs: [],
|
|
87
|
-
|
|
100
|
+
tabs: [...parsedExtTabs],
|
|
101
|
+
extensionTabs: parsedExtTabs,
|
|
102
|
+
activeTabName: null
|
|
88
103
|
};
|
|
89
104
|
},
|
|
90
105
|
|
|
@@ -320,6 +335,24 @@ export default {
|
|
|
320
335
|
}"
|
|
321
336
|
>
|
|
322
337
|
<slot />
|
|
338
|
+
<!-- Extension tabs -->
|
|
339
|
+
<Tab
|
|
340
|
+
v-for="tab, i in extensionTabs"
|
|
341
|
+
:key="`${tab.name}${i}`"
|
|
342
|
+
:name="tab.name"
|
|
343
|
+
:label="tab.label"
|
|
344
|
+
:label-key="tab.labelKey"
|
|
345
|
+
:weight="tab.weight"
|
|
346
|
+
:tooltip="tab.tooltip"
|
|
347
|
+
:show-header="tab.showHeader"
|
|
348
|
+
:display-alert-icon="tab.displayAlertIcon"
|
|
349
|
+
:error="tab.error"
|
|
350
|
+
:badge="tab.badge"
|
|
351
|
+
>
|
|
352
|
+
<component
|
|
353
|
+
:is="tab.component"
|
|
354
|
+
/>
|
|
355
|
+
</Tab>
|
|
323
356
|
</div>
|
|
324
357
|
</div>
|
|
325
358
|
</template>
|
|
@@ -52,14 +52,14 @@ export enum RESOURCE_LABEL_SELECT_MODE {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
55
|
+
* Convenience wrapper around the LabelSelect component to support pagination
|
|
56
56
|
*
|
|
57
57
|
* Handles
|
|
58
58
|
*
|
|
59
59
|
* 1) Conditionally enabling the pagination feature given system settings
|
|
60
60
|
* 2) Helper function to fetch the pagination result
|
|
61
61
|
*
|
|
62
|
-
* A number of ways can be provided to override the
|
|
62
|
+
* A number of ways can be provided to override the conveniences (see props)
|
|
63
63
|
*/
|
|
64
64
|
export default defineComponent({
|
|
65
65
|
name: 'ResourceLabeledSelect',
|
|
@@ -11,8 +11,6 @@ import { EVENT } from '@shell/config/types';
|
|
|
11
11
|
import SortableTable from '@shell/components/SortableTable';
|
|
12
12
|
import { _VIEW } from '@shell/config/query-params';
|
|
13
13
|
import RelatedResources from '@shell/components/RelatedResources';
|
|
14
|
-
import { ExtensionPoint, TabLocation } from '@shell/core/types';
|
|
15
|
-
import { getApplicableExtensionEnhancements } from '@shell/core/plugin-helpers';
|
|
16
14
|
import { isConditionReadyAndWaiting } from '@shell/plugins/dashboard-store/resource-class';
|
|
17
15
|
|
|
18
16
|
export default {
|
|
@@ -77,7 +75,6 @@ export default {
|
|
|
77
75
|
allEvents: [],
|
|
78
76
|
selectedTab: this.defaultTab,
|
|
79
77
|
didLoadEvents: false,
|
|
80
|
-
extensionTabs: getApplicableExtensionEnhancements(this, ExtensionPoint.TAB, TabLocation.RESOURCE_DETAIL, this.$route, this, this.extensionParams),
|
|
81
78
|
inStore,
|
|
82
79
|
showConditions: false,
|
|
83
80
|
};
|
|
@@ -246,25 +243,5 @@ export default {
|
|
|
246
243
|
direction="to"
|
|
247
244
|
/>
|
|
248
245
|
</Tab>
|
|
249
|
-
|
|
250
|
-
<!-- Extension tabs -->
|
|
251
|
-
<Tab
|
|
252
|
-
v-for="tab, i in extensionTabs"
|
|
253
|
-
:key="`${tab.name}${i}`"
|
|
254
|
-
:name="tab.name"
|
|
255
|
-
:label="tab.label"
|
|
256
|
-
:label-key="tab.labelKey"
|
|
257
|
-
:weight="tab.weight"
|
|
258
|
-
:tooltip="tab.tooltip"
|
|
259
|
-
:show-header="tab.showHeader"
|
|
260
|
-
:display-alert-icon="tab.displayAlertIcon"
|
|
261
|
-
:error="tab.error"
|
|
262
|
-
:badge="tab.badge"
|
|
263
|
-
>
|
|
264
|
-
<component
|
|
265
|
-
:is="tab.component"
|
|
266
|
-
:resource="value"
|
|
267
|
-
/>
|
|
268
|
-
</Tab>
|
|
269
246
|
</Tabbed>
|
|
270
247
|
</template>
|
|
@@ -71,7 +71,7 @@ export default {
|
|
|
71
71
|
:preserve-keys="['effect']"
|
|
72
72
|
:add-label="t('labels.addTaint')"
|
|
73
73
|
:disabled="disabled"
|
|
74
|
-
@update:value="$emit('
|
|
74
|
+
@update:value="(e) => $emit('update:value', e)"
|
|
75
75
|
>
|
|
76
76
|
<template #label:effect>
|
|
77
77
|
{{ t('tableHeaders.effect') }}
|
|
@@ -184,7 +184,7 @@ describe('component: UnitInput', () => {
|
|
|
184
184
|
input.trigger('blur');
|
|
185
185
|
|
|
186
186
|
expect(wrapper.emitted('update:value')).toBeTruthy();
|
|
187
|
-
expect(wrapper.emitted('update:value')[
|
|
187
|
+
expect(wrapper.emitted('update:value')[3][0]).toBe(value);
|
|
188
188
|
});
|
|
189
189
|
|
|
190
190
|
describe.each([
|