fixed many minor UI bugs

This commit is contained in:
Brad Rydzewski 2015-08-12 23:56:05 -07:00
parent 35d05b0cce
commit f6078a4b71
4 changed files with 68 additions and 7 deletions

View file

@ -202,8 +202,7 @@
}
// update the build
$scope.build = event;
console.log(event.builds);
$scope.task = event.builds[step - 1];
$scope.task = event.jobs[step - 1];
$scope.$apply();
// start streaming the current build
@ -218,7 +217,7 @@
$scope.restart = function () {
builds.restart(fullName, number).then(function (payload) {
$scope.build = payload.data;
$scope.task = payload.data.builds[step - 1];
$scope.task = payload.data.jobs[step - 1];
}).catch(function (err) {
$scope.error = err;
});

View file

@ -24,14 +24,22 @@
<div class="param" ng-repeat="(key, value) in job.environment">
{{ key.toUpperCase() }}={{ value }}
</div>
<div class="meta-group">
<div class="meta-group" ng-if="job.status !== 'pending' && job.status !== 'running'">
<div class="meta">finished {{ job.started_at | fromNow }}</div>
<div class="meta">duration of {{ job.finished_at - job.started_at | toDuration }}</div>
<div class="meta">with exit code {{ job.exit_code }}</div>
</div>
<div class="meta-group" ng-if="job.status === 'running'">
<div class="meta">started {{ job.started_at | fromNow }}</div>
</div>
<div class="meta-group" ng-if="job.status === 'pending'">
<div class="meta">pending execution</div>
</div>
</div>
</a>
</div>
<button ng-if="build.status !== 'pending' && build.status !== 'running'" ng-click="restart()" style="display:none;">Restart</button>
</div>
</aside>

View file

@ -356,7 +356,7 @@ main aside > div {
flex:1 1 auto;
font-size:13px;
}
.job-list > a > div.param,
.job-list > a div.param,
.job-list > li div.param {
margin-top:5px;
}

View file

@ -102,7 +102,34 @@ func (db *Buildstore) KillBuilds() error {
// SQL query to retrieve the latest builds across all branches.
const buildListQuery = `
SELECT *
SELECT
build_id
,build_repo_id
,build_number
,build_status
,build_started
,build_finished
,build_commit_sha
,build_commit_ref
,build_commit_link
,build_commit_branch
,build_commit_message
,build_commit_timestamp
,build_commit_remote
,build_commit_author_login
,build_commit_author_email
,build_pull_request_number
,build_pull_request_title
,build_pull_request_link
,build_pull_request_base_sha
,build_pull_request_base_ref
,build_pull_request_base_link
,build_pull_request_base_branch
,build_pull_request_base_message
,build_pull_request_base_timestamp
,build_pull_request_base_remote
,build_pull_request_base_author_login
,build_pull_request_base_author_email
FROM builds
WHERE build_repo_id = ?
ORDER BY build_number DESC
@ -112,7 +139,34 @@ LIMIT ? OFFSET ?
// SQL query to retrieve the most recent build.
// TODO exclude pull requests
const buildLastQuery = `
SELECT *
SELECT
build_id
,build_repo_id
,build_number
,build_status
,build_started
,build_finished
,build_commit_sha
,build_commit_ref
,build_commit_link
,build_commit_branch
,build_commit_message
,build_commit_timestamp
,build_commit_remote
,build_commit_author_login
,build_commit_author_email
,build_pull_request_number
,build_pull_request_title
,build_pull_request_link
,build_pull_request_base_sha
,build_pull_request_base_ref
,build_pull_request_base_link
,build_pull_request_base_branch
,build_pull_request_base_message
,build_pull_request_base_timestamp
,build_pull_request_base_remote
,build_pull_request_base_author_login
,build_pull_request_base_author_email
FROM builds
WHERE build_repo_id = ?
AND build_commit_branch = ?