madhusudancs@gmail.com | 99e82c6 | 2013-03-31 00:26:34 +0000 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <meta name="description" content="ASTERIX WEB PAGE" /> |
| 5 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 6 | <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] | 7 | <script src="/webui/static/js/jquery.min.js"></script> |
madhusudancs@gmail.com | 99e82c6 | 2013-03-31 00:26:34 +0000 | [diff] [blame] | 8 | |
madhusudancs@gmail.com | 2e1e54c | 2013-03-31 02:31:10 +0000 | [diff] [blame] | 9 | <link href="/webui/static/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> |
| 10 | <link href="/webui/static/css/bootstrap-responsive.min.css" rel="stylesheet" type="text/css" /> |
| 11 | |
| 12 | <script src="/webui/static/js/bootstrap.min.js"></script> |
| 13 | |
| 14 | <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] | 15 | |
| 16 | <script type="text/javascript"> |
genia.likes.science@gmail.com | b0680b3 | 2013-05-22 16:21:53 -0700 | [diff] [blame] | 17 | $(document).ready(function() { |
genia.likes.science@gmail.com | 024749d | 2013-05-20 21:33:08 -0700 | [diff] [blame] | 18 | |
genia.likes.science@gmail.com | 2076bee | 2013-06-02 14:21:09 -0700 | [diff] [blame] | 19 | var optionButtonSize = $('#checkboxes-on').width(); |
| 20 | $('#clear-query-button, #run-btn').width(optionButtonSize); |
| 21 | |
genia.likes.science@gmail.com | 024749d | 2013-05-20 21:33:08 -0700 | [diff] [blame] | 22 | $('#checkboxes-on').click(function() { |
genia.likes.science@gmail.com | 016314e | 2013-05-25 03:19:07 -0700 | [diff] [blame] | 23 | /* Displays a checkmark to indicate selection/clearing */ |
| 24 | if ($('#opts').is(":visible")) { |
| 25 | $('#opts').hide(); |
| 26 | $('#queryform :input').prop('checked', false); |
| 27 | } else { |
| 28 | $('#opts').show(); |
| 29 | $('#queryform :input').prop('checked', true); |
| 30 | } |
genia.likes.science@gmail.com | b0680b3 | 2013-05-22 16:21:53 -0700 | [diff] [blame] | 31 | return false; |
genia.likes.science@gmail.com | 024749d | 2013-05-20 21:33:08 -0700 | [diff] [blame] | 32 | }); |
| 33 | |
genia.likes.science@gmail.com | 83fb065 | 2013-05-20 22:03:49 -0700 | [diff] [blame] | 34 | $('#clear-query-button').click(function() { |
| 35 | $("#qry").val(''); |
| 36 | return false; |
| 37 | }); |
| 38 | |
genia.likes.science@gmail.com | 016314e | 2013-05-25 03:19:07 -0700 | [diff] [blame] | 39 | $('form#queryform :input').click( function () { |
| 40 | /* Hides selection check on uncheck, shows when all 5 selected */ |
| 41 | if ($(this).val()) { |
| 42 | if ($(this).is(':checked') && $('input[type=checkbox]').filter(':checked').length == 5) { |
| 43 | $('#opts').show(); |
| 44 | } else { |
| 45 | $('#opts').hide(); |
| 46 | } |
| 47 | } |
| 48 | }); |
| 49 | |
genia.likes.science@gmail.com | b0680b3 | 2013-05-22 16:21:53 -0700 | [diff] [blame] | 50 | $("form#queryform").submit(function() { |
| 51 | $('#output-message').html(""); |
| 52 | $.post("/", $("form#queryform").serialize(), function(data) { |
genia.likes.science@gmail.com | c69cb70 | 2013-05-22 12:50:52 -0700 | [diff] [blame] | 53 | |
genia.likes.science@gmail.com | b0680b3 | 2013-05-22 16:21:53 -0700 | [diff] [blame] | 54 | var resSet = 0; |
Eugenia Gabrielova | c459e2b | 2013-05-23 02:59:43 +0000 | [diff] [blame] | 55 | var resPattern = /<h4>Results:<\/h4>/g; |
| 56 | var durPattern = /<PRE>Duration/g; |
Madhusudan.C.S | e7bdea6 | 2013-06-02 14:34:30 -0700 | [diff] [blame] | 57 | var errorPattern = /<div class="accordion" id="errorblock">/g; |
Eugenia Gabrielova | c459e2b | 2013-05-23 02:59:43 +0000 | [diff] [blame] | 58 | var resultCount = data.match(resPattern); |
genia.likes.science@gmail.com | c69cb70 | 2013-05-22 12:50:52 -0700 | [diff] [blame] | 59 | |
Madhusudan.C.S | e7bdea6 | 2013-06-02 14:34:30 -0700 | [diff] [blame] | 60 | if (!resPattern.test(data) && errorPattern.test(data)) { |
| 61 | $('#output-heading').html('Error'); |
| 62 | $('#output-heading').addClass('error'); |
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 | |
genia.likes.science@gmail.com | 024749d | 2013-05-20 21:33:08 -0700 | [diff] [blame] | 170 | <div class="btn-group"> |
genia.likes.science@gmail.com | 2076bee | 2013-06-02 14:21:09 -0700 | [diff] [blame] | 171 | <button id="checkboxes-on" class="btn"> |
| 172 | <i id="opts" class="icon-ok" style="display:none;"></i>Select Options</button> |
Eugenia Gabrielova | 0200195 | 2013-05-24 02:47:54 +0000 | [diff] [blame] | 173 | <button id="clear-query-button" class="btn">Clear Query</button> |
genia.likes.science@gmail.com | 016314e | 2013-05-25 03:19:07 -0700 | [diff] [blame] | 174 | <!-- <button id="checkboxes-off" class="btn">Clear All Options</button> --> |
Eugenia Gabrielova | 1e0d5e8 | 2013-05-24 02:37:43 +0000 | [diff] [blame] | 175 | <button type="submit" id="run-btn" class="btn btn-custom-darken">Run</button> |
genia.likes.science@gmail.com | 024749d | 2013-05-20 21:33:08 -0700 | [diff] [blame] | 176 | </div> |
| 177 | |
madhusudancs@gmail.com | 99e82c6 | 2013-03-31 00:26:34 +0000 | [diff] [blame] | 178 | <div> |
genia.likes.science@gmail.com | 2076bee | 2013-06-02 14:21:09 -0700 | [diff] [blame] | 179 | <label class="checkbox optlabel"><input type="checkbox" name="print-expr-tree" value="true" /> Print parsed expressions</label> |
| 180 | <label class="checkbox optlabel"><input type="checkbox" name="print-rewritten-expr-tree" value="true" /> Print rewritten expressions</label> |
| 181 | <label class="checkbox optlabel"><input type="checkbox" name="print-logical-plan" value="true" /> Print logical plan</label> |
| 182 | <label class="checkbox optlabel"><input type="checkbox" name="print-optimized-logical-plan" value="true" /> Print optimized logical plan</label> |
| 183 | <label class="checkbox optlabel"><input type="checkbox" name="print-job" value="true" /> Print Hyracks job</label> |
madhusudancs@gmail.com | 99e82c6 | 2013-03-31 00:26:34 +0000 | [diff] [blame] | 184 | </div> |
madhusudancs@gmail.com | 99e82c6 | 2013-03-31 00:26:34 +0000 | [diff] [blame] | 185 | </form> |
genia.likes.science@gmail.com | 024749d | 2013-05-20 21:33:08 -0700 | [diff] [blame] | 186 | </div> |
madhusudancs@gmail.com | 99e82c6 | 2013-03-31 00:26:34 +0000 | [diff] [blame] | 187 | |
genia.likes.science@gmail.com | 024749d | 2013-05-20 21:33:08 -0700 | [diff] [blame] | 188 | <div class="span6"> |
madhusudancs@gmail.com | 99e82c6 | 2013-03-31 00:26:34 +0000 | [diff] [blame] | 189 | <div class="output"> |
Madhusudan.C.S | e7bdea6 | 2013-06-02 14:34:30 -0700 | [diff] [blame] | 190 | <label id="output-heading" class="heading">Output</label> |
madhusudancs@gmail.com | 99e82c6 | 2013-03-31 00:26:34 +0000 | [diff] [blame] | 191 | <div id="output-message" class="message"> |
| 192 | </div> |
| 193 | </div> |
| 194 | </div> |
genia.likes.science@gmail.com | 024749d | 2013-05-20 21:33:08 -0700 | [diff] [blame] | 195 | |
madhusudancs@gmail.com | 99e82c6 | 2013-03-31 00:26:34 +0000 | [diff] [blame] | 196 | </div> |
| 197 | </div> |
genia.likes.science@gmail.com | bcd0ea1 | 2013-05-13 01:34:31 -0700 | [diff] [blame] | 198 | </div> |
madhusudancs@gmail.com | 99e82c6 | 2013-03-31 00:26:34 +0000 | [diff] [blame] | 199 | <div class="footer"> |
| 200 | <section class="line"><hr></section> |
| 201 | <section class="content"> |
| 202 | <section class="left"> |
madhusudancs@gmail.com | 99e82c6 | 2013-03-31 00:26:34 +0000 | [diff] [blame] | 203 | </section> |
| 204 | <section class="right"> |
| 205 | © Copyright 2013 University of California, Irvine |
| 206 | </section> |
| 207 | </section> |
| 208 | </div> |
| 209 | </body> |
| 210 | </html> |
| 211 | |