@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.
- package/assets/brand/suse/dark/rancher-logo.svg +1 -148
- package/assets/brand/suse/favicon.png +0 -0
- package/assets/brand/suse/rancher-logo.svg +1 -130
- package/assets/images/featured/img1.jpg +0 -0
- package/assets/images/featured.jpg +0 -0
- package/assets/images/generic-plugin.svg +1 -0
- package/assets/styles/themes/_dark.scss +3 -0
- package/assets/styles/themes/_light.scss +3 -0
- package/assets/styles/themes/_suse.scss +1 -1
- package/assets/translations/en-us.yaml +219 -47
- package/assets/translations/zh-hans.yaml +21 -24
- package/components/AsyncButton.vue +17 -2
- package/components/ButtonDropdown.vue +4 -0
- package/components/Carousel.vue +291 -0
- package/components/CommunityLinks.vue +64 -22
- package/components/CruResource.vue +11 -3
- package/components/Dialog.vue +102 -0
- package/components/ExplorerMembers.vue +2 -4
- package/components/ExplorerProjectsNamespaces.vue +25 -9
- package/components/IconMessage.vue +9 -1
- package/components/LazyImage.vue +21 -8
- package/components/LocaleSelector.vue +62 -29
- 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/ResourceTable.vue +7 -2
- package/components/SimpleBox.vue +6 -4
- package/components/SortableTable/index.vue +18 -25
- package/components/Tabbed/Tab.vue +5 -0
- package/components/Tabbed/index.vue +54 -9
- package/components/TypeDescription.vue +10 -1
- package/components/auth/Principal.vue +1 -0
- package/components/fleet/FleetBundles.vue +8 -3
- package/components/fleet/FleetClusters.vue +6 -0
- package/components/fleet/FleetRepos.vue +7 -1
- package/components/fleet/FleetSummary.vue +6 -0
- package/components/form/Command.vue +5 -0
- package/components/form/EnvVars.vue +5 -0
- package/components/form/KeyValue.vue +80 -58
- package/components/form/NameNsDescription.vue +13 -5
- package/components/form/NodeScheduling.vue +6 -1
- package/components/form/PodAffinity.vue +5 -0
- package/components/form/ResourceTabs/index.vue +5 -1
- package/components/form/ServiceNameSelect.vue +5 -0
- package/components/form/ValueFromResource.vue +7 -1
- package/components/formatter/ClusterLink.vue +3 -7
- package/components/nav/NamespaceFilter.vue +3 -3
- package/components/nav/TopLevelMenu.vue +12 -29
- package/config/home-links.js +155 -0
- package/config/labels-annotations.js +2 -1
- package/config/private-label.js +1 -1
- package/config/product/explorer.js +5 -4
- package/config/product/legacy.js +0 -47
- package/config/product/manager.js +0 -2
- package/config/product/multi-cluster-apps.js +0 -12
- package/config/product/settings.js +12 -1
- package/config/product/uiplugins.js +17 -0
- package/config/settings.js +23 -2
- package/config/types.js +5 -1
- package/config/uiplugins.js +117 -0
- package/config/version.js +17 -0
- package/content/docs/en-us/getting-started.md +1 -26
- package/core/plugin.ts +12 -0
- package/core/plugins.js +38 -2
- 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/provisioning.cattle.io.cluster.vue +3 -3
- package/detail/workload/index.vue +3 -2
- package/dialog/DiagnosticTimingsDialog.vue +116 -0
- package/dialog/RotateCertificatesDialog.vue +9 -3
- package/edit/auth/azuread.vue +28 -9
- package/edit/networking.k8s.io.ingress/index.vue +2 -2
- package/edit/persistentvolume/index.vue +51 -13
- package/edit/persistentvolumeclaim.vue +31 -13
- package/edit/pod.vue +27 -0
- package/edit/provisioning.cattle.io.cluster/rke2.vue +103 -24
- package/edit/service.vue +7 -5
- package/edit/workload/__tests__/Upgrading.test.ts +1 -0
- package/edit/workload/index.vue +32 -10
- package/edit/workload/mixins/workload.js +121 -126
- package/edit/workload/storage/ContainerMountPaths.vue +240 -0
- package/edit/workload/storage/Mount.vue +1 -0
- package/edit/workload/storage/awsElasticBlockStore.vue +20 -1
- package/edit/workload/storage/azureDisk.vue +22 -2
- package/edit/workload/storage/azureFile.vue +20 -2
- package/edit/workload/storage/csi/index.vue +23 -1
- package/edit/workload/storage/gcePersistentDisk.vue +20 -2
- package/edit/workload/storage/index.vue +33 -65
- package/edit/workload/storage/persistentVolumeClaim/index.vue +5 -0
- package/edit/workload/storage/secret.vue +6 -1
- package/edit/workload/storage/vsphereVolume.vue +11 -1
- package/layouts/default.vue +14 -8
- package/layouts/home.vue +9 -4
- package/layouts/plain.vue +10 -5
- 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.setting.vue +3 -3
- 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 +35 -9
- package/list/service.vue +24 -12
- package/list/ui.cattle.io.navlink.vue +6 -0
- package/list/workload.vue +2 -2
- package/machine-config/harvester.vue +5 -3
- 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 +38 -0
- package/models/cluster/node.js +25 -2
- package/models/fleet.cattle.io.bundle.js +1 -1
- package/models/harvesterhci.io.management.cluster.js +11 -5
- package/models/pod.js +15 -5
- package/models/provisioning.cattle.io.cluster.js +16 -6
- package/models/workload.js +5 -3
- package/models/workload.service.js +10 -0
- package/nuxt.config.js +70 -25
- package/package.json +108 -109
- package/pages/auth/login.vue +11 -1
- package/pages/auth/verify.vue +9 -0
- package/pages/c/_cluster/apps/charts/index.vue +46 -1
- package/pages/c/_cluster/apps/charts/install.vue +10 -9
- package/pages/c/_cluster/explorer/index.vue +72 -9
- package/pages/c/_cluster/explorer/tools/index.vue +12 -5
- package/pages/c/_cluster/mcapps/index.vue +1 -1
- package/pages/c/_cluster/settings/DefaultLinksEditor.vue +108 -0
- package/pages/c/_cluster/settings/brand.vue +0 -40
- package/pages/c/_cluster/settings/links.vue +152 -0
- package/pages/c/_cluster/settings/performance.vue +90 -7
- package/pages/c/_cluster/uiplugins/DeveloperInstallDialog.vue +232 -0
- package/pages/c/_cluster/uiplugins/InstallDialog.vue +293 -0
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +300 -0
- package/pages/c/_cluster/uiplugins/RemoveUIPlugins.vue +125 -0
- package/pages/c/_cluster/uiplugins/SetupUIPlugins.vue +261 -0
- package/pages/c/_cluster/uiplugins/UninstallDialog.vue +122 -0
- package/pages/c/_cluster/uiplugins/index.vue +808 -0
- package/pages/diagnostic.vue +185 -101
- package/pages/docs/_doc.vue +3 -1
- package/pages/home.vue +21 -56
- package/pages/prefs.vue +108 -88
- package/pages/safeMode.vue +17 -0
- package/pages/support/index.vue +34 -137
- package/pkg/dynamic-importer.lib.js +4 -0
- 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/dashboard-store/resource-class.js +2 -2
- package/plugins/formatters.js +15 -0
- package/plugins/plugin.js +61 -6
- package/plugins/steve/getters.js +12 -0
- package/plugins/steve/mutations.js +1 -1
- package/plugins/steve/subscribe.js +94 -72
- package/plugins/steve/web-worker.steve-sub-worker.js +24 -15
- package/plugins/version.js +21 -0
- package/promptRemove/management.cattle.io.globalrole.vue +47 -0
- package/promptRemove/management.cattle.io.roletemplate.vue +47 -0
- package/promptRemove/mixin/roleDeletionCheck.js +97 -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 +40 -7
- package/scripts/record-deps.js +37 -0
- package/scripts/sync-shell-deps +37 -0
- package/scripts/test-plugins-build.sh +8 -5
- package/scripts/typegen.sh +84 -0
- package/store/auth.js +3 -0
- package/store/catalog.js +9 -8
- package/store/i18n.js +10 -1
- package/store/index.js +12 -3
- package/store/prefs.js +16 -0
- package/store/type-map.js +32 -5
- package/store/uiplugins.ts +15 -61
- package/types/shell/index.d.ts +3046 -0
- package/utils/__tests__/object.test.ts +0 -24
- package/utils/__tests__/selector.test.ts +1 -1
- package/utils/dynamic-importer.js +4 -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/utils/grafana.js +2 -6
- package/utils/socket.js +41 -20
- package/utils/string.js +1 -7
- package/utils/validators/formRules/__tests__/index.test.ts +108 -0
- package/utils/validators/formRules/index.ts +9 -1
- package/config/footer.js +0 -19
- package/creators/pkg/nuxt.config.js +0 -6
- package/pages/plugins.vue +0 -387
- package/server/verdaccio-middleware.js +0 -56
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import BrandImage from '@shell/components/BrandImage';
|
|
3
3
|
import ClusterProviderIcon from '@shell/components/ClusterProviderIcon';
|
|
4
|
-
import LocaleSelector from '@shell/components/LocaleSelector';
|
|
5
4
|
import { mapGetters } from 'vuex';
|
|
6
5
|
import $ from 'jquery';
|
|
7
6
|
import { CAPI, MANAGEMENT } from '@shell/config/types';
|
|
8
|
-
import { mapPref,
|
|
7
|
+
import { mapPref, MENU_MAX_CLUSTERS } from '@shell/store/prefs';
|
|
9
8
|
import { sortBy } from '@shell/utils/sort';
|
|
10
9
|
import { ucFirst } from '@shell/utils/string';
|
|
11
10
|
import { KEY } from '@shell/utils/platform';
|
|
@@ -13,6 +12,7 @@ import { getVersionInfo } from '@shell/utils/version';
|
|
|
13
12
|
import { LEGACY } from '@shell/store/features';
|
|
14
13
|
import { SETTING } from '@shell/config/settings';
|
|
15
14
|
import { filterOnlyKubernetesClusters, filterHiddenLocalCluster } from '@shell/utils/cluster';
|
|
15
|
+
import { isRancherPrime } from '@shell/config/version';
|
|
16
16
|
|
|
17
17
|
const UNKNOWN = 'unknown';
|
|
18
18
|
const UI_VERSION = process.env.VERSION || UNKNOWN;
|
|
@@ -20,9 +20,7 @@ const UI_COMMIT = process.env.COMMIT || UNKNOWN;
|
|
|
20
20
|
|
|
21
21
|
export default {
|
|
22
22
|
|
|
23
|
-
components: {
|
|
24
|
-
BrandImage, ClusterProviderIcon, LocaleSelector
|
|
25
|
-
},
|
|
23
|
+
components: { BrandImage, ClusterProviderIcon },
|
|
26
24
|
|
|
27
25
|
data() {
|
|
28
26
|
const { displayVersion, fullVersion } = getVersionInfo(this.$store);
|
|
@@ -68,9 +66,10 @@ export default {
|
|
|
68
66
|
clusters() {
|
|
69
67
|
const all = this.$store.getters['management/all'](MANAGEMENT.CLUSTER);
|
|
70
68
|
let kubeClusters = filterHiddenLocalCluster(filterOnlyKubernetesClusters(all), this.$store);
|
|
69
|
+
let pClusters = null;
|
|
71
70
|
|
|
72
71
|
if (this.hasProvCluster) {
|
|
73
|
-
|
|
72
|
+
pClusters = this.$store.getters['management/all'](CAPI.RANCHER_CLUSTER);
|
|
74
73
|
const available = pClusters.reduce((p, c) => {
|
|
75
74
|
p[c.mgmt] = true;
|
|
76
75
|
|
|
@@ -84,10 +83,12 @@ export default {
|
|
|
84
83
|
}
|
|
85
84
|
|
|
86
85
|
return kubeClusters.map((x) => {
|
|
86
|
+
const pCluster = pClusters?.find(c => c.mgmt.id === x.id);
|
|
87
|
+
|
|
87
88
|
return {
|
|
88
89
|
id: x.id,
|
|
89
90
|
label: x.nameDisplay,
|
|
90
|
-
ready: x.isReady,
|
|
91
|
+
ready: x.isReady && !pCluster?.hasError,
|
|
91
92
|
osLogo: x.providerOsLogo,
|
|
92
93
|
providerNavLogo: x.providerMenuLogo,
|
|
93
94
|
badge: x.badge,
|
|
@@ -101,13 +102,11 @@ export default {
|
|
|
101
102
|
|
|
102
103
|
const out = search ? this.clusters.filter(item => item.label.toLowerCase().includes(search)) : this.clusters;
|
|
103
104
|
|
|
104
|
-
const sorted = sortBy(out, ['
|
|
105
|
+
const sorted = sortBy(out, ['name:desc', 'label']);
|
|
105
106
|
|
|
106
107
|
return sorted;
|
|
107
108
|
},
|
|
108
109
|
|
|
109
|
-
dev: mapPref(DEV),
|
|
110
|
-
|
|
111
110
|
maxClustersToShow: mapPref(MENU_MAX_CLUSTERS),
|
|
112
111
|
|
|
113
112
|
multiClusterApps() {
|
|
@@ -125,22 +124,7 @@ export default {
|
|
|
125
124
|
configurationApps() {
|
|
126
125
|
const options = this.options;
|
|
127
126
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
// Add plugin page
|
|
131
|
-
// Ony when developing for now
|
|
132
|
-
if (process.env.dev) {
|
|
133
|
-
items.push({
|
|
134
|
-
label: 'Plugins',
|
|
135
|
-
inStore: 'management',
|
|
136
|
-
icon: 'icon-gear',
|
|
137
|
-
value: 'plugins',
|
|
138
|
-
weight: 1,
|
|
139
|
-
to: { name: 'plugins' },
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
return items;
|
|
127
|
+
return options.filter(opt => opt.category === 'configuration');
|
|
144
128
|
},
|
|
145
129
|
|
|
146
130
|
options() {
|
|
@@ -179,14 +163,14 @@ export default {
|
|
|
179
163
|
},
|
|
180
164
|
|
|
181
165
|
hasSupport() {
|
|
182
|
-
return this.$store.getters['management/byId'](MANAGEMENT.SETTING, SETTING.SUPPORTED )?.value === 'true';
|
|
166
|
+
return isRancherPrime() || this.$store.getters['management/byId'](MANAGEMENT.SETTING, SETTING.SUPPORTED )?.value === 'true';
|
|
183
167
|
},
|
|
184
168
|
},
|
|
185
169
|
|
|
186
170
|
watch: {
|
|
187
171
|
$route() {
|
|
188
172
|
this.shown = false;
|
|
189
|
-
}
|
|
173
|
+
}
|
|
190
174
|
},
|
|
191
175
|
|
|
192
176
|
mounted() {
|
|
@@ -349,7 +333,6 @@ export default {
|
|
|
349
333
|
v-html="displayVersion"
|
|
350
334
|
/>
|
|
351
335
|
</div>
|
|
352
|
-
<LocaleSelector></LocaleSelector>
|
|
353
336
|
</div>
|
|
354
337
|
</div>
|
|
355
338
|
</transition>
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { DOCS_BASE } from '@shell/config/private-label';
|
|
2
|
+
import { MANAGEMENT } from '@shell/config/types';
|
|
3
|
+
import { SETTING } from '@shell/config/settings';
|
|
4
|
+
import { allHash } from '@shell/utils/promise';
|
|
5
|
+
|
|
6
|
+
const DEFAULT_LINKS = [
|
|
7
|
+
{
|
|
8
|
+
key: 'docs',
|
|
9
|
+
value: DOCS_BASE,
|
|
10
|
+
enabled: true,
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
key: 'forums',
|
|
14
|
+
value: 'https://forums.rancher.com/',
|
|
15
|
+
enabled: true,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
key: 'slack',
|
|
19
|
+
value: 'https://slack.rancher.io/',
|
|
20
|
+
enabled: true,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
key: 'issues',
|
|
24
|
+
value: 'https://github.com/rancher/dashboard/issues/new/choose',
|
|
25
|
+
enabled: true,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
key: 'getStarted',
|
|
29
|
+
value: '/docs/getting-started',
|
|
30
|
+
enabled: true,
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
const SUPPORT_LINK = {
|
|
35
|
+
key: 'commercialSupport',
|
|
36
|
+
value: '/support',
|
|
37
|
+
enabled: true,
|
|
38
|
+
readonly: true
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// We add a version attribute to the setting so we know what has been migrated and which version of the setting we have
|
|
42
|
+
export const CUSTOM_LINKS_VERSION = 'v1';
|
|
43
|
+
|
|
44
|
+
// Fetch the settings required for the links, taking into account legacy settings if we have not migrated
|
|
45
|
+
export async function fetchLinks(store, hasSupport, isSupportPage, t) {
|
|
46
|
+
let uiLinks = {};
|
|
47
|
+
|
|
48
|
+
try {
|
|
49
|
+
const uiLinksSetting = await store.dispatch('management/find', { type: MANAGEMENT.SETTING, id: SETTING.UI_CUSTOM_LINKS });
|
|
50
|
+
|
|
51
|
+
uiLinks = JSON.parse(uiLinksSetting.value);
|
|
52
|
+
} catch (e) {
|
|
53
|
+
console.warn('Could not parse custom link settings', e); // eslint-disable-line no-console
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// If uiLinks is set and has the correct version, then we are okay, otherwise we need to migrate from the old settings
|
|
57
|
+
if (uiLinks?.version === CUSTOM_LINKS_VERSION) {
|
|
58
|
+
// Map out the default settings, as we only store keys of the ones to show
|
|
59
|
+
if (uiLinks.defaults) {
|
|
60
|
+
const defaults = [...DEFAULT_LINKS];
|
|
61
|
+
|
|
62
|
+
// Map the link name stored to the default link, if it exists
|
|
63
|
+
defaults.forEach((link) => {
|
|
64
|
+
const enabled = uiLinks.defaults.find(linkName => linkName === link.key);
|
|
65
|
+
|
|
66
|
+
link.enabled = !!enabled;
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
uiLinks.defaults = defaults;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return ensureSupportLink(uiLinks, hasSupport, isSupportPage, t);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// No new setting, so return the required structure
|
|
76
|
+
// We don't migrate here, as we may not have permissions to create the setting
|
|
77
|
+
const links = {
|
|
78
|
+
version: CUSTOM_LINKS_VERSION,
|
|
79
|
+
defaults: [...DEFAULT_LINKS],
|
|
80
|
+
custom: []
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
// There are two legacy settings:
|
|
84
|
+
// SETTING.ISSUES - can specify a custom link to use for 'File an issue'
|
|
85
|
+
// SETTING.COMMUNITY_LINKS - can specify whether to hide all of the default links (other than 'File an issue')
|
|
86
|
+
try {
|
|
87
|
+
const { uiIssuesSetting, uiCommunitySetting } = await allHash({
|
|
88
|
+
uiIssuesSetting: store.dispatch('management/find', { type: MANAGEMENT.SETTING, id: SETTING.ISSUES }),
|
|
89
|
+
uiCommunitySetting: store.dispatch('management/find', { type: MANAGEMENT.SETTING, id: SETTING.COMMUNITY_LINKS })
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
// Should we show the default set of links?
|
|
93
|
+
if (uiCommunitySetting?.value === 'false') {
|
|
94
|
+
// Hide all of the default links
|
|
95
|
+
links.defaults.forEach(link => (link.enabled = false));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Do we have a custom 'File an issue' link ?
|
|
99
|
+
if (uiIssuesSetting?.value) {
|
|
100
|
+
links.custom.push({
|
|
101
|
+
label: t ? t('customLinks.defaults.issues') : 'Issues',
|
|
102
|
+
value: uiIssuesSetting.value
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
// Hide the default 'File an issue' link
|
|
106
|
+
const issueLink = links.defaults?.find(link => link.key === 'issues');
|
|
107
|
+
|
|
108
|
+
if (issueLink) {
|
|
109
|
+
issueLink.enabled = false;
|
|
110
|
+
issueLink.readOnly = true;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
} catch (e) {
|
|
114
|
+
console.warn('Could not parse legacy link settings', e); // eslint-disable-line no-console
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return ensureSupportLink(links, hasSupport, isSupportPage, t);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Ensure the support link is added if needed
|
|
121
|
+
function ensureSupportLink(links, hasSupport, isSupportPage, t) {
|
|
122
|
+
if (!hasSupport && !isSupportPage) {
|
|
123
|
+
const supportLink = links.defaults?.find(link => link.key === 'commercialSupport');
|
|
124
|
+
|
|
125
|
+
if (!supportLink) {
|
|
126
|
+
links.defaults.push(SUPPORT_LINK);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Localise the default links
|
|
131
|
+
links.defaults = links.defaults.map((link) => {
|
|
132
|
+
return {
|
|
133
|
+
...link,
|
|
134
|
+
label: t(`'customLinks.defaults.${ link.key }`)
|
|
135
|
+
};
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
// Ensure that if any custom links have the same name as a default link, we use the custom link
|
|
139
|
+
const customNamesMap = links.custom.reduce((linkMap, link) => {
|
|
140
|
+
linkMap[link.label] = link;
|
|
141
|
+
|
|
142
|
+
return linkMap;
|
|
143
|
+
}, {});
|
|
144
|
+
|
|
145
|
+
// If any custom links have the same name as a default link, then hide and mark readonly the default link
|
|
146
|
+
// Main use case if the 'File an Issue' link when migrating the old settings
|
|
147
|
+
links.defaults.forEach((link) => {
|
|
148
|
+
if (customNamesMap[link.label]) {
|
|
149
|
+
link.enabled = false;
|
|
150
|
+
link.readonly = true;
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
return links;
|
|
155
|
+
}
|
|
@@ -65,6 +65,7 @@ export const CATALOG = {
|
|
|
65
65
|
EXPERIMENTAL: 'catalog.cattle.io/experimental',
|
|
66
66
|
NAMESPACE: 'catalog.cattle.io/namespace',
|
|
67
67
|
RELEASE_NAME: 'catalog.cattle.io/release-name',
|
|
68
|
+
FEATURED: 'catalog.cattle.io/featured',
|
|
68
69
|
|
|
69
70
|
REQUIRES_GVK: 'catalog.cattle.io/requires-gvr',
|
|
70
71
|
PROVIDES: 'catalog.cattle.io/provides-gvr',
|
|
@@ -94,7 +95,7 @@ export const CATALOG = {
|
|
|
94
95
|
DEPLOYED_OS: 'catalog.cattle.io/deploys-on-os',
|
|
95
96
|
|
|
96
97
|
MIGRATED: 'apps.cattle.io/migrated',
|
|
97
|
-
MANAGED: 'catalog.cattle.io/managed'
|
|
98
|
+
MANAGED: 'catalog.cattle.io/managed',
|
|
98
99
|
};
|
|
99
100
|
|
|
100
101
|
export const FLEET = {
|
package/config/private-label.js
CHANGED
|
@@ -7,7 +7,7 @@ export const DOCS_BASE = 'https://rancher.com/docs/rancher/v2.6/en';
|
|
|
7
7
|
|
|
8
8
|
const STANDARD_VENDOR = 'Rancher';
|
|
9
9
|
const STANDARD_PRODUCT = 'Explorer';
|
|
10
|
-
const CUSTOM_VENDOR = { suse: '
|
|
10
|
+
const CUSTOM_VENDOR = { suse: 'Rancher Prime' };
|
|
11
11
|
|
|
12
12
|
let mode = STANDARD;
|
|
13
13
|
let vendor = STANDARD_VENDOR;
|
|
@@ -58,6 +58,7 @@ export function init(store) {
|
|
|
58
58
|
'namespaces',
|
|
59
59
|
NODE,
|
|
60
60
|
VIRTUAL_TYPES.CLUSTER_MEMBERS,
|
|
61
|
+
EVENT,
|
|
61
62
|
], 'cluster');
|
|
62
63
|
basicType([
|
|
63
64
|
SERVICE,
|
|
@@ -142,6 +143,7 @@ export function init(store) {
|
|
|
142
143
|
configureType(NORMAN.PROJECT_ROLE_TEMPLATE_BINDING, { depaginate: true });
|
|
143
144
|
|
|
144
145
|
configureType(EVENT, { limit: 500 });
|
|
146
|
+
weightType(EVENT, -1, true);
|
|
145
147
|
|
|
146
148
|
// Allow Pods to be grouped by node
|
|
147
149
|
configureType(POD, {
|
|
@@ -158,13 +160,12 @@ export function init(store) {
|
|
|
158
160
|
|
|
159
161
|
setGroupDefaultType('serviceDiscovery', SERVICE);
|
|
160
162
|
|
|
161
|
-
configureType(
|
|
162
|
-
displayName: '
|
|
163
|
+
configureType(WORKLOAD, {
|
|
164
|
+
displayName: store.getters['i18n/t'](`typeLabel.${ WORKLOAD }`, { count: 1 }).trim(),
|
|
163
165
|
location: {
|
|
164
166
|
name: 'c-cluster-product-resource',
|
|
165
|
-
params: { resource:
|
|
167
|
+
params: { resource: WORKLOAD },
|
|
166
168
|
},
|
|
167
|
-
resource: WORKLOAD_TYPES.DEPLOYMENT
|
|
168
169
|
});
|
|
169
170
|
|
|
170
171
|
headers(PV, [STATE, NAME_COL, RECLAIM_POLICY, PERSISTENT_VOLUME_CLAIM, PERSISTENT_VOLUME_SOURCE, PV_REASON, AGE]);
|
package/config/product/legacy.js
CHANGED
|
@@ -46,16 +46,6 @@ export function init(store) {
|
|
|
46
46
|
exact: true
|
|
47
47
|
});
|
|
48
48
|
|
|
49
|
-
virtualType({
|
|
50
|
-
labelKey: 'legacy.cis-scans',
|
|
51
|
-
name: 'v1-cis-scans',
|
|
52
|
-
group: 'Root',
|
|
53
|
-
namespaced: true,
|
|
54
|
-
weight: 111,
|
|
55
|
-
route: { name: 'c-cluster-legacy-pages-page', params: { page: 'cis' } },
|
|
56
|
-
exact: true
|
|
57
|
-
});
|
|
58
|
-
|
|
59
49
|
virtualType({
|
|
60
50
|
ifHave: IF_HAVE.PROJECT,
|
|
61
51
|
labelKey: 'legacy.project.label',
|
|
@@ -82,7 +72,6 @@ export function init(store) {
|
|
|
82
72
|
'v1-alerts',
|
|
83
73
|
'v1-catalogs',
|
|
84
74
|
'v1-notifiers',
|
|
85
|
-
'v1-cis-scans',
|
|
86
75
|
'v1-project-overview'
|
|
87
76
|
]);
|
|
88
77
|
|
|
@@ -121,17 +110,6 @@ export function init(store) {
|
|
|
121
110
|
overview: false,
|
|
122
111
|
});
|
|
123
112
|
|
|
124
|
-
virtualType({
|
|
125
|
-
ifHave: IF_HAVE.PROJECT,
|
|
126
|
-
labelKey: 'legacy.logging',
|
|
127
|
-
namespaced: true,
|
|
128
|
-
name: 'project-logging',
|
|
129
|
-
weight: 105,
|
|
130
|
-
route: { name: 'c-cluster-legacy-project-page', params: { page: 'logging' } },
|
|
131
|
-
exact: true,
|
|
132
|
-
overview: false,
|
|
133
|
-
});
|
|
134
|
-
|
|
135
113
|
virtualType({
|
|
136
114
|
ifHave: IF_HAVE.PROJECT,
|
|
137
115
|
labelKey: 'legacy.monitoring',
|
|
@@ -143,28 +121,6 @@ export function init(store) {
|
|
|
143
121
|
overview: false,
|
|
144
122
|
});
|
|
145
123
|
|
|
146
|
-
virtualType({
|
|
147
|
-
ifHave: IF_HAVE.PROJECT,
|
|
148
|
-
labelKey: 'legacy.istio',
|
|
149
|
-
namespaced: true,
|
|
150
|
-
name: 'project-istio',
|
|
151
|
-
weight: 105,
|
|
152
|
-
route: { name: 'c-cluster-legacy-project-page', params: { page: 'istio' } },
|
|
153
|
-
exact: true,
|
|
154
|
-
overview: false,
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
virtualType({
|
|
158
|
-
ifHave: IF_HAVE.PROJECT,
|
|
159
|
-
labelKey: 'legacy.pipelines',
|
|
160
|
-
namespaced: true,
|
|
161
|
-
name: 'project-pipelines',
|
|
162
|
-
weight: 104,
|
|
163
|
-
route: { name: 'c-cluster-legacy-project-pipelines' },
|
|
164
|
-
exact: true,
|
|
165
|
-
overview: false,
|
|
166
|
-
});
|
|
167
|
-
|
|
168
124
|
virtualType({
|
|
169
125
|
ifHave: IF_HAVE.PROJECT,
|
|
170
126
|
labelKey: 'legacy.secrets',
|
|
@@ -192,10 +148,7 @@ export function init(store) {
|
|
|
192
148
|
'project-alerts',
|
|
193
149
|
'project-catalogs',
|
|
194
150
|
'project-config-maps',
|
|
195
|
-
'project-logging',
|
|
196
|
-
'project-istio',
|
|
197
151
|
'project-monitoring',
|
|
198
|
-
'project-pipelines',
|
|
199
152
|
'project-secrets',
|
|
200
153
|
], 'Project');
|
|
201
154
|
}
|
|
@@ -120,8 +120,6 @@ export function init(store) {
|
|
|
120
120
|
weightType(CAPI.MACHINE, 1, true);
|
|
121
121
|
weightType(CATALOG.CLUSTER_REPO, 0, true);
|
|
122
122
|
|
|
123
|
-
configureType(CATALOG.CLUSTER_REPO, { showListMasthead: false });
|
|
124
|
-
|
|
125
123
|
basicType([
|
|
126
124
|
CAPI.MACHINE_DEPLOYMENT,
|
|
127
125
|
CAPI.MACHINE_SET,
|
|
@@ -20,17 +20,6 @@ export function init(store) {
|
|
|
20
20
|
showWorkspaceSwitcher: false,
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
virtualType({
|
|
24
|
-
labelKey: 'legacy.apps',
|
|
25
|
-
name: 'mc-apps',
|
|
26
|
-
group: 'Root',
|
|
27
|
-
namespaced: false,
|
|
28
|
-
weight: 112,
|
|
29
|
-
icon: 'folder',
|
|
30
|
-
route: { name: 'c-cluster-mcapps-pages-page', params: { cluster: 'local', page: 'apps' } },
|
|
31
|
-
exact: true
|
|
32
|
-
});
|
|
33
|
-
|
|
34
23
|
virtualType({
|
|
35
24
|
labelKey: 'legacy.catalogs',
|
|
36
25
|
name: 'mc-catalogs',
|
|
@@ -65,7 +54,6 @@ export function init(store) {
|
|
|
65
54
|
});
|
|
66
55
|
|
|
67
56
|
basicType([
|
|
68
|
-
'mc-apps',
|
|
69
57
|
'mc-catalogs',
|
|
70
58
|
'global-dns-entries',
|
|
71
59
|
'global-dns-providers',
|
|
@@ -90,12 +90,23 @@ export function init(store) {
|
|
|
90
90
|
route: { name: 'c-cluster-settings-performance' }
|
|
91
91
|
});
|
|
92
92
|
|
|
93
|
+
virtualType({
|
|
94
|
+
ifHaveType: MANAGEMENT.SETTING,
|
|
95
|
+
labelKey: 'customLinks.label',
|
|
96
|
+
name: 'links',
|
|
97
|
+
namespaced: false,
|
|
98
|
+
weight: 96,
|
|
99
|
+
icon: 'folder',
|
|
100
|
+
route: { name: 'c-cluster-settings-links' }
|
|
101
|
+
});
|
|
102
|
+
|
|
93
103
|
basicType([
|
|
94
104
|
'settings',
|
|
95
105
|
'features',
|
|
96
106
|
'brand',
|
|
97
107
|
'banners',
|
|
98
|
-
'performance'
|
|
108
|
+
'performance',
|
|
109
|
+
'links'
|
|
99
110
|
]);
|
|
100
111
|
|
|
101
112
|
configureType(MANAGEMENT.SETTING, {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DSL, IF_HAVE } from '@shell/store/type-map';
|
|
2
|
+
|
|
3
|
+
export const NAME = 'uiplugins';
|
|
4
|
+
|
|
5
|
+
export function init(store) {
|
|
6
|
+
const { product } = DSL(store, NAME);
|
|
7
|
+
|
|
8
|
+
// Add a product for UI Plugins - will appear in the top-level menu
|
|
9
|
+
product({
|
|
10
|
+
ifHave: IF_HAVE.ADMIN, // Only admins can see the UI Plugin Custom Resource by default
|
|
11
|
+
inStore: 'management',
|
|
12
|
+
icon: 'extension',
|
|
13
|
+
removable: false,
|
|
14
|
+
showClusterSwitcher: false,
|
|
15
|
+
category: 'configuration',
|
|
16
|
+
});
|
|
17
|
+
}
|
package/config/settings.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Settings
|
|
2
|
+
import { GC_DEFAULTS } from '../utils/gc/gc-types';
|
|
2
3
|
import { MANAGEMENT } from './types';
|
|
3
4
|
|
|
4
5
|
// Adapted from: https://github.com/rancher/ui/blob/08c379a9529f740666a704b52522a468986c3520/lib/shared/addon/utils/constants.js#L564
|
|
@@ -55,6 +56,7 @@ export const SETTING = {
|
|
|
55
56
|
COMMUNITY_LINKS: 'ui-community-links',
|
|
56
57
|
FAVICON: 'ui-favicon',
|
|
57
58
|
UI_PERFORMANCE: 'ui-performance',
|
|
59
|
+
UI_CUSTOM_LINKS: 'ui-custom-links',
|
|
58
60
|
/**
|
|
59
61
|
* Allow the backend to force a light/dark theme. Used in non-rancher world and results in the theme used
|
|
60
62
|
* both pre and post log in. If not present defaults to the usual process
|
|
@@ -86,7 +88,7 @@ export const ALLOWED_SETTINGS = {
|
|
|
86
88
|
kind: 'enum',
|
|
87
89
|
options: ['dynamic', 'true', 'false']
|
|
88
90
|
},
|
|
89
|
-
[SETTING.BRAND]: {},
|
|
91
|
+
[SETTING.BRAND]: { canReset: true },
|
|
90
92
|
[SETTING.CLUSTER_TEMPLATE_ENFORCEMENT]: { kind: 'boolean' },
|
|
91
93
|
[SETTING.TELEMETRY]: {
|
|
92
94
|
kind: 'enum',
|
|
@@ -104,7 +106,8 @@ export const DEFAULT_PERF_SETTING = {
|
|
|
104
106
|
enabled: false,
|
|
105
107
|
threshold: 1500,
|
|
106
108
|
},
|
|
107
|
-
disableWebsocketNotification:
|
|
109
|
+
disableWebsocketNotification: true,
|
|
110
|
+
garbageCollection: GC_DEFAULTS
|
|
108
111
|
};
|
|
109
112
|
|
|
110
113
|
export const fetchOrCreateSetting = async(store, id, val, save = true) => {
|
|
@@ -135,3 +138,21 @@ export const setSetting = async(store, id, val) => {
|
|
|
135
138
|
|
|
136
139
|
return setting;
|
|
137
140
|
};
|
|
141
|
+
|
|
142
|
+
export const getPerformanceSetting = (rootGetters) => {
|
|
143
|
+
const perfSetting = rootGetters['management/byId'](MANAGEMENT.SETTING, SETTING.UI_PERFORMANCE);
|
|
144
|
+
let perfConfig = {};
|
|
145
|
+
|
|
146
|
+
if (perfSetting && perfSetting.value) {
|
|
147
|
+
try {
|
|
148
|
+
perfConfig = JSON.parse(perfSetting.value);
|
|
149
|
+
} catch (e) {
|
|
150
|
+
console.warn('ui-performance setting contains invalid data'); // eslint-disable-line no-console
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Start with the default and overwrite the values from the setting - ensures we have defaults for newly added options
|
|
155
|
+
perfConfig = Object.assign(DEFAULT_PERF_SETTING, perfConfig);
|
|
156
|
+
|
|
157
|
+
return perfConfig;
|
|
158
|
+
};
|
package/config/types.js
CHANGED
|
@@ -51,6 +51,7 @@ export const NAMESPACE = 'namespace';
|
|
|
51
51
|
export const NODE = 'node';
|
|
52
52
|
export const NETWORK_POLICY = 'networking.k8s.io.networkpolicy';
|
|
53
53
|
export const POD = 'pod';
|
|
54
|
+
export const PSP = 'policy.podsecuritypolicy';
|
|
54
55
|
export const PV = 'persistentvolume';
|
|
55
56
|
export const PVC = 'persistentvolumeclaim';
|
|
56
57
|
export const RESOURCE_QUOTA = 'resourcequota';
|
|
@@ -80,7 +81,6 @@ export const WORKLOAD_TYPES = {
|
|
|
80
81
|
STATEFUL_SET: 'apps.statefulset',
|
|
81
82
|
REPLICA_SET: 'apps.replicaset',
|
|
82
83
|
REPLICATION_CONTROLLER: 'replicationcontroller',
|
|
83
|
-
POD: 'pod'
|
|
84
84
|
};
|
|
85
85
|
|
|
86
86
|
const {
|
|
@@ -101,6 +101,9 @@ export const CATALOG = {
|
|
|
101
101
|
REPO: 'catalog.cattle.io.repo',
|
|
102
102
|
};
|
|
103
103
|
|
|
104
|
+
// UI Plugin type
|
|
105
|
+
export const UI_PLUGIN = 'catalog.cattle.io.uiplugin';
|
|
106
|
+
|
|
104
107
|
export const HELM = { PROJECTHELMCHART: 'helm.cattle.io.projecthelmchart' };
|
|
105
108
|
|
|
106
109
|
export const MONITORING = {
|
|
@@ -271,6 +274,7 @@ export const HCI = {
|
|
|
271
274
|
CLUSTER: 'harvesterhci.io.management.cluster',
|
|
272
275
|
DASHBOARD: 'harvesterhci.io.dashboard',
|
|
273
276
|
IMAGE: 'harvesterhci.io.virtualmachineimage',
|
|
277
|
+
SETTING: 'harvesterhci.io.setting',
|
|
274
278
|
};
|
|
275
279
|
|
|
276
280
|
export const VIRTUAL_HARVESTER_PROVIDER = 'harvester';
|