@rancher/shell 0.3.16 → 0.3.18
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/images/wechat-qr-code.jpg +0 -0
- package/assets/translations/en-us.yaml +75 -16
- package/assets/translations/zh-hans.yaml +151 -15
- package/chart/__tests__/S3.test.ts +50 -0
- package/chart/rancher-backup/S3.vue +21 -0
- package/chart/rancher-backup/index.vue +4 -0
- package/components/AsyncButton.vue +1 -1
- package/components/CommunityLinks.vue +1 -0
- package/components/FileDiff.vue +92 -85
- package/components/Inactivity.vue +10 -0
- package/components/LazyImage.vue +2 -2
- package/components/PromptRestore.vue +7 -5
- package/components/ResourceDetail/Masthead.vue +1 -1
- package/components/ResourceDetail/index.vue +8 -14
- package/components/ResourceList/index.vue +1 -1
- package/components/ResourceTable.vue +50 -2
- package/components/YamlEditor.vue +1 -0
- package/components/__tests__/PromptRestore.test.ts +72 -0
- package/components/auth/AzureWarning.vue +1 -1
- package/components/auth/RoleDetailEdit.vue +1 -0
- package/components/fleet/FleetResources.vue +3 -64
- package/components/form/FileImageSelector.vue +9 -0
- package/components/form/FileSelector.vue +2 -1
- package/components/form/MatchExpressions.vue +1 -3
- package/components/form/NameNsDescription.vue +28 -12
- package/components/form/NodeAffinity.vue +2 -2
- package/components/form/PodAffinity.vue +2 -2
- package/components/form/ResourceTabs/index.vue +8 -2
- package/components/form/Select.vue +16 -0
- package/components/form/__tests__/FileImageSelector.test.ts +42 -0
- package/components/form/__tests__/FileSelector.test.ts +76 -0
- package/components/form/__tests__/NodeAffinity.test.ts +38 -0
- package/components/form/__tests__/PodAffinity.test.ts +46 -0
- package/components/formatter/ClusterLink.vue +8 -4
- package/components/formatter/ClusterProvider.vue +3 -1
- package/components/formatter/ImageName.vue +23 -0
- package/components/formatter/PodImages.vue +7 -1
- package/components/formatter/__tests__/ClusterLink.test.ts +101 -0
- package/components/formatter/__tests__/ClusterProvider.test.ts +24 -0
- package/components/nav/Header.vue +2 -2
- package/components/nav/WindowManager/ContainerShell.vue +60 -36
- package/components/nav/WindowManager/__tests__/ContainerShell.test.ts +561 -0
- package/config/__test__/home-links.test.ts +62 -0
- package/config/home-links.js +15 -3
- package/config/labels-annotations.js +7 -2
- package/config/persistentVolume.ts +108 -0
- package/config/product/manager.js +5 -1
- package/config/router.js +0 -4
- package/config/settings.ts +4 -0
- package/config/table-headers.js +6 -5
- package/config/types.js +2 -0
- package/config/uiplugins.js +50 -5
- package/core/plugin-helpers.js +39 -15
- package/core/plugin.ts +9 -0
- package/core/plugins.js +1 -1
- package/core/types-provisioning.ts +253 -0
- package/core/types.ts +21 -3
- package/detail/autoscaling.horizontalpodautoscaler/index.vue +50 -1
- package/detail/fleet.cattle.io.gitrepo.vue +10 -2
- package/detail/node.vue +6 -6
- package/detail/pod.vue +38 -9
- package/detail/provisioning.cattle.io.cluster.vue +46 -7
- package/detail/workload/index.vue +49 -18
- package/edit/__tests__/fleet.cattle.io.gitrepo.test.ts +62 -0
- package/edit/__tests__/ui.cattle.io.navlink.test.ts +110 -0
- package/edit/auth/github.vue +1 -0
- package/edit/autoscaling.horizontalpodautoscaler/hpa-scaling-rule.vue +130 -0
- package/edit/autoscaling.horizontalpodautoscaler/index.vue +79 -0
- package/edit/fleet.cattle.io.clustergroup.vue +14 -3
- package/edit/fleet.cattle.io.gitrepo.vue +18 -1
- package/edit/namespace.vue +9 -1
- package/edit/networking.k8s.io.ingress/RulePath.vue +0 -2
- package/edit/persistentvolume/__tests__/persistentvolume.test.ts +82 -0
- package/edit/persistentvolume/index.vue +2 -1
- package/edit/persistentvolume/plugins/csi.vue +3 -1
- package/edit/persistentvolume/plugins/longhorn.vue +12 -12
- package/edit/provisioning.cattle.io.cluster/AgentConfiguration.vue +1 -30
- package/edit/provisioning.cattle.io.cluster/RegistryConfigs.vue +15 -11
- package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +79 -1
- package/edit/provisioning.cattle.io.cluster/index.vue +53 -1
- package/edit/provisioning.cattle.io.cluster/rke2.vue +335 -151
- package/edit/storage.k8s.io.storageclass/index.vue +1 -2
- package/edit/ui.cattle.io.navlink.vue +213 -186
- package/initialize/App.js +3 -13
- package/initialize/layouts.ts +26 -0
- package/layouts/default.vue +1 -1
- package/list/group.principal.vue +1 -1
- package/list/provisioning.cattle.io.cluster.vue +8 -1
- package/middleware/authenticated.js +101 -5
- package/mixins/brand.js +39 -3
- package/mixins/child-hook.js +2 -2
- package/mixins/create-edit-view/impl.js +4 -4
- package/models/chart.js +1 -1
- package/models/fleet.cattle.io.cluster.js +33 -4
- package/models/fleet.cattle.io.gitrepo.js +113 -38
- package/models/management.cattle.io.kontainerdriver.js +14 -0
- package/models/persistentvolume.js +2 -111
- package/models/pod.js +30 -0
- package/models/provisioning.cattle.io.cluster.js +9 -1
- package/models/rke.cattle.io.etcdsnapshot.js +10 -7
- package/package.json +2 -2
- package/pages/about.vue +8 -2
- package/pages/auth/login.vue +1 -1
- package/pages/auth/logout.vue +11 -3
- package/pages/c/_cluster/apps/charts/index.vue +5 -2
- package/pages/c/_cluster/apps/charts/install.vue +5 -0
- package/pages/c/_cluster/auth/group.principal/assign-edit.vue +1 -1
- package/pages/c/_cluster/auth/roles/index.vue +1 -1
- package/pages/c/_cluster/explorer/index.vue +2 -11
- package/pages/c/_cluster/manager/cloudCredential/_id.vue +0 -1
- package/pages/c/_cluster/manager/cloudCredential/create.vue +0 -1
- package/pages/c/_cluster/settings/brand.vue +11 -8
- package/pages/c/_cluster/uiplugins/AddExtensionRepos.vue +177 -0
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +19 -3
- package/pages/c/_cluster/uiplugins/RemoveUIPlugins.vue +90 -21
- package/pages/c/_cluster/uiplugins/SetupUIPlugins.vue +107 -37
- package/pages/c/_cluster/uiplugins/index.vue +160 -44
- package/pages/docs/_doc.vue +9 -3
- package/pages/home.vue +6 -6
- package/pages/support/index.vue +10 -4
- package/pkg/auto-import.js +1 -1
- package/plugins/clean-tooltip-directive.js +1 -1
- package/plugins/dashboard-store/__tests__/actions.spec.ts +165 -0
- package/plugins/dashboard-store/__tests__/getters.spec.ts +100 -0
- package/plugins/dashboard-store/__tests__/{mutations.spec.js → mutations.spec.ts} +2 -2
- package/plugins/dashboard-store/actions.js +1 -1
- package/plugins/dashboard-store/resource-class.js +39 -2
- package/plugins/plugin.js +9 -1
- package/plugins/steve/__tests__/getters.spec.ts +93 -0
- package/plugins/steve/getters.js +21 -1
- package/plugins/steve/subscribe.js +1 -3
- package/rancher-components/BadgeState/BadgeState.vue +5 -1
- package/rancher-components/Banner/Banner.test.ts +51 -1
- package/rancher-components/Banner/Banner.vue +134 -53
- package/rancher-components/Card/Card.test.ts +37 -0
- package/rancher-components/Card/Card.vue +24 -7
- package/rancher-components/Form/Checkbox/Checkbox.test.ts +20 -29
- package/rancher-components/Form/Checkbox/Checkbox.vue +45 -20
- package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +2 -8
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +22 -10
- package/rancher-components/Form/Radio/RadioButton.test.ts +31 -0
- package/rancher-components/Form/Radio/RadioButton.vue +30 -13
- package/rancher-components/Form/Radio/RadioGroup.vue +26 -7
- package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +7 -6
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.test.ts +25 -38
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +23 -11
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +19 -5
- package/rancher-components/StringList/StringList.test.ts +453 -49
- package/rancher-components/StringList/StringList.vue +44 -26
- package/scripts/extension/publish +2 -2
- package/scripts/typegen.sh +11 -2
- package/server/server-middleware.js +4 -12
- package/store/index.js +14 -3
- package/store/prefs.js +0 -3
- package/store/store-types.js +2 -0
- package/store/type-map.js +17 -29
- package/types/api.d.ts +1 -0
- package/types/fleet.d.ts +1 -0
- package/types/shell/index.d.ts +931 -85
- package/types/userPreferences.d.ts +1 -1
- package/utils/__mocks__/socket.js +21 -0
- package/utils/grafana.js +23 -11
- package/utils/kube.js +9 -0
- package/utils/object.js +27 -0
- package/utils/selector.js +2 -1
- package/utils/settings.ts +2 -2
- package/utils/validators/formRules/index.ts +3 -3
- package/vue.config.js +3 -2
- package/components/.DS_Store +0 -0
- package/components/__tests__/.DS_Store +0 -0
- package/creators/pkg/package-lock.json +0 -37
- package/pages/safeMode.vue +0 -17
- package/plugins/steve/urloptions.js +0 -47
- package/yarn-error.log +0 -196
|
@@ -30,9 +30,9 @@ const CLASS = {
|
|
|
30
30
|
* Manage a list of strings
|
|
31
31
|
*/
|
|
32
32
|
export default Vue.extend({
|
|
33
|
-
components: { LabeledInput },
|
|
34
33
|
|
|
35
|
-
name:
|
|
34
|
+
name: 'StringList',
|
|
35
|
+
components: { LabeledInput },
|
|
36
36
|
|
|
37
37
|
props: {
|
|
38
38
|
/**
|
|
@@ -85,11 +85,11 @@ export default Vue.extend({
|
|
|
85
85
|
},
|
|
86
86
|
data() {
|
|
87
87
|
return {
|
|
88
|
-
value:
|
|
89
|
-
selected:
|
|
90
|
-
editedItem:
|
|
91
|
-
isCreateItem:
|
|
92
|
-
errors:
|
|
88
|
+
value: null as string | null,
|
|
89
|
+
selected: null as string | null,
|
|
90
|
+
editedItem: null as string | null,
|
|
91
|
+
isCreateItem: false,
|
|
92
|
+
errors: { duplicate: false } as Record<Error, boolean>
|
|
93
93
|
};
|
|
94
94
|
},
|
|
95
95
|
|
|
@@ -100,8 +100,8 @@ export default Vue.extend({
|
|
|
100
100
|
*/
|
|
101
101
|
errorMessagesArray(): string[] {
|
|
102
102
|
return (Object.keys(this.errors) as Error[])
|
|
103
|
-
.filter(f => this.errors[f] && this.errorMessages[f])
|
|
104
|
-
.map(k => this.errorMessages[k]);
|
|
103
|
+
.filter((f) => this.errors[f] && this.errorMessages[f])
|
|
104
|
+
.map((k) => this.errorMessages[k]);
|
|
105
105
|
},
|
|
106
106
|
},
|
|
107
107
|
|
|
@@ -113,6 +113,9 @@ export default Vue.extend({
|
|
|
113
113
|
this.toggleEditMode(false);
|
|
114
114
|
this.toggleCreateMode(false);
|
|
115
115
|
},
|
|
116
|
+
value(val) {
|
|
117
|
+
this.$emit('type:item', val);
|
|
118
|
+
},
|
|
116
119
|
errors: {
|
|
117
120
|
handler(val) {
|
|
118
121
|
this.$emit('errors', val);
|
|
@@ -186,37 +189,42 @@ export default Vue.extend({
|
|
|
186
189
|
return;
|
|
187
190
|
}
|
|
188
191
|
if (this.editedItem) {
|
|
192
|
+
this.deleteAndSelectNext(this.editedItem);
|
|
189
193
|
this.toggleEditMode(false);
|
|
190
194
|
|
|
191
195
|
return;
|
|
192
196
|
}
|
|
193
197
|
if (this.selected) {
|
|
194
|
-
|
|
198
|
+
this.deleteAndSelectNext(this.selected);
|
|
199
|
+
}
|
|
200
|
+
},
|
|
195
201
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
* Select the next item in the list when an item is to be deleted.
|
|
199
|
-
*/
|
|
200
|
-
const item = (this.items[index + 1] || this.items[index - 1]);
|
|
202
|
+
deleteAndSelectNext(currItem: string) {
|
|
203
|
+
const index = findStringIndex(this.items, currItem, false);
|
|
201
204
|
|
|
202
|
-
|
|
203
|
-
|
|
205
|
+
if (index !== -1) {
|
|
206
|
+
/**
|
|
207
|
+
* Select the next item in the list.
|
|
208
|
+
*/
|
|
209
|
+
const item = (this.items[index + 1] || this.items[index - 1]);
|
|
204
210
|
|
|
205
|
-
|
|
206
|
-
|
|
211
|
+
this.onSelect(item);
|
|
212
|
+
this.setFocus(item);
|
|
213
|
+
|
|
214
|
+
this.deleteItem(this.items[index]);
|
|
207
215
|
}
|
|
208
216
|
},
|
|
209
217
|
|
|
210
218
|
setFocus(refId: string) {
|
|
211
|
-
this.$nextTick(() => this.getElemByRef(refId)?.focus());
|
|
219
|
+
this.$nextTick(() => (this.getElemByRef(refId) as Vue & HTMLElement)?.focus());
|
|
212
220
|
},
|
|
213
221
|
|
|
214
222
|
/**
|
|
215
223
|
* Move scrollbar when the selected item is over the top or bottom side of the box
|
|
216
224
|
*/
|
|
217
225
|
moveScrollbar(arrow: Arrow, value?: number) {
|
|
218
|
-
const box = this.getElemByRef(BOX);
|
|
219
|
-
const item = this.getElemByRef(this.selected || '');
|
|
226
|
+
const box = this.getElemByRef(BOX) as HTMLElement;
|
|
227
|
+
const item = this.getElemByRef(this.selected || '') as HTMLElement;
|
|
220
228
|
|
|
221
229
|
if (box && item && item.className.includes(CLASS.item)) {
|
|
222
230
|
const boxRect = box.getClientRects()[0];
|
|
@@ -245,7 +253,7 @@ export default Vue.extend({
|
|
|
245
253
|
},
|
|
246
254
|
|
|
247
255
|
toggleErrorClass(refId: string, val: boolean) {
|
|
248
|
-
const input = this.getElemByRef(refId)?.$el;
|
|
256
|
+
const input = (this.getElemByRef(refId) as Vue)?.$el;
|
|
249
257
|
|
|
250
258
|
if (input) {
|
|
251
259
|
if (val) {
|
|
@@ -303,7 +311,7 @@ export default Vue.extend({
|
|
|
303
311
|
getElemByRef(id: string) {
|
|
304
312
|
const ref = this.$refs[id];
|
|
305
313
|
|
|
306
|
-
return
|
|
314
|
+
return Array.isArray(ref) ? ref[0] : ref;
|
|
307
315
|
},
|
|
308
316
|
|
|
309
317
|
/**
|
|
@@ -356,7 +364,7 @@ export default Vue.extend({
|
|
|
356
364
|
* Remove an item from items list
|
|
357
365
|
*/
|
|
358
366
|
deleteItem(item?: string) {
|
|
359
|
-
const items = this.items.filter(f => f !== item);
|
|
367
|
+
const items = this.items.filter((f) => f !== item);
|
|
360
368
|
|
|
361
369
|
this.updateItems(items);
|
|
362
370
|
},
|
|
@@ -410,6 +418,7 @@ export default Vue.extend({
|
|
|
410
418
|
<LabeledInput
|
|
411
419
|
v-if="editedItem && editedItem === item"
|
|
412
420
|
ref="item-edit"
|
|
421
|
+
:data-testid="`item-edit-${item}`"
|
|
413
422
|
class="edit-input static"
|
|
414
423
|
:value="value != null ? value : item"
|
|
415
424
|
@input="onChange($event)"
|
|
@@ -423,6 +432,7 @@ export default Vue.extend({
|
|
|
423
432
|
>
|
|
424
433
|
<LabeledInput
|
|
425
434
|
ref="item-create"
|
|
435
|
+
data-testid="item-create"
|
|
426
436
|
class="create-input static"
|
|
427
437
|
type="text"
|
|
428
438
|
:value="value"
|
|
@@ -443,6 +453,7 @@ export default Vue.extend({
|
|
|
443
453
|
class="action-buttons"
|
|
444
454
|
>
|
|
445
455
|
<button
|
|
456
|
+
data-testid="button-remove"
|
|
446
457
|
class="btn btn-sm role-tertiary remove-button"
|
|
447
458
|
:disabled="!selected && !isCreateItem && !editedItem"
|
|
448
459
|
@mousedown.prevent="onClickMinusButton"
|
|
@@ -450,6 +461,7 @@ export default Vue.extend({
|
|
|
450
461
|
<span class="icon icon-minus icon-sm" />
|
|
451
462
|
</button>
|
|
452
463
|
<button
|
|
464
|
+
data-testid="button-add"
|
|
453
465
|
class="btn btn-sm role-tertiary add-button"
|
|
454
466
|
:disabled="isCreateItem || editedItem"
|
|
455
467
|
@click.prevent="onClickPlusButton"
|
|
@@ -458,10 +470,15 @@ export default Vue.extend({
|
|
|
458
470
|
</button>
|
|
459
471
|
</div>
|
|
460
472
|
<div class="messages">
|
|
461
|
-
<i
|
|
473
|
+
<i
|
|
474
|
+
v-if="errorMessagesArray.length > 0"
|
|
475
|
+
data-testid="i-warning-icon"
|
|
476
|
+
class="icon icon-warning icon-lg"
|
|
477
|
+
/>
|
|
462
478
|
<span
|
|
463
479
|
v-for="(msg, idx) in errorMessagesArray"
|
|
464
480
|
:key="idx"
|
|
481
|
+
:data-testid="`span-error-message-${msg}`"
|
|
465
482
|
class="error"
|
|
466
483
|
>
|
|
467
484
|
{{ idx > 0 ? '; ' : '' }}
|
|
@@ -515,6 +532,7 @@ export default Vue.extend({
|
|
|
515
532
|
width: auto;
|
|
516
533
|
user-select: none;
|
|
517
534
|
overflow: hidden;
|
|
535
|
+
white-space: no-wrap;
|
|
518
536
|
text-overflow: ellipsis;
|
|
519
537
|
padding-top: 1px;
|
|
520
538
|
}
|
|
@@ -299,12 +299,12 @@ for d in pkg/*/ ; do
|
|
|
299
299
|
fi
|
|
300
300
|
done
|
|
301
301
|
|
|
302
|
-
if [ -f ${ROOT_INDEX} ]; then
|
|
302
|
+
if [ -f ${ROOT_INDEX} ] && [ "${GITHUB_BUILD}" == "false" ]; then
|
|
303
303
|
UPDATE="--merge ${ROOT_INDEX}"
|
|
304
304
|
helm repo index ${ASSETS} ${UPDATE}
|
|
305
305
|
fi
|
|
306
306
|
|
|
307
|
-
if [ -f ${ASSETS}/index.yaml ]; then
|
|
307
|
+
if [ -f ${ASSETS}/index.yaml ] && ! [ -e "${ROOT_INDEX}" ]; then
|
|
308
308
|
cp ${ASSETS}/index.yaml ${BASE_DIR}
|
|
309
309
|
fi
|
|
310
310
|
|
package/scripts/typegen.sh
CHANGED
|
@@ -13,23 +13,32 @@ echo "Generating ..."
|
|
|
13
13
|
|
|
14
14
|
# utils
|
|
15
15
|
${BASE_DIR}/node_modules/.bin/tsc shell/utils/*.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/utils > /dev/null
|
|
16
|
+
${BASE_DIR}/node_modules/.bin/tsc shell/utils/validators/*.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/utils/validators > /dev/null
|
|
17
|
+
${BASE_DIR}/node_modules/.bin/tsc shell/utils/crypto/*.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/utils/crypto > /dev/null
|
|
16
18
|
|
|
17
19
|
# config
|
|
18
20
|
${BASE_DIR}/node_modules/.bin/tsc shell/config/query-params.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/config > /dev/null
|
|
19
21
|
${BASE_DIR}/node_modules/.bin/tsc shell/config/table-headers.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/config > /dev/null
|
|
20
22
|
${BASE_DIR}/node_modules/.bin/tsc shell/config/types.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/config > /dev/null
|
|
23
|
+
${BASE_DIR}/node_modules/.bin/tsc shell/config/labels-annotations.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/config > /dev/null
|
|
21
24
|
|
|
22
25
|
# store
|
|
23
26
|
${BASE_DIR}/node_modules/.bin/tsc shell/store/features.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/store > /dev/null
|
|
27
|
+
${BASE_DIR}/node_modules/.bin/tsc shell/store/prefs.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/store > /dev/null
|
|
24
28
|
|
|
25
29
|
# plugins
|
|
26
30
|
${BASE_DIR}/node_modules/.bin/tsc shell/plugins/dashboard-store/normalize.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/plugins/dashboard-store/ > /dev/null
|
|
27
31
|
${BASE_DIR}/node_modules/.bin/tsc shell/plugins/dashboard-store/resource-class.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/plugins/dashboard-store/ > /dev/null
|
|
32
|
+
${BASE_DIR}/node_modules/.bin/tsc shell/plugins/dashboard-store/classify.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/plugins/dashboard-store/ > /dev/null
|
|
33
|
+
${BASE_DIR}/node_modules/.bin/tsc shell/plugins/dashboard-store/actions.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/plugins/dashboard-store/ > /dev/null
|
|
28
34
|
|
|
29
|
-
|
|
30
|
-
# mkixins
|
|
35
|
+
# mixins
|
|
31
36
|
${BASE_DIR}/node_modules/.bin/tsc shell/mixins/create-edit-view/index.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/mixins/create-edit-view > /dev/null
|
|
32
37
|
|
|
38
|
+
# models
|
|
39
|
+
${BASE_DIR}/node_modules/.bin/tsc shell/models/namespace.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/models/ > /dev/null
|
|
40
|
+
${BASE_DIR}/node_modules/.bin/tsc shell/models/networking.k8s.io.ingress.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/models/ > /dev/null
|
|
41
|
+
|
|
33
42
|
#./node_modules/.bin/tsc shell/plugins/dashboard-store/*.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/plugins/dashboard-store > /dev/null
|
|
34
43
|
|
|
35
44
|
# Go through all of the folders and combine by wrapping with 'declare module'
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export default function(req, res, next) {
|
|
4
|
-
const parsed = new URL(req.url, 'https://localhost');
|
|
5
|
-
|
|
6
|
-
if ( parsed.searchParams.has('spa') ) {
|
|
7
|
-
res.spa = true;
|
|
8
|
-
console.log('SPA mode enabled'); // eslint-disable-line no-console
|
|
9
|
-
}
|
|
10
|
-
|
|
1
|
+
module.exports = function(req, res, next) {
|
|
11
2
|
// We do this redirect so that /verify-auth can work with both standalone and
|
|
12
3
|
// while dashboard is nested under ember.
|
|
13
4
|
if (req.url.includes('/verify-auth') || req.url.includes('/verify-auth-azure')) {
|
|
14
5
|
res.writeHead(301, { Location: req.url.replace(/verify-auth(-azure)?/, 'auth/verify') });
|
|
15
6
|
res.end();
|
|
16
|
-
}
|
|
17
7
|
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
18
10
|
next();
|
|
19
|
-
}
|
|
11
|
+
};
|
package/store/index.js
CHANGED
|
@@ -33,14 +33,13 @@ import { allHash, allHashSettled } from '@shell/utils/promise';
|
|
|
33
33
|
import { sortBy } from '@shell/utils/sort';
|
|
34
34
|
import { addParam } from '@shell/utils/url';
|
|
35
35
|
import semver from 'semver';
|
|
36
|
-
import { STORE } from '@shell/store/store-types';
|
|
36
|
+
import { STORE, BLANK_CLUSTER } from '@shell/store/store-types';
|
|
37
|
+
import { isDevBuild } from '@shell/utils/version';
|
|
37
38
|
|
|
38
39
|
// Disables strict mode for all store instances to prevent warning about changing state outside of mutations
|
|
39
40
|
// because it's more efficient to do that sometimes.
|
|
40
41
|
export const strict = false;
|
|
41
42
|
|
|
42
|
-
export const BLANK_CLUSTER = '_';
|
|
43
|
-
|
|
44
43
|
export const plugins = [
|
|
45
44
|
Steve({
|
|
46
45
|
namespace: STORE.MANAGEMENT,
|
|
@@ -573,6 +572,18 @@ export const getters = {
|
|
|
573
572
|
return state.targetRoute;
|
|
574
573
|
},
|
|
575
574
|
|
|
575
|
+
releaseNotesUrl(state, getters) {
|
|
576
|
+
const version = getters['management/byId'](MANAGEMENT.SETTING, 'server-version')?.value;
|
|
577
|
+
|
|
578
|
+
const base = 'https://github.com/rancher/rancher/releases';
|
|
579
|
+
|
|
580
|
+
if (version && !isDevBuild(version)) {
|
|
581
|
+
return `${ base }/tag/${ version }`;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
return `${ base }/latest`;
|
|
585
|
+
},
|
|
586
|
+
|
|
576
587
|
...gcGetters
|
|
577
588
|
};
|
|
578
589
|
|
package/store/prefs.js
CHANGED
|
@@ -111,9 +111,6 @@ export const _RKE1 = 'rke1';
|
|
|
111
111
|
export const _RKE2 = 'rke2';
|
|
112
112
|
export const PROVISIONER = create('provisioner', _RKE2, { options: [_RKE1, _RKE2] });
|
|
113
113
|
|
|
114
|
-
// Promo for Cluster Tools feature on Cluster Dashboard page
|
|
115
|
-
export const CLUSTER_TOOLS_TIP = create('hide-cluster-tools-tip', false, { parseJSON });
|
|
116
|
-
|
|
117
114
|
// Promo for Pod Security Policies (PSPs) being deprecated on kube version 1.25 on Cluster Dashboard page
|
|
118
115
|
export const PSP_DEPRECATION_BANNER = create('hide-psp-deprecation-banner', false, { parseJSON });
|
|
119
116
|
|
package/store/store-types.js
CHANGED
package/store/type-map.js
CHANGED
|
@@ -151,8 +151,6 @@ import { sortBy } from '@shell/utils/sort';
|
|
|
151
151
|
import { haveV1Monitoring, haveV2Monitoring } from '@shell/utils/monitoring';
|
|
152
152
|
import { NEU_VECTOR_NAMESPACE } from '@shell/config/product/neuvector';
|
|
153
153
|
|
|
154
|
-
import { ExtensionPoint, TableColumnLocation } from '@shell/core/types';
|
|
155
|
-
|
|
156
154
|
export const NAMESPACED = 'namespaced';
|
|
157
155
|
export const CLUSTER_LEVEL = 'cluster';
|
|
158
156
|
export const BOTH = 'both';
|
|
@@ -229,33 +227,6 @@ export function DSL(store, product, module = 'type-map') {
|
|
|
229
227
|
},
|
|
230
228
|
|
|
231
229
|
headers(type, headers) {
|
|
232
|
-
// gate it so that we prevent errors on older versions of dashboard
|
|
233
|
-
if (store.$plugin?.getUIConfig) {
|
|
234
|
-
const extensionCols = store.$plugin.getUIConfig(ExtensionPoint.TABLE_COL, TableColumnLocation.RESOURCE);
|
|
235
|
-
|
|
236
|
-
// Try and insert the columns before the Age column, if that is the last column
|
|
237
|
-
let insertPosition = headers.length;
|
|
238
|
-
|
|
239
|
-
if (headers.length > 0) {
|
|
240
|
-
const lastColumn = headers[headers.length - 1];
|
|
241
|
-
|
|
242
|
-
if (lastColumn?.name === AGE.name) {
|
|
243
|
-
insertPosition--;
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
// adding extension defined cols to the correct header config
|
|
248
|
-
extensionCols.forEach((col) => {
|
|
249
|
-
if (col.locationConfig.resource) {
|
|
250
|
-
col.locationConfig.resource.forEach((resource) => {
|
|
251
|
-
if (resource && type === resource) {
|
|
252
|
-
headers.splice(insertPosition, 0, col);
|
|
253
|
-
}
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
|
|
259
230
|
headers.forEach((header) => {
|
|
260
231
|
// If on the client, then use the value getter if there is one
|
|
261
232
|
if (header.getValue) {
|
|
@@ -782,6 +753,15 @@ export const getters = {
|
|
|
782
753
|
};
|
|
783
754
|
},
|
|
784
755
|
|
|
756
|
+
isVirtual(state, getters, rootState, rootGetters) {
|
|
757
|
+
return (name, product) => {
|
|
758
|
+
product = product || rootGetters['productId'];
|
|
759
|
+
const productVirtualTypes = state.virtualTypes[product] || [];
|
|
760
|
+
|
|
761
|
+
return productVirtualTypes.some((st) => st.name === name);
|
|
762
|
+
};
|
|
763
|
+
},
|
|
764
|
+
|
|
785
765
|
getSpoofedInstances(state, getters, rootState, rootGetters) {
|
|
786
766
|
return async(type, product) => {
|
|
787
767
|
product = product || rootGetters['productId'];
|
|
@@ -1390,6 +1370,14 @@ export const getters = {
|
|
|
1390
1370
|
return _rowValueGetter(col);
|
|
1391
1371
|
};
|
|
1392
1372
|
},
|
|
1373
|
+
|
|
1374
|
+
isProductRegistered(state) {
|
|
1375
|
+
return (productName) => {
|
|
1376
|
+
const prod = state.products.find((p) => p.name === productName);
|
|
1377
|
+
|
|
1378
|
+
return !!prod;
|
|
1379
|
+
};
|
|
1380
|
+
},
|
|
1393
1381
|
};
|
|
1394
1382
|
|
|
1395
1383
|
export const mutations = {
|
package/types/api.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Verbs = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'WATCH' | 'LIST' | 'CREATE' | 'UP'
|
package/types/fleet.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type WorkloadType = 'pods' | 'apps.deployments' | 'replicasets' | 'daemonsets' | 'statefulsets' | 'jobs' | 'cronjobs'
|