@rancher/shell 0.1.4 → 0.1.21

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.
Files changed (152) hide show
  1. package/assets/brand/suse/favicon.png +0 -0
  2. package/assets/images/generic-plugin.svg +1 -7
  3. package/assets/translations/en-us.yaml +81 -47
  4. package/components/CommunityLinks.vue +40 -49
  5. package/components/ExplorerProjectsNamespaces.vue +20 -3
  6. package/components/LazyImage.vue +21 -8
  7. package/components/PromptRemove.vue +2 -2
  8. package/components/ResourceList/Masthead.vue +21 -1
  9. package/components/ResourceList/ResourceLoadingIndicator.vue +0 -8
  10. package/components/ResourceList/index.vue +9 -23
  11. package/components/SortableTable/index.vue +13 -10
  12. package/components/Tabbed/index.vue +25 -7
  13. package/components/TypeDescription.vue +10 -1
  14. package/components/fleet/FleetClusters.vue +6 -0
  15. package/components/fleet/FleetRepos.vue +7 -1
  16. package/components/form/Command.vue +5 -0
  17. package/components/form/EnvVars.vue +5 -0
  18. package/components/form/NameNsDescription.vue +3 -1
  19. package/components/form/NodeScheduling.vue +6 -1
  20. package/components/form/PodAffinity.vue +5 -0
  21. package/components/form/ServiceNameSelect.vue +5 -0
  22. package/components/form/ValueFromResource.vue +7 -1
  23. package/components/nav/TopLevelMenu.vue +2 -1
  24. package/config/home-links.js +155 -0
  25. package/config/private-label.js +1 -1
  26. package/config/product/manager.js +0 -2
  27. package/config/product/uiplugins.js +1 -1
  28. package/config/settings.js +3 -1
  29. package/config/uiplugins.js +63 -6
  30. package/config/version.js +17 -0
  31. package/core/plugin.ts +12 -0
  32. package/core/plugins.js +29 -5
  33. package/core/types.ts +6 -0
  34. package/creators/app/{.eslintignore → files/.eslintignore} +0 -0
  35. package/creators/app/{.eslintrc.js → files/.eslintrc.js} +0 -0
  36. package/creators/app/{.vscode → files/.vscode}/settings.json +0 -0
  37. package/creators/app/{babel.config.js → files/babel.config.js} +0 -0
  38. package/creators/app/{nuxt.config.js → files/nuxt.config.js} +0 -0
  39. package/creators/app/{tsconfig.json → files/tsconfig.json} +2 -1
  40. package/creators/app/init +16 -17
  41. package/creators/app/package.json +6 -0
  42. package/creators/pkg/{babel.config.js → files/babel.config.js} +0 -0
  43. package/creators/pkg/{index.ts → files/index.ts} +0 -0
  44. package/creators/pkg/{tsconfig.json → files/tsconfig.json} +13 -12
  45. package/creators/pkg/{vue.config.js → files/vue.config.js} +0 -0
  46. package/creators/pkg/init +1 -1
  47. package/creators/update/init +54 -0
  48. package/creators/update/package.json +20 -0
  49. package/creators/update/upgrade +56 -0
  50. package/creators/update/yarn-error.log +54 -0
  51. package/detail/workload/index.vue +1 -0
  52. package/edit/persistentvolume/index.vue +48 -13
  53. package/edit/persistentvolumeclaim.vue +31 -13
  54. package/edit/provisioning.cattle.io.cluster/rke2.vue +27 -19
  55. package/edit/workload/index.vue +19 -9
  56. package/edit/workload/mixins/workload.js +109 -114
  57. package/edit/workload/storage/index.vue +11 -17
  58. package/edit/workload/storage/persistentVolumeClaim/index.vue +5 -0
  59. package/edit/workload/storage/secret.vue +6 -1
  60. package/list/catalog.cattle.io.app.vue +10 -9
  61. package/list/catalog.cattle.io.clusterrepo.vue +6 -61
  62. package/list/cis.cattle.io.clusterscan.vue +12 -12
  63. package/list/fleet.cattle.io.bundle.vue +33 -28
  64. package/list/fleet.cattle.io.cluster.vue +26 -22
  65. package/list/fleet.cattle.io.clustergroup.vue +6 -0
  66. package/list/fleet.cattle.io.clusterregistrationtoken.vue +28 -24
  67. package/list/fleet.cattle.io.gitrepo.vue +25 -14
  68. package/list/helm.cattle.io.projecthelmchart.vue +52 -33
  69. package/list/logging.banzaicloud.io.clusterflow.vue +7 -12
  70. package/list/logging.banzaicloud.io.flow.vue +7 -14
  71. package/list/management.cattle.io.cluster.vue +26 -15
  72. package/list/management.cattle.io.feature.vue +13 -8
  73. package/list/management.cattle.io.user.vue +38 -19
  74. package/list/monitoring.coreos.com.alertmanagerconfig.vue +8 -15
  75. package/list/namespace.vue +14 -1
  76. package/list/node.vue +13 -16
  77. package/list/persistentvolume.vue +16 -9
  78. package/list/persistentvolumeclaim.vue +5 -8
  79. package/list/provisioning.cattle.io.cluster.vue +34 -8
  80. package/list/service.vue +24 -12
  81. package/list/ui.cattle.io.navlink.vue +6 -0
  82. package/list/workload.vue +2 -2
  83. package/middleware/authenticated.js +6 -0
  84. package/mixins/resource-fetch.js +12 -18
  85. package/mixins/resource-manager.js +126 -0
  86. package/models/catalog.cattle.io.uiplugin.js +4 -0
  87. package/models/pod.js +15 -5
  88. package/models/provisioning.cattle.io.cluster.js +4 -0
  89. package/models/workload.service.js +10 -0
  90. package/nuxt.config.js +2 -1
  91. package/package.json +1 -1
  92. package/pages/auth/login.vue +10 -0
  93. package/pages/auth/verify.vue +9 -0
  94. package/pages/c/_cluster/settings/DefaultLinksEditor.vue +108 -0
  95. package/pages/c/_cluster/settings/links.vue +53 -101
  96. package/pages/c/_cluster/settings/performance.vue +90 -7
  97. package/pages/c/_cluster/uiplugins/DeveloperInstallDialog.vue +3 -3
  98. package/pages/c/_cluster/uiplugins/InstallDialog.vue +71 -20
  99. package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +21 -5
  100. package/pages/c/_cluster/uiplugins/RemoveUIPlugins.vue +2 -7
  101. package/pages/c/_cluster/uiplugins/SetupUIPlugins.vue +23 -15
  102. package/pages/c/_cluster/uiplugins/UninstallDialog.vue +11 -4
  103. package/pages/c/_cluster/uiplugins/index.vue +179 -65
  104. package/pages/support/index.vue +31 -142
  105. package/plugins/dashboard-store/actions.js +19 -0
  106. package/plugins/dashboard-store/getters.js +20 -3
  107. package/plugins/dashboard-store/mutations.js +13 -7
  108. package/plugins/plugin.js +18 -15
  109. package/plugins/steve/getters.js +12 -0
  110. package/plugins/version.js +21 -0
  111. package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +6 -7
  112. package/rancher-components/components/BadgeState/BadgeState.spec.ts +12 -0
  113. package/rancher-components/components/BadgeState/BadgeState.vue +107 -0
  114. package/rancher-components/components/BadgeState/index.ts +1 -0
  115. package/rancher-components/components/Banner/Banner.test.ts +13 -0
  116. package/rancher-components/components/Banner/Banner.vue +163 -0
  117. package/rancher-components/components/Banner/index.ts +1 -0
  118. package/rancher-components/components/Card/Card.vue +150 -0
  119. package/rancher-components/components/Card/index.ts +1 -0
  120. package/rancher-components/components/Form/Checkbox/Checkbox.test.ts +77 -0
  121. package/rancher-components/components/Form/Checkbox/Checkbox.vue +395 -0
  122. package/rancher-components/components/Form/Checkbox/index.ts +1 -0
  123. package/rancher-components/components/Form/LabeledInput/LabeledInput.test.ts +29 -0
  124. package/rancher-components/components/Form/LabeledInput/LabeledInput.vue +343 -0
  125. package/rancher-components/components/Form/LabeledInput/index.ts +1 -0
  126. package/rancher-components/components/Form/Radio/RadioButton.vue +270 -0
  127. package/rancher-components/components/Form/Radio/RadioGroup.vue +235 -0
  128. package/rancher-components/components/Form/Radio/index.ts +2 -0
  129. package/rancher-components/components/Form/TextArea/TextAreaAutoGrow.vue +168 -0
  130. package/rancher-components/components/Form/TextArea/index.ts +1 -0
  131. package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.test.ts +107 -0
  132. package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.vue +137 -0
  133. package/rancher-components/components/Form/ToggleSwitch/index.ts +1 -0
  134. package/rancher-components/components/Form/index.ts +5 -0
  135. package/rancher-components/components/LabeledTooltip/LabeledTooltip.vue +137 -0
  136. package/rancher-components/components/LabeledTooltip/index.ts +1 -0
  137. package/scripts/publish-shell.sh +39 -6
  138. package/scripts/record-deps.js +37 -0
  139. package/scripts/test-plugins-build.sh +8 -5
  140. package/scripts/typegen.sh +84 -0
  141. package/store/auth.js +3 -0
  142. package/store/index.js +12 -3
  143. package/types/shell/index.d.ts +3046 -0
  144. package/utils/favicon.js +8 -2
  145. package/utils/gc/gc-interval.ts +40 -0
  146. package/utils/gc/gc-root-store.js +76 -0
  147. package/utils/gc/gc-route-changed.ts +44 -0
  148. package/utils/gc/gc-types.ts +21 -0
  149. package/utils/gc/gc.ts +282 -0
  150. package/config/footer.js +0 -18
  151. package/creators/pkg/nuxt.config.js +0 -6
  152. package/yarn-error.log +0 -195
