Skip to content

Commit 6af1afc

Browse files
committed
load Default Env vars
1 parent 91f5538 commit 6af1afc

File tree

2 files changed

+71
-30
lines changed

2 files changed

+71
-30
lines changed

client/src/components/apps/form.vue

Lines changed: 50 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,23 @@
33
<v-container>
44
<Breadcrumbs :items="breadcrumbItems"></Breadcrumbs>
55
<v-row>
6-
<v-col cols="12" sm="12" md="12" lg="12" xl="12">
7-
<h1 v-if="app=='new'" style="font-size: xxx-large">
6+
<v-col
7+
cols="12"
8+
md="1"
9+
class="hidden-xs-and-down"
10+
>
11+
<v-img
12+
:src="(deploymentstrategy == 'git') ? '/img/icons/hexagon1.svg' : '/img/icons/hexagon1-empty-bold-tp.svg'"
13+
max-width="50"
14+
max-height="50"
15+
class="mr-2"
16+
></v-img>
17+
</v-col>
18+
<v-col cols="12" sm="11" md="11" lg="11" xl="11">
19+
<h1 v-if="app=='new'">
820
Create a new App in {{ pipeline }}
921
</h1>
10-
<h1 v-if="app!='new'" style="font-size: xxx-large">
22+
<h1 v-if="app!='new'">
1123
Edit {{ app }} in {{ pipeline }}
1224
</h1>
1325
<p class="text-justify">
@@ -70,7 +82,7 @@
7082
<v-row v-for="(host, index) in ingress.hosts" :key="index" :style="index > 0 ? 'margin-top: -20px;' : ''">
7183
<v-col
7284
cols="9"
73-
md="5"
85+
md="6"
7486
>
7587
<v-text-field
7688
v-model="host.host"
@@ -81,7 +93,7 @@
8193
></v-text-field>
8294
</v-col>
8395
<v-col
84-
cols="3"
96+
cols="2"
8597
md="2"
8698
pullright
8799
>
@@ -93,7 +105,7 @@
93105
></v-switch>
94106
</v-col>
95107
<v-col
96-
cols="12"
108+
cols="1"
97109
md="1"
98110
>
99111
<v-btn
@@ -130,7 +142,7 @@
130142
<v-row>
131143
<v-col
132144
cols="12"
133-
md="8"
145+
md="6"
134146
>
135147
<v-text-field
136148
v-model="containerPort"
@@ -1301,6 +1313,15 @@ type SAAnnotations = {
13011313
value: string,
13021314
}
13031315
1316+
type Phase = {
1317+
name: string;
1318+
enabled: boolean;
1319+
context: string;
1320+
domain: string;
1321+
defaultTTL?: number;
1322+
defaultEnvvars: EnvVar[];
1323+
}
1324+
13041325
export default defineComponent({
13051326
props: {
13061327
pipeline: {
@@ -1432,6 +1453,7 @@ export default defineComponent({
14321453
},
14331454
buildstrategy: 'plain',
14341455
deploymentstrategy: 'docker',
1456+
phases: [] as Phase[],
14351457
},
14361458
appname: '',
14371459
resourceVersion: '',
@@ -1778,7 +1800,27 @@ export default defineComponent({
17781800
this.deploymentstrategy = this.pipelineData.deploymentstrategy;
17791801
17801802
if (this.app == 'new') {
1781-
this.ingress.hosts[0].host = this.pipelineData.domain;
1803+
1804+
// extract domain from pipeline phase
1805+
for (let i = 0; i < this.pipelineData.phases.length; i++) {
1806+
if (this.pipelineData.phases[i].name == this.phase) {
1807+
this.pipelineData.domain = this.pipelineData.phases[i].domain;
1808+
this.ingress.hosts[0].host = this.pipelineData.domain;
1809+
}
1810+
}
1811+
1812+
// extract defaultEnvvars from pipeline phase
1813+
for (let i = 0; i < this.pipelineData.phases.length; i++) {
1814+
if (this.pipelineData.phases[i].name == this.phase) {
1815+
this.envvars = this.pipelineData.phases[i].defaultEnvvars;
1816+
}
1817+
}
1818+
1819+
// Open Panel if there is some data to show
1820+
if (this.envvars.length > 0) {
1821+
this.panel.push(5)
1822+
}
1823+
17821824
17831825
if (this.pipelineData.git.repository.admin == true) {
17841826
this.gitrepo = this.pipelineData.git.repository;

client/src/components/pipelines/form.vue

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
cols="12"
88
md="1"
99
>
10-
<v-img
11-
srcg="./../../../public/img/icons/hexagon3.svg"
12-
:src="(gitops == true) ? '/img/icons/hexagon3.svg' : '/img/icons/hexagon3-empty-bold-tp.svg'"
13-
max-width="50"
14-
max-height="50"
15-
class="mr-2"
16-
></v-img>
10+
<v-img
11+
:src="(gitops == true) ? '/img/icons/hexagon3.svg' : '/img/icons/hexagon3-empty-bold-tp.svg'"
12+
max-width="50"
13+
max-height="50"
14+
class="mr-2"
15+
></v-img>
1716
</v-col>
1817
<v-col cols="12" sm="11" md="11" lg="11" xl="11">
1918

@@ -31,7 +30,7 @@
3130
<v-row>
3231
<v-col
3332
cols="12"
34-
md="6"
33+
md="5"
3534
>
3635
<v-text-field
3736
v-model="pipelineName"
@@ -66,34 +65,33 @@
6665
md="8"
6766
>
6867
<v-tabs v-model="repotab" stacked centered @click="loadRepository">
69-
<v-tab value="github" :disabled="repositoriesList.github == false || !newPipeline"><v-icon class="mb-2 kubero">mdi-github</v-icon>Github</v-tab>
70-
<v-tab value="gitea" :disabled="repositoriesList.gitea == false || !newPipeline"><v-icon class="mb-2 gitea"></v-icon>Gitea</v-tab>
71-
<v-tab value="gitlab" :disabled="repositoriesList.gitlab == false || !newPipeline"><v-icon class="mb-2">mdi-gitlab</v-icon>Gitlab</v-tab>
72-
<!--<v-tab value="onedev" disabled>oneDev <v-icon class="mb-2 onedev"></v-icon></v-tab>-->
73-
<v-tab value="gogs" :disabled="repositoriesList.gogs == false || !newPipeline"><v-icon class="mb-2 gogs"></v-icon>Gogs</v-tab>
74-
<v-tab value="bitbucket" :disabled="repositoriesList.bitbucket == false || !newPipeline"><v-icon class="mb-2">mdi-bitbucket</v-icon>Bitbucket</v-tab>
68+
<v-tab value="github" :disabled="repositoriesList.github == false"><v-icon class="mb-2 kubero">mdi-github</v-icon>Github</v-tab>
69+
<v-tab value="gitea" :disabled="repositoriesList.gitea == false"><v-icon class="mb-2 gitea"></v-icon>Gitea</v-tab>
70+
<v-tab value="gitlab" :disabled="repositoriesList.gitlab == false"><v-icon class="mb-2">mdi-gitlab</v-icon>Gitlab</v-tab>
71+
<v-tab value="gogs" :disabled="repositoriesList.gogs == false"><v-icon class="mb-2 gogs"></v-icon>Gogs</v-tab>
72+
<v-tab value="bitbucket" :disabled="repositoriesList.bitbucket == false"><v-icon class="mb-2">mdi-bitbucket</v-icon>Bitbucket</v-tab>
7573
</v-tabs>
7674
</v-col>
7775
</v-row>
7876

7977
<v-row>
8078
<v-col
8179
cols="12"
82-
md="6"
80+
md="5"
8381
>
8482
<v-combobox
8583
v-model="gitrepo"
8684
:rules="repositoryRules"
8785
:items="gitrepoItems"
8886
label="Repository *"
89-
:disabled="repository_status.connected || !newPipeline"
87+
:disabled="repository_status.connected"
9088
required
9189
></v-combobox>
9290
</v-col>
9391

9492
<v-col
9593
cols="12"
96-
md="6"
94+
md="7"
9795
>
9896

9997
<v-alert variant="tonal" color="#8560a9" border="start">
@@ -192,7 +190,7 @@
192190
<v-row>
193191
<v-col
194192
cols="12"
195-
md="6"
193+
md="5"
196194
>
197195
<v-radio-group v-model="buildstrategy">
198196
<v-radio
@@ -224,7 +222,7 @@
224222
</v-col>
225223
<v-col
226224
cols="12"
227-
md="6"
225+
md="7"
228226
>
229227

230228
<v-alert variant="tonal" color="#8560a9" border="start" v-if="buildstrategy == 'plain'">
@@ -273,7 +271,7 @@
273271
<v-row>
274272
<v-col
275273
cols="12"
276-
md="6"
274+
md="5"
277275
v-if="buildstrategy == 'plain'"
278276
>
279277
<v-select
@@ -292,7 +290,7 @@
292290
v-if="buildstrategy == 'dockerfile'">
293291
<v-col
294292
cols="12"
295-
md="6"
293+
md="5"
296294
>
297295
<v-text-field
298296
v-model="dockerfilepath"
@@ -395,8 +393,9 @@
395393
<v-text-field
396394
v-model="phase.domain"
397395
:rules="domainRules"
398-
label="FQDN domain"
396+
label="Base domain"
399397
density="compact"
398+
hint="This Wildcard Domain should point to the IP of your cluster defined in 'Cluster Context'"
400399
></v-text-field>
401400
</v-col>
402401
</v-row>

0 commit comments

Comments
 (0)