From 79bf71b03b925dd32550eed0e68b8805e4c62be4 Mon Sep 17 00:00:00 2001
From: Brad Rydzewski
Date: Sun, 2 Aug 2015 23:02:44 -0700
Subject: [PATCH] fixed config prefix, hookup build output
---
cmd/drone-server/static/scripts/drone.js | 8 +-
.../scripts/views/builds/show/content.html | 79 ++++++++++---------
.../scripts/views/builds/show/toolbar.html | 21 -----
cmd/drone-server/static/styles/label.css | 4 +
cmd/drone-server/static/styles/main.css | 35 +++++---
pkg/config/config.go | 2 +-
pkg/server/commits.go | 7 +-
7 files changed, 81 insertions(+), 75 deletions(-)
diff --git a/cmd/drone-server/static/scripts/drone.js b/cmd/drone-server/static/scripts/drone.js
index b3e98dd40..238dd4714 100644
--- a/cmd/drone-server/static/scripts/drone.js
+++ b/cmd/drone-server/static/scripts/drone.js
@@ -177,12 +177,12 @@
views: {
'toolbar': {
templateUrl: '/static/scripts/views/builds/show/toolbar.html',
- controller: 'BuildCtrl',
+ controller: 'BuildOutCtrl',
resolve: resolveUser
},
'content': {
templateUrl: '/static/scripts/views/builds/show/content.html',
- controller: 'BuildCtrl',
+ controller: 'BuildOutCtrl',
resolve: resolveUser
}
},
@@ -192,12 +192,12 @@
url: '/:owner/:name/:number/:step',
views: {
'toolbar': {
- templateUrl: '/static/scripts/views/builds/step/toolbar.html',
+ templateUrl: '/static/scripts/views/builds/show/toolbar.html',
controller: 'BuildOutCtrl',
resolve: resolveUser
},
'content': {
- templateUrl: '/static/scripts/views/builds/step/content.html',
+ templateUrl: '/static/scripts/views/builds/show/content.html',
controller: 'BuildOutCtrl',
resolve: resolveUser
},
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 fa7d9446c..479191bff 100644
--- a/cmd/drone-server/static/scripts/views/builds/show/content.html
+++ b/cmd/drone-server/static/scripts/views/builds/show/content.html
@@ -1,40 +1,41 @@
-
-
-
-
-
-
-
{{ build.head_commit.message }}
-
-
{{ build.head_commit.author.login }} pushed to {{ build.head_commit.branch}} {{ build.started_at | fromNow }}
-
-
# {{build.number}}
-
-
-
-
-
Build jobs
-
-
-
-
-
-
+
+
+
+
+
+
+
+ expand_more
+
+
+
+
+
\ No newline at end of file
diff --git a/cmd/drone-server/static/scripts/views/builds/show/toolbar.html b/cmd/drone-server/static/scripts/views/builds/show/toolbar.html
index 0c5190222..98b4dc2da 100644
--- a/cmd/drone-server/static/scripts/views/builds/show/toolbar.html
+++ b/cmd/drone-server/static/scripts/views/builds/show/toolbar.html
@@ -1,24 +1,3 @@
-
-
-
-
-
diff --git a/cmd/drone-server/static/styles/label.css b/cmd/drone-server/static/styles/label.css
index 0c16d5dfd..199a432a6 100644
--- a/cmd/drone-server/static/styles/label.css
+++ b/cmd/drone-server/static/styles/label.css
@@ -17,6 +17,10 @@
color: #a3be8c;
border: 1px solid #a3be8c;
background: #fff;
+/*
+ background: rgba(163, 190, 140, 0.25);
+ border: none;
+ font-size: 11px;*/
}
.label-failure {
color: #bf616a;
diff --git a/cmd/drone-server/static/styles/main.css b/cmd/drone-server/static/styles/main.css
index 8e01655eb..1d89eec1b 100644
--- a/cmd/drone-server/static/styles/main.css
+++ b/cmd/drone-server/static/styles/main.css
@@ -143,6 +143,8 @@ main aside > div {
top:0px;
}
+
+
/*
* Build Console
*/
@@ -164,11 +166,19 @@ main aside > div {
box-sizing: border-box;
padding:35px 40px;
line-height:18px;
- font-family: "RobotoMono", Roboto+Mono, Roboto;
+ font-family: "Roboto Mono";
font-size:12px;
font-weight:300;
}
+@media (-webkit-min-device-pixel-ratio: 1) {
+ .console pre {
+ font-weight:400;
+ line-height:20px;
+ font-size:13px;
+ }
+}
+
/*
* Repo List
*/
@@ -307,16 +317,20 @@ main aside > div {
*/
.job-list { }
-.job-list li {
+.job-list > a,
+.job-list > li {
display:flex;
padding:20px 0px;
border-top:1px solid #f0f4f7;
}
-.job-list li > div:first-child {
- width:50px;
- min-width:50px;
+
+.job-list > a > div:first-child,
+.job-list > li > div:first-child {
+ width:40px;
+ min-width:40px;
}
-.job-list li > div:nth-child(2) { /** TEMPORARILY HIDDEN. MAY DECIDE TO REMOVE */
+.job-list > a > div:nth-child(2),
+.job-list > li > div:nth-child(2) { /** TEMPORARILY HIDDEN. MAY DECIDE TO REMOVE */
min-width:25px;
font-size:13px;
text-align:right;
@@ -325,14 +339,17 @@ main aside > div {
font-size:15px;
display:none;
}
-.job-list li > div:nth-child(3) {
+.job-list > a > div:nth-child(3),
+.job-list > li > div:nth-child(3) {
flex:1 1 auto;
font-size:13px;
}
-.job-list li div.param {
+.job-list > a > div.param,
+.job-list > li div.param {
margin-top:5px;
}
-.job-list li div.param:first-child {
+.job-list > a div.param:first-child,
+.job-list > li div.param:first-child {
margin-top:10px;
}
diff --git a/pkg/config/config.go b/pkg/config/config.go
index 70af08749..1825260a6 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -112,7 +112,7 @@ func LoadBytes(data []byte) (*Config, error) {
// if err != nil {
// return nil, err
// }
- err := envconfig.InitWithPrefix(conf, "DRONE")
+ err := envconfig.Init(conf)
if err != nil {
return nil, err
}
diff --git a/pkg/server/commits.go b/pkg/server/commits.go
index ee86b1979..04c9e4848 100644
--- a/pkg/server/commits.go
+++ b/pkg/server/commits.go
@@ -30,6 +30,7 @@ func GetCommit(c *gin.Context) {
build, err := store.BuildNumber(repo, num)
if err != nil {
c.Fail(404, err)
+ return
}
build.Jobs, err = store.JobList(build)
if err != nil {
@@ -72,7 +73,11 @@ func GetLogs(c *gin.Context) {
r, err := store.GetBlobReader(path)
if err != nil {
c.Fail(404, err)
- } else if full {
+ return
+ }
+
+ defer r.Close()
+ if full {
io.Copy(c.Writer, r)
} else {
io.Copy(c.Writer, io.LimitReader(r, 2000000))