@rancher/shell 0.1.3 → 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 (245) hide show
  1. package/assets/brand/suse/dark/rancher-logo.svg +1 -148
  2. package/assets/brand/suse/favicon.png +0 -0
  3. package/assets/brand/suse/rancher-logo.svg +1 -130
  4. package/assets/images/featured/img1.jpg +0 -0
  5. package/assets/images/featured.jpg +0 -0
  6. package/assets/images/generic-plugin.svg +1 -0
  7. package/assets/styles/themes/_dark.scss +3 -0
  8. package/assets/styles/themes/_light.scss +3 -0
  9. package/assets/styles/themes/_suse.scss +1 -1
  10. package/assets/translations/en-us.yaml +219 -47
  11. package/assets/translations/zh-hans.yaml +21 -24
  12. package/components/AsyncButton.vue +17 -2
  13. package/components/ButtonDropdown.vue +4 -0
  14. package/components/Carousel.vue +291 -0
  15. package/components/CommunityLinks.vue +64 -22
  16. package/components/CruResource.vue +11 -3
  17. package/components/Dialog.vue +102 -0
  18. package/components/ExplorerMembers.vue +2 -4
  19. package/components/ExplorerProjectsNamespaces.vue +25 -9
  20. package/components/IconMessage.vue +9 -1
  21. package/components/LazyImage.vue +21 -8
  22. package/components/LocaleSelector.vue +62 -29
  23. package/components/PromptRemove.vue +2 -2
  24. package/components/ResourceList/Masthead.vue +21 -1
  25. package/components/ResourceList/ResourceLoadingIndicator.vue +0 -8
  26. package/components/ResourceList/index.vue +9 -23
  27. package/components/ResourceTable.vue +7 -2
  28. package/components/SimpleBox.vue +6 -4
  29. package/components/SortableTable/index.vue +18 -25
  30. package/components/Tabbed/Tab.vue +5 -0
  31. package/components/Tabbed/index.vue +54 -9
  32. package/components/TypeDescription.vue +10 -1
  33. package/components/auth/Principal.vue +1 -0
  34. package/components/fleet/FleetBundles.vue +8 -3
  35. package/components/fleet/FleetClusters.vue +6 -0
  36. package/components/fleet/FleetRepos.vue +7 -1
  37. package/components/fleet/FleetSummary.vue +6 -0
  38. package/components/form/Command.vue +5 -0
  39. package/components/form/EnvVars.vue +5 -0
  40. package/components/form/KeyValue.vue +80 -58
  41. package/components/form/NameNsDescription.vue +13 -5
  42. package/components/form/NodeScheduling.vue +6 -1
  43. package/components/form/PodAffinity.vue +5 -0
  44. package/components/form/ResourceTabs/index.vue +5 -1
  45. package/components/form/ServiceNameSelect.vue +5 -0
  46. package/components/form/ValueFromResource.vue +7 -1
  47. package/components/formatter/ClusterLink.vue +3 -7
  48. package/components/nav/NamespaceFilter.vue +3 -3
  49. package/components/nav/TopLevelMenu.vue +12 -29
  50. package/config/home-links.js +155 -0
  51. package/config/labels-annotations.js +2 -1
  52. package/config/private-label.js +1 -1
  53. package/config/product/explorer.js +5 -4
  54. package/config/product/legacy.js +0 -47
  55. package/config/product/manager.js +0 -2
  56. package/config/product/multi-cluster-apps.js +0 -12
  57. package/config/product/settings.js +12 -1
  58. package/config/product/uiplugins.js +17 -0
  59. package/config/settings.js +23 -2
  60. package/config/types.js +5 -1
  61. package/config/uiplugins.js +117 -0
  62. package/config/version.js +17 -0
  63. package/content/docs/en-us/getting-started.md +1 -26
  64. package/core/plugin.ts +12 -0
  65. package/core/plugins.js +38 -2
  66. package/core/types.ts +6 -0
  67. package/creators/app/{.eslintignore → files/.eslintignore} +0 -0
  68. package/creators/app/{.eslintrc.js → files/.eslintrc.js} +0 -0
  69. package/creators/app/{.vscode → files/.vscode}/settings.json +0 -0
  70. package/creators/app/{babel.config.js → files/babel.config.js} +0 -0
  71. package/creators/app/{nuxt.config.js → files/nuxt.config.js} +0 -0
  72. package/creators/app/{tsconfig.json → files/tsconfig.json} +2 -1
  73. package/creators/app/init +16 -17
  74. package/creators/app/package.json +6 -0
  75. package/creators/pkg/{babel.config.js → files/babel.config.js} +0 -0
  76. package/creators/pkg/{index.ts → files/index.ts} +0 -0
  77. package/creators/pkg/{tsconfig.json → files/tsconfig.json} +13 -12
  78. package/creators/pkg/{vue.config.js → files/vue.config.js} +0 -0
  79. package/creators/pkg/init +1 -1
  80. package/creators/update/init +54 -0
  81. package/creators/update/package.json +20 -0
  82. package/creators/update/upgrade +56 -0
  83. package/creators/update/yarn-error.log +54 -0
  84. package/detail/provisioning.cattle.io.cluster.vue +3 -3
  85. package/detail/workload/index.vue +3 -2
  86. package/dialog/DiagnosticTimingsDialog.vue +116 -0
  87. package/dialog/RotateCertificatesDialog.vue +9 -3
  88. package/edit/auth/azuread.vue +28 -9
  89. package/edit/networking.k8s.io.ingress/index.vue +2 -2
  90. package/edit/persistentvolume/index.vue +51 -13
  91. package/edit/persistentvolumeclaim.vue +31 -13
  92. package/edit/pod.vue +27 -0
  93. package/edit/provisioning.cattle.io.cluster/rke2.vue +103 -24
  94. package/edit/service.vue +7 -5
  95. package/edit/workload/__tests__/Upgrading.test.ts +1 -0
  96. package/edit/workload/index.vue +32 -10
  97. package/edit/workload/mixins/workload.js +121 -126
  98. package/edit/workload/storage/ContainerMountPaths.vue +240 -0
  99. package/edit/workload/storage/Mount.vue +1 -0
  100. package/edit/workload/storage/awsElasticBlockStore.vue +20 -1
  101. package/edit/workload/storage/azureDisk.vue +22 -2
  102. package/edit/workload/storage/azureFile.vue +20 -2
  103. package/edit/workload/storage/csi/index.vue +23 -1
  104. package/edit/workload/storage/gcePersistentDisk.vue +20 -2
  105. package/edit/workload/storage/index.vue +33 -65
  106. package/edit/workload/storage/persistentVolumeClaim/index.vue +5 -0
  107. package/edit/workload/storage/secret.vue +6 -1
  108. package/edit/workload/storage/vsphereVolume.vue +11 -1
  109. package/layouts/default.vue +14 -8
  110. package/layouts/home.vue +9 -4
  111. package/layouts/plain.vue +10 -5
  112. package/list/catalog.cattle.io.app.vue +10 -9
  113. package/list/catalog.cattle.io.clusterrepo.vue +6 -61
  114. package/list/cis.cattle.io.clusterscan.vue +12 -12
  115. package/list/fleet.cattle.io.bundle.vue +33 -28
  116. package/list/fleet.cattle.io.cluster.vue +26 -22
  117. package/list/fleet.cattle.io.clustergroup.vue +6 -0
  118. package/list/fleet.cattle.io.clusterregistrationtoken.vue +28 -24
  119. package/list/fleet.cattle.io.gitrepo.vue +25 -14
  120. package/list/helm.cattle.io.projecthelmchart.vue +52 -33
  121. package/list/logging.banzaicloud.io.clusterflow.vue +7 -12
  122. package/list/logging.banzaicloud.io.flow.vue +7 -14
  123. package/list/management.cattle.io.cluster.vue +26 -15
  124. package/list/management.cattle.io.feature.vue +13 -8
  125. package/list/management.cattle.io.setting.vue +3 -3
  126. package/list/management.cattle.io.user.vue +38 -19
  127. package/list/monitoring.coreos.com.alertmanagerconfig.vue +8 -15
  128. package/list/namespace.vue +14 -1
  129. package/list/node.vue +13 -16
  130. package/list/persistentvolume.vue +16 -9
  131. package/list/persistentvolumeclaim.vue +5 -8
  132. package/list/provisioning.cattle.io.cluster.vue +35 -9
  133. package/list/service.vue +24 -12
  134. package/list/ui.cattle.io.navlink.vue +6 -0
  135. package/list/workload.vue +2 -2
  136. package/machine-config/harvester.vue +5 -3
  137. package/middleware/authenticated.js +6 -0
  138. package/mixins/resource-fetch.js +12 -18
  139. package/mixins/resource-manager.js +126 -0
  140. package/models/catalog.cattle.io.uiplugin.js +38 -0
  141. package/models/cluster/node.js +25 -2
  142. package/models/fleet.cattle.io.bundle.js +1 -1
  143. package/models/harvesterhci.io.management.cluster.js +11 -5
  144. package/models/pod.js +15 -5
  145. package/models/provisioning.cattle.io.cluster.js +16 -6
  146. package/models/workload.js +5 -3
  147. package/models/workload.service.js +10 -0
  148. package/nuxt.config.js +70 -25
  149. package/package.json +108 -109
  150. package/pages/auth/login.vue +11 -1
  151. package/pages/auth/verify.vue +9 -0
  152. package/pages/c/_cluster/apps/charts/index.vue +46 -1
  153. package/pages/c/_cluster/apps/charts/install.vue +10 -9
  154. package/pages/c/_cluster/explorer/index.vue +72 -9
  155. package/pages/c/_cluster/explorer/tools/index.vue +12 -5
  156. package/pages/c/_cluster/mcapps/index.vue +1 -1
  157. package/pages/c/_cluster/settings/DefaultLinksEditor.vue +108 -0
  158. package/pages/c/_cluster/settings/brand.vue +0 -40
  159. package/pages/c/_cluster/settings/links.vue +152 -0
  160. package/pages/c/_cluster/settings/performance.vue +90 -7
  161. package/pages/c/_cluster/uiplugins/DeveloperInstallDialog.vue +232 -0
  162. package/pages/c/_cluster/uiplugins/InstallDialog.vue +293 -0
  163. package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +300 -0
  164. package/pages/c/_cluster/uiplugins/RemoveUIPlugins.vue +125 -0
  165. package/pages/c/_cluster/uiplugins/SetupUIPlugins.vue +261 -0
  166. package/pages/c/_cluster/uiplugins/UninstallDialog.vue +122 -0
  167. package/pages/c/_cluster/uiplugins/index.vue +808 -0
  168. package/pages/diagnostic.vue +185 -101
  169. package/pages/docs/_doc.vue +3 -1
  170. package/pages/home.vue +21 -56
  171. package/pages/prefs.vue +108 -88
  172. package/pages/safeMode.vue +17 -0
  173. package/pages/support/index.vue +34 -137
  174. package/pkg/dynamic-importer.lib.js +4 -0
  175. package/plugins/dashboard-store/actions.js +19 -0
  176. package/plugins/dashboard-store/getters.js +20 -3
  177. package/plugins/dashboard-store/mutations.js +13 -7
  178. package/plugins/dashboard-store/resource-class.js +2 -2
  179. package/plugins/formatters.js +15 -0
  180. package/plugins/plugin.js +61 -6
  181. package/plugins/steve/getters.js +12 -0
  182. package/plugins/steve/mutations.js +1 -1
  183. package/plugins/steve/subscribe.js +94 -72
  184. package/plugins/steve/web-worker.steve-sub-worker.js +24 -15
  185. package/plugins/version.js +21 -0
  186. package/promptRemove/management.cattle.io.globalrole.vue +47 -0
  187. package/promptRemove/management.cattle.io.roletemplate.vue +47 -0
  188. package/promptRemove/mixin/roleDeletionCheck.js +97 -0
  189. package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +6 -7
  190. package/rancher-components/components/BadgeState/BadgeState.spec.ts +12 -0
  191. package/rancher-components/components/BadgeState/BadgeState.vue +107 -0
  192. package/rancher-components/components/BadgeState/index.ts +1 -0
  193. package/rancher-components/components/Banner/Banner.test.ts +13 -0
  194. package/rancher-components/components/Banner/Banner.vue +163 -0
  195. package/rancher-components/components/Banner/index.ts +1 -0
  196. package/rancher-components/components/Card/Card.vue +150 -0
  197. package/rancher-components/components/Card/index.ts +1 -0
  198. package/rancher-components/components/Form/Checkbox/Checkbox.test.ts +77 -0
  199. package/rancher-components/components/Form/Checkbox/Checkbox.vue +395 -0
  200. package/rancher-components/components/Form/Checkbox/index.ts +1 -0
  201. package/rancher-components/components/Form/LabeledInput/LabeledInput.test.ts +29 -0
  202. package/rancher-components/components/Form/LabeledInput/LabeledInput.vue +343 -0
  203. package/rancher-components/components/Form/LabeledInput/index.ts +1 -0
  204. package/rancher-components/components/Form/Radio/RadioButton.vue +270 -0
  205. package/rancher-components/components/Form/Radio/RadioGroup.vue +235 -0
  206. package/rancher-components/components/Form/Radio/index.ts +2 -0
  207. package/rancher-components/components/Form/TextArea/TextAreaAutoGrow.vue +168 -0
  208. package/rancher-components/components/Form/TextArea/index.ts +1 -0
  209. package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.test.ts +107 -0
  210. package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.vue +137 -0
  211. package/rancher-components/components/Form/ToggleSwitch/index.ts +1 -0
  212. package/rancher-components/components/Form/index.ts +5 -0
  213. package/rancher-components/components/LabeledTooltip/LabeledTooltip.vue +137 -0
  214. package/rancher-components/components/LabeledTooltip/index.ts +1 -0
  215. package/scripts/publish-shell.sh +40 -7
  216. package/scripts/record-deps.js +37 -0
  217. package/scripts/sync-shell-deps +37 -0
  218. package/scripts/test-plugins-build.sh +8 -5
  219. package/scripts/typegen.sh +84 -0
  220. package/store/auth.js +3 -0
  221. package/store/catalog.js +9 -8
  222. package/store/i18n.js +10 -1
  223. package/store/index.js +12 -3
  224. package/store/prefs.js +16 -0
  225. package/store/type-map.js +32 -5
  226. package/store/uiplugins.ts +15 -61
  227. package/types/shell/index.d.ts +3046 -0
  228. package/utils/__tests__/object.test.ts +0 -24
  229. package/utils/__tests__/selector.test.ts +1 -1
  230. package/utils/dynamic-importer.js +4 -0
  231. package/utils/favicon.js +8 -2
  232. package/utils/gc/gc-interval.ts +40 -0
  233. package/utils/gc/gc-root-store.js +76 -0
  234. package/utils/gc/gc-route-changed.ts +44 -0
  235. package/utils/gc/gc-types.ts +21 -0
  236. package/utils/gc/gc.ts +282 -0
  237. package/utils/grafana.js +2 -6
  238. package/utils/socket.js +41 -20
  239. package/utils/string.js +1 -7
  240. package/utils/validators/formRules/__tests__/index.test.ts +108 -0
  241. package/utils/validators/formRules/index.ts +9 -1
  242. package/config/footer.js +0 -19
  243. package/creators/pkg/nuxt.config.js +0 -6
  244. package/pages/plugins.vue +0 -387
  245. package/server/verdaccio-middleware.js +0 -56
