From f6078a4b7126cff2150cbda3436873f98e89c129 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Wed, 12 Aug 2015 23:56:05 -0700 Subject: [PATCH] fixed many minor UI bugs --- .../static/scripts/controllers/builds.js | 5 +- .../scripts/views/builds/show/content.html | 10 +++- cmd/drone-server/static/styles/main.css | 2 +- pkg/store/builtin/build.go | 58 ++++++++++++++++++- 4 files changed, 68 insertions(+), 7 deletions(-) diff --git a/cmd/drone-server/static/scripts/controllers/builds.js b/cmd/drone-server/static/scripts/controllers/builds.js index 94e5a144..c3a64d38 100644 --- a/cmd/drone-server/static/scripts/controllers/builds.js +++ b/cmd/drone-server/static/scripts/controllers/builds.js @@ -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; }); diff --git a/cmd/drone-server/static/scripts/views/builds/show/content.html b/cmd/drone-server/static/scripts/views/builds/show/content.html index f7f596b1..fa6b9f5c 100644 --- a/cmd/drone-server/static/scripts/views/builds/show/content.html +++ b/cmd/drone-server/static/scripts/views/builds/show/content.html @@ -24,14 +24,22 @@
{{ key.toUpperCase() }}={{ value }}
-
+
finished {{ job.started_at | fromNow }}
duration of {{ job.finished_at - job.started_at | toDuration }}
with exit code {{ job.exit_code }}
+
+
started {{ job.started_at | fromNow }}
+
+
+
pending execution
+
+ + diff --git a/cmd/drone-server/static/styles/main.css b/cmd/drone-server/static/styles/main.css index 1d888f5c..075085d6 100644 --- a/cmd/drone-server/static/styles/main.css +++ b/cmd/drone-server/static/styles/main.css @@ -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; } diff --git a/pkg/store/builtin/build.go b/pkg/store/builtin/build.go index ead54a12..e2b139e5 100644 --- a/pkg/store/builtin/build.go +++ b/pkg/store/builtin/build.go @@ -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 = ?