From f72a0a1b09db95044f57b8b8f1d4b5d6d5c99850 Mon Sep 17 00:00:00 2001 From: Alan Bernstein Date: Tue, 25 Apr 2017 13:40:14 -0500 Subject: [PATCH] Update error message and use it for 'frame not found' as well --- webui/assets/main.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/webui/assets/main.js b/webui/assets/main.js index 7532075ce..dde813a40 100644 --- a/webui/assets/main.js +++ b/webui/assets/main.js @@ -96,15 +96,20 @@ class REPL { var output_string = res['output'] var output_json = JSON.parse(output_string) var result_class = "result-output" + var getting_started_errors = [ + 'database not found', // TODO db->index + 'frame not found', + ] if("error" in output_json) { result_class = "result-error" - if(output_json['error'] == 'database not found') { // TODO db->index - output_string = `Error: index not found
+ if(getting_started_errors.indexOf(output_json['error']) >= 0) { + output_string += `

Just getting started? Try this:
- $ curl -XPOST "http://127.0.0.1:10101/db/test" -d '{"options": {"columnLabel": "col"}}' # create a database
- $ curl -XPOST "http://127.0.0.1:10101/db/test/frame/foo" -d '{"options": {"rowLabel": "row"}}' # create a frame
+ $ curl -XPOST "http://127.0.0.1:10101/db/test" -d '{"options": {"columnLabel": "col"}}' # create index "test"
+ $ curl -XPOST "http://127.0.0.1:10101/db/test/frame/foo" -d '{"options": {"rowLabel": "row"}}' # create frame "foo"
+ # Select "test" in the index dropdown above
SetBit(row=0, col=0, frame=foo) # Use PQL to set a bit ` }