Skip to content

Commit 34bb529

Browse files
committed
Add version info to footer
1 parent 86ae334 commit 34bb529

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

supervisor/ui/status.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959

6060
<div id="footer" class="clr">
6161
<div class="left">
62-
<a href="http://supervisord.org">Supervisor</a>&nbsp;
62+
<a href="http://supervisord.org">Supervisor</a> <span meld:id="supervisor_version">#</span>
6363
</div>
6464
<div class="right">
6565
&amp;copy; 2006-<span meld:id="copyright_date">#</span> <strong><a href="http://agendaless.com/">Agendaless Consulting and Contributors</a></strong>

supervisor/web.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from supervisor.process import ProcessStates
1818
from supervisor.http import NOT_DONE_YET
1919

20+
from supervisor.options import VERSION
2021
from supervisor.options import make_namespec
2122
from supervisor.options import split_namespec
2223

@@ -45,7 +46,7 @@ def more(self):
4546
response = self.callback()
4647
if response is NOT_DONE_YET:
4748
return NOT_DONE_YET
48-
49+
4950
self.finished = True
5051
return self.sendresponse(response)
5152

@@ -74,7 +75,7 @@ def sendresponse(self, response):
7475

7576
body = response.get('body', '')
7677
self.request['Content-Length'] = len(body)
77-
78+
7879
self.request.push(body)
7980

8081
connection = get_header(self.CONNECTION, self.request.header)
@@ -358,7 +359,7 @@ def startprocess():
358359
return 'Process %s started' % namespec
359360
startprocess.delay = 0.05
360361
return startprocess
361-
362+
362363
elif action == 'clearlog':
363364
callback = rpcinterface.supervisor.clearProcessLog(
364365
namespec)
@@ -368,7 +369,7 @@ def clearlog():
368369
return clearlog
369370

370371
raise ValueError(action)
371-
372+
372373
def render(self):
373374
form = self.context.form
374375
response = self.context.response
@@ -420,7 +421,7 @@ def render(self):
420421
'state':info['state'],
421422
'description':info['description'],
422423
})
423-
424+
424425
root = self.clone()
425426

426427
if message is not None:
@@ -449,24 +450,25 @@ def render(self):
449450

450451
actions = item['actions']
451452
actionitem_td = tr_element.findmeld('actionitem_td')
452-
453+
453454
for li_element, actionitem in actionitem_td.repeat(actions):
454455
anchor = li_element.findmeld('actionitem_anchor')
455456
if actionitem is None:
456457
anchor.attrib['class'] = 'hidden'
457458
else:
458-
anchor.attributes(href=actionitem['href'],
459+
anchor.attributes(href=actionitem['href'],
459460
name=actionitem['name'])
460461
anchor.content(actionitem['name'])
461462
if actionitem['target']:
462463
anchor.attributes(target=actionitem['target'])
463-
if shaded_tr:
464+
if shaded_tr:
464465
tr_element.attrib['class'] = 'shade'
465466
shaded_tr = not shaded_tr
466467
else:
467468
table = root.findmeld('statustable')
468469
table.replace('No programs to manage')
469470

471+
root.findmeld('supervisor_version').content(VERSION)
470472
copyright_year = str(datetime.date.today().year)
471473
root.findmeld('copyright_date').content(copyright_year)
472474

@@ -476,7 +478,7 @@ class OKView:
476478
delay = 0
477479
def __init__(self, context):
478480
self.context = context
479-
481+
480482
def __call__(self):
481483
return {'body':'OK'}
482484

@@ -513,7 +515,7 @@ def match(self, request):
513515

514516
if not path:
515517
path = 'index.html'
516-
518+
517519
for viewname in VIEWS.keys():
518520
if viewname == path:
519521
return True

0 commit comments

Comments
 (0)