bug fix with layout

community
Steve L. Nyemba 6 years ago
parent 368c73a120
commit 37f0ea7de7

@ -1103,7 +1103,7 @@ def prepare_plot(id):
q = [{"info":"Monitoring RAM consumption trends","ylabel":"% used","node":node, "x":XRAM,"labels":np.arange(1,xn).tolist(),"series":names,"title":"RAM Usage"}]
q.append({"info":"Monitoring CPU consumption trends","ylabel":"% used","node":node,"x":XCPU,"labels":np.arange(1,xn_).tolist(),"series":names,"title":"CPU Usage"})
q.append({"info":"Monitoring CPU consumption trends","ylabel":"% used","node":node,"type":"bar","x":XCPU,"labels":np.arange(1,xn_).tolist(),"series":names,"title":"CPU Usage"})
key = 'app.trend.'+node
session[key] = q
return (key,200)
@ -1120,14 +1120,16 @@ def get_charts(format,id,key):
series = ['series_1']
args = session[key]
if isinstance(args,list) and 'index' in request.args:
index = int(request.args['index'])
args = args[index]
if isinstance(args,list) is False:
args['remove'] = remove
info = [Graph.instance(format,id,**args)]
else:
# print args
info = [ Graph.instance(format,id, **dict(item,**{'remove':remove})) for item in args]
if 'index' in request.args :
index = int(request.args['index'])
args = args[index]
# if remove is not None :
# args['remove'] = remove

@ -150,5 +150,9 @@ class HTMLGraph(Graph):
dataset = {"label":name,"fill":False,"backgroundColor":Graph.COLORS[index],"borderColor":Graph.COLORS[index],"data":row}
config["data"]["datasets"].append(dataset)
if 'type' in self.args :
config['type'] = self.args['type']
else :
config['type'] = 'line'
return config

Loading…
Cancel
Save