Skip to content

Commit 93c0c11

Browse files
authored
Merge pull request #616 from kubero-dev/feature/show-addons-for-templates
Show configured Addons in templates list
2 parents e16fcab + 0c64ad3 commit 93c0c11

File tree

1 file changed

+40
-4
lines changed

1 file changed

+40
-4
lines changed

client/src/components/templates/index.vue

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,38 @@
6969
prepend-icon="mdi-file-certificate"
7070
v-if="template.spdx_id && template.spdx_id !== 'NOASSERTION'"
7171
>{{ template.spdx_id }}</v-chip>
72+
<br>
73+
<v-chip
74+
v-for="category in template.categories"
75+
:key="category"
76+
label
77+
size="x-small"
78+
class="mr-2 mt-2"
79+
prepend-icon="mdi-tag"
80+
@click="filterByCategory(category)"
81+
>{{ category }}</v-chip>
7282
</v-card-subtitle>
73-
<v-card-text style="height: 150px">
83+
<v-card-text style="height: 150px" class="overflow-y-auto">
7484
{{ template.description }}
7585
<!--Operator: <a :href="template.url">{{ template.id }}</a>-->
86+
<!--<v-chip
87+
v-for="addon in template.addons"
88+
:key="addon"
89+
label
90+
size="small"
91+
class="mr-2"
92+
prepend-icon="mdi-plus"
93+
>{{ addon }}</v-chip>-->
94+
</v-card-text>
95+
<v-card-text style="height: 60px" class="d-flex justify-left mb-0">
96+
<v-avatar
97+
v-for="addon in template.addons"
98+
class="pa-2 mr-2"
99+
color="grey-lighten-2"
100+
rounded
101+
:key="addon"
102+
:image="addonImages[addon]">
103+
</v-avatar>
76104
</v-card-text>
77105

78106
<v-divider></v-divider>
@@ -154,6 +182,7 @@
154182
import axios from "axios";
155183
import { forEach } from "lodash";
156184
import { defineComponent } from 'vue'
185+
import { useRouter } from 'vue-router'
157186
158187
type Pipeline = {
159188
name: string,
@@ -187,6 +216,7 @@ type Template = {
187216
last_updated: string,
188217
last_pushed: string,
189218
status: string,
219+
190220
}
191221
192222
type Templates = {
@@ -232,6 +262,12 @@ export default defineComponent({
232262
dialog: false,
233263
clickedTemplate: {} as Template,
234264
catalogId: 0,
265+
addonImages: {
266+
'KuberoPostgresql': '/img/addons/pgsql.svg',
267+
'KuberoMysql': '/img/addons/mysql.svg',
268+
'KuberoRedis': '/img/addons/redis.svg',
269+
'KuberoMongoDB': '/img/addons/mongo.svg',
270+
} as { [key: string]: string },
235271
templates: {
236272
enabled: true,
237273
catalogs: [] as Catalog[],
@@ -258,10 +294,10 @@ export default defineComponent({
258294
this.dialog = false;
259295
},
260296
openInstall(templateurl: string, pipeline: string, phase: string) {
297+
const router = useRouter();
261298
// redirect to install page
262299
const templateurlB64 = btoa(templateurl);
263-
this.$router.push({ name: 'App Form', params: { pipeline: pipeline, phase: phase, app: 'new'}, query: { template: templateurlB64 }})
264-
300+
router.push({ name: 'App Form', params: { pipeline: pipeline, phase: phase, app: 'new'}, query: { template: templateurlB64 }})
265301
},
266302
openInstallDialog(template: Template) {
267303
this.clickedTemplate = template;
@@ -282,7 +318,7 @@ export default defineComponent({
282318
});
283319
},
284320
filterByCategory(selectedCategory: string) {
285-
console.log(selectedCategory);
321+
286322
if (selectedCategory === 'All') {
287323
this.showedTemplates.services = this.templatesList.services;
288324
} else {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy