-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
106 additions
and
3 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
40 changes: 38 additions & 2 deletions
40
www/md_base/src/app/home/panels/overview/overview.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 |
---|---|---|
@@ -1,8 +1,44 @@ | ||
class Overview extends Directive | ||
|
||
constructor: -> | ||
constructor: -> | ||
return { | ||
restrict: 'E' | ||
templateUrl: 'views/overview_panel.html' | ||
controller: '_OverviewController' | ||
controllerAs: 'overview' | ||
} | ||
|
||
|
||
class _Overview extends Controller | ||
masters: | ||
count: 0 | ||
active: 0 | ||
|
||
slaves: | ||
count: 0 | ||
connections: 0 | ||
|
||
builders: | ||
count: 0 | ||
|
||
schedulers: | ||
count: 0 | ||
|
||
constructor: (buildbotService) -> | ||
buildbotService.all('masters').getList().then (entries) => | ||
actives = 0 | ||
for master in entries | ||
actives += 1 if master.active | ||
@masters.count = entries.length | ||
@masters.active = actives | ||
|
||
buildbotService.all('buildslaves').getList().then (entries) => | ||
connections = 0 | ||
connections += slave.connected_to.length for slave in entries | ||
@slaves.count = entries.length | ||
@slaves.connections = connections | ||
|
||
buildbotService.all('builders').getList().then (entries) => | ||
@builders.count = entries.length | ||
|
||
buildbotService.all('schedulers').getList().then (entries) => | ||
@schedulers.count = entries.length |
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,43 @@ | ||
overview { | ||
display: block; | ||
overflow: hidden; | ||
padding: 20px 0; | ||
|
||
.tile { | ||
float: left; | ||
width: 25%; | ||
text-align: center; | ||
|
||
.title { | ||
font-size: 0.8em; | ||
color: #333; | ||
} | ||
|
||
.count { | ||
font-size: 80px; | ||
color: #673ab7; | ||
} | ||
|
||
.extra { | ||
color: #999; | ||
font-size: 14px; | ||
} | ||
} | ||
} | ||
|
||
.collapsed overview { | ||
.tile { | ||
width: 50%; | ||
margin-bottom: 5px; | ||
} | ||
|
||
.count { | ||
font-size: 50px; | ||
} | ||
} | ||
|
||
@media (max-width: 640px) { | ||
overview .count { | ||
font-size: 50px !important; | ||
} | ||
} |
21 changes: 20 additions & 1 deletion
21
www/md_base/src/app/home/panels/overview/overview_panel.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,20 @@ | ||
| overview panel content | ||
div.tile | ||
div.title Masters | ||
div.count {{ overview.masters.count }} | ||
div.extra | ||
| {{ overview.masters.active }} active. | ||
div.tile | ||
div.title Slaves | ||
div.count {{ overview.slaves.count }} | ||
div.extra | ||
| {{ overview.slaves.connections }} connections. | ||
div.tile | ||
div.title Builders | ||
div.count {{ overview.builders.count }} | ||
div.extra | ||
a(ui-sref="builds") View all builders | ||
div.tile | ||
div.title Schedulers | ||
div.count {{ overview.schedulers.count }} | ||
div.extra | ||
a(ui-sref="builds") View all schedulers |