@@ -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,7 +6,13 @@ BASE_DIR="$(
6
6
  pwd
7
7
  )"
8
8
  SHELL_DIR=$BASE_DIR/shell/
9
- PUBLISH_ARGS="--no-git-tag-version --access public"
9
+ TMP_DIR=$BASE_DIR/tmp
10
+ PUBLISH_ARGS="--no-git-tag-version --access public $PUBLISH_ARGS"
11
+
12
+ if [ ! -d "${BASE_DIR}/node_modules" ]; then
13
+ echo "You need to run 'yarn install' first"
14
+ exit 1
15
+ fi
10
16
 
11
17
  echo "Publishing Shell Packages"
12
18
 
@@ -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
+ }
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs-extra');
4
+ const path = require('path');
5
+
6
+ console.log(__dirname);
7
+
8
+ const dir = path.resolve('.');
9
+
10
+ console.log('Syncing shell dependencies');
11
+
12
+ const topFile = path.join(dir, 'package.json');
13
+ const shellFile = path.join(dir, 'shell', 'package.json');
14
+
15
+ console.log(topFile);
16
+ console.log(shellFile);
17
+
18
+ const mainPkg = JSON.parse(fs.readFileSync(topFile));
19
+
20
+ console.log(mainPkg.version);
21
+
22
+ const shellPkg = JSON.parse(fs.readFileSync(shellFile));
23
+
24
+ console.log(shellPkg.version);
25
+
26
+ Object.keys(shellPkg.dependencies).forEach(k => {
27
+ const version = mainPkg.dependencies[k] || mainPkg.devDependencies[k];
28
+ const current = shellPkg.dependencies[k];
29
+
30
+ if (version) {
31
+ console.log(`Syncing ${ k } -> ${ version } was ${ current }`);
32
+ shellPkg.dependencies[k] = version;
33
+ }
34
+ });
35
+
36
+ fs.writeFileSync(shellFile, JSON.stringify(shellPkg, undefined, 2));
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/catalog.js CHANGED
@@ -61,6 +61,11 @@ export const getters = {
61
61
  return [...clustered, ...namespaced];
62
62
  },
