提交 4316808b 编写于 作者: Y Yan Chunwei 提交者: daminglu

Feature/add online scratch (#157)

* simplify image sample usage

* simplify image

* add scratch demo

* add scipy into dependency

* add demo

* update readme

* add better scratch demo

* add more data

* support mannul image
上级 c678924e
...@@ -84,8 +84,8 @@ mock_data_path = os.path.join(SERVER_DIR, "./mock_data/") ...@@ -84,8 +84,8 @@ mock_data_path = os.path.join(SERVER_DIR, "./mock_data/")
log_reader = LogReader(args.logdir) log_reader = LogReader(args.logdir)
graph_image_path = None # mannully put graph's image on this path also works.
graph_image_path = os.path.join(args.logdir, 'graph.jpg')
# return data # return data
# status, msg, data # status, msg, data
...@@ -203,7 +203,7 @@ def histogram(): ...@@ -203,7 +203,7 @@ def histogram():
@app.route('/data/plugin/graphs/graph') @app.route('/data/plugin/graphs/graph')
def graph(): def graph():
# TODO(ChunweiYan) need to add a config for whether have graph. # TODO(ChunweiYan) need to add a config for whether have graph.
if graph_image_path is None: if graph_image_path is None or not os.path.isfile(graph_image_path):
data = {'url': ''} data = {'url': ''}
else: else:
data = {'url': '/graphs/image'} data = {'url': '/graphs/image'}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册