Till Westmann | ea8ab39 | 2013-06-05 15:17:08 -0700 | [diff] [blame] | 1 | <!-- |
Ian Maxon | 928bbd1 | 2015-09-14 17:12:48 -0700 | [diff] [blame^] | 2 | ! Licensed to the Apache Software Foundation (ASF) under one |
| 3 | ! or more contributor license agreements. See the NOTICE file |
| 4 | ! distributed with this work for additional information |
| 5 | ! regarding copyright ownership. The ASF licenses this file |
| 6 | ! to you under the Apache License, Version 2.0 (the |
| 7 | ! "License"); you may not use this file except in compliance |
| 8 | ! with the License. You may obtain a copy of the License at |
| 9 | ! |
| 10 | ! http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | ! |
| 12 | ! Unless required by applicable law or agreed to in writing, |
| 13 | ! software distributed under the License is distributed on an |
| 14 | ! "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | ! KIND, either express or implied. See the License for the |
| 16 | ! specific language governing permissions and limitations |
| 17 | ! under the License. |
Till Westmann | ea8ab39 | 2013-06-05 15:17:08 -0700 | [diff] [blame] | 18 | !--> |
genia.likes.science@gmail.com | 016314e | 2013-05-25 03:19:07 -0700 | [diff] [blame] | 19 | if ($('#opts').is(":visible")) { |
| 20 | $('#opts').hide(); |
| 21 | $('#queryform :input').prop('checked', false); |
| 22 | } else { |
| 23 | $('#opts').show(); |
| 24 | $('#queryform :input').prop('checked', true); |
| 25 | } |
genia.likes.science@gmail.com | b0680b3 | 2013-05-22 16:21:53 -0700 | [diff] [blame] | 26 | return false; |
genia.likes.science@gmail.com | 024749d | 2013-05-20 21:33:08 -0700 | [diff] [blame] | 27 | }); |
| 28 | |
genia.likes.science@gmail.com | 83fb065 | 2013-05-20 22:03:49 -0700 | [diff] [blame] | 29 | $('#clear-query-button').click(function() { |
| 30 | $("#qry").val(''); |
| 31 | return false; |
| 32 | }); |
| 33 | |
genia.likes.science@gmail.com | 016314e | 2013-05-25 03:19:07 -0700 | [diff] [blame] | 34 | $('form#queryform :input').click( function () { |
| 35 | /* Hides selection check on uncheck, shows when all 5 selected */ |
| 36 | if ($(this).val()) { |
| 37 | if ($(this).is(':checked') && $('input[type=checkbox]').filter(':checked').length == 5) { |
| 38 | $('#opts').show(); |
| 39 | } else { |
| 40 | $('#opts').hide(); |
| 41 | } |
| 42 | } |
| 43 | }); |
| 44 | |
genia.likes.science@gmail.com | b0680b3 | 2013-05-22 16:21:53 -0700 | [diff] [blame] | 45 | $("form#queryform").submit(function() { |
| 46 | $('#output-message').html(""); |
| 47 | $.post("/", $("form#queryform").serialize(), function(data) { |
genia.likes.science@gmail.com | c69cb70 | 2013-05-22 12:50:52 -0700 | [diff] [blame] | 48 | |
genia.likes.science@gmail.com | b0680b3 | 2013-05-22 16:21:53 -0700 | [diff] [blame] | 49 | var resSet = 0; |
Eugenia Gabrielova | c459e2b | 2013-05-23 02:59:43 +0000 | [diff] [blame] | 50 | var resPattern = /<h4>Results:<\/h4>/g; |
| 51 | var durPattern = /<PRE>Duration/g; |
Madhusudan.C.S | e7bdea6 | 2013-06-02 14:34:30 -0700 | [diff] [blame] | 52 | var errorPattern = /<div class="accordion" id="errorblock">/g; |
Eugenia Gabrielova | c459e2b | 2013-05-23 02:59:43 +0000 | [diff] [blame] | 53 | var resultCount = data.match(resPattern); |
genia.likes.science@gmail.com | c69cb70 | 2013-05-22 12:50:52 -0700 | [diff] [blame] | 54 | |
Madhusudan.C.S | 0ccfc92 | 2013-06-04 01:57:38 -0700 | [diff] [blame] | 55 | if (!resPattern.test(data)) { |
| 56 | if(errorPattern.test(data)) { |
| 57 | $('#output-heading').html('Error'); |
| 58 | $('#output-heading').addClass('error'); |
| 59 | } else { |
| 60 | $('#output-heading').html('Output'); |
| 61 | $('#output-heading').removeClass('error'); |
| 62 | } |
genia.likes.science@gmail.com | b0680b3 | 2013-05-22 16:21:53 -0700 | [diff] [blame] | 63 | $('#output-message').html(data); |
Madhusudan.C.S | e7bdea6 | 2013-06-02 14:34:30 -0700 | [diff] [blame] | 64 | } else { |
| 65 | $('#output-heading').html('Output'); |
| 66 | $('#output-heading').removeClass('error'); |
Eugenia Gabrielova | c459e2b | 2013-05-23 02:59:43 +0000 | [diff] [blame] | 67 | if (resultCount.length <= 1) { |
| 68 | $('#output-message').html(data); |
| 69 | } else { |
| 70 | var splitData = data.split('<PRE>Duration'); |
| 71 | var results = splitData[0].split('<h4>'); |
| 72 | var components = results.slice(1, results.length); |
| 73 | var sections = components.length / resultCount.length; |
Madhusudan.C.S | c82c7ba | 2013-06-02 14:27:00 -0700 | [diff] [blame] | 74 | |
Eugenia Gabrielova | c459e2b | 2013-05-23 02:59:43 +0000 | [diff] [blame] | 75 | for (resSet = 0; resSet < resultCount.length; resSet++) { |
genia.likes.science@gmail.com | b0680b3 | 2013-05-22 16:21:53 -0700 | [diff] [blame] | 76 | |
Eugenia Gabrielova | 7fdb107 | 2013-05-24 03:32:54 +0000 | [diff] [blame] | 77 | $('#output-message').append('<h4>' + components[(resSet+1)*sections - 1]); |
Eugenia Gabrielova | c459e2b | 2013-05-23 02:59:43 +0000 | [diff] [blame] | 78 | |
Eugenia Gabrielova | 7fdb107 | 2013-05-24 03:32:54 +0000 | [diff] [blame] | 79 | if (sections > 1) { |
| 80 | var resNum = resSet + 1; |
| 81 | $('<button/>') |
| 82 | .attr("class", "btn") |
| 83 | .attr("data-toggle", "collapse") |
| 84 | .attr("data-target", "#collapse" + resSet) |
| 85 | .css("margin-bottom", "1em") |
genia.likes.science@gmail.com | 2b90817 | 2013-05-25 03:41:52 -0700 | [diff] [blame] | 86 | .html('Result Plan #' + resNum + '<i id="ibtn' + resSet + '" class="icon-plus extarget"></i>') |
Eugenia Gabrielova | 7fdb107 | 2013-05-24 03:32:54 +0000 | [diff] [blame] | 87 | .appendTo('#output-message'); |
Madhusudan.C.S | c82c7ba | 2013-06-02 14:27:00 -0700 | [diff] [blame] | 88 | |
Eugenia Gabrielova | 7fdb107 | 2013-05-24 03:32:54 +0000 | [diff] [blame] | 89 | $('<div/>') |
| 90 | .attr("id", "collapse" + resSet) |
| 91 | .attr("class", "collapse in") |
| 92 | .appendTo('#output-message'); |
Madhusudan.C.S | c82c7ba | 2013-06-02 14:27:00 -0700 | [diff] [blame] | 93 | |
Eugenia Gabrielova | 7fdb107 | 2013-05-24 03:32:54 +0000 | [diff] [blame] | 94 | for (var c = 0; c < sections - 1; c++) { |
| 95 | var pos = resSet*sections + c; |
| 96 | $('#collapse' + resSet).append('<h4>' + components[pos]); |
| 97 | } |
| 98 | |
genia.likes.science@gmail.com | 2b90817 | 2013-05-25 03:41:52 -0700 | [diff] [blame] | 99 | /* Placeholder for future on show/hide result plan behavior |
Eugenia Gabrielova | 7fdb107 | 2013-05-24 03:32:54 +0000 | [diff] [blame] | 100 | $('#collapse' + resSet).on('show', function() { |
Eugenia Gabrielova | 7fdb107 | 2013-05-24 03:32:54 +0000 | [diff] [blame] | 101 | }).on('hide', function() { |
Eugenia Gabrielova | 7fdb107 | 2013-05-24 03:32:54 +0000 | [diff] [blame] | 102 | }); |
genia.likes.science@gmail.com | 2b90817 | 2013-05-25 03:41:52 -0700 | [diff] [blame] | 103 | */ |
Eugenia Gabrielova | 7fdb107 | 2013-05-24 03:32:54 +0000 | [diff] [blame] | 104 | |
Madhusudan.C.S | c82c7ba | 2013-06-02 14:27:00 -0700 | [diff] [blame] | 105 | $('#output-message').append("<hr/>"); |
Eugenia Gabrielova | 7fdb107 | 2013-05-24 03:32:54 +0000 | [diff] [blame] | 106 | } |
Eugenia Gabrielova | f885fff | 2013-05-23 05:09:48 +0000 | [diff] [blame] | 107 | |
genia.likes.science@gmail.com | b0680b3 | 2013-05-22 16:21:53 -0700 | [diff] [blame] | 108 | } |
Eugenia Gabrielova | c459e2b | 2013-05-23 02:59:43 +0000 | [diff] [blame] | 109 | $('#output-message').append('<PRE>Duration' + splitData[1]); |
genia.likes.science@gmail.com | c69cb70 | 2013-05-22 12:50:52 -0700 | [diff] [blame] | 110 | } |
Eugenia Gabrielova | c459e2b | 2013-05-23 02:59:43 +0000 | [diff] [blame] | 111 | |
genia.likes.science@gmail.com | c69cb70 | 2013-05-22 12:50:52 -0700 | [diff] [blame] | 112 | } |
genia.likes.science@gmail.com | 99f019d | 2013-05-13 04:14:46 -0700 | [diff] [blame] | 113 | |
genia.likes.science@gmail.com | b0680b3 | 2013-05-22 16:21:53 -0700 | [diff] [blame] | 114 | var contentString = data.toString(); |
| 115 | if (contentString.indexOf("<PRE>Duration") !== -1) { |
| 116 | $('<div/>') |
| 117 | .addClass("alert alert-success") |
| 118 | .html("Success: Query Complete") |
| 119 | .appendTo('#output-message'); |
| 120 | } |
| 121 | }); |
| 122 | return false; |
| 123 | }); |
madhusudancs@gmail.com | 99e82c6 | 2013-03-31 00:26:34 +0000 | [diff] [blame] | 124 | }); |
| 125 | </script> |
| 126 | |
| 127 | <meta charset=utf-8 /> |
genia.likes.science@gmail.com | 12946c4 | 2013-05-12 12:12:15 -0700 | [diff] [blame] | 128 | <title>AsterixDB Web Interface</title> |
madhusudancs@gmail.com | 99e82c6 | 2013-03-31 00:26:34 +0000 | [diff] [blame] | 129 | </head> |
| 130 | |
| 131 | <body> |
genia.likes.science@gmail.com | bcd0ea1 | 2013-05-13 01:34:31 -0700 | [diff] [blame] | 132 | <div class="navbar navbar-fixed-top"> |
madhusudancs@gmail.com | 99e82c6 | 2013-03-31 00:26:34 +0000 | [diff] [blame] | 133 | <div class="navbar-inner"> |
| 134 | <div class="container"> |
| 135 | <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> |
| 136 | <span class="icon-bar"></span> |
| 137 | <span class="icon-bar"></span> |
| 138 | <span class="icon-bar"></span> |
| 139 | </a> |
genia.likes.science@gmail.com | bcd0ea1 | 2013-05-13 01:34:31 -0700 | [diff] [blame] | 140 | |
| 141 | <!-- Temporary logo placeholder --> |
genia.likes.science@gmail.com | 766d987 | 2013-05-24 12:57:48 -0700 | [diff] [blame] | 142 | <a class="brand" href="#"><img src="/webui/static/img/finalasterixlogo.png"></a> |
Madhusudan.C.S | c82c7ba | 2013-06-02 14:27:00 -0700 | [diff] [blame] | 143 | |
madhusudancs@gmail.com | 99e82c6 | 2013-03-31 00:26:34 +0000 | [diff] [blame] | 144 | <div class="nav-collapse collapse"> |
| 145 | <ul class="nav"> |
genia.likes.science@gmail.com | 5db8ef2 | 2013-05-24 14:05:55 -0700 | [diff] [blame] | 146 | <li><a href="http://code.google.com/p/asterixdb/" target="_blank"> |
| 147 | Open source<img class="extarget" src="/webui/static/img/targetlink.png"/></a></li> |
| 148 | <li><a href="http://code.google.com/p/asterixdb/issues/list" target="_blank"> |
| 149 | File issues<img class="extarget" src="/webui/static/img/targetlink.png"/></a></li> |
| 150 | <li><a href="https://groups.google.com/forum/?fromgroups#!forum/asterixdb-users" target="_blank"> |
| 151 | Contact<img class="extarget" src="/webui/static/img/targetlink.png"/></a></li> |
madhusudancs@gmail.com | 99e82c6 | 2013-03-31 00:26:34 +0000 | [diff] [blame] | 152 | </ul> |
| 153 | </div><!--/.nav-collapse --> |
| 154 | </div> |
| 155 | </div> |
| 156 | </div> |
| 157 | |
| 158 | <div class="content"> |
| 159 | <div class="container"> |
| 160 | <div class="row-fluid"> |
genia.likes.science@gmail.com | 024749d | 2013-05-20 21:33:08 -0700 | [diff] [blame] | 161 | |
madhusudancs@gmail.com | 99e82c6 | 2013-03-31 00:26:34 +0000 | [diff] [blame] | 162 | <div class="span6"> |
genia.likes.science@gmail.com | 83fb065 | 2013-05-20 22:03:49 -0700 | [diff] [blame] | 163 | |
| 164 | <form id="queryform" class="form-horizontal" method="post"> |
| 165 | <div style="margin-bottom: 1em;"> |
| 166 | <label class="query">Query</label> |
| 167 | <textarea rows="10" id="qry" name="query" class="query" value="%s" placeholder="Type your AQL query ..."></textarea> |
genia.likes.science@gmail.com | 83fb065 | 2013-05-20 22:03:49 -0700 | [diff] [blame] | 168 | </div> |
| 169 | |
Chris Hillery | 833774e | 2015-03-18 23:25:04 -0700 | [diff] [blame] | 170 | <div class="btn-group"> |
| 171 | <button id="checkboxes-on" class="btn"> |
| 172 | <i id="opts" class="icon-ok" style="display:none;"></i>Select Options</button> |
| 173 | <button id="clear-query-button" class="btn">Clear Query</button> |
| 174 | <!-- <button id="checkboxes-off" class="btn">Clear All Options</button> --> |
| 175 | <button type="submit" id="run-btn" class="btn btn-custom-darken">Run</button> |
| 176 | </div> |
genia.likes.science@gmail.com | 024749d | 2013-05-20 21:33:08 -0700 | [diff] [blame] | 177 | |
madhusudancs@gmail.com | 99e82c6 | 2013-03-31 00:26:34 +0000 | [diff] [blame] | 178 | <div> |
Chris Hillery | 833774e | 2015-03-18 23:25:04 -0700 | [diff] [blame] | 179 | <label class="checkbox optlabel"> Output Format:<br/> |
| 180 | <select name="output-format" class="btn"> |
Eldon Carman | 735bc4e | 2015-06-18 19:14:07 -0700 | [diff] [blame] | 181 | <option selected value="ADM">ADM</option> |
Chris Hillery | 833774e | 2015-03-18 23:25:04 -0700 | [diff] [blame] | 182 | <option value="CSV">CSV (no header)</option> |
| 183 | <option value="CSV-Header">CSV (with header)</option> |
Eldon Carman | 735bc4e | 2015-06-18 19:14:07 -0700 | [diff] [blame] | 184 | <option value="JSON">JSON</option> |
Chris Hillery | 833774e | 2015-03-18 23:25:04 -0700 | [diff] [blame] | 185 | </select> |
| 186 | </label> |
genia.likes.science@gmail.com | 2076bee | 2013-06-02 14:21:09 -0700 | [diff] [blame] | 187 | <label class="checkbox optlabel"><input type="checkbox" name="print-expr-tree" value="true" /> Print parsed expressions</label> |
| 188 | <label class="checkbox optlabel"><input type="checkbox" name="print-rewritten-expr-tree" value="true" /> Print rewritten expressions</label> |
| 189 | <label class="checkbox optlabel"><input type="checkbox" name="print-logical-plan" value="true" /> Print logical plan</label> |
| 190 | <label class="checkbox optlabel"><input type="checkbox" name="print-optimized-logical-plan" value="true" /> Print optimized logical plan</label> |
| 191 | <label class="checkbox optlabel"><input type="checkbox" name="print-job" value="true" /> Print Hyracks job</label> |
Till Westmann | 1621766 | 2013-07-09 15:37:42 -0700 | [diff] [blame] | 192 | <label class="checkbox optlabel"><input type="checkbox" name="execute-query" value="true" checked/> Execute query</label> |
madhusudancs@gmail.com | 99e82c6 | 2013-03-31 00:26:34 +0000 | [diff] [blame] | 193 | </div> |
madhusudancs@gmail.com | 99e82c6 | 2013-03-31 00:26:34 +0000 | [diff] [blame] | 194 | </form> |
genia.likes.science@gmail.com | 024749d | 2013-05-20 21:33:08 -0700 | [diff] [blame] | 195 | </div> |
madhusudancs@gmail.com | 99e82c6 | 2013-03-31 00:26:34 +0000 | [diff] [blame] | 196 | |
genia.likes.science@gmail.com | 024749d | 2013-05-20 21:33:08 -0700 | [diff] [blame] | 197 | <div class="span6"> |
madhusudancs@gmail.com | 99e82c6 | 2013-03-31 00:26:34 +0000 | [diff] [blame] | 198 | <div class="output"> |
Madhusudan.C.S | e7bdea6 | 2013-06-02 14:34:30 -0700 | [diff] [blame] | 199 | <label id="output-heading" class="heading">Output</label> |
madhusudancs@gmail.com | 99e82c6 | 2013-03-31 00:26:34 +0000 | [diff] [blame] | 200 | <div id="output-message" class="message"> |
| 201 | </div> |
| 202 | </div> |
| 203 | </div> |
genia.likes.science@gmail.com | 024749d | 2013-05-20 21:33:08 -0700 | [diff] [blame] | 204 | |
madhusudancs@gmail.com | 99e82c6 | 2013-03-31 00:26:34 +0000 | [diff] [blame] | 205 | </div> |
| 206 | </div> |
genia.likes.science@gmail.com | bcd0ea1 | 2013-05-13 01:34:31 -0700 | [diff] [blame] | 207 | </div> |
madhusudancs@gmail.com | 99e82c6 | 2013-03-31 00:26:34 +0000 | [diff] [blame] | 208 | <div class="footer"> |
| 209 | <section class="line"><hr></section> |
| 210 | <section class="content"> |
| 211 | <section class="left"> |
madhusudancs@gmail.com | 99e82c6 | 2013-03-31 00:26:34 +0000 | [diff] [blame] | 212 | </section> |
| 213 | <section class="right"> |
madhusudancs@gmail.com | 99e82c6 | 2013-03-31 00:26:34 +0000 | [diff] [blame] | 214 | </section> |
| 215 | </section> |
| 216 | </div> |
| 217 | </body> |
| 218 | </html> |
| 219 | |