@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.
- package/assets/brand/suse/favicon.png +0 -0
- package/assets/images/generic-plugin.svg +1 -7
- package/assets/styles/global/_button.scss +1 -0
- package/assets/translations/en-us.yaml +129 -53
- package/assets/translations/zh-hans.yaml +18 -0
- package/components/CommunityLinks.vue +40 -49
- package/components/ExplorerProjectsNamespaces.vue +20 -3
- package/components/HarvesterServiceAddOnConfig.vue +10 -10
- 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 +42 -36
- package/components/ResourceTable.vue +19 -0
- package/components/SortableTable/THead.vue +311 -70
- package/components/SortableTable/advanced-filtering.js +272 -0
- package/components/SortableTable/filtering.js +90 -29
- package/components/SortableTable/index.vue +486 -280
- 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/form/WorkloadPorts.vue +2 -2
- 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/settings.js +1 -0
- package/config/product/uiplugins.js +2 -1
- package/config/settings.js +3 -1
- package/config/uiplugins.js +76 -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 +7 -1
- 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/pkg/package.json +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 +1 -1
- 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/ACE.vue +2 -1
- package/edit/provisioning.cattle.io.cluster/DrainOptions.vue +0 -1
- package/edit/provisioning.cattle.io.cluster/rke2.vue +52 -43
- package/edit/service.vue +1 -1
- 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/management.cattle.io.cluster.js +9 -1
- 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/apps/charts/install.vue +119 -31
- 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 +72 -21
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +26 -7
- 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 +12 -5
- package/pages/c/_cluster/uiplugins/index.vue +223 -72
- 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/promptRemove/mixin/roleDeletionCheck.js +15 -1
- 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/store/type-map.js +2 -0
- 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
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import Vue from 'vue';
|
|
3
|
+
|
|
4
|
+
import { _VIEW } from '@shell/config/query-params';
|
|
5
|
+
import { Checkbox } from '@components/Form/Checkbox';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
name: 'DefaultLinksEditor',
|
|
9
|
+
|
|
10
|
+
components: { Checkbox },
|
|
11
|
+
|
|
12
|
+
props: {
|
|
13
|
+
// Array of objects with key, label, value and enabled properties
|
|
14
|
+
value: {
|
|
15
|
+
type: Array,
|
|
16
|
+
default: () => [],
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
mode: {
|
|
20
|
+
type: String,
|
|
21
|
+
required: true
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
computed: {
|
|
26
|
+
isView() {
|
|
27
|
+
return this.mode === _VIEW;
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
methods: {
|
|
32
|
+
showhide(row, i, e) {
|
|
33
|
+
const value = this.value[i];
|
|
34
|
+
|
|
35
|
+
Vue.set(value, 'enabled', !!value.enabled);
|
|
36
|
+
this.$emit('input', this.value);
|
|
37
|
+
},
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<template>
|
|
43
|
+
<div class="key-value">
|
|
44
|
+
<div class="clearfix">
|
|
45
|
+
<h3>
|
|
46
|
+
{{ t('customLinks.settings.default') }}
|
|
47
|
+
</h3>
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<div class="kv-container">
|
|
51
|
+
<label class="text-label">
|
|
52
|
+
{{ t('customLinks.settings.keyLabel') }}
|
|
53
|
+
</label>
|
|
54
|
+
<label class="text-label">
|
|
55
|
+
{{ t('customLinks.settings.valueLabel') }}
|
|
56
|
+
</label>
|
|
57
|
+
<label class="text-label">
|
|
58
|
+
</label>
|
|
59
|
+
|
|
60
|
+
<template v-for="(row,i) in value">
|
|
61
|
+
<div :key="i+'key'" class="kv-item key" :class="{'link-hidden': !row.enabled}">
|
|
62
|
+
<span>{{ row.label }}</span>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
<div :key="i+'value'" class="kv-item value" :class="{'link-hidden': !row.enabled}">
|
|
66
|
+
<span>{{ row.value }}</span>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<div v-if="!row.readonly && !isView" :key="i+'show'">
|
|
70
|
+
<Checkbox v-if="!isView" v-model="row.enabled" label-key="customLinks.settings.showLabel" @input="showhide(row, i, $event)" />
|
|
71
|
+
</div>
|
|
72
|
+
<div v-else :key="i+'show'"></div>
|
|
73
|
+
</template>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
</template>
|
|
77
|
+
|
|
78
|
+
<style lang="scss" scoped>
|
|
79
|
+
.key-value {
|
|
80
|
+
width: 100%;
|
|
81
|
+
|
|
82
|
+
.kv-container {
|
|
83
|
+
display: grid;
|
|
84
|
+
align-items: center;
|
|
85
|
+
grid-template-columns: 1fr 1fr 50px;
|
|
86
|
+
column-gap: $column-gutter;
|
|
87
|
+
|
|
88
|
+
.kv-item {
|
|
89
|
+
background-color: var(--disabled-bg);
|
|
90
|
+
border: 1px solid var(--border);
|
|
91
|
+
border-radius: 5px;
|
|
92
|
+
width: 100%;
|
|
93
|
+
margin: 10px 0px 10px 0px;
|
|
94
|
+
height: 40px;
|
|
95
|
+
line-height: 40px;
|
|
96
|
+
padding: 0 10px;
|
|
97
|
+
|
|
98
|
+
&.link-hidden {
|
|
99
|
+
color: var(--disabled-text);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&.key {
|
|
103
|
+
align-self: flex-start;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
</style>
|
|
@@ -3,50 +3,13 @@ import Loading from '@shell/components/Loading';
|
|
|
3
3
|
import AsyncButton from '@shell/components/AsyncButton';
|
|
4
4
|
import Banner from '@components/Banner/Banner.vue';
|
|
5
5
|
import { MANAGEMENT } from '@shell/config/types';
|
|
6
|
-
import { fetchOrCreateSetting, SETTING } from '@shell/config/settings';
|
|
7
6
|
import { _EDIT, _VIEW } from '@shell/config/query-params';
|
|
8
7
|
import KeyValue from '@shell/components/form/KeyValue';
|
|
9
|
-
import { allHash } from '@shell/utils/promise';
|
|
10
8
|
import { mapGetters } from 'vuex';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
key: 'customLinks.defaults.docs',
|
|
16
|
-
value: 'https://rancher.com/docs/rancher/v2.6/en'
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
order: 2,
|
|
20
|
-
key: 'customLinks.defaults.forums',
|
|
21
|
-
value: 'https://forums.rancher.com/'
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
order: 3,
|
|
26
|
-
key: 'customLinks.defaults.slack',
|
|
27
|
-
value: 'https://slack.rancher.io/'
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
order: 5,
|
|
31
|
-
key: 'customLinks.defaults.getStarted',
|
|
32
|
-
value: '/docs/getting-started'
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
];
|
|
36
|
-
|
|
37
|
-
const DEFAULT_SUPPORT_LINK = {
|
|
38
|
-
order: 4,
|
|
39
|
-
key: 'customLinks.defaults.issues',
|
|
40
|
-
value: 'https://github.com/rancher/dashboard/issues/new'
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const COMMUNITY_LINKS = [
|
|
44
|
-
{
|
|
45
|
-
order: 99,
|
|
46
|
-
key: 'customLinks.defaults.commercialSupport',
|
|
47
|
-
value: '/support'
|
|
48
|
-
}
|
|
49
|
-
];
|
|
9
|
+
import { isRancherPrime } from '@shell/config/version';
|
|
10
|
+
import DefaultLinksEditor from './DefaultLinksEditor';
|
|
11
|
+
import { CUSTOM_LINKS_VERSION, fetchLinks } from '@shell/config/home-links';
|
|
12
|
+
import { SETTING, fetchOrCreateSetting } from '@shell/config/settings';
|
|
50
13
|
|
|
51
14
|
export default {
|
|
52
15
|
layout: 'authenticated',
|
|
@@ -55,40 +18,20 @@ export default {
|
|
|
55
18
|
Loading,
|
|
56
19
|
AsyncButton,
|
|
57
20
|
Banner,
|
|
21
|
+
DefaultLinksEditor,
|
|
58
22
|
},
|
|
59
23
|
async fetch() {
|
|
60
|
-
|
|
61
|
-
const { uiIssuesSetting, uiCommunitySetting } = await allHash({
|
|
62
|
-
uiIssuesSetting: this.$store.dispatch('management/find', { type: MANAGEMENT.SETTING, id: SETTING.ISSUES }),
|
|
63
|
-
uiCommunitySetting: this.$store.dispatch('management/find', { type: MANAGEMENT.SETTING, id: SETTING.COMMUNITY_LINKS })
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
this.uiIssuesSetting = uiIssuesSetting;
|
|
67
|
-
this.uiCommunitySetting = uiCommunitySetting;
|
|
68
|
-
} catch {}
|
|
69
|
-
|
|
70
|
-
try {
|
|
71
|
-
const defaultIssueLink = !!this.uiIssuesSetting.value ? { key: this.t('customLinks.defaults.issues'), value: this.uiIssuesSetting.value } : DEFAULT_SUPPORT_LINK;
|
|
72
|
-
const defaultLinks = this.multiWithFallback([...DEFAULT_CUSTOM_LINKS, defaultIssueLink, ...COMMUNITY_LINKS]);
|
|
73
|
-
|
|
74
|
-
this.uiCustomLinks = await fetchOrCreateSetting(this.$store, SETTING.UI_CUSTOM_LINKS, JSON.stringify(defaultLinks));
|
|
75
|
-
|
|
76
|
-
await this.deprecateIssueLinks();
|
|
77
|
-
} catch {}
|
|
78
|
-
|
|
79
|
-
const sValue = this.uiCustomLinks?.value || JSON.stringify(this.multiWithFallback([...DEFAULT_CUSTOM_LINKS]));
|
|
80
|
-
|
|
81
|
-
this.value = JSON.parse(sValue);
|
|
24
|
+
this.value = await fetchLinks(this.$store, this.hasSupport, false, str => this.t(str));
|
|
82
25
|
},
|
|
83
26
|
|
|
84
27
|
data() {
|
|
85
28
|
return {
|
|
29
|
+
defaultsDisabled: true,
|
|
30
|
+
isRancherPrime: isRancherPrime(),
|
|
86
31
|
uiCustomLinks: {},
|
|
87
|
-
defaultValues: undefined,
|
|
88
32
|
bannerVal: {},
|
|
89
|
-
value:
|
|
33
|
+
value: [],
|
|
90
34
|
errors: [],
|
|
91
|
-
showRestoredBanner: false
|
|
92
35
|
};
|
|
93
36
|
},
|
|
94
37
|
computed: {
|
|
@@ -99,20 +42,20 @@ export default {
|
|
|
99
42
|
|
|
100
43
|
return schema?.resourceMethods?.includes('PUT') ? _EDIT : _VIEW;
|
|
101
44
|
},
|
|
102
|
-
},
|
|
103
|
-
methods: {
|
|
104
|
-
useDefaults() {
|
|
105
|
-
const nonCommercialRancherLinks = this.isCommercial ? [] : COMMUNITY_LINKS;
|
|
106
45
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}, 10000);
|
|
46
|
+
allValues() {
|
|
47
|
+
return {
|
|
48
|
+
version: CUSTOM_LINKS_VERSION,
|
|
49
|
+
defaults: this.value.defaults.filter(obj => obj.enabled).map(obj => obj.key),
|
|
50
|
+
custom: this.value.custom
|
|
51
|
+
};
|
|
114
52
|
},
|
|
115
53
|
|
|
54
|
+
hasSupport() {
|
|
55
|
+
return isRancherPrime() || this.$store.getters['management/byId'](MANAGEMENT.SETTING, SETTING.SUPPORTED )?.value === 'true';
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
methods: {
|
|
116
59
|
deprecateIssueLinks() {
|
|
117
60
|
if (this.uiIssuesSetting.value || this.uiIssuesSetting.value) {
|
|
118
61
|
this.uiIssuesSetting.value = '';
|
|
@@ -123,10 +66,15 @@ export default {
|
|
|
123
66
|
},
|
|
124
67
|
|
|
125
68
|
async save(btnCB) {
|
|
126
|
-
this.uiCustomLinks.value = JSON.stringify(this.value);
|
|
127
69
|
this.errors = [];
|
|
128
70
|
try {
|
|
129
|
-
await this.
|
|
71
|
+
const uiCustomLinks = await fetchOrCreateSetting(this.$store, SETTING.UI_CUSTOM_LINKS, '');
|
|
72
|
+
|
|
73
|
+
uiCustomLinks.value = JSON.stringify(this.allValues);
|
|
74
|
+
|
|
75
|
+
await uiCustomLinks.save();
|
|
76
|
+
|
|
77
|
+
this.value = await fetchLinks(this.$store, this.hasSupport, false, str => this.t(str));
|
|
130
78
|
btnCB(true);
|
|
131
79
|
} catch (err) {
|
|
132
80
|
this.errors.push(err);
|
|
@@ -139,38 +87,39 @@ export default {
|
|
|
139
87
|
<template>
|
|
140
88
|
<Loading v-if="$fetchState.pending" />
|
|
141
89
|
<div v-else>
|
|
142
|
-
<
|
|
143
|
-
<h1
|
|
144
|
-
class="mb-20"
|
|
145
|
-
>
|
|
90
|
+
<h1 class="mb-20">
|
|
146
91
|
{{ t("customLinks.label") }}
|
|
147
92
|
</h1>
|
|
148
93
|
<div>
|
|
149
94
|
<label class="text-label">
|
|
150
95
|
{{ t(`customLinks.description`, {}, true) }}
|
|
151
96
|
</label>
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
97
|
+
</div>
|
|
98
|
+
<div class="mt-20">
|
|
99
|
+
<KeyValue
|
|
100
|
+
v-model="value.custom"
|
|
101
|
+
:title="'Custom Links'"
|
|
102
|
+
:as-map="false"
|
|
103
|
+
key-name="label"
|
|
104
|
+
:key-label="t('customLinks.settings.keyLabel')"
|
|
105
|
+
:value-label="t('customLinks.settings.valueLabel')"
|
|
106
|
+
:add-label="t('customLinks.addLink')"
|
|
107
|
+
:read-allowed="false"
|
|
108
|
+
:protip="false"
|
|
109
|
+
:mode="mode"
|
|
110
|
+
/>
|
|
111
|
+
</div>
|
|
112
|
+
<div class="ui-links-setting mt-20">
|
|
113
|
+
<DefaultLinksEditor
|
|
114
|
+
v-model="value.defaults"
|
|
115
|
+
:mode="mode"
|
|
116
|
+
/>
|
|
165
117
|
</div>
|
|
166
118
|
<template v-for="err in errors">
|
|
167
119
|
<Banner :key="err" color="error" :label="err" />
|
|
168
120
|
</template>
|
|
169
121
|
<div v-if="mode === 'edit'" class="mt-20">
|
|
170
122
|
<AsyncButton class="pull-right" mode="apply" @click="save" />
|
|
171
|
-
<button class="pull-right btn role-secondary mr-10" @click="useDefaults">
|
|
172
|
-
{{ t('customLinks.restoreDefaults') }}
|
|
173
|
-
</button>
|
|
174
123
|
</div>
|
|
175
124
|
</div>
|
|
176
125
|
</template>
|
|
@@ -194,7 +143,10 @@ export default {
|
|
|
194
143
|
text-decoration: underline;
|
|
195
144
|
}
|
|
196
145
|
}
|
|
197
|
-
.
|
|
198
|
-
|
|
146
|
+
.action {
|
|
147
|
+
display: flex;
|
|
148
|
+
input {
|
|
149
|
+
margin-right: 5px;
|
|
150
|
+
}
|
|
199
151
|
}
|
|
200
152
|
</style>
|
|
@@ -7,6 +7,7 @@ import { LabeledInput } from '@components/Form/LabeledInput';
|
|
|
7
7
|
import { MANAGEMENT } from '@shell/config/types';
|
|
8
8
|
import { DEFAULT_PERF_SETTING, SETTING } from '@shell/config/settings';
|
|
9
9
|
import { _EDIT, _VIEW } from '@shell/config/query-params';
|
|
10
|
+
import UnitInput from '@shell/components/form/UnitInput';
|
|
10
11
|
|
|
11
12
|
export default {
|
|
12
13
|
layout: 'authenticated',
|
|
@@ -16,6 +17,7 @@ export default {
|
|
|
16
17
|
AsyncButton,
|
|
17
18
|
Banner,
|
|
18
19
|
LabeledInput,
|
|
20
|
+
UnitInput
|
|
19
21
|
},
|
|
20
22
|
|
|
21
23
|
async fetch() {
|
|
@@ -30,15 +32,21 @@ export default {
|
|
|
30
32
|
|
|
31
33
|
const sValue = this.uiPerfSetting?.value || JSON.stringify(DEFAULT_PERF_SETTING);
|
|
32
34
|
|
|
33
|
-
this.value =
|
|
35
|
+
this.value = {
|
|
36
|
+
...DEFAULT_PERF_SETTING,
|
|
37
|
+
...JSON.parse(sValue),
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
this.gcStartedEnabled = this.value.garbageCollection.enabled;
|
|
34
41
|
},
|
|
35
42
|
|
|
36
43
|
data() {
|
|
37
44
|
return {
|
|
38
|
-
uiPerfSetting:
|
|
39
|
-
bannerVal:
|
|
40
|
-
value:
|
|
41
|
-
errors:
|
|
45
|
+
uiPerfSetting: DEFAULT_PERF_SETTING,
|
|
46
|
+
bannerVal: {},
|
|
47
|
+
value: {},
|
|
48
|
+
errors: [],
|
|
49
|
+
gcStartedEnabled: null
|
|
42
50
|
};
|
|
43
51
|
},
|
|
44
52
|
|
|
@@ -57,12 +65,19 @@ export default {
|
|
|
57
65
|
|
|
58
66
|
try {
|
|
59
67
|
await this.uiPerfSetting.save();
|
|
68
|
+
|
|
69
|
+
this.$store.dispatch('gcPreferencesUpdated', {
|
|
70
|
+
previouslyEnabled: this.gcStartedEnabled,
|
|
71
|
+
newPreferences: this.value.garbageCollection
|
|
72
|
+
}, { root: true });
|
|
73
|
+
|
|
74
|
+
this.gcStartedEnabled = this.value.garbageCollection.enabled;
|
|
60
75
|
btnCB(true);
|
|
61
76
|
} catch (err) {
|
|
62
77
|
this.errors.push(err);
|
|
63
78
|
btnCB(false);
|
|
64
79
|
}
|
|
65
|
-
}
|
|
80
|
+
}
|
|
66
81
|
}
|
|
67
82
|
};
|
|
68
83
|
</script>
|
|
@@ -75,7 +90,7 @@ export default {
|
|
|
75
90
|
<div>
|
|
76
91
|
<div class="ui-perf-setting">
|
|
77
92
|
<!-- Websocket Notifications -->
|
|
78
|
-
<div class="mt-
|
|
93
|
+
<div class="mt-20">
|
|
79
94
|
<h2>{{ t('performance.websocketNotification.label') }}</h2>
|
|
80
95
|
<p>{{ t('performance.websocketNotification.description') }}</p>
|
|
81
96
|
<Checkbox
|
|
@@ -134,6 +149,74 @@ export default {
|
|
|
134
149
|
/>
|
|
135
150
|
</div>
|
|
136
151
|
</div>
|
|
152
|
+
<!-- Enable GC of resources from store -->
|
|
153
|
+
<div class="mt-40">
|
|
154
|
+
<h2 v-t="'performance.gc.label'" />
|
|
155
|
+
<p>{{ t('performance.gc.description') }}</p>
|
|
156
|
+
<Banner color="error" label-key="performance.gc.banner" />
|
|
157
|
+
<Checkbox
|
|
158
|
+
v-model="value.garbageCollection.enabled"
|
|
159
|
+
:label="t('performance.gc.checkboxLabel')"
|
|
160
|
+
class="mt-10 mb-20"
|
|
161
|
+
:primary="true"
|
|
162
|
+
/>
|
|
163
|
+
<div class="ml-20">
|
|
164
|
+
<h3>{{ t('performance.gc.whenRun.description') }}</h3>
|
|
165
|
+
<div class="ml-20 mb-10">
|
|
166
|
+
<Checkbox
|
|
167
|
+
v-model="value.garbageCollection.enabledInterval"
|
|
168
|
+
:class="{ 'text-muted': !value.garbageCollection.enabled }"
|
|
169
|
+
:label="t('performance.gc.whenRun.intervalCheckBox.label')"
|
|
170
|
+
class="mt-10 mb-10"
|
|
171
|
+
:disabled="!value.garbageCollection.enabled"
|
|
172
|
+
:primary="true"
|
|
173
|
+
/>
|
|
174
|
+
<div class="ml-20">
|
|
175
|
+
<UnitInput
|
|
176
|
+
v-model="value.garbageCollection.interval"
|
|
177
|
+
:suffix="t('suffix.seconds', { count: value.garbageCollection.interval })"
|
|
178
|
+
:label="t('performance.gc.whenRun.interval.inputLabel')"
|
|
179
|
+
:disabled="!value.garbageCollection.enabled || !value.garbageCollection.enabledInterval"
|
|
180
|
+
min="30"
|
|
181
|
+
class="input"
|
|
182
|
+
/>
|
|
183
|
+
</div>
|
|
184
|
+
<Checkbox
|
|
185
|
+
v-model="value.garbageCollection.enabledOnNavigate"
|
|
186
|
+
:class="{ 'text-muted': !value.garbageCollection.enabled }"
|
|
187
|
+
:label="t('performance.gc.whenRun.route.description')"
|
|
188
|
+
class="mt-20 mb-10"
|
|
189
|
+
:disabled="!value.garbageCollection.enabled"
|
|
190
|
+
:primary="true"
|
|
191
|
+
/>
|
|
192
|
+
</div>
|
|
193
|
+
<h3>{{ t('performance.gc.howRun.description') }}</h3>
|
|
194
|
+
<div class="ml-20">
|
|
195
|
+
<p :class="{ 'text-muted': !value.garbageCollection.enabled }">
|
|
196
|
+
{{ t('performance.gc.howRun.age.description', {}, true) }}
|
|
197
|
+
</p>
|
|
198
|
+
<UnitInput
|
|
199
|
+
v-model="value.garbageCollection.ageThreshold"
|
|
200
|
+
:suffix="t('suffix.seconds', { count: value.garbageCollection.ageThreshold })"
|
|
201
|
+
:label="t('performance.gc.howRun.age.inputLabel')"
|
|
202
|
+
:disabled="!value.garbageCollection.enabled"
|
|
203
|
+
min="30"
|
|
204
|
+
class="input"
|
|
205
|
+
/>
|
|
206
|
+
<p class="mt-20" :class="{ 'text-muted': !value.garbageCollection.enabled }">
|
|
207
|
+
{{ t('performance.gc.howRun.count.description') }}
|
|
208
|
+
</p>
|
|
209
|
+
<LabeledInput
|
|
210
|
+
v-model.number="value.garbageCollection.countThreshold"
|
|
211
|
+
:label="t('performance.gc.howRun.count.inputLabel')"
|
|
212
|
+
:disabled="!value.garbageCollection.enabled"
|
|
213
|
+
class="input"
|
|
214
|
+
type="number"
|
|
215
|
+
min="0"
|
|
216
|
+
/>
|
|
217
|
+
</div>
|
|
218
|
+
</div>
|
|
219
|
+
</div>
|
|
137
220
|
</div>
|
|
138
221
|
</div>
|
|
139
222
|
<template v-for="err in errors">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import AsyncButton from '@shell/components/AsyncButton';
|
|
3
3
|
import LabeledSelect from '@shell/components/form/LabeledSelect';
|
|
4
|
-
import { CATALOG } from '@shell/config/types';
|
|
4
|
+
import { CATALOG, MANAGEMENT } from '@shell/config/types';
|
|
5
5
|
import { CATALOG as CATALOG_ANNOTATIONS } from '@shell/config/labels-annotations';
|
|
6
6
|
import { UI_PLUGIN_NAMESPACE } from '@shell/config/uiplugins';
|
|
7
7
|
import Banner from '@components/Banner/Banner.vue';
|
|
@@ -15,13 +15,21 @@ export default {
|
|
|
15
15
|
LabeledSelect,
|
|
16
16
|
},
|
|
17
17
|
|
|
18
|
+
async fetch() {
|
|
19
|
+
this.defaultRegistrySetting = await this.$store.dispatch('management/find', {
|
|
20
|
+
type: MANAGEMENT.SETTING,
|
|
21
|
+
id: 'system-default-registry'
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
|
|
18
25
|
data() {
|
|
19
26
|
return {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
defaultRegistrySetting: null,
|
|
28
|
+
plugin: undefined,
|
|
29
|
+
busy: false,
|
|
30
|
+
version: '',
|
|
31
|
+
update: false,
|
|
32
|
+
mode: '',
|
|
25
33
|
};
|
|
26
34
|
},
|
|
27
35
|
|
|
@@ -92,7 +100,7 @@ export default {
|
|
|
92
100
|
|
|
93
101
|
const plugin = this.plugin;
|
|
94
102
|
|
|
95
|
-
this.$emit(plugin.name, 'install');
|
|
103
|
+
this.$emit('update', plugin.name, 'install');
|
|
96
104
|
|
|
97
105
|
// Find the version that the user wants to install
|
|
98
106
|
const version = plugin.versions?.find(v => v.version === this.version);
|
|
@@ -103,6 +111,35 @@ export default {
|
|
|
103
111
|
return;
|
|
104
112
|
}
|
|
105
113
|
|
|
114
|
+
// is the image used by the chart in the rancher org?
|
|
115
|
+
let isRancherImage = false;
|
|
116
|
+
|
|
117
|
+
try {
|
|
118
|
+
const chartVersionInfo = await this.$store.dispatch('catalog/getVersionInfo', {
|
|
119
|
+
repoType: version.repoType,
|
|
120
|
+
repoName: version.repoName,
|
|
121
|
+
chartName: plugin.chart.chartName,
|
|
122
|
+
versionName: this.version,
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
const image = chartVersionInfo?.values?.image?.repository || '';
|
|
126
|
+
|
|
127
|
+
isRancherImage = image.startsWith('rancher/');
|
|
128
|
+
} catch (e) {}
|
|
129
|
+
|
|
130
|
+
// See if there is already a plugin with this name
|
|
131
|
+
let exists = false;
|
|
132
|
+
|
|
133
|
+
try {
|
|
134
|
+
const app = await this.$store.dispatch('management/find', {
|
|
135
|
+
type: CATALOG.APP,
|
|
136
|
+
id: `${ UI_PLUGIN_NAMESPACE }/${ plugin.chart.chartName }`,
|
|
137
|
+
opt: { force: true },
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
exists = !!app;
|
|
141
|
+
} catch (e) {}
|
|
142
|
+
|
|
106
143
|
const repoType = version.repoType;
|
|
107
144
|
const repoName = version.repoName;
|
|
108
145
|
const repo = this.$store.getters['catalog/repo']({ repoType, repoName });
|
|
@@ -118,6 +155,15 @@ export default {
|
|
|
118
155
|
values: {}
|
|
119
156
|
};
|
|
120
157
|
|
|
158
|
+
// Pass in the system default registry property if set - only if the image is in the rancher org
|
|
159
|
+
const defaultRegistry = this.defaultRegistrySetting?.value || '';
|
|
160
|
+
|
|
161
|
+
if (isRancherImage && defaultRegistry) {
|
|
162
|
+
chart.values.global = chart.values.global || {};
|
|
163
|
+
chart.values.global.cattle = chart.values.global.cattle || {};
|
|
164
|
+
chart.values.global.cattle.systemDefaultRegistry = defaultRegistry;
|
|
165
|
+
}
|
|
166
|
+
|
|
121
167
|
const input = {
|
|
122
168
|
charts: [chart],
|
|
123
169
|
// timeout: this.cmdOptions.timeout > 0 ? `${ this.cmdOptions.timeout }s` : null,
|
|
@@ -126,24 +172,29 @@ export default {
|
|
|
126
172
|
};
|
|
127
173
|
|
|
128
174
|
// Helm action
|
|
129
|
-
const action = this.update ? 'upgrade' : 'install';
|
|
175
|
+
const action = (exists || this.update) ? 'upgrade' : 'install';
|
|
130
176
|
|
|
131
|
-
|
|
177
|
+
try {
|
|
178
|
+
const res = await repo.doAction(action, input);
|
|
179
|
+
const operationId = `${ res.operationNamespace }/${ res.operationName }`;
|
|
132
180
|
|
|
133
|
-
|
|
134
|
-
const res = await repo.doAction(action, input);
|
|
135
|
-
const operationId = `${ res.operationNamespace }/${ res.operationName }`;
|
|
181
|
+
this.closeDialog(plugin);
|
|
136
182
|
|
|
137
|
-
|
|
183
|
+
await repo.waitForOperation(operationId);
|
|
138
184
|
|
|
139
|
-
|
|
185
|
+
await this.$store.dispatch(`management/find`, {
|
|
186
|
+
type: CATALOG.OPERATION,
|
|
187
|
+
id: operationId
|
|
188
|
+
});
|
|
189
|
+
} catch (e) {
|
|
190
|
+
this.$store.dispatch('growl/error', {
|
|
191
|
+
title: this.t('plugins.error.generic'),
|
|
192
|
+
message: e.message ? e.message : e,
|
|
193
|
+
timeout: 10000
|
|
194
|
+
}, { root: true });
|
|
140
195
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
await this.$store.dispatch(`management/find`, {
|
|
144
|
-
type: CATALOG.OPERATION,
|
|
145
|
-
id: operationId
|
|
146
|
-
});
|
|
196
|
+
this.closeDialog(plugin);
|
|
197
|
+
}
|
|
147
198
|
}
|
|
148
199
|
}
|
|
149
200
|
};
|
|
@@ -157,7 +208,7 @@ export default {
|
|
|
157
208
|
>
|
|
158
209
|
<div v-if="plugin" class="plugin-install-dialog">
|
|
159
210
|
<h4 class="mt-10">
|
|
160
|
-
{{ t(`plugins.${ mode }.title`, { name: plugin.
|
|
211
|
+
{{ t(`plugins.${ mode }.title`, { name: plugin.label }) }}
|
|
161
212
|
</h4>
|
|
162
213
|
<div class="custom mt-10">
|
|
163
214
|
<div class="dialog-panel">
|