@rancher/shell 3.0.5-rc.3 → 3.0.5-rc.5
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/images/icons/document.svg +3 -0
- package/assets/images/vendor/cognito.svg +1 -0
- package/assets/styles/app.scss +1 -0
- package/assets/styles/base/_basic.scss +10 -0
- package/assets/styles/base/_spacing.scss +29 -0
- package/assets/styles/global/_layout.scss +1 -1
- package/assets/styles/themes/_dark.scss +25 -0
- package/assets/styles/themes/_light.scss +65 -0
- package/assets/translations/en-us.yaml +322 -24
- package/assets/translations/zh-hans.yaml +8 -5
- package/components/Certificates.vue +5 -0
- package/components/FilterPanel.vue +156 -0
- package/components/{fleet/ForceDirectedTreeChart/index.vue → ForceDirectedTreeChart.vue} +47 -41
- package/components/IconOrSvg.vue +14 -35
- package/components/PromptRemove.vue +5 -1
- package/components/Resource/Detail/Card/PodsCard/Bubble.vue +13 -0
- package/components/Resource/Detail/Card/PodsCard/composable.ts +30 -0
- package/components/Resource/Detail/Card/PodsCard/index.vue +118 -0
- package/components/Resource/Detail/Card/ResourceUsageCard/composable.ts +51 -0
- package/components/Resource/Detail/Card/ResourceUsageCard/index.vue +79 -0
- package/components/Resource/Detail/Card/Scaler.vue +89 -0
- package/components/Resource/Detail/Card/StateCard/composables.ts +112 -0
- package/components/Resource/Detail/Card/StateCard/index.vue +39 -0
- package/components/Resource/Detail/Card/VerticalGap.vue +11 -0
- package/components/Resource/Detail/Card/__tests__/Card.test.ts +36 -0
- package/components/Resource/Detail/Card/__tests__/PodsCard.test.ts +84 -0
- package/components/Resource/Detail/Card/__tests__/ResourceUsageCard.test.ts +72 -0
- package/components/Resource/Detail/Card/__tests__/Scaler.test.ts +87 -0
- package/components/Resource/Detail/Card/__tests__/StateCard.test.ts +53 -0
- package/components/Resource/Detail/Card/__tests__/VerticalGap.test.ts +14 -0
- package/components/Resource/Detail/Card/__tests__/index.test.ts +36 -0
- package/components/Resource/Detail/Card/index.vue +56 -0
- package/components/Resource/Detail/Metadata/Annotations/__tests__/index.test.ts +19 -0
- package/components/Resource/Detail/Metadata/Annotations/composable.ts +12 -0
- package/components/Resource/Detail/Metadata/Annotations/index.vue +26 -0
- package/components/Resource/Detail/Metadata/IdentifyingInformation/__tests__/index.test.ts +103 -0
- package/components/Resource/Detail/Metadata/IdentifyingInformation/composable.ts +281 -0
- package/components/Resource/Detail/Metadata/IdentifyingInformation/index.vue +111 -0
- package/components/Resource/Detail/Metadata/KeyValue.vue +130 -0
- package/components/Resource/Detail/Metadata/Labels/__tests__/index.test.ts +18 -0
- package/components/Resource/Detail/Metadata/Labels/composable.ts +12 -0
- package/components/Resource/Detail/Metadata/Labels/index.vue +27 -0
- package/components/Resource/Detail/Metadata/Rectangle.vue +32 -0
- package/components/Resource/Detail/Metadata/__tests__/KeyValue.test.ts +107 -0
- package/components/Resource/Detail/Metadata/__tests__/Rectangle.test.ts +24 -0
- package/components/Resource/Detail/Metadata/__tests__/index.test.ts +91 -0
- package/components/Resource/Detail/Metadata/composables.ts +29 -0
- package/components/Resource/Detail/Metadata/index.vue +66 -0
- package/components/Resource/Detail/Page.vue +22 -0
- package/components/Resource/Detail/PercentageBar.vue +40 -0
- package/components/Resource/Detail/ResourceRow.vue +119 -0
- package/components/Resource/Detail/SpacedRow.vue +14 -0
- package/components/Resource/Detail/StatusBar.vue +59 -0
- package/components/Resource/Detail/StatusRow.vue +61 -0
- package/components/Resource/Detail/TitleBar/Title.vue +13 -0
- package/components/Resource/Detail/TitleBar/Top.vue +14 -0
- package/components/Resource/Detail/TitleBar/__tests__/Title.test.ts +17 -0
- package/components/Resource/Detail/TitleBar/__tests__/Top.test.ts +17 -0
- package/components/Resource/Detail/TitleBar/__tests__/index.test.ts +142 -0
- package/components/Resource/Detail/TitleBar/composable.ts +31 -0
- package/components/Resource/Detail/TitleBar/index.vue +124 -0
- package/components/Resource/Detail/Top/index.vue +34 -0
- package/components/Resource/Detail/__tests__/Page.test.ts +32 -0
- package/components/ResourceDetail/__tests__/index.test.ts +114 -0
- package/components/ResourceDetail/index.vue +64 -562
- package/components/ResourceDetail/legacy.vue +545 -0
- package/components/ResourceTable.vue +41 -7
- package/components/SlideInPanelManager.vue +76 -8
- package/components/SortableTable/index.vue +13 -2
- package/components/SortableTable/selection.js +21 -8
- package/components/StatusBadge.vue +6 -4
- package/components/SubtleLink.vue +25 -0
- package/components/Wizard.vue +12 -1
- package/components/YamlEditor.vue +1 -1
- package/components/__tests__/FilterPanel.test.ts +81 -0
- package/components/auth/AuthBanner.vue +2 -3
- package/components/auth/RoleDetailEdit.vue +45 -3
- package/components/auth/login/oidc.vue +6 -1
- package/components/fleet/FleetApplications.vue +181 -0
- package/components/fleet/FleetHelmOps.vue +115 -0
- package/components/fleet/FleetIntro.vue +58 -28
- package/components/fleet/FleetNoWorkspaces.vue +5 -1
- package/components/fleet/FleetOCIStorageSecret.vue +171 -0
- package/components/fleet/FleetRepos.vue +38 -76
- package/components/fleet/FleetResources.vue +50 -22
- package/components/fleet/FleetSummary.vue +26 -51
- package/components/fleet/__tests__/FleetOCIStorageSecret.test.ts +213 -0
- package/components/fleet/__tests__/FleetSummary.test.ts +39 -39
- package/components/fleet/dashboard/Empty.vue +73 -0
- package/components/fleet/dashboard/ResourceCard.vue +183 -0
- package/components/fleet/dashboard/ResourceCardSummary.vue +199 -0
- package/components/fleet/dashboard/ResourceDetails.vue +196 -0
- package/components/fleet/dashboard/ResourcePanel.vue +376 -0
- package/components/form/ArrayList.vue +6 -0
- package/components/form/SimpleSecretSelector.vue +8 -2
- package/components/form/ValueFromResource.vue +31 -19
- package/components/formatter/FleetApplicationClustersReady.vue +77 -0
- package/components/formatter/FleetApplicationSource.vue +71 -0
- package/components/formatter/FleetSummaryGraph.vue +7 -0
- package/components/nav/Header.vue +8 -7
- package/components/nav/TopLevelMenu.helper.ts +55 -34
- package/components/nav/TopLevelMenu.vue +11 -0
- package/components/nav/Type.vue +4 -1
- package/composables/useI18n.ts +12 -11
- package/config/labels-annotations.js +14 -11
- package/config/product/auth.js +1 -0
- package/config/product/fleet.js +70 -17
- package/config/query-params.js +3 -1
- package/config/roles.ts +1 -0
- package/config/router/routes.js +20 -2
- package/config/secret.ts +15 -0
- package/config/settings.ts +3 -2
- package/config/table-headers.js +52 -22
- package/config/types.js +2 -0
- package/core/plugin-helpers.ts +3 -2
- package/detail/fleet.cattle.io.cluster.vue +28 -15
- package/detail/fleet.cattle.io.gitrepo.vue +10 -1
- package/detail/fleet.cattle.io.helmop.vue +157 -0
- package/dialog/HelmOpForceUpdateDialog.vue +132 -0
- package/dialog/RedeployWorkloadDialog.vue +164 -0
- package/edit/__tests__/fleet.cattle.io.gitrepo.test.ts +56 -67
- package/edit/auth/oidc.vue +159 -93
- package/edit/fleet.cattle.io.gitrepo.vue +26 -33
- package/edit/fleet.cattle.io.helmop.vue +997 -0
- package/edit/management.cattle.io.fleetworkspace.vue +43 -10
- package/list/fleet.cattle.io.gitrepo.vue +1 -1
- package/list/fleet.cattle.io.helmop.vue +108 -0
- package/list/namespace.vue +5 -2
- package/mixins/auth-config.js +8 -1
- package/mixins/preset.js +100 -0
- package/mixins/resource-fetch-api-pagination.js +2 -0
- package/mixins/resource-fetch.js +1 -1
- package/mixins/resource-table-watch.js +45 -0
- package/models/__tests__/chart.test.ts +273 -0
- package/models/__tests__/fleet.cattle.io.gitrepo.test.ts +1 -1
- package/models/chart.js +144 -2
- package/models/fleet-application.js +385 -0
- package/models/fleet.cattle.io.bundle.js +9 -8
- package/models/fleet.cattle.io.gitrepo.js +41 -365
- package/models/fleet.cattle.io.helmop.js +228 -0
- package/models/management.cattle.io.authconfig.js +1 -0
- package/models/management.cattle.io.fleetworkspace.js +12 -0
- package/models/workload.js +14 -18
- package/package.json +2 -1
- package/pages/auth/verify.vue +13 -1
- package/pages/c/_cluster/apps/charts/AddRepoLink.vue +37 -0
- package/pages/c/_cluster/apps/charts/AppChartCardFooter.vue +80 -0
- package/pages/c/_cluster/apps/charts/AppChartCardSubHeader.vue +54 -0
- package/pages/c/_cluster/apps/charts/StatusLabel.vue +33 -0
- package/pages/c/_cluster/apps/charts/index.vue +302 -484
- package/pages/c/_cluster/explorer/EventsTable.vue +1 -1
- package/pages/c/_cluster/fleet/__tests__/index.test.ts +426 -0
- package/pages/c/_cluster/fleet/application/_resource/_id.vue +14 -0
- package/pages/c/_cluster/fleet/application/_resource/create.vue +14 -0
- package/pages/c/_cluster/fleet/application/create.vue +340 -0
- package/pages/c/_cluster/fleet/application/index.vue +139 -0
- package/pages/c/_cluster/fleet/graph/config.js +277 -0
- package/pages/c/_cluster/fleet/index.vue +772 -330
- package/pages/explorer/resource/detail/configmap.vue +19 -0
- package/plugins/dashboard-store/actions.js +31 -9
- package/plugins/dashboard-store/getters.js +34 -21
- package/plugins/dashboard-store/mutations.js +51 -7
- package/plugins/dashboard-store/resource-class.js +14 -2
- package/plugins/steve/__tests__/subscribe.spec.ts +66 -1
- package/plugins/steve/actions.js +3 -0
- package/plugins/steve/steve-pagination-utils.ts +14 -13
- package/plugins/steve/subscribe.js +229 -42
- package/rancher-components/BadgeState/BadgeState.vue +3 -1
- package/rancher-components/Form/Checkbox/Checkbox.vue +2 -2
- package/rancher-components/RcItemCard/RcItemCard.test.ts +189 -0
- package/rancher-components/RcItemCard/RcItemCard.vue +425 -0
- package/rancher-components/RcItemCard/RcItemCardAction.vue +24 -0
- package/rancher-components/RcItemCard/index.ts +2 -0
- package/store/auth.js +1 -0
- package/store/catalog.js +62 -24
- package/store/index.js +33 -14
- package/store/slideInPanel.ts +6 -0
- package/store/type-map.js +1 -0
- package/types/fleet.d.ts +35 -0
- package/types/resources/settings.d.ts +19 -1
- package/types/shell/index.d.ts +339 -272
- package/types/store/dashboard-store.types.ts +17 -3
- package/types/store/pagination.types.ts +6 -1
- package/types/store/subscribe.types.ts +50 -0
- package/utils/auth.js +32 -3
- package/utils/fleet-types.ts +0 -0
- package/utils/fleet.ts +200 -1
- package/utils/pagination-utils.ts +26 -1
- package/utils/pagination-wrapper.ts +132 -50
- package/utils/settings.ts +4 -1
- package/utils/style.ts +39 -0
- package/utils/validators/formRules/__tests__/index.test.ts +36 -3
- package/utils/validators/formRules/index.ts +10 -3
- package/utils/window.js +11 -7
- package/components/__tests__/ApplicationCard.test.ts +0 -27
- package/components/cards/ApplicationCard.vue +0 -145
- package/components/fleet/ForceDirectedTreeChart/chartIcons.js +0 -17
- package/config/secret.js +0 -14
- package/pages/c/_cluster/fleet/GitRepoGraphConfig.js +0 -249
- /package/{components/form/SSHKnownHosts → dialog}/__tests__/KnownHostsEditDialog.test.ts +0 -0
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { FLEET } from '@shell/config/types';
|
|
3
|
+
import { SUB_TYPE } from '@shell/config/query-params';
|
|
4
|
+
import FleetUtils from '@shell/utils/fleet';
|
|
5
|
+
import Masthead from '@shell/components/ResourceDetail/Masthead';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
name: 'FleetApplicationCreatePage',
|
|
9
|
+
|
|
10
|
+
components: { Masthead },
|
|
11
|
+
|
|
12
|
+
data() {
|
|
13
|
+
return {
|
|
14
|
+
resource: FLEET.APPLICATION,
|
|
15
|
+
application: { parentNameOverride: this.$store.getters['i18n/t'](`typeLabel."${ FLEET.APPLICATION }"`, { count: 1 })?.trim() },
|
|
16
|
+
abbrSizes: {
|
|
17
|
+
3: '24px',
|
|
18
|
+
4: '18px',
|
|
19
|
+
5: '16px',
|
|
20
|
+
6: '14px'
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
computed: {
|
|
26
|
+
types() {
|
|
27
|
+
return [
|
|
28
|
+
FLEET.GIT_REPO,
|
|
29
|
+
FLEET.HELM_OP
|
|
30
|
+
].reduce((acc, type) => {
|
|
31
|
+
const schema = this.$store.getters['management/schemaFor'](type);
|
|
32
|
+
|
|
33
|
+
if (schema) {
|
|
34
|
+
const label = this.$store.getters['type-map/labelFor'](schema, 2) || '';
|
|
35
|
+
|
|
36
|
+
const canCreate = !!schema.resourceMethods?.includes('PUT');
|
|
37
|
+
|
|
38
|
+
return [
|
|
39
|
+
...acc,
|
|
40
|
+
{
|
|
41
|
+
id: type,
|
|
42
|
+
label,
|
|
43
|
+
description: `fleet.application.subTypes.'${ type }'.description`,
|
|
44
|
+
icon: FleetUtils.resourceIcons[type],
|
|
45
|
+
disabled: !canCreate,
|
|
46
|
+
tooltip: canCreate ? null : this.t('fleet.application.noPermissions', { label }, true),
|
|
47
|
+
}
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return acc;
|
|
52
|
+
}, []);
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
selectedSubtype() {
|
|
56
|
+
return this.$route.query[SUB_TYPE];
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
methods: {
|
|
61
|
+
selectType(subtype, event) {
|
|
62
|
+
if (subtype.disabled) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (event?.srcElement?.tagName === 'A') {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
this.$router.push({
|
|
71
|
+
name: 'c-cluster-fleet-application-resource-create',
|
|
72
|
+
params: {
|
|
73
|
+
cluster: this.$route.params.cluster,
|
|
74
|
+
product: this.$store.getters['productId'],
|
|
75
|
+
resource: subtype.id,
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
cancel() {
|
|
81
|
+
this.$router.back();
|
|
82
|
+
},
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
</script>
|
|
86
|
+
|
|
87
|
+
<template>
|
|
88
|
+
<div v-if="!selectedSubtype">
|
|
89
|
+
<div class="header">
|
|
90
|
+
<Masthead
|
|
91
|
+
:resource="resource"
|
|
92
|
+
:value="application"
|
|
93
|
+
/>
|
|
94
|
+
</div>
|
|
95
|
+
<div class="subtypes-container">
|
|
96
|
+
<div
|
|
97
|
+
v-for="(subtype, i) in types"
|
|
98
|
+
:key="i"
|
|
99
|
+
v-clean-tooltip="subtype.tooltip"
|
|
100
|
+
class="subtype-banner"
|
|
101
|
+
tabindex="0"
|
|
102
|
+
role="link"
|
|
103
|
+
:class="{
|
|
104
|
+
selected: subtype.id === selectedSubtype,
|
|
105
|
+
disabled: subtype.disabled
|
|
106
|
+
}"
|
|
107
|
+
:data-testid="`subtype-banner-item-${subtype.id}`"
|
|
108
|
+
:aria-disabled="false"
|
|
109
|
+
:aria-label="subtype.description ? `${subtype.label} - ${subtype.description}` : subtype.label"
|
|
110
|
+
@click="selectType(subtype, $event)"
|
|
111
|
+
@keyup.enter.space="selectType(subtype, $event)"
|
|
112
|
+
>
|
|
113
|
+
<slot name="subtype-content">
|
|
114
|
+
<div class="subtype-container">
|
|
115
|
+
<div class="subtype-logo">
|
|
116
|
+
<img
|
|
117
|
+
v-if="subtype.bannerImage"
|
|
118
|
+
:src="subtype.bannerImage"
|
|
119
|
+
:alt="(resource.type ? resource.type + ': ' : '') + (subtype.label || '')"
|
|
120
|
+
>
|
|
121
|
+
<div v-else-if="subtype.icon">
|
|
122
|
+
<i
|
|
123
|
+
class="icon icon-image"
|
|
124
|
+
:class="subtype.icon"
|
|
125
|
+
/>
|
|
126
|
+
</div>
|
|
127
|
+
<div
|
|
128
|
+
v-else
|
|
129
|
+
class="round-image"
|
|
130
|
+
>
|
|
131
|
+
<div
|
|
132
|
+
v-if="subtype.bannerAbbrv"
|
|
133
|
+
class="banner-abbrv"
|
|
134
|
+
>
|
|
135
|
+
<span v-if="$store.getters['i18n/exists'](subtype.bannerAbbrv)">{{ t(subtype.bannerAbbrv) }}</span>
|
|
136
|
+
<span
|
|
137
|
+
v-else
|
|
138
|
+
:style="{fontSize: abbrSizes[subtype.bannerAbbrv.length]}"
|
|
139
|
+
>{{ subtype.bannerAbbrv }}</span>
|
|
140
|
+
</div>
|
|
141
|
+
<div v-else>
|
|
142
|
+
{{ subtype.id.slice(0, 1).toUpperCase() }}
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
<div class="subtype-body">
|
|
147
|
+
<div
|
|
148
|
+
class="title"
|
|
149
|
+
:class="{'with-description': !!subtype.description}"
|
|
150
|
+
>
|
|
151
|
+
<h5>
|
|
152
|
+
<span
|
|
153
|
+
v-if="$store.getters['i18n/exists'](subtype.label)"
|
|
154
|
+
v-clean-html="t(subtype.label)"
|
|
155
|
+
/>
|
|
156
|
+
<span v-else>{{ subtype.label }}</span>
|
|
157
|
+
</h5>
|
|
158
|
+
<a
|
|
159
|
+
v-if="subtype.docLink"
|
|
160
|
+
:href="subtype.docLink"
|
|
161
|
+
target="_blank"
|
|
162
|
+
rel="noopener nofollow"
|
|
163
|
+
class="flex-right"
|
|
164
|
+
>{{ t('generic.moreInfo') }} <i class="icon icon-external-link" /></a>
|
|
165
|
+
</div>
|
|
166
|
+
<hr v-if="subtype.description">
|
|
167
|
+
<div
|
|
168
|
+
v-if="subtype.description"
|
|
169
|
+
class="description"
|
|
170
|
+
>
|
|
171
|
+
<span
|
|
172
|
+
v-if="$store.getters['i18n/exists'](subtype.description)"
|
|
173
|
+
v-clean-html="t(subtype.description, {}, true)"
|
|
174
|
+
/>
|
|
175
|
+
<span v-else>{{ subtype.description }}</span>
|
|
176
|
+
</div>
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
</slot>
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
<div class="footer">
|
|
183
|
+
<button
|
|
184
|
+
type="button"
|
|
185
|
+
class="btn role-secondary"
|
|
186
|
+
@click="cancel"
|
|
187
|
+
>
|
|
188
|
+
<t k="generic.cancel" />
|
|
189
|
+
</button>
|
|
190
|
+
</div>
|
|
191
|
+
</div>
|
|
192
|
+
<div v-else>
|
|
193
|
+
empty
|
|
194
|
+
</div>
|
|
195
|
+
</template>
|
|
196
|
+
|
|
197
|
+
<style lang='scss' scoped>
|
|
198
|
+
|
|
199
|
+
$logo: 60px;
|
|
200
|
+
$logo-space: 100px;
|
|
201
|
+
|
|
202
|
+
.subtypes-container {
|
|
203
|
+
display: flex;
|
|
204
|
+
flex-wrap: wrap;
|
|
205
|
+
width: 100%;
|
|
206
|
+
flex-direction:row;
|
|
207
|
+
align-content: baseline;
|
|
208
|
+
}
|
|
209
|
+
.subtype-content {
|
|
210
|
+
width: 100%;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.subtype-banner {
|
|
214
|
+
border: 1px solid var(--border);
|
|
215
|
+
border-radius: 0;
|
|
216
|
+
display: flex;
|
|
217
|
+
flex-basis: 48%;
|
|
218
|
+
margin: 10px;
|
|
219
|
+
|
|
220
|
+
&.disabled {
|
|
221
|
+
cursor: not-allowed !important;
|
|
222
|
+
background-color: var(--disabled-bg);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
&.selected {
|
|
226
|
+
background-color: var(--accent-btn);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
&.top {
|
|
230
|
+
background-image: linear-gradient(
|
|
231
|
+
-90deg,
|
|
232
|
+
var(--body-bg),
|
|
233
|
+
var(--accent-btn)
|
|
234
|
+
);
|
|
235
|
+
|
|
236
|
+
h2 {
|
|
237
|
+
margin: 0px;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.title {
|
|
242
|
+
align-items: center;
|
|
243
|
+
display: flex;
|
|
244
|
+
width: 100%;
|
|
245
|
+
|
|
246
|
+
h5 {
|
|
247
|
+
margin: 0;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.flex-right {
|
|
251
|
+
margin-left: auto;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.description {
|
|
256
|
+
color: var(--input-label);
|
|
257
|
+
display: flex;
|
|
258
|
+
flex-direction: column;
|
|
259
|
+
justify-content: center;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
&:not(.top) {
|
|
263
|
+
flex-direction: column;
|
|
264
|
+
justify-content: start;
|
|
265
|
+
&:hover {
|
|
266
|
+
cursor: pointer;
|
|
267
|
+
box-shadow: 0px 0px 1px var(--outline-width) var(--outline);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.round-image {
|
|
272
|
+
border-radius: 50%;
|
|
273
|
+
height: 60px;
|
|
274
|
+
width: 60px;
|
|
275
|
+
overflow: hidden;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.banner-abbrv {
|
|
279
|
+
align-items: center;
|
|
280
|
+
background-color: var(--primary);
|
|
281
|
+
color: var(--body-bg);
|
|
282
|
+
display: flex;
|
|
283
|
+
font-size: 2.5em;
|
|
284
|
+
height: 100%;
|
|
285
|
+
justify-content: center;
|
|
286
|
+
width: 100%;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.subtype-container {
|
|
291
|
+
position: relative;
|
|
292
|
+
display: flex;
|
|
293
|
+
height: 100%;
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
.subtype-body {
|
|
297
|
+
flex: 1;
|
|
298
|
+
padding: 10px;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.subtype-logo {
|
|
302
|
+
align-items: center;
|
|
303
|
+
display: flex;
|
|
304
|
+
justify-content: center;
|
|
305
|
+
min-width: $logo-space;
|
|
306
|
+
min-height: $logo-space;
|
|
307
|
+
overflow: hidden;
|
|
308
|
+
background-color: var(--box-bg);
|
|
309
|
+
|
|
310
|
+
img {
|
|
311
|
+
width: $logo - 4px;
|
|
312
|
+
height: $logo - 4px;
|
|
313
|
+
object-fit: contain;
|
|
314
|
+
position: relative;
|
|
315
|
+
top: 2px;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.subtype-banner {
|
|
320
|
+
.round-image {
|
|
321
|
+
background-color: var(--primary);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
&:focus-visible {
|
|
325
|
+
@include focus-outline;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.icon {
|
|
330
|
+
font-size: 4.45em;
|
|
331
|
+
line-height: 0.95em;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.footer {
|
|
335
|
+
display: flex;
|
|
336
|
+
justify-content: flex-end;
|
|
337
|
+
margin: 20px 10px 0 10px;
|
|
338
|
+
z-index: 19;
|
|
339
|
+
}
|
|
340
|
+
</style>
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { SCHEMA, FLEET } from '@shell/config/types';
|
|
3
|
+
import { checkPermissions, checkSchemasForFindAllHash } from '@shell/utils/auth';
|
|
4
|
+
import Masthead from '@shell/components/ResourceList/Masthead';
|
|
5
|
+
import FleetNoWorkspaces from '@shell/components/fleet/FleetNoWorkspaces.vue';
|
|
6
|
+
import FleetApplications from '@shell/components/fleet/FleetApplications';
|
|
7
|
+
|
|
8
|
+
const schema = {
|
|
9
|
+
id: FLEET.APPLICATION,
|
|
10
|
+
type: SCHEMA,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
name: 'ListApplications',
|
|
15
|
+
components: {
|
|
16
|
+
Masthead,
|
|
17
|
+
FleetNoWorkspaces,
|
|
18
|
+
FleetApplications,
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
props: {
|
|
22
|
+
loadIndeterminate: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
incrementalLoadingIndicator: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: false
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
useQueryParamsForSimpleFiltering: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: false
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
async fetch() {
|
|
39
|
+
try {
|
|
40
|
+
const hash = await checkSchemasForFindAllHash({
|
|
41
|
+
cluster: {
|
|
42
|
+
inStoreType: 'management',
|
|
43
|
+
type: FLEET.CLUSTER
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
clusterGroups: {
|
|
47
|
+
inStoreType: 'management',
|
|
48
|
+
type: FLEET.CLUSTER_GROUP
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
gitRepos: {
|
|
52
|
+
inStoreType: 'management',
|
|
53
|
+
type: FLEET.GIT_REPO
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
helmOps: {
|
|
57
|
+
inStoreType: 'management',
|
|
58
|
+
type: FLEET.HELM_OP
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
workspaces: {
|
|
62
|
+
inStoreType: 'management',
|
|
63
|
+
type: FLEET.WORKSPACE
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
}, this.$store);
|
|
67
|
+
|
|
68
|
+
this.hasWorkspaces = (hash.workspaces || []).length > 0;
|
|
69
|
+
} catch (e) {
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
try {
|
|
73
|
+
const permissions = await checkPermissions(
|
|
74
|
+
{
|
|
75
|
+
workspaces: { type: FLEET.WORKSPACE },
|
|
76
|
+
gitRepos: { type: FLEET.GIT_REPO },
|
|
77
|
+
helmOps: { type: FLEET.HELM_OP }
|
|
78
|
+
},
|
|
79
|
+
this.$store.getters
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
this.permissions = permissions;
|
|
83
|
+
} catch (e) {
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
data() {
|
|
88
|
+
// TODO show warning if 1 of the {gitrepo, helmOps} has no permission
|
|
89
|
+
|
|
90
|
+
return {
|
|
91
|
+
schema,
|
|
92
|
+
hasWorkspaces: false,
|
|
93
|
+
permissions: {},
|
|
94
|
+
createLocation: { name: 'c-cluster-fleet-application-create' },
|
|
95
|
+
forceUpdateLiveAndDelayed: 10
|
|
96
|
+
};
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
computed: {
|
|
100
|
+
rows() {
|
|
101
|
+
return [
|
|
102
|
+
...this.$store.getters[`management/all`](FLEET.GIT_REPO),
|
|
103
|
+
...this.$store.getters[`management/all`](FLEET.HELM_OP)
|
|
104
|
+
];
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
methods: {}
|
|
109
|
+
};
|
|
110
|
+
</script>
|
|
111
|
+
|
|
112
|
+
<template>
|
|
113
|
+
<div v-if="hasWorkspaces">
|
|
114
|
+
<Masthead
|
|
115
|
+
:schema="schema"
|
|
116
|
+
:resource="schema.id"
|
|
117
|
+
:type-display="t('fleet.application.pageTitle')"
|
|
118
|
+
>
|
|
119
|
+
<template #createButton>
|
|
120
|
+
<router-link
|
|
121
|
+
:to="createLocation"
|
|
122
|
+
class="btn role-primary"
|
|
123
|
+
>
|
|
124
|
+
{{ t('fleet.application.actions.create') }}
|
|
125
|
+
</router-link>
|
|
126
|
+
</template>
|
|
127
|
+
</Masthead>
|
|
128
|
+
<FleetApplications
|
|
129
|
+
:rows="rows"
|
|
130
|
+
:schema="schema"
|
|
131
|
+
:loading="$fetchState.pending"
|
|
132
|
+
:use-query-params-for-simple-filtering="useQueryParamsForSimpleFiltering"
|
|
133
|
+
:force-update-live-and-delayed="forceUpdateLiveAndDelayed"
|
|
134
|
+
/>
|
|
135
|
+
</div>
|
|
136
|
+
<div v-else>
|
|
137
|
+
<FleetNoWorkspaces :can-view="permissions.workspaces" />
|
|
138
|
+
</div>
|
|
139
|
+
</template>
|