Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
www_ui: first stub implementation of some widgets
provided as an example on how this is supposed to work Code should eventually be replaced by using the api Signed-off-by: Pierre Tardy <tardyp@gmail.com>
- Loading branch information
Showing
11 changed files
with
322 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
define( | ||
[ | ||
"dojo/_base/declare", | ||
"lib/fakeStore" | ||
], | ||
function(declare, fakeStore) { | ||
var data=[]; | ||
return declare(fakeStore, { | ||
data:data, | ||
fields: ["changeid", "revision", "committer", "files", "comments" ], | ||
addData: function(o) { | ||
/* persist data over reload */ | ||
data = this.data; | ||
this.put(o); | ||
} | ||
}); | ||
}); |
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,39 @@ | ||
define( | ||
[ | ||
"dojo/_base/declare", | ||
"dojo/store/Memory" | ||
], | ||
function(declare, Memory) { | ||
return declare([Memory], { | ||
fields: ["field1"], | ||
constructor: function(args){ | ||
declare.safeMixin(this,args); | ||
this.interval = setInterval(dojo.hitch(this, this.addSomeData), 1000); //simulate adding some data every second | ||
}, | ||
addSomeData: function() { | ||
var randomfeed = "sdlkjs alkdj alsdjl ksdj lsajldkjaslkdj asdlkja iwjedo ajlskj lhsl"; | ||
var curId=0; | ||
if (this.data.length>0) { | ||
curId = this.data[this.data.length-1].id+1; | ||
} | ||
var o = {id:curId}; | ||
this.curId+=1; | ||
for (var i=0; i < this.fields.length; i+=1) { | ||
var l = Math.floor(Math.random()*20); | ||
var v = ""; | ||
for (var j=0; j<l; j+=1) { | ||
v +=randomfeed[Math.floor(Math.random()*randomfeed.length)]; | ||
} | ||
o[this.fields[i]] = v; | ||
} | ||
this.addData(o); | ||
}, | ||
addData: function(o) { | ||
this.put(o); | ||
}, | ||
destroy: function(){ | ||
clearInterval(this.interval); | ||
this.inherited(arguments); | ||
} | ||
}); | ||
}); |
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
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
.container-fluid | ||
%ul.breadcrumb | ||
%li | ||
%a{href:"../"}<> #{ builderName } | ||
%span.divider #{"/"} | ||
%li.active Build ##{number} | ||
.row-fluid | ||
.span5 | ||
.well | ||
:if !isFinished() | ||
%h3 Build In Progress: | ||
:if when_time | ||
%p ETA: #{ when_time } [ #{ when } ] | ||
%li.form-inline>= currentStep | ||
| ||
.btn.btn-inverse.btn-mini{data-dojo-attach-point:"stop_build_node"} Stop Build | ||
:if isFinished() | ||
%h3.form-inline Results: | ||
  | ||
.btn.disabled{class:results_class} #{text} | ||
.well | ||
%h3.form-inline BuildSlave: | ||
:if this.slave_url | ||
%a{href:slave_url}= slave | ||
:if !this.slave_url | ||
%span= slave | ||
.well | ||
%h3.form-inline Reason: | ||
%p= reason | ||
.well | ||
%h3 Steps and Logfiles: | ||
%ol | ||
:each step in steps | ||
%li #{step.name} | ||
%ol | ||
:each name, url in step.logs | ||
%li | ||
%a{href:url} #{name} | ||
:each name, url in step.urls | ||
%li | ||
%a{href:url} #{name} | ||
.span7.well | ||
%h3 build properties |
21 changes: 21 additions & 0 deletions
21
master/buildbot/www/static/js/lib/ui/templates/changes.html
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,21 @@ | ||
<div class="container-fluid"> | ||
<style type="text/css"> | ||
.mainchangegrid .field-id { | ||
width: 30px; | ||
} | ||
</style> | ||
<div class="row-fluid"> | ||
<div class="span12"> | ||
<h2>Last changes coming into the system</h2> | ||
</div> | ||
</div> | ||
<div class="row-fluid"> | ||
<div class="span5"> | ||
<div class="mainchangegrid" data-dojo-attach-point="maingrid_node"></div> | ||
</div><!--/span--> | ||
<div class="span7"> | ||
<h4>Associated Files</h4> | ||
<div data-dojo-attach-point="filesgrid_node"></div> | ||
</div><!--/span--> | ||
</div> | ||
</div> |
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 @@ | ||
<div class="container-fluid"> | ||
<div class="row-fluid"> | ||
<div class="span3"> | ||
<div class="well sidebar-nav"> | ||
<ul class="nav nav-list"> | ||
<li class="nav-header">Most recently browsed builds</li> | ||
<li><a href="#/builders/builder1/builds/1">builder1/1</a></li> | ||
<li><a href="#/builders/builder2/builds/10">builder2/10</a></li> | ||
<li><a href="#/builders/tester1/builds/1">tester1/1</a></li> | ||
<li class="nav-header">Most recently browsed builders</li> | ||
<li><a href="#/builders/builder1">builder1</a></li> | ||
<li><a href="#/builders/builder2">builder2</a></li> | ||
<li><a href="#/builders/tester1">tester1</a></li> | ||
</ul> | ||
</div><!--/.well --> | ||
</div><!--/span--> | ||
<div class="span9"> | ||
<div class="well"> | ||
<h2>Welcome to buildbot</h2> | ||
Probably we should display information about the current config | ||
</div> | ||
<div class="row-fluid"> | ||
<div class="span4"> | ||
<ul> | ||
<li>Buildbot version</li> | ||
<li>Twisted version</li> | ||
</div> | ||
<div class="span4"> | ||
<ul> | ||
<li>Project name</li> | ||
<li>Project version</li> | ||
<li>Project URL</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
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 |
---|---|---|
|
@@ -37,3 +37,43 @@ def render(self, request): | |
static_url = self.static_url, | ||
ws_url = self.baseurl.replace("http:", "ws:")) | ||
return html % contents | ||
|
||
if __name__ == '__main__': | ||
from twisted.application import strports, service | ||
from twisted.web import server, static | ||
from twisted.internet import reactor | ||
class myStaticFile(static.File): | ||
"""Fix issue in twisted static implementation | ||
where a 304 Not Modified always returns text/html | ||
which makes chrome complain a lot in its logs""" | ||
def render_GET(self, request): | ||
r = static.File.render_GET(self, request) | ||
if r=="": | ||
request.setHeader('content-type', self.type) | ||
return r | ||
|
||
class WWWService(service.MultiService): | ||
def __init__(self): | ||
service.MultiService.__init__(self) | ||
class fakeConfig(): | ||
www = dict(url="http://localhost:8010/", port=8010) | ||
class fakeMaster(): | ||
config = fakeConfig() | ||
self.master = fakeMaster() | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
tardyp
Author
Member
|
||
self.setup_site() | ||
self.port_service = strports.service("8010", self.site) | ||
self.port_service.setServiceParent(self) | ||
self.startService() | ||
def setup_site(self): | ||
root = static.Data('placeholder', 'text/plain') | ||
# redirect the root to UI | ||
root.putChild('', resource.RedirectResource(self.master, 'ui/')) | ||
# /ui | ||
root.putChild('ui', UIResource(self.master)) | ||
# /static | ||
staticdir = util.sibpath(__file__, 'static') | ||
|
||
root.putChild('static', myStaticFile(staticdir)) | ||
self.site = server.Site(root) | ||
WWWService() | ||
reactor.run() |
should probably use
buildbot.test.fake.fakemaster.make_master
here?