@@ -0,0 +1,137 @@
1
+ <script lang="ts">
2
+ import Vue from 'vue';
3
+
4
+ export default Vue.extend({
5
+ props: {
6
+ /**
7
+ * The Labeled Tooltip value.
8
+ */
9
+ value: {
10
+ type: [String, Object],
11
+ default: null
12
+ },
13
+
14
+ /**
15
+ * The status for the Labeled Tooltip. Controls the Labeled Tooltip class.
16
+ * @values info, success, warning, error
17
+ */
18
+ status: {
19
+ type: String,
20
+ default: 'error'
21
+ },
22
+
23
+ /**
24
+ * Displays the Labeled Tooltip on mouse hover.
25
+ */
26
+ hover: {
27
+ type: Boolean,
28
+ default: true
29
+ }
30
+ },
31
+ computed: {
32
+ iconClass() {
33
+ return this.status === 'error' ? 'icon-warning' : 'icon-info';
34
+ }
35
+ }
36
+ });
37
+ </script>
38
+
39
+ <template>
40
+ <div ref="container" class="labeled-tooltip" :class="{[status]: true, hoverable: hover}">
41
+ <template v-if="hover">
42
+ <i v-tooltip="value.content ? { ...{content: value.content, classes: [`tooltip-${status}`]}, ...value } : value" :class="{'hover':!value, [iconClass]: true}" class="icon status-icon" />
43
+ </template>
44
+ <template v-else>
45
+ <i :class="{'hover':!value}" class="icon status-icon" />
46
+ <div v-if="value" class="tooltip" x-placement="bottom">
47
+ <div class="tooltip-arrow" />
48
+ <div class="tooltip-inner">
49
+ {{ value }}
50
+ </div>
51
+ </div>
52
+ </template>
53
+ </div>
54
+ </template>
55
+
56
+ <style lang='scss'>
57
+ .labeled-tooltip {
58
+ position: absolute;
59
+ width: 100%;
60
+ height: 100%;
61
+ left: 0;
62
+ top: 0;
63
+
64
+ &.hoverable {
65
+ height: 0%;
66
+ }
67
+
68
+ .status-icon {
69
+ position: absolute;
70
+ right: 30px;
71
+ top: $input-padding-lg;
72
+ font-size: 20px;
73
+ z-index: z-index(hoverOverContent);
74
+ }
75
+
76
+ .tooltip {
77
+ position: absolute;
78
+ width: calc(100% + 2px);
79
+ top: calc(100% + 6px);
80
+
81
+ .tooltip-arrow {
82
+ right: 30px;
83
+ }
84
+
85
+ .tooltip-inner {
86
+ padding: 10px;
87
+ }
88
+ }
89
+
90
+ @mixin tooltipColors($color) {
91
+ .status-icon {
92
+ color: $color;
93
+ }
94
+ .tooltip {
95
+ .tooltip-inner {
96
+ color: var(--input-bg);
97
+ background: $color;
98
+ border-color: $color;
99
+ }
100
+
101
+ .tooltip-arrow {
102
+ border-bottom-color: $color;
103
+ &:after {
104
+ border: none;
105
+ }
106
+ }
107
+ }
108
+ }
109
+
110
+ &.error {
111
+ @include tooltipColors(var(--error));
112
+
113
+ .status-icon {
114
+ top: 7px;
115
+ right: 5px;
116
+ }
117
+ }
118
+
119
+ &.warning {
120
+ @include tooltipColors(var(--warning));
121
+ }
122
+
123
+ &.success {
124
+ @include tooltipColors(var(--success));
125
+ }
126
+ }
127
+
128
+ // Ensure code blocks inside tootips don't look awful
129
+ .tooltip {
130
+ .tooltip-inner {
131
+ > pre {
132
+ padding: 2px;
133
+ vertical-align: middle;
134
+ }
135
+ }
136
+ }
137
+ </style>
@@ -0,0 +1 @@
1
+ export { default as LabeledTooltip } from './LabeledTooltip.vue';
@@ -6,8 +6,14 @@ BASE_DIR="$(
6
6
  pwd
