Skip to content

Commit

Permalink
Add version info to footer
Browse files Browse the repository at this point in the history
  • Loading branch information
mnaberez committed Jul 21, 2013
1 parent 86ae334 commit 34bb529
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion supervisor/ui/status.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

<div id="footer" class="clr">
<div class="left">
<a href="http://supervisord.org">Supervisor</a>&nbsp;
<a href="http://supervisord.org">Supervisor</a> <span meld:id="supervisor_version">#</span>
</div>
<div class="right">
&amp;copy; 2006-<span meld:id="copyright_date">#</span> <strong><a href="http://agendaless.com/">Agendaless Consulting and Contributors</a></strong>
Expand Down
22 changes: 12 additions & 10 deletions supervisor/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from supervisor.process import ProcessStates
from supervisor.http import NOT_DONE_YET

from supervisor.options import VERSION
from supervisor.options import make_namespec
from supervisor.options import split_namespec

Expand Down Expand Up @@ -45,7 +46,7 @@ def more(self):
response = self.callback()
if response is NOT_DONE_YET:
return NOT_DONE_YET

self.finished = True
return self.sendresponse(response)

Expand Down Expand Up @@ -74,7 +75,7 @@ def sendresponse(self, response):

body = response.get('body', '')
self.request['Content-Length'] = len(body)

self.request.push(body)

connection = get_header(self.CONNECTION, self.request.header)
Expand Down Expand Up @@ -358,7 +359,7 @@ def startprocess():
return 'Process %s started' % namespec
startprocess.delay = 0.05
return startprocess

elif action == 'clearlog':
callback = rpcinterface.supervisor.clearProcessLog(
namespec)
Expand All @@ -368,7 +369,7 @@ def clearlog():
return clearlog

raise ValueError(action)

def render(self):
form = self.context.form
response = self.context.response
Expand Down Expand Up @@ -420,7 +421,7 @@ def render(self):
'state':info['state'],
'description':info['description'],
})

root = self.clone()

if message is not None:
Expand Down Expand Up @@ -449,24 +450,25 @@ def render(self):

actions = item['actions']
actionitem_td = tr_element.findmeld('actionitem_td')

for li_element, actionitem in actionitem_td.repeat(actions):
anchor = li_element.findmeld('actionitem_anchor')
if actionitem is None:
anchor.attrib['class'] = 'hidden'
else:
anchor.attributes(href=actionitem['href'],
anchor.attributes(href=actionitem['href'],
name=actionitem['name'])
anchor.content(actionitem['name'])
if actionitem['target']:
anchor.attributes(target=actionitem['target'])
if shaded_tr:
if shaded_tr:
tr_element.attrib['class'] = 'shade'
shaded_tr = not shaded_tr
else:
table = root.findmeld('statustable')
table.replace('No programs to manage')

root.findmeld('supervisor_version').content(VERSION)
copyright_year = str(datetime.date.today().year)
root.findmeld('copyright_date').content(copyright_year)

Expand All @@ -476,7 +478,7 @@ class OKView:
delay = 0
def __init__(self, context):
self.context = context

def __call__(self):
return {'body':'OK'}

Expand Down Expand Up @@ -513,7 +515,7 @@ def match(self, request):

if not path:
path = 'index.html'

for viewname in VIEWS.keys():
if viewname == path:
return True
Expand Down

0 comments on commit 34bb529

Please sign in to comment.