|
@@ -17,6 +17,7 @@ import meld3
|
|
from supervisor.process import ProcessStates
|
|
from supervisor.process import ProcessStates
|
|
from supervisor.http import NOT_DONE_YET
|
|
from supervisor.http import NOT_DONE_YET
|
|
|
|
|
|
|
|
+from supervisor.options import VERSION
|
|
from supervisor.options import make_namespec
|
|
from supervisor.options import make_namespec
|
|
from supervisor.options import split_namespec
|
|
from supervisor.options import split_namespec
|
|
|
|
|
|
@@ -45,7 +46,7 @@ class DeferredWebProducer:
|
|
response = self.callback()
|
|
response = self.callback()
|
|
if response is NOT_DONE_YET:
|
|
if response is NOT_DONE_YET:
|
|
return NOT_DONE_YET
|
|
return NOT_DONE_YET
|
|
-
|
|
|
|
|
|
+
|
|
self.finished = True
|
|
self.finished = True
|
|
return self.sendresponse(response)
|
|
return self.sendresponse(response)
|
|
|
|
|
|
@@ -74,7 +75,7 @@ class DeferredWebProducer:
|
|
|
|
|
|
body = response.get('body', '')
|
|
body = response.get('body', '')
|
|
self.request['Content-Length'] = len(body)
|
|
self.request['Content-Length'] = len(body)
|
|
-
|
|
|
|
|
|
+
|
|
self.request.push(body)
|
|
self.request.push(body)
|
|
|
|
|
|
connection = get_header(self.CONNECTION, self.request.header)
|
|
connection = get_header(self.CONNECTION, self.request.header)
|
|
@@ -358,7 +359,7 @@ class StatusView(MeldView):
|
|
return 'Process %s started' % namespec
|
|
return 'Process %s started' % namespec
|
|
startprocess.delay = 0.05
|
|
startprocess.delay = 0.05
|
|
return startprocess
|
|
return startprocess
|
|
-
|
|
|
|
|
|
+
|
|
elif action == 'clearlog':
|
|
elif action == 'clearlog':
|
|
callback = rpcinterface.supervisor.clearProcessLog(
|
|
callback = rpcinterface.supervisor.clearProcessLog(
|
|
namespec)
|
|
namespec)
|
|
@@ -368,7 +369,7 @@ class StatusView(MeldView):
|
|
return clearlog
|
|
return clearlog
|
|
|
|
|
|
raise ValueError(action)
|
|
raise ValueError(action)
|
|
-
|
|
|
|
|
|
+
|
|
def render(self):
|
|
def render(self):
|
|
form = self.context.form
|
|
form = self.context.form
|
|
response = self.context.response
|
|
response = self.context.response
|
|
@@ -420,7 +421,7 @@ class StatusView(MeldView):
|
|
'state':info['state'],
|
|
'state':info['state'],
|
|
'description':info['description'],
|
|
'description':info['description'],
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+
|
|
root = self.clone()
|
|
root = self.clone()
|
|
|
|
|
|
if message is not None:
|
|
if message is not None:
|
|
@@ -449,24 +450,25 @@ class StatusView(MeldView):
|
|
|
|
|
|
actions = item['actions']
|
|
actions = item['actions']
|
|
actionitem_td = tr_element.findmeld('actionitem_td')
|
|
actionitem_td = tr_element.findmeld('actionitem_td')
|
|
-
|
|
|
|
|
|
+
|
|
for li_element, actionitem in actionitem_td.repeat(actions):
|
|
for li_element, actionitem in actionitem_td.repeat(actions):
|
|
anchor = li_element.findmeld('actionitem_anchor')
|
|
anchor = li_element.findmeld('actionitem_anchor')
|
|
if actionitem is None:
|
|
if actionitem is None:
|
|
anchor.attrib['class'] = 'hidden'
|
|
anchor.attrib['class'] = 'hidden'
|
|
else:
|
|
else:
|
|
- anchor.attributes(href=actionitem['href'],
|
|
|
|
|
|
+ anchor.attributes(href=actionitem['href'],
|
|
name=actionitem['name'])
|
|
name=actionitem['name'])
|
|
anchor.content(actionitem['name'])
|
|
anchor.content(actionitem['name'])
|
|
if actionitem['target']:
|
|
if actionitem['target']:
|
|
anchor.attributes(target=actionitem['target'])
|
|
anchor.attributes(target=actionitem['target'])
|
|
- if shaded_tr:
|
|
|
|
|
|
+ if shaded_tr:
|
|
tr_element.attrib['class'] = 'shade'
|
|
tr_element.attrib['class'] = 'shade'
|
|
shaded_tr = not shaded_tr
|
|
shaded_tr = not shaded_tr
|
|
else:
|
|
else:
|
|
table = root.findmeld('statustable')
|
|
table = root.findmeld('statustable')
|
|
table.replace('No programs to manage')
|
|
table.replace('No programs to manage')
|
|
|
|
|
|
|
|
+ root.findmeld('supervisor_version').content(VERSION)
|
|
copyright_year = str(datetime.date.today().year)
|
|
copyright_year = str(datetime.date.today().year)
|
|
root.findmeld('copyright_date').content(copyright_year)
|
|
root.findmeld('copyright_date').content(copyright_year)
|
|
|
|
|
|
@@ -476,7 +478,7 @@ class OKView:
|
|
delay = 0
|
|
delay = 0
|
|
def __init__(self, context):
|
|
def __init__(self, context):
|
|
self.context = context
|
|
self.context = context
|
|
-
|
|
|
|
|
|
+
|
|
def __call__(self):
|
|
def __call__(self):
|
|
return {'body':'OK'}
|
|
return {'body':'OK'}
|
|
|
|
|
|
@@ -513,7 +515,7 @@ class supervisor_ui_handler:
|
|
|
|
|
|
if not path:
|
|
if not path:
|
|
path = 'index.html'
|
|
path = 'index.html'
|
|
-
|
|
|
|
|
|
+
|
|
for viewname in VIEWS.keys():
|
|
for viewname in VIEWS.keys():
|
|
if viewname == path:
|
|
if viewname == path:
|
|
return True
|
|
return True
|