@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.
- package/assets/brand/suse/favicon.png +0 -0
- package/assets/images/generic-plugin.svg +1 -7
- package/assets/translations/en-us.yaml +81 -47
- package/components/CommunityLinks.vue +40 -49
- package/components/ExplorerProjectsNamespaces.vue +20 -3
- package/components/LazyImage.vue +21 -8
- package/components/PromptRemove.vue +2 -2
- package/components/ResourceList/Masthead.vue +21 -1
- package/components/ResourceList/ResourceLoadingIndicator.vue +0 -8
- package/components/ResourceList/index.vue +9 -23
- package/components/SortableTable/index.vue +13 -10
- package/components/Tabbed/index.vue +25 -7
- package/components/TypeDescription.vue +10 -1
- package/components/fleet/FleetClusters.vue +6 -0
- package/components/fleet/FleetRepos.vue +7 -1
- package/components/form/Command.vue +5 -0
- package/components/form/EnvVars.vue +5 -0
- package/components/form/NameNsDescription.vue +3 -1
- package/components/form/NodeScheduling.vue +6 -1
- package/components/form/PodAffinity.vue +5 -0
- package/components/form/ServiceNameSelect.vue +5 -0
- package/components/form/ValueFromResource.vue +7 -1
- package/components/nav/TopLevelMenu.vue +2 -1
- package/config/home-links.js +155 -0
- package/config/private-label.js +1 -1
- package/config/product/manager.js +0 -2
- package/config/product/uiplugins.js +1 -1
- package/config/settings.js +3 -1
- package/config/uiplugins.js +63 -6
- package/config/version.js +17 -0
- package/core/plugin.ts +12 -0
- package/core/plugins.js +29 -5
- package/core/types.ts +6 -0
- package/creators/app/{.eslintignore → files/.eslintignore} +0 -0
- package/creators/app/{.eslintrc.js → files/.eslintrc.js} +0 -0
- package/creators/app/{.vscode → files/.vscode}/settings.json +0 -0
- package/creators/app/{babel.config.js → files/babel.config.js} +0 -0
- package/creators/app/{nuxt.config.js → files/nuxt.config.js} +0 -0
- package/creators/app/{tsconfig.json → files/tsconfig.json} +2 -1
- package/creators/app/init +16 -17
- package/creators/app/package.json +6 -0
- package/creators/pkg/{babel.config.js → files/babel.config.js} +0 -0
- package/creators/pkg/{index.ts → files/index.ts} +0 -0
- package/creators/pkg/{tsconfig.json → files/tsconfig.json} +13 -12
- package/creators/pkg/{vue.config.js → files/vue.config.js} +0 -0
- package/creators/pkg/init +1 -1
- package/creators/update/init +54 -0
- package/creators/update/package.json +20 -0
- package/creators/update/upgrade +56 -0
- package/creators/update/yarn-error.log +54 -0
- package/detail/workload/index.vue +1 -0
- package/edit/persistentvolume/index.vue +48 -13
- package/edit/persistentvolumeclaim.vue +31 -13
- package/edit/provisioning.cattle.io.cluster/rke2.vue +27 -19
- package/edit/workload/index.vue +19 -9
- package/edit/workload/mixins/workload.js +109 -114
- package/edit/workload/storage/index.vue +11 -17
- package/edit/workload/storage/persistentVolumeClaim/index.vue +5 -0
- package/edit/workload/storage/secret.vue +6 -1
- package/list/catalog.cattle.io.app.vue +10 -9
- package/list/catalog.cattle.io.clusterrepo.vue +6 -61
- package/list/cis.cattle.io.clusterscan.vue +12 -12
- package/list/fleet.cattle.io.bundle.vue +33 -28
- package/list/fleet.cattle.io.cluster.vue +26 -22
- package/list/fleet.cattle.io.clustergroup.vue +6 -0
- package/list/fleet.cattle.io.clusterregistrationtoken.vue +28 -24
- package/list/fleet.cattle.io.gitrepo.vue +25 -14
- package/list/helm.cattle.io.projecthelmchart.vue +52 -33
- package/list/logging.banzaicloud.io.clusterflow.vue +7 -12
- package/list/logging.banzaicloud.io.flow.vue +7 -14
- package/list/management.cattle.io.cluster.vue +26 -15
- package/list/management.cattle.io.feature.vue +13 -8
- package/list/management.cattle.io.user.vue +38 -19
- package/list/monitoring.coreos.com.alertmanagerconfig.vue +8 -15
- package/list/namespace.vue +14 -1
- package/list/node.vue +13 -16
- package/list/persistentvolume.vue +16 -9
- package/list/persistentvolumeclaim.vue +5 -8
- package/list/provisioning.cattle.io.cluster.vue +34 -8
- package/list/service.vue +24 -12
- package/list/ui.cattle.io.navlink.vue +6 -0
- package/list/workload.vue +2 -2
- package/middleware/authenticated.js +6 -0
- package/mixins/resource-fetch.js +12 -18
- package/mixins/resource-manager.js +126 -0
- package/models/catalog.cattle.io.uiplugin.js +4 -0
- package/models/pod.js +15 -5
- package/models/provisioning.cattle.io.cluster.js +4 -0
- package/models/workload.service.js +10 -0
- package/nuxt.config.js +2 -1
- package/package.json +1 -1
- package/pages/auth/login.vue +10 -0
- package/pages/auth/verify.vue +9 -0
- package/pages/c/_cluster/settings/DefaultLinksEditor.vue +108 -0
- package/pages/c/_cluster/settings/links.vue +53 -101
- package/pages/c/_cluster/settings/performance.vue +90 -7
- package/pages/c/_cluster/uiplugins/DeveloperInstallDialog.vue +3 -3
- package/pages/c/_cluster/uiplugins/InstallDialog.vue +71 -20
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +21 -5
- package/pages/c/_cluster/uiplugins/RemoveUIPlugins.vue +2 -7
- package/pages/c/_cluster/uiplugins/SetupUIPlugins.vue +23 -15
- package/pages/c/_cluster/uiplugins/UninstallDialog.vue +11 -4
- package/pages/c/_cluster/uiplugins/index.vue +179 -65
- package/pages/support/index.vue +31 -142
- package/plugins/dashboard-store/actions.js +19 -0
- package/plugins/dashboard-store/getters.js +20 -3
- package/plugins/dashboard-store/mutations.js +13 -7
- package/plugins/plugin.js +18 -15
- package/plugins/steve/getters.js +12 -0
- package/plugins/version.js +21 -0
- package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +6 -7
- package/rancher-components/components/BadgeState/BadgeState.spec.ts +12 -0
- package/rancher-components/components/BadgeState/BadgeState.vue +107 -0
- package/rancher-components/components/BadgeState/index.ts +1 -0
- package/rancher-components/components/Banner/Banner.test.ts +13 -0
- package/rancher-components/components/Banner/Banner.vue +163 -0
- package/rancher-components/components/Banner/index.ts +1 -0
- package/rancher-components/components/Card/Card.vue +150 -0
- package/rancher-components/components/Card/index.ts +1 -0
- package/rancher-components/components/Form/Checkbox/Checkbox.test.ts +77 -0
- package/rancher-components/components/Form/Checkbox/Checkbox.vue +395 -0
- package/rancher-components/components/Form/Checkbox/index.ts +1 -0
- package/rancher-components/components/Form/LabeledInput/LabeledInput.test.ts +29 -0
- package/rancher-components/components/Form/LabeledInput/LabeledInput.vue +343 -0
- package/rancher-components/components/Form/LabeledInput/index.ts +1 -0
- package/rancher-components/components/Form/Radio/RadioButton.vue +270 -0
- package/rancher-components/components/Form/Radio/RadioGroup.vue +235 -0
- package/rancher-components/components/Form/Radio/index.ts +2 -0
- package/rancher-components/components/Form/TextArea/TextAreaAutoGrow.vue +168 -0
- package/rancher-components/components/Form/TextArea/index.ts +1 -0
- package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.test.ts +107 -0
- package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.vue +137 -0
- package/rancher-components/components/Form/ToggleSwitch/index.ts +1 -0
- package/rancher-components/components/Form/index.ts +5 -0
- package/rancher-components/components/LabeledTooltip/LabeledTooltip.vue +137 -0
- package/rancher-components/components/LabeledTooltip/index.ts +1 -0
- package/scripts/publish-shell.sh +39 -6
- package/scripts/record-deps.js +37 -0
- package/scripts/test-plugins-build.sh +8 -5
- package/scripts/typegen.sh +84 -0
- package/store/auth.js +3 -0
- package/store/index.js +12 -3
- package/types/shell/index.d.ts +3046 -0
- package/utils/favicon.js +8 -2
- package/utils/gc/gc-interval.ts +40 -0
- package/utils/gc/gc-root-store.js +76 -0
- package/utils/gc/gc-route-changed.ts +44 -0
- package/utils/gc/gc-types.ts +21 -0
- package/utils/gc/gc.ts +282 -0
- package/config/footer.js +0 -18
- package/creators/pkg/nuxt.config.js +0 -6
- package/yarn-error.log +0 -195
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
|
-
|
|
20
|
+
let plugins = {};
|
|
21
21
|
|
|
22
|
-
|
|
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
|
-
|
|
40
|
+
loadPluginAsync(plugin) {
|
|
41
|
+
const { name, version } = plugin;
|
|
41
42
|
const id = `${ name }-${ version }`;
|
|
43
|
+
let url;
|
|
42
44
|
|
|
43
|
-
if (
|
|
44
|
-
url =
|
|
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
|
*/
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
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
|
|
4
|
+
const fs = require('fs-extra');
|
|
6
5
|
|
|
7
6
|
const targets = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
75
|
-
|
|
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((pkg) => {
|
|
77
|
+
pkg.dependencies[pkg] = creatorPkg._pkgs[pkg];
|
|
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(
|
|
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
|
-
|
|
97
|
-
// cwd: process.cwd(),
|
|
98
|
-
// stdio: "inherit"
|
|
99
|
-
// });
|
|
100
|
-
|
|
101
|
-
console.log('');
|
|
100
|
+
console.log('');
|
|
File without changes
|
|
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
|
|
34
|
-
"../../node_modules/@rancher/shell
|
|
35
|
-
],
|
|
36
|
-
"@shell/config/*": [
|
|
37
|
-
"../../node_modules/@rancher/shell/config/*"
|
|
37
|
+
"@shell/*": [
|
|
38
|
+
"../../node_modules/@rancher/shell/*"
|
|
38
39
|
],
|
|
39
|
-
"@
|
|
40
|
-
"
|
|
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
|
}
|
|
File without changes
|
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)) {
|
|
@@ -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
|
|
@@ -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
|
-
|
|
45
|
-
|
|
46
|
+
fetch() {
|
|
47
|
+
if (this.mode === _EDIT) {
|
|
48
|
+
this.secondaryResourceData.namespace = this.value?.spec?.claimRef?.namespace || null;
|
|
46
49
|
|
|
47
|
-
|
|
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.
|
|
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="
|
|
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>
|
|
203
|
-
<n-link :to="
|
|
204
|
-
{{
|
|
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>
|
|
@@ -15,6 +15,7 @@ import StatusTable from '@shell/components/StatusTable';
|
|
|
15
15
|
import ResourceTabs from '@shell/components/form/ResourceTabs';
|
|
16
16
|
import Labels from '@shell/components/form/Labels';
|
|
17
17
|
import { Banner } from '@components/Banner';
|
|
18
|
+
import ResourceManager from '@shell/mixins/resource-manager';
|
|
18
19
|
|
|
19
20
|
const DEFAULT_STORAGE = '10Gi';
|
|
20
21
|
|
|
@@ -36,26 +37,17 @@ export default {
|
|
|
36
37
|
UnitInput,
|
|
37
38
|
},
|
|
38
39
|
|
|
39
|
-
mixins: [CreateEditView],
|
|
40
|
+
mixins: [CreateEditView, ResourceManager],
|
|
40
41
|
async fetch() {
|
|
41
42
|
const storageClasses = await this.$store.dispatch('cluster/findAll', { type: STORAGE_CLASS });
|
|
42
43
|
|
|
43
44
|
if (this.$store.getters['management/canList'](PV)) {
|
|
44
|
-
this.
|
|
45
|
+
this.resourceManagerFetchSecondaryResources(this.secondaryResourceData);
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
this.storageClassOptions = storageClasses.map(s => s.name).sort();
|
|
48
49
|
this.storageClassOptions.unshift(this.t('persistentVolumeClaim.useDefault'));
|
|
49
|
-
this.persistentVolumeOptions = this.persistentVolumes
|
|
50
|
-
.map((s) => {
|
|
51
|
-
const status = s.status.phase === 'Available' ? '' : ` (${ s.status.phase })`;
|
|
52
50
|
|
|
53
|
-
return {
|
|
54
|
-
label: `${ s.name }${ status }`,
|
|
55
|
-
value: s.name
|
|
56
|
-
};
|
|
57
|
-
})
|
|
58
|
-
.sort((l, r) => l.label.localeCompare(r.label));
|
|
59
51
|
this.$set(this.value.spec, 'storageClassName', this.value.spec.storageClassName || this.storageClassOptions[0]);
|
|
60
52
|
},
|
|
61
53
|
data() {
|
|
@@ -85,6 +77,31 @@ export default {
|
|
|
85
77
|
const defaultTab = this.$route.query[FOCUS] || null;
|
|
86
78
|
|
|
87
79
|
return {
|
|
80
|
+
secondaryResourceData: {
|
|
81
|
+
namespace: this.value?.metadata?.namespace || null,
|
|
82
|
+
data: {
|
|
83
|
+
[PV]: {
|
|
84
|
+
applyTo: [
|
|
85
|
+
{ var: 'persistentVolumes' },
|
|
86
|
+
{
|
|
87
|
+
var: 'persistentVolumeOptions',
|
|
88
|
+
parsingFunc: (data) => {
|
|
89
|
+
return data
|
|
90
|
+
.map((s) => {
|
|
91
|
+
const status = s.status.phase === 'Available' ? '' : ` (${ s.status.phase })`;
|
|
92
|
+
|
|
93
|
+
return {
|
|
94
|
+
label: `${ s.metadata.name }${ status }`,
|
|
95
|
+
value: s.metadata.name
|
|
96
|
+
};
|
|
97
|
+
})
|
|
98
|
+
.sort((l, r) => l.label.localeCompare(r.label));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
}
|
|
104
|
+
},
|
|
88
105
|
sourceOptions,
|
|
89
106
|
source: this.value.spec.volumeName ? sourceOptions[1].value : sourceOptions[0].value,
|
|
90
107
|
immutableMode: this.realMode === _CREATE ? _CREATE : _VIEW,
|
|
@@ -126,7 +143,7 @@ export default {
|
|
|
126
143
|
return this.value.spec.volumeName;
|
|
127
144
|
},
|
|
128
145
|
set(value) {
|
|
129
|
-
const persistentVolume = this.persistentVolumes.find(pv => pv.name === value);
|
|
146
|
+
const persistentVolume = this.persistentVolumes.find(pv => pv.metadata.name === value);
|
|
130
147
|
|
|
131
148
|
if (persistentVolume) {
|
|
132
149
|
this.$set(this.value.spec.resources.requests, 'storage', persistentVolume.spec.capacity?.storage);
|
|
@@ -170,7 +187,7 @@ export default {
|
|
|
170
187
|
}
|
|
171
188
|
},
|
|
172
189
|
isPersistentVolumeSelectable(option) {
|
|
173
|
-
const persistentVolume = this.persistentVolumes.find(pv => pv.name === option.value);
|
|
190
|
+
const persistentVolume = this.persistentVolumes.find(pv => pv.metadata.name === option.value);
|
|
174
191
|
|
|
175
192
|
return persistentVolume.status.phase === 'Available';
|
|
176
193
|
},
|
|
@@ -248,6 +265,7 @@ export default {
|
|
|
248
265
|
:label="t('persistentVolumeClaim.volumeClaim.persistentVolume')"
|
|
249
266
|
:selectable="isPersistentVolumeSelectable"
|
|
250
267
|
:mode="immutableMode"
|
|
268
|
+
:loading="isLoadingSecondaryResources"
|
|
251
269
|
/>
|
|
252
270
|
<LabeledInput
|
|
253
271
|
v-else
|