7
7
  )"
8
8
  SHELL_DIR=$BASE_DIR/shell/
9
+ TMP_DIR=$BASE_DIR/tmp
9
10
  PUBLISH_ARGS="--no-git-tag-version --access public $PUBLISH_ARGS"
10
11
 
12
+ if [ ! -d "${BASE_DIR}/node_modules" ]; then
13
+ echo "You need to run 'yarn install' first"
14
+ exit 1
15
+ fi
16
+
11
17
  echo "Publishing Shell Packages"
12
18
 
13
19
  # We use the version from the shell package for the creator packages
@@ -20,6 +26,7 @@ PKG_DIST=$BASE_DIR/dist-pkg/creators
20
26
  mkdir -p ${PKG_DIST}
21
27
  rm -rf ${PKG_DIST}/app
22
28
  rm -rf ${PKG_DIST}/pkg
29
+ rm -rf ${PKG_DIST}/update
23
30
 
24
31
  pushd ${SHELL_DIR} >/dev/null
25
32
 
@@ -30,12 +37,15 @@ echo "Publishing version: $PKG_VERSION"
30
37
 
31
38
  cp -R ${SHELL_DIR}/creators/app ${PKG_DIST}
32
39
  cp -R ${SHELL_DIR}/creators/pkg ${PKG_DIST}
