@rancher/shell 0.1.4 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/assets/brand/suse/favicon.png +0 -0
  2. package/assets/images/generic-plugin.svg +1 -7
  3. package/assets/styles/global/_button.scss +1 -0
  4. package/assets/translations/en-us.yaml +129 -53
  5. package/assets/translations/zh-hans.yaml +18 -0
  6. package/components/CommunityLinks.vue +40 -49
  7. package/components/ExplorerProjectsNamespaces.vue +20 -3
  8. package/components/HarvesterServiceAddOnConfig.vue +10 -10
  9. package/components/LazyImage.vue +21 -8
  10. package/components/PromptRemove.vue +2 -2
  11. package/components/ResourceList/Masthead.vue +21 -1
  12. package/components/ResourceList/ResourceLoadingIndicator.vue +0 -8
  13. package/components/ResourceList/index.vue +42 -36
  14. package/components/ResourceTable.vue +19 -0
  15. package/components/SortableTable/THead.vue +311 -70
  16. package/components/SortableTable/advanced-filtering.js +272 -0
  17. package/components/SortableTable/filtering.js +90 -29
  18. package/components/SortableTable/index.vue +486 -280
  19. package/components/Tabbed/index.vue +25 -7
  20. package/components/TypeDescription.vue +10 -1
  21. package/components/fleet/FleetClusters.vue +6 -0
  22. package/components/fleet/FleetRepos.vue +7 -1
  23. package/components/form/Command.vue +5 -0
  24. package/components/form/EnvVars.vue +5 -0
  25. package/components/form/NameNsDescription.vue +3 -1
  26. package/components/form/NodeScheduling.vue +6 -1
  27. package/components/form/PodAffinity.vue +5 -0
  28. package/components/form/ServiceNameSelect.vue +5 -0
  29. package/components/form/ValueFromResource.vue +7 -1
  30. package/components/form/WorkloadPorts.vue +2 -2
  31. package/components/nav/TopLevelMenu.vue +2 -1
  32. package/config/home-links.js +155 -0
  33. package/config/private-label.js +1 -1
  34. package/config/product/manager.js +0 -2
  35. package/config/product/settings.js +1 -0
  36. package/config/product/uiplugins.js +2 -1
  37. package/config/settings.js +3 -1
  38. package/config/uiplugins.js +76 -6
  39. package/config/version.js +17 -0
  40. package/core/plugin.ts +12 -0
  41. package/core/plugins.js +29 -5
  42. package/core/types.ts +6 -0
  43. package/creators/app/{.eslintignore → files/.eslintignore} +0 -0
  44. package/creators/app/{.eslintrc.js → files/.eslintrc.js} +0 -0
  45. package/creators/app/{.vscode → files/.vscode}/settings.json +0 -0
  46. package/creators/app/{babel.config.js → files/babel.config.js} +0 -0
  47. package/creators/app/{nuxt.config.js → files/nuxt.config.js} +0 -0
  48. package/creators/app/{tsconfig.json → files/tsconfig.json} +2 -1
  49. package/creators/app/init +16 -17
  50. package/creators/app/package.json +7 -1
  51. package/creators/pkg/{babel.config.js → files/babel.config.js} +0 -0
  52. package/creators/pkg/{index.ts → files/index.ts} +0 -0
  53. package/creators/pkg/{tsconfig.json → files/tsconfig.json} +13 -12
  54. package/creators/pkg/{vue.config.js → files/vue.config.js} +0 -0
  55. package/creators/pkg/init +1 -1
  56. package/creators/pkg/package.json +1 -1
  57. package/creators/update/init +54 -0
  58. package/creators/update/package.json +20 -0
  59. package/creators/update/upgrade +56 -0
  60. package/creators/update/yarn-error.log +54 -0
  61. package/detail/provisioning.cattle.io.cluster.vue +1 -1
  62. package/detail/workload/index.vue +1 -0
  63. package/edit/persistentvolume/index.vue +48 -13
  64. package/edit/persistentvolumeclaim.vue +31 -13
  65. package/edit/provisioning.cattle.io.cluster/ACE.vue +2 -1
  66. package/edit/provisioning.cattle.io.cluster/DrainOptions.vue +0 -1
  67. package/edit/provisioning.cattle.io.cluster/rke2.vue +52 -43
  68. package/edit/service.vue +1 -1
  69. package/edit/workload/index.vue +19 -9
  70. package/edit/workload/mixins/workload.js +109 -114
  71. package/edit/workload/storage/index.vue +11 -17
  72. package/edit/workload/storage/persistentVolumeClaim/index.vue +5 -0
  73. package/edit/workload/storage/secret.vue +6 -1
  74. package/list/catalog.cattle.io.app.vue +10 -9
  75. package/list/catalog.cattle.io.clusterrepo.vue +6 -61
  76. package/list/cis.cattle.io.clusterscan.vue +12 -12
  77. package/list/fleet.cattle.io.bundle.vue +33 -28
  78. package/list/fleet.cattle.io.cluster.vue +26 -22
  79. package/list/fleet.cattle.io.clustergroup.vue +6 -0
  80. package/list/fleet.cattle.io.clusterregistrationtoken.vue +28 -24
  81. package/list/fleet.cattle.io.gitrepo.vue +25 -14
  82. package/list/helm.cattle.io.projecthelmchart.vue +52 -33
  83. package/list/logging.banzaicloud.io.clusterflow.vue +7 -12
  84. package/list/logging.banzaicloud.io.flow.vue +7 -14
  85. package/list/management.cattle.io.cluster.vue +26 -15
  86. package/list/management.cattle.io.feature.vue +13 -8
  87. package/list/management.cattle.io.user.vue +38 -19
  88. package/list/monitoring.coreos.com.alertmanagerconfig.vue +8 -15
  89. package/list/namespace.vue +14 -1
  90. package/list/node.vue +13 -16
  91. package/list/persistentvolume.vue +16 -9
  92. package/list/persistentvolumeclaim.vue +5 -8
  93. package/list/provisioning.cattle.io.cluster.vue +34 -8
  94. package/list/service.vue +24 -12
  95. package/list/ui.cattle.io.navlink.vue +6 -0
  96. package/list/workload.vue +2 -2
  97. package/middleware/authenticated.js +6 -0
  98. package/mixins/resource-fetch.js +12 -18
  99. package/mixins/resource-manager.js +126 -0
  100. package/models/catalog.cattle.io.uiplugin.js +4 -0
  101. package/models/management.cattle.io.cluster.js +9 -1
  102. package/models/pod.js +15 -5
  103. package/models/provisioning.cattle.io.cluster.js +4 -0
  104. package/models/workload.service.js +10 -0
  105. package/nuxt.config.js +2 -1
  106. package/package.json +1 -1
  107. package/pages/auth/login.vue +10 -0
  108. package/pages/auth/verify.vue +9 -0
  109. package/pages/c/_cluster/apps/charts/install.vue +119 -31
  110. package/pages/c/_cluster/settings/DefaultLinksEditor.vue +108 -0
  111. package/pages/c/_cluster/settings/links.vue +53 -101
  112. package/pages/c/_cluster/settings/performance.vue +90 -7
  113. package/pages/c/_cluster/uiplugins/DeveloperInstallDialog.vue +3 -3
  114. package/pages/c/_cluster/uiplugins/InstallDialog.vue +72 -21
  115. package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +26 -7
  116. package/pages/c/_cluster/uiplugins/RemoveUIPlugins.vue +2 -7
  117. package/pages/c/_cluster/uiplugins/SetupUIPlugins.vue +23 -15
  118. package/pages/c/_cluster/uiplugins/UninstallDialog.vue +12 -5
  119. package/pages/c/_cluster/uiplugins/index.vue +223 -72
  120. package/pages/support/index.vue +31 -142
  121. package/plugins/dashboard-store/actions.js +19 -0
  122. package/plugins/dashboard-store/getters.js +20 -3
  123. package/plugins/dashboard-store/mutations.js +13 -7
  124. package/plugins/plugin.js +18 -15
  125. package/plugins/steve/getters.js +12 -0
  126. package/plugins/version.js +21 -0
  127. package/promptRemove/mixin/roleDeletionCheck.js +15 -1
  128. package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +6 -7
  129. package/rancher-components/components/BadgeState/BadgeState.spec.ts +12 -0
  130. package/rancher-components/components/BadgeState/BadgeState.vue +107 -0
  131. package/rancher-components/components/BadgeState/index.ts +1 -0
  132. package/rancher-components/components/Banner/Banner.test.ts +13 -0
  133. package/rancher-components/components/Banner/Banner.vue +163 -0
  134. package/rancher-components/components/Banner/index.ts +1 -0
  135. package/rancher-components/components/Card/Card.vue +150 -0
  136. package/rancher-components/components/Card/index.ts +1 -0
  137. package/rancher-components/components/Form/Checkbox/Checkbox.test.ts +77 -0
  138. package/rancher-components/components/Form/Checkbox/Checkbox.vue +395 -0
  139. package/rancher-components/components/Form/Checkbox/index.ts +1 -0
  140. package/rancher-components/components/Form/LabeledInput/LabeledInput.test.ts +29 -0
  141. package/rancher-components/components/Form/LabeledInput/LabeledInput.vue +343 -0
  142. package/rancher-components/components/Form/LabeledInput/index.ts +1 -0
  143. package/rancher-components/components/Form/Radio/RadioButton.vue +270 -0
  144. package/rancher-components/components/Form/Radio/RadioGroup.vue +235 -0
  145. package/rancher-components/components/Form/Radio/index.ts +2 -0
  146. package/rancher-components/components/Form/TextArea/TextAreaAutoGrow.vue +168 -0
  147. package/rancher-components/components/Form/TextArea/index.ts +1 -0
  148. package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.test.ts +107 -0
  149. package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.vue +137 -0
  150. package/rancher-components/components/Form/ToggleSwitch/index.ts +1 -0
  151. package/rancher-components/components/Form/index.ts +5 -0
  152. package/rancher-components/components/LabeledTooltip/LabeledTooltip.vue +137 -0
  153. package/rancher-components/components/LabeledTooltip/index.ts +1 -0
  154. package/scripts/publish-shell.sh +39 -6
  155. package/scripts/record-deps.js +37 -0
  156. package/scripts/test-plugins-build.sh +8 -5
  157. package/scripts/typegen.sh +84 -0
  158. package/store/auth.js +3 -0
  159. package/store/index.js +12 -3
  160. package/store/type-map.js +2 -0
  161. package/types/shell/index.d.ts +3046 -0
  162. package/utils/favicon.js +8 -2
  163. package/utils/gc/gc-interval.ts +40 -0
  164. package/utils/gc/gc-root-store.js +76 -0
  165. package/utils/gc/gc-route-changed.ts +44 -0
  166. package/utils/gc/gc-types.ts +21 -0
  167. package/utils/gc/gc.ts +282 -0
  168. package/config/footer.js +0 -18
  169. package/creators/pkg/nuxt.config.js +0 -6
  170. package/yarn-error.log +0 -195