63
63
 
64
+ // Raw charts
65
+ rawCharts(state) {
66
+ return state.charts;
67
+ },
68
+
64
69
  repo(state, getters) {
65
70
  return ({ repoType, repoName }) => {
66
71
  const ary = (repoType === 'cluster' ? state.clusterRepos : state.namespacedRepos);
@@ -250,19 +255,13 @@ export const getters = {
250
255
 
251
256
  haveComponent() {
252
257
  return (name) => {
253
- try {
254
- require.resolve(`@shell/chart/${ name }`);
255
-
256
- return true;
257
- } catch (e) {
258
- return false;
259
- }
258
+ return getters['type-map/hasCustomChart'](name);
260
259
  };
261
260
  },
262
261
 
263
262
  importComponent(state, getters) {
264
263
  return (name) => {
265
- return importChart(name);
264
+ return getters['type-map/importChart'](name);
266
265
  };
267
266
  },
268
267
 
@@ -340,6 +339,7 @@ export const actions = {
340
339
  // Installing an app? This is fine (in cluster store)
341
340
  // Fetching list of cluster templates? This is fine (in management store)
342
341
  // Installing a cluster template? This isn't fine (in cluster store as per installing app, but if there is no cluster we need to default to management)
342
+
343
343
  const inStore = rootGetters['currentCluster'] ? rootGetters['currentProduct'].inStore : 'management';
344
344
 
345
345
  if ( rootGetters[`${ inStore }/schemaFor`](CATALOG.CLUSTER_REPO) ) {
@@ -517,6 +517,7 @@ function addChart(ctx, map, chart, repo) {
517
517
  chartName: chart.name,
518
518
  chartNameDisplay: chart.annotations?.[CATALOG_ANNOTATIONS.DISPLAY_NAME] || chart.name,
519
519
  chartDescription: chart.description,
520
+ featured: chart.annotations?.[CATALOG_ANNOTATIONS.FEATURED],
520
521
  repoKey: repo._key,
521
522
  versions: [],
522
523
  categories: filterCategories(chart.keywords),
package/store/i18n.js CHANGED
@@ -139,6 +139,14 @@ export const getters = {
139
139
  return state.default;
140
140
  },
141
141
 
142
+ multiWithFallback: (state, getters) => (items, key = 'key') => {
143
+ return items.map((item) => {
144
+ item[key] = getters.withFallback(item[key], null, item[key]);
145
+
146
+ return item;
147
+ });
148
+ },
149
+
142
150
  withFallback: (state, getters) => (key, args, fallback, fallbackIsKey = false) => {
143
151
  // Support withFallback(key,fallback) when no args
144
152
  if ( !fallback && typeof args === 'string' ) {
@@ -153,7 +161,8 @@ export const getters = {
153
161
  } else {
154
162
  return fallback;
155
163
  }
156
- }
164
+ },
165
+
157
166
  };
158
167
 
159
168
  export const mutations = {
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
  };
package/store/prefs.js CHANGED
@@ -15,6 +15,7 @@ export const create = function(name, def, opt = {}) {
15
15
  const asCookie = opt.asCookie === true;
16
16
  const asUserPreference = opt.asUserPreference !== false;
17
17
  const options = opt.options;
18
+ const inheritFrom = opt.inheritFrom;
18
19
 
19
20
  definitions[name] = {
20
21
  def,
@@ -22,6 +23,7 @@ export const create = function(name, def, opt = {}) {
22
23
  parseJSON,
23
24
  asCookie,
24
25
  asUserPreference,
26
+ inheritFrom, // if value is not defined on server, we can default it to another pref
25
27
  mangleRead: opt.mangleRead, // Alter the value read from the API (to match old Rancher expectations)
26
28
  mangleWrite: opt.mangleWrite, // Alter the value written back to the API (ditto)
27
29
  };
@@ -72,6 +74,7 @@ export const HIDE_REPOS = create('hide-repos', [], { parseJSON });
72
74
  export const HIDE_DESC = create('hide-desc', [], { parseJSON });
73
75
  export const HIDE_SENSITIVE = create('hide-sensitive', true, { options: [true, false], parseJSON });
74
76
  export const SHOW_PRE_RELEASE = create('show-pre-release', false, { options: [false, true], parseJSON });
77
+ export const SHOW_CHART_MODE = create('chartMode', 'featured', { parseJSON });
75
78
 
76
79
  export const DATE_FORMAT = create('date-format', 'ddd, MMM D YYYY', {
77
80
  options: [
@@ -91,12 +94,18 @@ export const TIME_FORMAT = create('time-format', 'h:mm:ss a', {
91
94
  });
92
95
 
93
96
  export const TIME_ZONE = create('time-zone', 'local');
97
+ // DEV will be deprecated on v2.7.0, but is needed so that we can grab the value for the new settings that derived from it
98
+ // such as: VIEW_IN_API, ALL_NAMESPACES, THEME_SHORTCUT
94
99
  export const DEV = create('dev', false, { parseJSON });
100
+ export const VIEW_IN_API = create('view-in-api', false, { parseJSON, inheritFrom: DEV });
101
+ export const ALL_NAMESPACES = create('all-namespaces', false, { parseJSON, inheritFrom: DEV });
102
+ export const THEME_SHORTCUT = create('theme-shortcut', false, { parseJSON, inheritFrom: DEV });
95
103
  export const LAST_VISITED = create('last-visited', 'home', { parseJSON });
96
104
  export const SEEN_WHATS_NEW = create('seen-whatsnew', '', { parseJSON });
97
105
  export const READ_WHATS_NEW = create('read-whatsnew', '', { parseJSON });
98
106
  export const AFTER_LOGIN_ROUTE = create('after-login-route', 'home', { parseJSON } );
99
107
  export const HIDE_HOME_PAGE_CARDS = create('home-page-cards', {}, { parseJSON } );
108
+ export const PLUGIN_DEVELOPER = create('plugin-developer', false, { parseJSON, inheritFrom: DEV }); // Is the user a plugin developer?
100
109
 
101
110
  export const _RKE1 = 'rke1';
102
111
  export const _RKE2 = 'rke2';
@@ -105,6 +114,9 @@ export const PROVISIONER = create('provisioner', _RKE1, { options: [_RKE1, _RKE2
105
114
  // Promo for Cluster Tools feature on Cluster Dashboard page
106
115
  export const CLUSTER_TOOLS_TIP = create('hide-cluster-tools-tip', false, { parseJSON });
107
116
 
117
+ // Promo for Pod Security Policies (PSPs) being deprecated on kube version 1.25 on Cluster Dashboard page
118
+ export const PSP_DEPRECATION_BANNER = create('hide-psp-deprecation-banner', false, { parseJSON });
119
+
108
120
  // Maximum number of clusters to show in the slide-in menu
109
121
  export const MENU_MAX_CLUSTERS = create('menu-max-clusters', 4, { options: [2, 3, 4, 5, 6, 7, 8, 9, 10], parseJSON });
110
122
 
@@ -431,6 +443,10 @@ export const actions = {
431
443
  const definition = definitions[key];
432
444
  let value = clone(server.data[key]);
433
445
 
446
+ if (value === undefined && definition.inheritFrom) {
447
+ value = clone(server.data[definition.inheritFrom]);
448
+ }
449
+
434
450
  if ( value === undefined || key === ignoreKey) {
435
451
  continue;
436
452
  }