40
+ cp -R ${SHELL_DIR}/creators/update ${PKG_DIST}
33
41
 
34
42
  sed -i.bak -e "s/\"0.0.0/"\"$PKG_VERSION"/g" ${PKG_DIST}/app/package.json
35
43
  sed -i.bak -e "s/\"0.0.0/"\"$PKG_VERSION"/g" ${PKG_DIST}/pkg/package.json
44
+ sed -i.bak -e "s/\"0.0.0/"\"$PKG_VERSION"/g" ${PKG_DIST}/update/package.json
36
45
 
37
46
  rm ${PKG_DIST}/app/package.json.bak
38
47
  rm ${PKG_DIST}/pkg/package.json.bak
48
+ rm ${PKG_DIST}/update/package.json.bak
39
49
 
40
50
  function publish() {
41
51
  NAME=$1
@@ -45,14 +55,32 @@ function publish() {
45
55
  pushd ${FOLDER} >/dev/null
46
56
 
47
57
  # For now, copy the rancher components into the shell and ship them with it
48
- if [ "$NAME" == "Shell" ]; then
58
+ if [ "$NAME" == "+Shell" ]; then
49
59
  echo "Adding Rancher Components"
50
- rm -rf ${SHELL_DIR}/rancher-components
51
- cp -R ${BASE_DIR}/pkg/rancher-components/src/components ${SHELL_DIR}/rancher-components/
60
+ cp -R ${BASE_DIR}/pkg/rancher-components/src/components ./rancher-components/
61
+ fi
62
+
63
+ if [ "$NAME" == "Update" ]; then
64
+ # Add files from the app and pkg creators to the update package
65
+ mkdir -p ./app
66
+ mkdir -p ./pkg
67
+ cp -R ${BASE_DIR}/shell/creators/app/* ./app
68
+ cp -R ${BASE_DIR}/shell/creators/pkg/* ./pkg
69
+ # Remove index.ts from pkg files, as we don't want to replace that
70
+ rm -f ./pkg/files/index.ts
71
+
72
+ # Update the package.json for the app
73
+ cd app
74
+ node ${SCRIPT_DIR}/record-deps.js
75
+ cd ..
52
76
  fi
53
77
 
78
+ # Make a note of dependency versions, if required
79
+ node ${SCRIPT_DIR}/record-deps.js
80
+
54
81
  yarn publish . --new-version ${PKG_VERSION} ${PUBLISH_ARGS}
55
82
  RET=$?
83
+
56
84
  popd >/dev/null
57
85
 
58
86
  if [ $RET -ne 0 ]; then
@@ -61,10 +89,15 @@ function publish() {
61
89
  fi
62
90
  }
63
91
 
92
+ # Generate the type definitions for the shell
93
+ ${SCRIPT_DIR}/typegen.sh
94
+
64
95
  # Publish the packages - don't tag the git repo and don't auto-increment the version number
65
96
  publish "Shell" ${SHELL_DIR}
66
-
67
- publish "Application creator" ${PKG_DIST}/app
68
- publish "Package creator" ${PKG_DIST}/pkg
97
+ publish "Application creator" ${PKG_DIST}/app/
98
+ publish "Package creator" ${PKG_DIST}/pkg/
99
+ publish "Update" ${PKG_DIST}/update/
69
100
 
70
101
  echo "Done"
102
+
103
+
@@ -0,0 +1,37 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+
4
+ // Script lives in shell/scripts, so work out top-level dir from there
5
+ const topDir = path.resolve(__dirname, '..', '..')
6
+ const dir = process.cwd();
7
+
8
+ // Read the package.json file
9
+ const topPkgFile = path.join(topDir, 'package.json');
10
+ const pkgFile = path.join(dir, 'package.json');
11
+
12
+ const topPkg = JSON.parse(fs.readFileSync(topPkgFile));
13
+ const mainPkg = JSON.parse(fs.readFileSync(pkgFile));
14
+
15
+ // Look to see if we specify the deps we require
16
+ if (mainPkg._requires) {
17
+ // Map each one to the same version as the main package
18
+ const out = {};
19
+
20
+ mainPkg._requires.forEach(name => {
21
+ let ver = topPkg.dependencies?.[name] || topPkg.devDependencies?.[name];
22
+
23
+ if (name === '@rancher/components') {
24
+ const componentsPkgFile = path.join(topDir, 'pkg', 'rancher-components', 'package.json');
25
+ const componentsPkg = JSON.parse(fs.readFileSync(componentsPkgFile));
26
+
27
+ ver = componentsPkg.version;
28
+ }
29
+
30
+ out[name] = ver;
31
+ });
32
+
33
+ mainPkg._pkgs = out;
34
+ delete mainPkg._requires;
35
+
36
+ fs.writeFileSync(pkgFile, JSON.stringify(mainPkg, null, 2), 'utf-8');
37
+ }
@@ -67,7 +67,10 @@ else
67
67
  fi
68
68
 
69
69
  export YARN_REGISTRY=http://localhost:4873
70
- export NEXT_TELEMETRY_DISABLED=1
70
+ export NUXT_TELEMETRY_DISABLED=1
71
+
72
+ # Remove test package from previous run, if present
73
+ rm -rf ${BASE_DIR}/pkg/test-pkg
71
74
 
72
75
  # We need to patch the version number of the shell, otherwise if we are running
73
76
  # with the currently published version, things will fail as those versions
@@ -92,21 +95,21 @@ if [ "${SKIP_STANDALONE}" == "false" ]; then
92
95
  yarn install
93
96
 
94
97
  echo "Building skeleton app"
95
- yarn build
98
+ FORCE_COLOR=true yarn build | cat
96
99
 
97
100
  # Package creator
98
101
  echo "Verifying package creator package"
99
102
  yarn create @rancher/pkg test-pkg
100
103
 
101
104
  echo "Building test package"
102
- yarn build-pkg test-pkg
105
+ FORCE_COLOR=true yarn build-pkg test-pkg | cat
103
106
 
104
107
  # Add test list component to the test package
105
108
  # Validates rancher-components imports
106
109
  mkdir pkg/test-pkg/list
107
110
  cp ${SHELL_DIR}/list/catalog.cattle.io.clusterrepo.vue pkg/test-pkg/list
108
111
 
109
- yarn build-pkg test-pkg
112
+ FORCE_COLOR=true yarn build-pkg test-pkg | cat
110
113
 
111
114
  echo "Cleaning temporary dir"
112
115
  popd > /dev/null
@@ -126,7 +129,7 @@ yarn install
126
129
  rm -rf ./pkg/test-pkg
127
130
  yarn create @rancher/pkg test-pkg -t
128
131
  cp ${SHELL_DIR}/list/catalog.cattle.io.clusterrepo.vue ./pkg/test-pkg/list
129
- yarn build-pkg test-pkg
132
+ FORCE_COLOR=true yarn build-pkg test-pkg | cat
130
133
  rm -rf ./pkg/test-pkg
131
134
 
132
135
  echo "All done"
@@ -0,0 +1,84 @@
1
+ #!/usr/bin/env bash
2
+
3
+ SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
4
+ BASE_DIR="$( cd $SCRIPT_DIR && cd ../.. & pwd)"
5
+ SHELL_DIR=$BASE_DIR/shell
6
+
7
+ echo "Generating typescript definitions"
8
+
9
+ rm -rf ${SHELL_DIR}/tmp
10
+ mkdir -p ${SHELL_DIR}/tmp
11
+
12
+ echo "Generating ..."
13
+
14
+ # utils
15
+ ${BASE_DIR}/node_modules/.bin/tsc shell/utils/*.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/utils > /dev/null
16
+
17
+ # config
18
+ ${BASE_DIR}/node_modules/.bin/tsc shell/config/query-params.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/config > /dev/null
19
+ ${BASE_DIR}/node_modules/.bin/tsc shell/config/table-headers.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/config > /dev/null
20
+ ${BASE_DIR}/node_modules/.bin/tsc shell/config/types.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/config > /dev/null
21
+
22
+ # store
23
+ ${BASE_DIR}/node_modules/.bin/tsc shell/store/features.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/store > /dev/null
24
+
25
+ # plugins
26
+ ${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
+ ${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
28
+
29
+
30
+ # mkixins
31
+ ${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
+
33
+ #./node_modules/.bin/tsc shell/plugins/dashboard-store/*.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/plugins/dashboard-store > /dev/null
34
+
35
+ # Go through all of the folders and combine by wrapping with 'declare module'
36
+
37
+ echo "Combining type definitions ..."
38
+
39
+ DEST=${SHELL_DIR}/types/shell
40
+ mkdir -p ${DEST}
41
+
42
+ INDEX=${DEST}/index.d.ts
43
+ rm -rf ${INDEX}
44
+
45
+ echo "// Auto-generated type definitions for shell" > ${INDEX}
46
+ echo "// Do not modify this file as changes will get overwritten" >> ${INDEX}
47
+
48
+ # Copy in the vue shim type definitions
49
+ if [ -f "$BASE_DIR/vue-shim.d.ts" ]; then
50
+ cat "$BASE_DIR/vue-shim.d.ts" >> ${INDEX}
51
+ fi
52
+
53
+ function processDir() {
54
+ local dir=$1
55
+ local basePkg=$2
56
+
57
+ for entry in $1/*
58
+ do
59
+ local filename=$(basename $entry)
60
+
61
+ if [ -d $entry ]; then
62
+ processDir $entry $basePkg/$filename
63
+ else
64
+ if [[ $filename == *.d.ts ]]; then
65
+ # We use convoluted mechanism here to ensure this works on mac with bash 3.x
66
+ local name=$(echo $filename | rev | cut -c6- | rev)
67
+
68
+ local module=${basePkg}/${name}
69
+ if [ "${name}" == "index" ]; then
70
+ module=${basePkg}
71
+ fi
72
+
73
+ echo -e "\n// ${module}\n" >> ${INDEX}
74
+ echo "declare module '${module}' {" >> ${INDEX}
75
+ cat $entry >> ${INDEX}
76
+ echo -e "}" >> ${INDEX}
77
+ fi
78
+ fi
79
+ done
80
+ }
81
+
82
+ processDir ${SHELL_DIR}/tmp @shell
83
+
84
+ rm -rf ${SHELL_DIR}/tmp
package/store/auth.js CHANGED
@@ -310,6 +310,9 @@ export const actions = {
310
310
  },
311
311
 
312
312
  async logout({ dispatch, commit }) {
313
+ // Unload plugins - we will load again on login
314
+ await this.$plugin.logout();
315
+
313
316
  try {
314
317
  await dispatch('rancher/request', {
315
318
  url: '/v3/tokens?action=logout',
package/store/index.js CHANGED
@@ -26,6 +26,7 @@ import {
26
26
  NAMESPACE_FILTER_NAMESPACED_PREFIX as NAMESPACED_PREFIX,
27
27
  splitNamespaceFilterKey,
28
28
  } from '@shell/utils/namespace-filter';
29
+ import { gcActions, gcGetters } from '@shell/utils/gc/gc-root-store';
29
30
 
30
31
  // Disables strict mode for all store instances to prevent warning about changing state outside of mutations
31
32
  // because it's more efficient to do that sometimes.
@@ -44,6 +45,7 @@ export const plugins = [
44
45
  namespace: 'cluster',
45
46
  baseUrl: '', // URL is dynamically set for the selected cluster
46
47
  supportsStream: false, // true, -- Disabled due to report that it's sometimes much slower in Chrome
48
+ supportsGc: true, // Enable garbage collection for this store only
47
49
  }),
48
50
  Steve({
49
51
  namespace: 'rancher',
@@ -455,7 +457,9 @@ export const getters = {
455
457
  const cluster = getters['currentCluster'];
456
458
 
457
459
  return cluster?.status?.provider === VIRTUAL_HARVESTER_PROVIDER;
458
- }
460
+ },
461
+
462
+ ...gcGetters
459
463
  };
460
464
 
461
465
  export const mutations = {
@@ -539,7 +543,8 @@ export const mutations = {
539
543
 
540
544
  setIsSingleProduct(state, isSingleProduct) {
541
545
  state.isSingleProduct = isSingleProduct;
542
- }
546
+ },
547
+
543
548
  };
544
549
 
545
550
  export const actions = {
@@ -861,6 +866,8 @@ export const actions = {
861
866
  async onLogout(store) {
862
867
  const { dispatch, commit, state } = store;
863
868
 
869
+ store.dispatch('gcStopIntervals');
870
+
864
871
  Object.values(this.$plugin.getPlugins()).forEach((p) => {
865
872
  if (p.onLogOut) {
866
873
  p.onLogOut(store);
@@ -975,5 +982,7 @@ export const actions = {
975
982
 
976
983
  setIsSingleProduct({ commit }, isSingleProduct) {
977
984
  commit(`setIsSingleProduct`, isSingleProduct);
978
- }
985
+ },
986
+
987
+ ...gcActions
979
988
  };