package/core/plugin.ts CHANGED
@@ -45,6 +45,10 @@ export class Plugin implements IPlugin {
45
45
  this.name = this._metadata.name || this.id;
46
46
  }
47
47
 
48
+ get version() {
49
+ return this._metadata.version;
50
+ }
51
+
48
52
  get validators() {
49
53
  return this._validators;
50
54
  }
@@ -104,6 +108,14 @@ export class Plugin implements IPlugin {
104
108
  this.routes.push({ parent, route });
105
109
  }
106
110
 
111
+ setHomePage(component: any) {
112
+ this.addRoute({
113
+ name: 'home',
114
+ path: '/home',
115
+ component
116
+ });
117
+ }
118
+
107
119
  addUninstallHook(hook: Function) {
108
120
  this.uninstallHooks.push(hook);
109
121
  }
package/core/plugins.js CHANGED
@@ -17,9 +17,9 @@ export default function({
17
17
  let _lastLoaded = 0;
18
18
 
19
19
  // Track which plugin loaded what, so we can unload stuff
20
- const plugins = {};
20
+ let plugins = {};
21
21
 
22
- const pluginRoutes = new PluginRoutes(app.router);
22
+ let pluginRoutes = new PluginRoutes(app.router);
23
23
 
24
24
  inject('plugin', {
25
25
  // Plugins should not use these - but we will pass them in for now as a 2nd argument
@@ -37,11 +37,18 @@ export default function({
37
37
  },
38
38
 
39
39
  // Load a plugin from a UI package
40
- loadAsyncByNameAndVersion(name, version, url) {
40
+ loadPluginAsync(plugin) {
41
+ const { name, version } = plugin;
41
42
  const id = `${ name }-${ version }`;
43
+ let url;
42
44
 
43
- if (!url) {
44
- url = `${ UI_PLUGIN_BASE_URL }/${ name }/${ version }/plugin/${ id }.umd.min.js`;
45
+ if (plugin?.metadata?.direct === 'true') {
46
+ url = plugin.endpoint;
47
+ } else {
48
+ // See if the plugin has a main metadata property set
49
+ const main = plugin?.metadata?.main || `${ id }.umd.min.js`;
50
+
51
+ url = `${ UI_PLUGIN_BASE_URL }/${ name }/${ version }/plugin/${ main }`;
45
52
  }
46
53
 
47
54
  return this.loadAsync(id, url);
@@ -152,6 +159,23 @@ export default function({
152
159
  }
153
160
  },
154
161
 
162
+ async logout() {
163
+ const all = Object.keys(plugins);
164
+
165
+ for (let i = 0; i < all.length; i++) {
166
+ const name = all[i];
167
+
168
+ try {
169
+ await this.removePlugin(name);
170
+ } catch (e) {
171
+ console.error('Error removing plugin', e); // eslint-disable-line no-console
172
+ }
173
+ }
174
+
175
+ plugins = {};
176
+ pluginRoutes = new PluginRoutes(app.router);
177
+ },
178
+
155
179
  // Remove the plugin
156
180
  async removePlugin(name) {
157
181
  const plugin = Object.values(plugins).find(p => p.name === name);
package/core/types.ts CHANGED
@@ -73,6 +73,12 @@ export interface IPlugin {
73
73
  addRoute(route: RouteConfig): void;
74
74
  addRoute(parent: string, route: RouteConfig): void;
75
75
 
76
+ /**
77
+ * Set the component to use for the landing home page
78
+ * @param component Home page component
79
+ */
80
+ setHomePage(component: any): void;
81
+
76
82
  /**
77
83
  * Add routes to the Vue Router
78
84
  */
@@ -33,7 +33,8 @@
33
33
  "@types/node",
34
34
  "@nuxt/types",
35
35
  "cypress",
36
- "rancher"
36
+ "rancher",
37
+ "shell"
37
38
  ]
38
39
  },
39
40
  "exclude": [
package/creators/app/init CHANGED
@@ -1,13 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const fs = require('fs-extra');
4
3
  const path = require('path');
5
- const exec = require('child_process').exec;
4
+ const fs = require('fs-extra');
6
5
 
7
6
  const targets = {
8
- 'dev': './node_modules/.bin/nuxt dev',
9
- 'nuxt': './node_modules/.bin/nuxt',
10
- 'build': './node_modules/.bin/nuxt build'
7
+ dev: './node_modules/.bin/nuxt dev',
8
+ nuxt: './node_modules/.bin/nuxt',
9
+ build: './node_modules/.bin/nuxt build'
11
10
  };
12
11
 
13
12
  const files = [
@@ -30,8 +29,8 @@ if (args.length == 3) {
30
29
  const folder = path.resolve('.');
31
30
 
32
31
  appFolder = path.join(folder, name);
33
- console.log(` Creating application folder: ${ appFolder}`);
34
- fs.ensureDirSync(appFolder);
32
+ console.log(` Creating application folder: ${ appFolder }`);
33
+ fs.ensureDirSync(appFolder);
35
34
  }
36
35
 
37
36
  // Check that there is a package file
@@ -71,18 +70,23 @@ const creatorPkgData = fs.readFileSync(path.join(__dirname, 'package.json'));
71
70
  const creatorPkg = JSON.parse(creatorPkgData);
72
71
 
73
72
  pkg.dependencies['@rancher/shell'] = `^${ creatorPkg.version }`;
74
- pkg.dependencies['core-js'] = '^3.20.3';
75
- pkg.dependencies['css-loader'] = '4.3.0';
73
+
74
+ // Rest of dependencies are in the _pkgs property of package.json - copy then across
75
+ if (creatorPkg._pkgs) {
76
+ Object.keys(creatorPkg._pkgs).forEach((pkgName) => {
77
+ pkg.dependencies[pkgName] = creatorPkg._pkgs[pkgName];
78
+ });
79
+ }
76
80
 
77
81
  fs.writeFileSync(path.join(appFolder, 'package.json'), JSON.stringify(pkg, null, 2));
78
82
 
79
83
  // Copy base files
80
84
  files.forEach((file) => {
81
- const src = path.join(__dirname, file);
85
+ const src = path.join(__dirname, 'files', file);
82
86
  const dest = path.join(appFolder, file);
83
87
 
84
88
  if (!fs.existsSync(dest)) {
85
- console.log(' Adding file: ' + file);
89
+ console.log(` Adding file: ${ file }`);
86
90
 
87
91
  const folder = path.dirname(file);
88
92
 
@@ -93,9 +97,4 @@ files.forEach((file) => {
93
97
  }
94
98
  });
95
99
 
96
- // require("child_process").spawn('yarn', ['install'], {
97
- // cwd: process.cwd(),
98
- // stdio: "inherit"
99
- // });
100
-
101
- console.log('');
100
+ console.log('');
@@ -7,12 +7,18 @@
7
7
  "private": false,
8
8
  "bin": "./init",
9
9
  "files": [
10
- "*.*",
10
+ "**/*.*",
11
11
  "init"
12
12
  ],
13
13
  "engines": {
14
14
  "node": ">=12"
15
15
  },
16
+ "_requires": [
17
+ "core-js",
18
+ "css-loader",
19
+ "@types/lodash",
20
+ "@rancher/components"
21
+ ],
16
22
  "dependencies": {
17
23
  "fs-extra": "^10.0.0"
18
24
  }
File without changes
@@ -16,12 +16,16 @@
16
16
  "typeRoots": [
17
17
  "../../node_modules",
18
18
  "../../node_modules/@rancher/shell/types"
19
- ],
19
+ ],
20
20
  "types": [
21
21
  "node",
22
22
  "webpack-env",
23
+ "@types/node",
24
+ "@types/jest",
25
+ "@types/lodash",
23
26
  "@nuxt/types",
24
- "rancher"
27
+ "rancher",
28
+ "shell"
25
29
  ],
26
30
  "lib": [
27
31
  "esnext",
@@ -30,24 +34,21 @@
30
34
  "scripthost"
31
35
  ],
32
36
  "paths": {
33
- "@shell/core/*": [
34
- "../../node_modules/@rancher/shell/core/*"
35
- ],
36
- "@shell/config/*": [
37
- "../../node_modules/@rancher/shell/config/*"
37
+ "@shell/*": [
38
+ "../../node_modules/@rancher/shell/*"
38
39
  ],
39
- "@shell/store/*": [
40
- "../../node_modules/@rancher/shell/store/*"
40
+ "@components/*": [
41
+ "@rancher/components/*"
41
42
  ]
42
43
  }
43
44
  },
44
45
  "include": [
45
46
  "**/*.ts",
47
+ "**/*.d.ts",
46
48
  "**/*.tsx",
47
- "**/*.vue",
48
- "../../node_modules/@rancher/shell/core/types.ts"
49
+ "**/*.vue"
49
50
  ],
50
51
  "exclude": [
51
- "node_modules"
52
+ "../../node_modules"
52
53
  ]
53
54
  }
package/creators/pkg/init CHANGED
@@ -95,7 +95,7 @@ if (addTypeFolders) {
95
95
 
96
96
  // Copy base files
97
97
  files.forEach((file) => {
98
- const src = path.join(__dirname, file);
98
+ const src = path.join(__dirname, 'files', file);
99
99
  const dest = path.join(path.join(pkgFolder, file));
100
100
 
101
101
  if (!fs.existsSync(dest)) {
@@ -7,7 +7,7 @@
7
7
  "private": false,
8
8
  "bin": "./init",
9
9
  "files": [
10
- "*.*",
10
+ "**/*.*",
11
11
  "init"
12
12
  ],
13
13
  "engines": {
@@ -0,0 +1,54 @@
1
+ #!/usr/bin/env node
2
+
3
+ const path = require('path');
4
+ const fs = require('fs-extra');
5
+ const { spawnSync } = require('child_process');
6
+
7
+ const scriptFolder = __dirname;
8
+ const dest = path.resolve('.');
9
+
10
+ // Remove first two args
11
+ let args = process.argv;
12
+ args.splice(0, 2);
13
+
14
+ const res = spawnSync(`${__dirname}/upgrade`, args, {
15
+ cwd: dest,
16
+ shell: false,
17
+ stdio: [ 'ignore', process.stdout, process.stderr ],
18
+ });
19
+
20
+ if (res.status !== 0) {
21
+ process.exit(res.status);
22
+ }
23
+
24
+ // Read the existing package.json
25
+ let rawdata = fs.readFileSync(path.join(dest, 'package.json'));
26
+ const appPackage = JSON.parse(rawdata);
27
+
28
+ // Read the package.json from the app creator
29
+ rawdata = fs.readFileSync(path.join(scriptFolder, 'app', 'package.json'));
30
+ const latestPackage = JSON.parse(rawdata);
31
+
32
+ // Read the package.json from the upgrade creator
33
+ rawdata = fs.readFileSync(path.join(scriptFolder, 'package.json'));
34
+ const upgradePackage = JSON.parse(rawdata);
35
+
36
+ // Update dependency versions to match the latest from the creator
37
+ Object.keys(latestPackage.dependencies).forEach((key) => {
38
+ const version = latestPackage.dependencies[key];
39
+
40
+ appPackage.dependencies[key] = version;
41
+ });
42
+
43
+ // Update the version of @rancher/shell
44
+ const shellVersion = upgradePackage.version;
45
+
46
+ appPackage.dependencies['@rancher/shell'] = shellVersion;
47
+
48
+ fs.writeFileSync(path.join(dest, 'package.json'), JSON.stringify(appPackage, null, 2));
49
+
50
+ spawnSync(`yarn`, ['install'], {
51
+ cwd: dest,
52
+ shell: false,
53
+ stdio: [ 'ignore', process.stdout, process.stderr ],
54
+ });
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@rancher/create-update",
3
+ "description": "Rancher UI Update helper",
4
+ "version": "0.0.0",
5
+ "license": "Apache-2.0",
6
+ "author": "SUSE",
7
+ "private": false,
8
+ "bin": "./init",
9
+ "files": [
10
+ "**/*.*",
11
+ "init",
12
+ "upgrade"
13
+ ],
14
+ "engines": {
15
+ "node": ">=12"
16
+ },
17
+ "dependencies": {
18
+ "fs-extra": "^10.0.0"
19
+ }
20
+ }
@@ -0,0 +1,56 @@
1
+ #!/usr/bin/env sh
2
+
3
+ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
4
+
5
+ echo "Upgrading Rancher Shell"
6
+
7
+ # Get the version number from the package.json file
8
+ VERSION=$(node -p -e "require('${SCRIPT_DIR}/package.json').version")
9
+
10
+ echo "Updating to version: ${VERSION}"
11
+ echo ""
12
+
13
+ FORCE="false"
14
+
15
+ if [ "$1" == "-f" ]; then
16
+ FORCE="true"
17
+ fi
18
+
19
+ # Check for a clean git repository
20
+ if [ ! -d ".git" ] && [ "${FORCE}" == "false" ]; then
21
+ echo "Not runnning in a git repository. Re-run with -f to ignore this check"
22
+ echo "Note: This action will update yuor files - running in a git repsository will ensure you have visibility over changes made"
23
+ exit 1
24
+ fi
25
+
26
+ if [[ $(git diff --stat) != '' ]] && [ "${FORCE}" == "false" ]; then
27
+ echo "Git repository is not clean. Re-run with -f to ignore this check"
28
+ echo "Note: This action will update yuor files - running in a clean git repsository will ensure you have visibility over changes made"
29
+ exit 1
30
+ fi
31
+
32
+ # Check this is a Rancher Extension
33
+ if [ ! -f "./package.json" ]; then
34
+ echo "Can't find package.json - check you're running from the correct folder"
35
+ exit 1
36
+ fi
37
+
38
+ HAS_SHELL=$(grep "\"@rancher/shell\"" package.json -c )
39
+ if [ "${HAS_SHELL}" != "1" ]; then
40
+ echo "package.json does not reference @rancher/shell - check you're running from the correct folder"
41
+ exit 1
42
+ fi
43
+
44
+ # Copy files for the top-level folder (from the app creator)
45
+ cp ${SCRIPT_DIR}/app/files/* .
46
+
47
+ # Go through each folder in the pkg folder and update their files
48
+ for pkg in ./pkg/*
49
+ do
50
+ if [ -d "${pkg}" ]; then
51
+ pkgName=$(basename $pkg)
52
+ echo "Updating package ${pkgName}"
53
+
54
+ cp ${SCRIPT_DIR}/pkg/files/* ${pkg}
55
+ fi
56
+ done
@@ -0,0 +1,54 @@
1
+ Arguments:
2
+ /usr/local/bin/node /usr/local/Cellar/yarn/1.22.11/libexec/bin/yarn.js add @rancher/pkg@0.0.0
3
+
4
+ PATH:
5
+ /Users/nwm/.gem/ruby/3.1.2/bin:/Users/nwm/.rubies/ruby-3.1.2/lib/ruby/gems/3.1.0/bin:/Users/nwm/.rubies/ruby-3.1.2/bin:/Users/nwm/.deno/bin:/usr/local/sbin:/opt/local/bin:/opt/local/sbin:/Users/nwm/.rd/bin:/Users/nwm/go/bin:/usr/local/bin:/Users/nwm/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/usr/local/MacGPG2/bin:/Library/Apple/usr/bin:/Users/nwm/.deno/bin:/usr/local/sbin:/Users/nwm/google-cloud-sdk/bin:/opt/local/bin:/opt/local/sbin:/Users/nwm/.rd/bin:/Users/nwm/go/bin:/Users/nwm/bin:/Applications/Utilities/kdiff3.app/Contents/MacOS/:/Applications/Visual Studio Code.app/Contents/Resources/app/bin:/Applications/Utilities/kdiff3.app/Contents/MacOS/:/Applications/Visual Studio Code.app/Contents/Resources/app/bin
6
+
7
+ Yarn version:
8
+ 1.22.11
9
+
10
+ Node version:
11
+ 16.16.0
12
+
13
+ Platform:
14
+ darwin x64
15
+
16
+ Trace:
17
+ Error: https://registry.yarnpkg.com/@rancher%2fpkg: Not found
18
+ at Request.params.callback [as _callback] (/usr/local/Cellar/yarn/1.22.11/libexec/lib/cli.js:66992:18)
19
+ at Request.self.callback (/usr/local/Cellar/yarn/1.22.11/libexec/lib/cli.js:140763:22)
20
+ at Request.emit (node:events:527:28)
21
+ at Request.<anonymous> (/usr/local/Cellar/yarn/1.22.11/libexec/lib/cli.js:141735:10)
22
+ at Request.emit (node:events:527:28)
23
+ at IncomingMessage.<anonymous> (/usr/local/Cellar/yarn/1.22.11/libexec/lib/cli.js:141657:12)
24
+ at Object.onceWrapper (node:events:641:28)
25
+ at IncomingMessage.emit (node:events:539:35)
26
+ at endReadableNT (node:internal/streams/readable:1345:12)
27
+ at processTicksAndRejections (node:internal/process/task_queues:83:21)
28
+
29
+ npm manifest:
30
+ {
31
+ "name": "@rancher/create-app",
32
+ "description": "Rancher UI Upgrade helper",
33
+ "version": "0.0.0",
34
+ "license": "Apache-2.0",
35
+ "author": "SUSE",
36
+ "private": false,
37
+ "bin": "./init",
38
+ "files": [
39
+ "*.*",
40
+ "init"
41
+ ],
42
+ "engines": {
43
+ "node": ">=12"
44
+ },
45
+ "dependencies": {
46
+ "fs-extra": "^10.0.0"
47
+ }
48
+ }
49
+
50
+ yarn manifest:
51
+ No manifest
52
+
53
+ Lockfile:
54
+ No lockfile
@@ -709,7 +709,7 @@ export default {
709
709
  </Tab>
710
710
 
711
711
  <Tab v-if="showRegistration" name="registration" :label="t('cluster.tabs.registration')" :weight="2">
712
- <Banner color="warning" :label="t('cluster.import.warningBanner')" />
712
+ <Banner v-if="!value.isCustom" color="warning" :label="t('cluster.import.warningBanner')" />
713
713
  <CustomCommand v-if="value.isCustom" :cluster-token="clusterToken" :cluster="value" @copied-windows="hasWindowsMachine ? null : showWindowsWarning = true" />
714
714
  <template v-else>
715
715
  <h4 v-html="t('cluster.import.commandInstructions', null, true)" />
@@ -141,6 +141,7 @@ export default {
141
141
  return this.value.spec.jobTemplate.spec.template.spec;
142
142
  }
143
143
 
144
+ // This is for viewing
144
145
  if ( this.value.type === POD ) {
145
146
  return this.value;
146
147
  }
@@ -1,4 +1,5 @@
1
1
  <script>
2
+ import { mapGetters } from 'vuex';
2
3
  import CreateEditView from '@shell/mixins/create-edit-view';
3
4
  import CruResource from '@shell/components/CruResource';
4
5
  import NameNsDescription from '@shell/components/form/NameNsDescription';
@@ -15,10 +16,11 @@ import UnitInput from '@shell/components/form/UnitInput';
15
16
  import { NODE, PVC, STORAGE_CLASS } from '@shell/config/types';
16
17
  import Loading from '@shell/components/Loading';
17
18
  import { LONGHORN_PLUGIN, VOLUME_PLUGINS } from '@shell/models/persistentvolume';
18
- import { _CREATE, _VIEW } from '@shell/config/query-params';
19
+ import { _CREATE, _VIEW, _EDIT } from '@shell/config/query-params';
19
20
  import { clone } from '@shell/utils/object';
20
21
  import InfoBox from '@shell/components/InfoBox';
21
22
  import { mapFeature, UNSUPPORTED_STORAGE_DRIVERS } from '@shell/store/features';
23
+ import ResourceManager from '@shell/mixins/resource-manager';
22
24
 
23
25
  export default {
24
26
  name: 'PersistentVolume',
@@ -39,18 +41,26 @@ export default {
39
41
  UnitInput
40
42
  },
41
43
 
42
- mixins: [CreateEditView],
44
+ mixins: [CreateEditView, ResourceManager],
43
45
 
44
- async fetch() {
45
- const storageClasses = await this.$store.dispatch('cluster/findAll', { type: STORAGE_CLASS });
46
+ fetch() {
47
+ if (this.mode === _EDIT) {
48
+ this.secondaryResourceData.namespace = this.value?.spec?.claimRef?.namespace || null;
46
49
 
47
- await this.$store.dispatch('cluster/findAll', { type: PVC });
50
+ this.secondaryResourceData.data[PVC] = {
51
+ applyTo: [
52
+ {
53
+ var: 'currentClaim',
54
+ classify: true,
55
+ parsingFunc: (data) => {
56
+ return data.find(claim => claim.spec.volumeName === this.value.name);
57
+ }
58
+ }
59
+ ]
60
+ };
61
+ }
48
62
 
49
- this.storageClassOptions = storageClasses.map(s => ({
50
- label: s.name,
51
- value: s.name
52
- }));
53
- this.storageClassOptions.unshift(this.NONE_OPTION);
63
+ this.resourceManagerFetchSecondaryResources(this.secondaryResourceData);
54
64
  },
55
65
 
56
66
  data() {
@@ -70,7 +80,30 @@ export default {
70
80
  const plugin = (foundPlugin || VOLUME_PLUGINS[0]).value;
71
81
 
72
82
  return {
83
+ secondaryResourceData: {
84
+ namespace: null,
85
+ data: {
86
+ [STORAGE_CLASS]: {
87
+ applyTo: [
88
+ {
89
+ var: 'storageClassOptions',
90
+ parsingFunc: (data) => {
91
+ const storageClassOptions = data.map(s => ({
92
+ label: s.metadata.name,
93
+ value: s.metadata.name
94
+ }));
95
+
96
+ storageClassOptions.unshift(this.NONE_OPTION);
97
+
98
+ return storageClassOptions;
99
+ }
100
+ }
101
+ ]
102
+ },
103
+ }
104
+ },
73
105
  storageClassOptions: [],
106
+ currentClaim: null,
74
107
  plugin,
75
108
  NONE_OPTION,
76
109
  NODE,
@@ -80,6 +113,7 @@ export default {
80
113
 
81
114
  computed: {
82
115
  showUnsupportedStorage: mapFeature(UNSUPPORTED_STORAGE_DRIVERS),
116
+ ...mapGetters(['currentProduct', 'currentCluster']),
83
117
 
84
118
  readWriteOnce: {
85
119
  get() {
@@ -196,12 +230,12 @@ export default {
196
230
  :namespaced="false"
197
231
  />
198
232
 
199
- <InfoBox v-if="value.claim">
233
+ <InfoBox v-if="currentClaim">
200
234
  <div class="row">
201
235
  <div class="col span-6 text-center">
202
236
  <label class="text-muted">Persistent Volume Claim:</label>&nbsp;
203
- <n-link :to="value.claim.detailLocation">
204
- {{ value.claim.namespacedName }}
237
+ <n-link :to="currentClaim.detailLocation">
238
+ {{ currentClaim.namespacedName }}
205
239
  </n-link>
206
240
  </div>
207
241
  <div class="col span-6 text-center">
@@ -267,6 +301,7 @@ export default {
267
301
  v-model="value.spec.storageClassName"
268
302
  :label="t('persistentVolume.customize.assignToStorageClass.label')"
269
303
  :options="storageClassOptions"
304
+ :loading="isLoadingSecondaryResources"
270
305
  />
271
306
  </div>
272
307
  </div>