Skip to content

Commit

Permalink
Some adjustments for the UI. Fixed small bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
michelvocks committed Mar 6, 2018
1 parent 48f9525 commit 95b3324
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
16 changes: 8 additions & 8 deletions frontend/client/views/pipelines/create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<label class="label">Type the name of your pipeline. You can put your pipelines into folders by defining a path. For example
<strong>MyFolder/MyAwesomePipeline</strong>.</label>
<p class="control has-icons-left" v-bind:class="{ 'has-icons-right': pipelineNameSuccess }">
<input class="input is-medium input-bar" v-model="pipelinename" type="text" placeholder="Pipeline name ...">
<input class="input is-medium input-bar" v-model.lazy="pipelinename" type="text" placeholder="Pipeline name ...">
<span class="icon is-small is-left">
<i class="fa fa-book"></i>
</span>
Expand Down Expand Up @@ -99,21 +99,21 @@
</thead>
<tbody>
<tr v-bind:class="{ blink: pipeline.status < 100 }" v-for="(pipeline, index) in createdPipelines" :key="index">
<td>
<td v-bind:class="{ th: pipeline.status === 100 }">
{{ pipeline.pipelinename }}
</td>
<td>
<td class="th">
<div v-if="pipeline.status < 100">
<progress-bar :type="'info'" :size="'small'" :value="pipeline.status" :max="100" :show-label="false"></progress-bar>
</div>
<div v-if="pipeline.status === 100">
<span style="color: green;">Completed</span>
<span>Completed</span>
</div>
</td>
<td>
<td v-bind:class="{ th: pipeline.status === 100 }">
{{ pipeline.pipelinetype }}
</td>
<td>
<td v-bind:class="{ th: pipeline.status === 100 }">
{{ pipeline.creationdate }}
</td>
</tr>
Expand All @@ -140,7 +140,7 @@
</span>
</p>
<p class="control has-icons-left">
<input class="input is-medium input-bar" type="password" v-model="pipeline.gitrepo.password" placeholder="Password">
<input class="input is-medium input-bar" type="password" v-model="pipeline.gitrepo.gitpassword" placeholder="Password">
<span class="icon is-small is-left">
<i class="fa fa-lock"></i>
</span>
Expand Down Expand Up @@ -285,7 +285,7 @@ export default {
this.gitSuccess = true
// Get branches and set to master if available
this.gitBranches = response.data.gitbranches
this.gitBranches = response.data
for (var i = 0; i < this.gitBranches.length; i++) {
if (this.gitBranches[i] === 'refs/heads/master') {
this.pipeline.gitrepo.selectedbranch = this.gitBranches[i]
Expand Down
4 changes: 2 additions & 2 deletions handlers/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func PipelineGitLSRemote(ctx iris.Context) {
}

// Return branches
ctx.JSON(repo)
ctx.JSON(repo.Branches)
}

// PipelineBuildFromSource clones a given git repo and
Expand Down Expand Up @@ -77,7 +77,7 @@ func PipelineBuildFromSource(ctx iris.Context) {
}

// createPipelineExecute clones the given git repo and compiles
// the pipeline. After every step, the status will be store.
// the pipeline. After every step, the status will be stored.
// This method is designed to be called async.
func createPipelineExecute(p *gaia.Pipeline) {
// Define build process for the given type
Expand Down
14 changes: 5 additions & 9 deletions pipeline/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ func GitLSRemote(repo *gaia.GitRepo) error {
// Attach credentials if provided
var auth transport.AuthMethod
if repo.Username != "" && repo.Password != "" {
ep.User = repo.Username
ep.Password = repo.Password
// Basic auth provided
auth = &http.BasicAuth{
Username: repo.Username,
Password: repo.Password,
}
} else if repo.PrivateKey.Key != "" {
auth, err = ssh.NewPublicKeys(repo.PrivateKey.Username, []byte(repo.PrivateKey.Key), repo.PrivateKey.Password)
if err != nil {
Expand All @@ -53,13 +56,6 @@ func GitLSRemote(repo *gaia.GitRepo) error {
defer s.Close()

// Get advertised references (e.g. branches)
// We have to reset the username and password to
// prevent go-git setting the credentials in the URL
// which will not be URL encoded.
// https://github.com/src-d/go-git/issues/723
ep.User = ""
ep.Password = ""
repo.Password = ""
ar, err := s.AdvertisedReferences()
if err != nil {
return err
Expand Down

0 comments on commit 95b3324

Please sign in to comment.