Commit 4021d85e authored by Roque's avatar Roque

slapos master monitoring url update

See merge request !595
parents 051b5490 7d3ff37d
# TODO how to avoid hardcode here? from InstanceTree_getConnectionParameterList? # TODO how to avoid hardcode here? from InstanceTree_getConnectionParameterList?
base_url = 'https://monitor.app.officejs.com/#/?page=ojsm_landing' base_url = 'https://monitor.app.officejs.com/#/?page=ojsm_landing'
try:
instance_tree = context
if context.getPortalType() in ["Software Instance", "Slave Instance"]:
instance_tree = context.getSpecialise()
connection_parameter_dict = instance_tree.InstanceTree_getMonitorParameterDict()
connection_url = '&url=%s'% connection_parameter_dict['url'] + '&username=%s'% connection_parameter_dict['username'] + '&password=%s'% connection_parameter_dict['password']
except (AttributeError, TypeError) as e:
connection_url = ''
if context.getPortalType() == "Instance Tree": if context.getPortalType() == "Instance Tree":
for connection_parameter in context.InstanceTree_getConnectionParameterList(raw=True): for connection_parameter in context.InstanceTree_getConnectionParameterList(raw=True):
if connection_parameter['connection_key'] == "monitor-setup-url": if connection_parameter['connection_key'] == "monitor-setup-url":
return connection_parameter['connection_value'] return connection_parameter['connection_value']
connection_parameter_dict = context.InstanceTree_getMonitorParameterDict()
connection_url = '&url=%s'% connection_parameter_dict['url'] + '&username=%s'% connection_parameter_dict['username'] + '&password=%s'% connection_parameter_dict['password']
return base_url + '&query=portal_type:"Instance Tree" AND title:(%s)' % context.getTitle() + connection_url return base_url + '&query=portal_type:"Instance Tree" AND title:(%s)' % context.getTitle() + connection_url
if context.getPortalType() in ["Software Instance", "Slave Instance"]: if context.getPortalType() in ["Software Instance", "Slave Instance"]:
instance_tree = context.getSpecialise()
connection_parameter_dict = instance_tree.InstanceTree_getMonitorParameterDict()
connection_url = '&url=%s'% connection_parameter_dict['url'] + '&username=%s'% connection_parameter_dict['username'] + '&password=%s'% connection_parameter_dict['password']
return base_url + '&query=portal_type:"Software Instance" AND title:"%s" AND ' % context.getTitle() + 'specialise_title:"%s"' % context.getSpecialiseTitle() + connection_url return base_url + '&query=portal_type:"Software Instance" AND title:"%s" AND ' % context.getTitle() + 'specialise_title:"%s"' % context.getSpecialiseTitle() + connection_url
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment