status icons, animated running icon

This commit is contained in:
Brad Rydzewski 2015-08-09 20:18:21 -07:00
parent c6b9d09602
commit 819fa9db87
7 changed files with 102 additions and 43 deletions

View file

@ -60,12 +60,34 @@
} }
} }
/**
* message is a helper function that return the build icon.
*/
function icon() {
return function(status) {
switch(status) {
case "pending":
case "running":
return "refresh";
case "failure":
return "clear";
case "success":
return "check";
case "killed":
case "error":
return "remove";
}
return "";
}
}
angular angular
.module('drone') .module('drone')
.filter('trunc', trunc) .filter('trunc', trunc)
.filter('author', author) .filter('author', author)
.filter('message', message) .filter('message', message)
.filter('sha', sha) .filter('sha', sha)
.filter('icon', icon)
.filter('ref', ref); .filter('ref', ref);
})(); })();

View file

@ -30,7 +30,9 @@
<div class="list"> <div class="list">
<a ng-repeat="build in builds | orderBy:'-number' | filter: search_text" ng-href="/{{ repo.full_name }}/{{ build.number}}"> <a ng-repeat="build in builds | orderBy:'-number' | filter: search_text" ng-href="/{{ repo.full_name }}/{{ build.number}}">
<div class="column-status"> <div class="column-status">
<div class="status {{ build.status }}"></div> <div class="status {{ build.status }}">
<i class="material-icons">{{ build.status | icon }}</i>
</div>
</div> </div>
<div class="column-fill"> <div class="column-fill">
<h2>{{ build.head_commit.message }}</h2> <h2>{{ build.head_commit.message }}</h2>

View file

@ -15,8 +15,8 @@
<div class="list job-list"> <div class="list job-list">
<a ng-repeat="job in build.jobs" ng-href="{{ repo.full_name }}/{{ build.number }}/{{ job.number }}"> <a ng-repeat="job in build.jobs" ng-href="{{ repo.full_name }}/{{ build.number }}/{{ job.number }}">
<div> <div>
<div class="status {{ job.status }}"> <div class="status {{ job.status }} status-small">
<i class="material-icons">check</i> <i class="material-icons">{{ job.status | icon }}</i>
</div> </div>
</div> </div>
<div>{{ job.number }}</div> <div>{{ job.number }}</div>

View file

