58
58
<v-text-field
59
59
v-model =" pipelineData.git.repository.ssh_url"
60
60
:rules =" repositoryRules"
61
- :counter =" 60"
62
61
label =" Repository"
63
62
required
64
63
disabled
71
70
cols =" 12"
72
71
md =" 6"
73
72
>
74
- <v-text-field
73
+ <v-combobox
75
74
v-model =" branch"
76
- :rules =" branchRules"
77
- :counter =" 60"
75
+ :items =" branchesList"
78
76
label =" Branch"
79
77
required
80
- ></v-text-field >
78
+ ></v-combobox >
81
79
</v-col >
82
80
</v-row >
83
81
<v-row
116
114
>
117
115
<v-text-field
118
116
v-model =" docker.tag"
119
- :rules =" branchRules"
120
117
:counter =" 60"
121
118
label =" Tag"
122
119
required
@@ -507,6 +504,7 @@ export default {
507
504
ssh_url: ' [email protected] :kubero-dev/template-nodeapp.git' ,
508
505
},
509
506
branch: ' main' ,
507
+ branchesList: [],
510
508
docker: {
511
509
image: ' ghcr.io/kubero-dev/template-nodeapp' ,
512
510
tag: ' main' ,
@@ -563,11 +561,6 @@ export default {
563
561
// ((git|ssh|http(s)?)|(git@[\w\.]+))(:(//)?)([\w\.@\:/\-~]+)(\.git)(/)?
564
562
v => / ((git| ssh| http(s)? )| (git@[\w. ] + ))(:(\/\/ )? )([\w. @:/\-~ ] + )(\. git)(\/ )? / .test (v) || ' Format "owner/repository"' ,
565
563
],
566
- branchRules: [
567
- // v => !!v || 'Branch is required',
568
- v => v .length <= 60 || ' Name must be less than 60 characters' ,
569
- v => / ^ [a-zA-Z0-9 ][a-zA-Z0-9 _-] * $ / .test (v) || ' Allowed characters : [a-zA-Z0-9_-]' ,
570
- ],
571
564
domainRules: [
572
565
v => !! v || ' Domain is required' ,
573
566
v => v .length <= 60 || ' Name must be less than 60 characters' ,
@@ -605,6 +598,8 @@ export default {
605
598
this .buildpack = this .pipelineData .buildpack ;
606
599
607
600
this .gitrepo .ssh_url = this .pipelineData .git .repository .ssh_url ;
601
+
602
+ this .loadBranches ();
608
603
/*
609
604
if (this.app == 'new') {
610
605
switch (this.pipelineData.github.repository.language) {
@@ -623,6 +618,23 @@ export default {
623
618
*/
624
619
});
625
620
},
621
+ loadBranches () {
622
+
623
+ // encode string to base64 (for ssh url)
624
+ const gitrepoB64 = btoa (this .pipelineData .git .repository .ssh_url );
625
+ const gitprovider = this .pipelineData .git .provider ;
626
+
627
+ axios .get (' /api/repo/' + gitprovider+ " /" + gitrepoB64+ " /branches/list" ).then (response => {
628
+ for (let i = 0 ; i < response .data .length ; i++ ) {
629
+ this .branchesList .push ({
630
+ text: response .data [i],
631
+ value: response .data [i],
632
+ });
633
+ }
634
+ });
635
+ },
636
+
637
+
626
638
loadPodsizeList () {
627
639
axios .get (' /api/config/podsize' ).then (response => {
628
640
for (let i = 0 ; i < response .data .length ; i++ ) {
0 commit comments