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