Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1752 from shanzi/md
Material Design: Masters, Slaves, Schedulers and latest changes page
- Loading branch information
Showing
29 changed files
with
395 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
h1 changes | ||
md-list.changes-list | ||
md-subheader.md-no-sticky Latest changes | ||
md-divider | ||
change-item(change="change", ng-repeat="change in changes.list") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
class Changes extends Controller | ||
constructor: () -> | ||
constructor: ($scope, dataService) -> | ||
opened = dataService.open() | ||
opened.closeOnDestroy($scope) | ||
@list = opened.getChanges(limit: 40, order: '-when_timestamp').getArray() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,14 @@ | ||
h1 masters | ||
md-list.master-list | ||
md-subheader.md-no-sticky Masters | ||
md-divider | ||
md-list-item.master-item(ng-repeat="master in masters.list") | ||
div.master-id | ||
span \#{{ master.id }} | ||
div.master-title(flex) | ||
h3 {{ master.name}} | ||
p(ng-if="master.last_active > 0") Last active at | ||
span(am-time-ago="master.last_active") | ||
p(ng-if="master.last_active == 0") Never been active. | ||
div.master-state | ||
span.active(ng-if="master.active") Active | ||
span.inactive(ng-if="!master.active") Inactive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
class Masters extends Controller | ||
constructor: () -> | ||
constructor: ($scope, dataService) -> | ||
opened = dataService.open() | ||
opened.closeOnDestroy($scope) | ||
@list = opened.getMasters().getArray() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
.master-list { | ||
.master-item { | ||
margin: 20px 10px; | ||
} | ||
|
||
.master-id { | ||
width: 50px; | ||
font-size: 24px; | ||
color: #999; | ||
} | ||
|
||
.master-title { | ||
white-space: nowrap; | ||
|
||
h3 { | ||
margin: 0; | ||
color: #673ab7; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
} | ||
|
||
p { | ||
margin: 0; | ||
color: #999; | ||
} | ||
} | ||
|
||
.master-state { | ||
font-weight: bold; | ||
width: 50px; | ||
text-align: center; | ||
|
||
.active { | ||
color: #8d4; | ||
} | ||
|
||
.inactive { | ||
color: #ecc; | ||
} | ||
} | ||
} |
8 changes: 7 additions & 1 deletion
8
www/md_base/src/app/builds/schedulers/builds.schedulers.tpl.jade
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
h1 schedulers | ||
md-list.scheduler-list | ||
md-subheader.md-no-sticky Schedulers | ||
md-divider | ||
md-list-item.scheduler-item(ng-repeat="scheduler in schedulers.list") | ||
span.scheduler-id \#{{ scheduler.id }} | ||
p.scheduler-name(flex) {{ scheduler.name }} | ||
span.scheduler-master {{ scheduler.master || "No master" }} |
5 changes: 4 additions & 1 deletion
5
www/md_base/src/app/builds/schedulers/schedulers.controller.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
class Schedulers extends Controller | ||
constructor: () -> | ||
constructor: ($scope, dataService) -> | ||
opened = dataService.open() | ||
opened.closeOnDestroy($scope) | ||
@list = opened.getSchedulers().getArray() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.scheduler-list { | ||
color: #999; | ||
|
||
.scheduler-id { | ||
min-width: 40px; | ||
} | ||
|
||
.scheduler-name { | ||
color: #673ab7; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,18 @@ | ||
h1 slaves | ||
md-list.slave-list | ||
md-subheader.md-no-sticky Slaves | ||
md-divider | ||
div.slave-item(ng-repeat="slave in slaves.list", layout="row", layout-md="column") | ||
div.slave-title(flex-gt-md="50") | ||
h3 {{ slave.name }} | ||
p | ||
| Connected to | ||
ng-pluralize( | ||
count="slave.connected_to.length", | ||
when="{'0': 'no master.','one': '1 master.','other': '{} masters.'}") | ||
p | ||
| Configured on | ||
ng-pluralize( | ||
count="slave.configured_on.length", | ||
when="{'0': 'no builder.','one': '1 builder.','other': '{} builders.'}") | ||
div.slave-info(flex-gt-md="50") | ||
inspect-data(data="slave.slaveinfo") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
class Slaves extends Controller | ||
constructor: () -> | ||
constructor: ($scope, dataService) -> | ||
opened = dataService.open() | ||
opened.closeOnDestroy($scope) | ||
# TODO: show builder names related to one slave after cache function | ||
# of dataService has been finished. | ||
@list = opened.getBuildslaves().getArray() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.slave-list { | ||
.slave-item { | ||
margin: 20px 10px; | ||
} | ||
|
||
.slave-title { | ||
h3 { | ||
color: #673ab7; | ||
} | ||
|
||
p { | ||
margin: 5px 0; | ||
color: #999; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
www/md_base/src/app/common/directives/changeitem/changeitem.directive.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
class ChangeItem extends Directive | ||
|
||
constructor: -> | ||
return { | ||
restrict: 'E' | ||
templateUrl: 'views/changeitem.html' | ||
controller: '_ChangeItemController' | ||
controllerAs: 'changeitem' | ||
bindToController: true | ||
scope: | ||
change: "=" | ||
} | ||
|
||
class _ChangeItem extends Controller | ||
showDetail: false | ||
|
||
toggleDetail: -> | ||
@showDetail = !@showDetail | ||
|
||
constructor: (dataService) -> | ||
@author = @change.author | ||
@revision = @change.revision[0...6] | ||
@comments = @change.comments | ||
@date = @change.when_timestamp | ||
@files = @change.files | ||
|
||
# Official W3C email regular expression | ||
emailRegex = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*/ | ||
email = emailRegex.exec @author | ||
|
||
@email = email[0] if email | ||
|
||
@displayData = | ||
'Repository': @change.repository | ||
'Branch': @change.branch | ||
'Revision': @change.revision | ||
|
79 changes: 79 additions & 0 deletions
79
www/md_base/src/app/common/directives/changeitem/changeitem.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
change-item { | ||
display: block; | ||
padding: 5px; | ||
|
||
.inner { | ||
line-height: 30px; | ||
font-size: 16px; | ||
color: #999; | ||
|
||
span { | ||
padding: 0 5px; | ||
} | ||
} | ||
|
||
.author { | ||
height: 20px; | ||
width: 20px; | ||
overflow: hidden; | ||
border-radius: 50%; | ||
margin: 5px; | ||
|
||
img { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
} | ||
|
||
.comments { | ||
white-space: nowrap; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
} | ||
|
||
.revision { | ||
width: 80px; | ||
text-align: right; | ||
font-family: monospace; | ||
color: #666; | ||
} | ||
|
||
.detail { | ||
color: #666; | ||
margin-left: 30px; | ||
padding: 10px 0; | ||
|
||
&>div { | ||
border-bottom: 1px solid #eee; | ||
padding-bottom: 10px; | ||
} | ||
} | ||
|
||
.sub-title { | ||
margin: 10px 0; | ||
text-transform: uppercase; | ||
font-size: 12px; | ||
font-weight: bold; | ||
} | ||
|
||
.meta { | ||
.author-name { | ||
font-weight: bold; | ||
} | ||
|
||
.time { | ||
float: right; | ||
} | ||
} | ||
|
||
.full-comment { | ||
|
||
.content { | ||
white-space: pre-wrap; | ||
} | ||
} | ||
|
||
.changed-files { | ||
|
||
} | ||
} |
Oops, something went wrong.