@ -17,8 +17,8 @@
min-width: 60px; min-width: 60px;
} }
.list .column-status { .list .column-status {
width: 45px; width: 60px;
min-width: 45px; min-width: 60px;
} }
.list .column-fill { .list .column-fill {
flex: 1 1 auto; flex: 1 1 auto;
@ -51,6 +51,12 @@
border-radius:4px; border-radius:4px;
margin-left:5px; margin-left:5px;
} }
.user-list .column-avatar img {
width:32px;
height:32px;
border-radius:50%;
margin-left:5px;
}
.list h2 { .list h2 {
line-height:32px; line-height:32px;
font-size:18px; font-size:18px;

View file

@ -133,8 +133,8 @@ main article {
margin-bottom:20px; margin-bottom:20px;
} }
main aside { main aside {
min-width:500px; min-width:450px;
width:500px; width:450px;
box-sizing: border-box; box-sizing: border-box;
padding:40px 50px; padding:40px 50px;
} }
@ -306,10 +306,10 @@ main aside > div {
box-sizing: border-box; box-sizing: border-box;
} }
.build-summary h2 { .build-summary h2 {
line-height:25px; line-height:21px;
} }
.build-summary p { .build-summary p {
margin-top:15px; margin-top:10px;
} }
/* /*
@ -326,8 +326,8 @@ main aside > div {
.job-list > a > div:first-child, .job-list > a > div:first-child,
.job-list > li > div:first-child { .job-list > li > div:first-child {
width:40px; width:50px;
min-width:40px; min-width:50px;
} }
.job-list > a > div:nth-child(2), .job-list > a > div:nth-child(2),
.job-list > li > div:nth-child(2) { /** TEMPORARILY HIDDEN. MAY DECIDE TO REMOVE */ .job-list > li > div:nth-child(2) { /** TEMPORARILY HIDDEN. MAY DECIDE TO REMOVE */
@ -507,18 +507,17 @@ menu .button span {
width: 36px; width: 36px;
vertical-align: middle; vertical-align: middle;
text-align: center; text-align: center;
font-size:32px; font-size:24px;
color:rgba(255,255,255,0.7);
} }
.status-small { .status-small {
width: 32px;
height: 32px;
} }
.status.error, .status-small i {
.status.killed, line-height: 32px;
.status.failure { width: 32px;
color: #bf616a; height: 32px;
}
.status.success {
color:#a3be8c;
} }
/* Search Form */ /* Search Form */
@ -607,13 +606,7 @@ pre.snippet {
/* ROUND INDICATORS */ /* ROUND INDICATORS */
.status { .status {
width:12px; border-radius:50%;
height:12px;
border-radius:50px;
margin-top:10px;
}
.status i {
font-size:0px;
} }
.status.error, .status.error,
.status.killed, .status.killed,
@ -623,10 +616,32 @@ pre.snippet {
.status.success { .status.success {
background:#a3be8c; background:#a3be8c;
} }
.status.running,
.status.pending {
background:#ebcb8b;
}
.status.running i,
.status.pending i {
-webkit-animation-name: delayed-rotate;
-webkit-animation-duration: 1s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: ease-in-out;
-moz-animation-name: delayed-rotate;
-moz-animation-duration: 1s;
-moz-animation-iteration-count: infinite;
-moz-animation-timing-function: ease-in-out;
animation-name: delayed-rotate;
animation-duration: 1s;
animation-iteration-count: infinite;
animation-timing-function: ease-in-out;
}
.build-list li > div:first-child, .build-list li > div:first-child,
.job-list li > div:first-child { .job-list li > div:first-child {
width: 45px; width: 55px;
min-width: 45px; min-width: 55px;
} }

View file

@ -9,12 +9,26 @@ DATABASE_CONFIG="/var/lib/drone/drone.sqlite"
## Sqlite3 configuration ## Sqlite3 configuration
The following is the standard URI connection scheme:
```
file:path[?options]
```
The components of the datasource connection string are: The components of the datasource connection string are:
* `path` local path to sqlite database. The default value is `/var/lib/drone/drone.sqlite`. * `file:` URI prefix to identify database files.
* `path` local path to the database file. The default value is `/var/lib/drone/drone.sqlite`.
* `?options` connection specific options. **not recommended**
This is an example connection string: ## Sqlite3 options
```bash This section lists all connection options used in the connection string format. Connection options are pairs in the following form: `name=value`. The value is always case sensitive. Separate options with the ampersand (i.e. &) character:
DATABASE_CONFIG="/var/lib/drone/drone.sqlite"
``` * `vfs` opens the database connection using the VFS value.
* `mode` opens the database as `ro`, `rw`, `rwc` or `memory`.
* `cache` opens the database with `shared` or `private` cache.
* `psow` overrides the powersafe overwrite property of the database file being opened.
* `_loc` sets the location of the time format. Use `auto` to auto-detect.
* `_busy_timeout` sets the value of the `sqlite3_busy_timeout`
* `_txlock` sets the locking behavior to `immediate`, `deferred`, or `exclusive`

View file

@ -18,15 +18,15 @@ type Build struct {
Finished int64 `json:"finished_at"` Finished int64 `json:"finished_at"`
Commit *Commit `json:"head_commit"` Commit *Commit `json:"head_commit"`
PullRequest *PullRequest `json:"pull_request"` PullRequest *PullRequest `json:"pull_request,omitempty"`
Jobs []*Job `json:"jobs,omitempty" sql:"-"` Jobs []*Job `json:"jobs,omitempty" sql:"-"`
} }
type PullRequest struct { type PullRequest struct {
Number int `json:"number"` Number int `json:"number,omitempty"`
Title string `json:"title"` Title string `json:"title,omitempty"`
Base *Commit `json:"base_commit"` Base *Commit `json:"base_commit,omitempty"`
} }
type Commit struct { type Commit struct {
@ -34,12 +34,12 @@ type Commit struct {
Ref string `json:"ref"` Ref string `json:"ref"`
Branch string `json:"branch" sql:"index:ix_commit_branch"` Branch string `json:"branch" sql:"index:ix_commit_branch"`
Message string `json:"message"` Message string `json:"message"`
Timestamp string `json:"timestamp"` Timestamp string `json:"timestamp,omitempty"`
Remote string `json:"remote"` Remote string `json:"remote,omitempty"`
Author *Author `json:"author"` Author *Author `json:"author,omitempty"`
} }
type Author struct { type Author struct {
Login string `json:"login"` Login string `json:"login,omitempty"`
Email string `json:"email"` Email string `json:"email,omitempty"`
} }