blob: bcd177c38a4ccdb29ecae03fed19d5ab769bfea7 [file] [log] [blame]
Till Westmannea8ab392013-06-05 15:17:08 -07001<!--
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.com99e82c62013-03-31 00:26:34 +000015<!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.com2e1e54c2013-03-31 02:31:10 +000021<script src="/webui/static/js/jquery.min.js"></script>
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +000022
madhusudancs@gmail.com2e1e54c2013-03-31 02:31:10 +000023<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.com99e82c62013-03-31 00:26:34 +000029
30<script type="text/javascript">
genia.likes.science@gmail.comb0680b32013-05-22 16:21:53 -070031$(document).ready(function() {
genia.likes.science@gmail.com024749d2013-05-20 21:33:08 -070032
genia.likes.science@gmail.com2076bee2013-06-02 14:21:09 -070033 var optionButtonSize = $('#checkboxes-on').width();
34 $('#clear-query-button, #run-btn').width(optionButtonSize);
35
genia.likes.science@gmail.com024749d2013-05-20 21:33:08 -070036 $('#checkboxes-on').click(function() {
genia.likes.science@gmail.com016314e2013-05-25 03:19:07 -070037 /* 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.comb0680b32013-05-22 16:21:53 -070045 return false;
genia.likes.science@gmail.com024749d2013-05-20 21:33:08 -070046 });
47
genia.likes.science@gmail.com83fb0652013-05-20 22:03:49 -070048 $('#clear-query-button').click(function() {
49 $("#qry").val('');
50 return false;
51 });
52
genia.likes.science@gmail.com016314e2013-05-25 03:19:07 -070053 $('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.comb0680b32013-05-22 16:21:53 -070064 $("form#queryform").submit(function() {
65 $('#output-message').html("");
66 $.post("/", $("form#queryform").serialize(), function(data) {
genia.likes.science@gmail.comc69cb702013-05-22 12:50:52 -070067
genia.likes.science@gmail.comb0680b32013-05-22 16:21:53 -070068 var resSet = 0;
Eugenia Gabrielovac459e2b2013-05-23 02:59:43 +000069 var resPattern = /<h4>Results:<\/h4>/g;
70 var durPattern = /<PRE>Duration/g;
Madhusudan.C.Se7bdea62013-06-02 14:34:30 -070071 var errorPattern = /<div class="accordion" id="errorblock">/g;
Eugenia Gabrielovac459e2b2013-05-23 02:59:43 +000072 var resultCount = data.match(resPattern);
genia.likes.science@gmail.comc69cb702013-05-22 12:50:52 -070073
Madhusudan.C.S0ccfc922013-06-04 01:57:38 -070074 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.comb0680b32013-05-22 16:21:53 -070082 $('#output-message').html(data);
Madhusudan.C.Se7bdea62013-06-02 14:34:30 -070083 } else {
84 $('#output-heading').html('Output');
85 $('#output-heading').removeClass('error');
Eugenia Gabrielovac459e2b2013-05-23 02:59:43 +000086 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.Sc82c7ba2013-06-02 14:27:00 -070093
Eugenia Gabrielovac459e2b2013-05-23 02:59:43 +000094 for (resSet = 0; resSet < resultCount.length; resSet++) {
genia.likes.science@gmail.comb0680b32013-05-22 16:21:53 -070095
Eugenia Gabrielova7fdb1072013-05-24 03:32:54 +000096 $('#output-message').append('<h4>' + components[(resSet+1)*sections - 1]);
Eugenia Gabrielovac459e2b2013-05-23 02:59:43 +000097
Eugenia Gabrielova7fdb1072013-05-24 03:32:54 +000098 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.com2b908172013-05-25 03:41:52 -0700105 .html('Result Plan #' + resNum + '<i id="ibtn' + resSet + '" class="icon-plus extarget"></i>')
Eugenia Gabrielova7fdb1072013-05-24 03:32:54 +0000106 .appendTo('#output-message');
Madhusudan.C.Sc82c7ba2013-06-02 14:27:00 -0700107
Eugenia Gabrielova7fdb1072013-05-24 03:32:54 +0000108 $('<div/>')
109 .attr("id", "collapse" + resSet)
110 .attr("class", "collapse in")
111 .appendTo('#output-message');
Madhusudan.C.Sc82c7ba2013-06-02 14:27:00 -0700112
Eugenia Gabrielova7fdb1072013-05-24 03:32:54 +0000113 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.com2b908172013-05-25 03:41:52 -0700118 /* Placeholder for future on show/hide result plan behavior
Eugenia Gabrielova7fdb1072013-05-24 03:32:54 +0000119 $('#collapse' + resSet).on('show', function() {
Eugenia Gabrielova7fdb1072013-05-24 03:32:54 +0000120 }).on('hide', function() {
Eugenia Gabrielova7fdb1072013-05-24 03:32:54 +0000121 });
genia.likes.science@gmail.com2b908172013-05-25 03:41:52 -0700122 */
Eugenia Gabrielova7fdb1072013-05-24 03:32:54 +0000123
Madhusudan.C.Sc82c7ba2013-06-02 14:27:00 -0700124 $('#output-message').append("<hr/>");
Eugenia Gabrielova7fdb1072013-05-24 03:32:54 +0000125 }
Eugenia Gabrielovaf885fff2013-05-23 05:09:48 +0000126
genia.likes.science@gmail.comb0680b32013-05-22 16:21:53 -0700127 }
Eugenia Gabrielovac459e2b2013-05-23 02:59:43 +0000128 $('#output-message').append('<PRE>Duration' + splitData[1]);
genia.likes.science@gmail.comc69cb702013-05-22 12:50:52 -0700129 }
Eugenia Gabrielovac459e2b2013-05-23 02:59:43 +0000130
genia.likes.science@gmail.comc69cb702013-05-22 12:50:52 -0700131 }
genia.likes.science@gmail.com99f019d2013-05-13 04:14:46 -0700132
genia.likes.science@gmail.comb0680b32013-05-22 16:21:53 -0700133 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.com99e82c62013-03-31 00:26:34 +0000143});
144</script>
145
146<meta charset=utf-8 />
genia.likes.science@gmail.com12946c42013-05-12 12:12:15 -0700147<title>AsterixDB Web Interface</title>
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000148</head>
149
150<body>
genia.likes.science@gmail.combcd0ea12013-05-13 01:34:31 -0700151 <div class="navbar navbar-fixed-top">
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000152 <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.combcd0ea12013-05-13 01:34:31 -0700159
160 <!-- Temporary logo placeholder -->
genia.likes.science@gmail.com766d9872013-05-24 12:57:48 -0700161 <a class="brand" href="#"><img src="/webui/static/img/finalasterixlogo.png"></a>
Madhusudan.C.Sc82c7ba2013-06-02 14:27:00 -0700162
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000163 <div class="nav-collapse collapse">
164 <ul class="nav">
genia.likes.science@gmail.com5db8ef22013-05-24 14:05:55 -0700165 <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.com99e82c62013-03-31 00:26:34 +0000171 </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.com024749d2013-05-20 21:33:08 -0700180
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000181 <div class="span6">
genia.likes.science@gmail.com83fb0652013-05-20 22:03:49 -0700182
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.com83fb0652013-05-20 22:03:49 -0700187 </div>
188
Chris Hillery833774e2015-03-18 23:25:04 -0700189 <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.com024749d2013-05-20 21:33:08 -0700196
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000197 <div>
Chris Hillery833774e2015-03-18 23:25:04 -0700198 <label class="checkbox optlabel"> Output Format:<br/>
199 <select name="output-format" class="btn">
200 <option selected value="JSON">JSON</option>
201 <option value="ADM">ADM</option>
202 <option value="CSV">CSV (no header)</option>
203 <option value="CSV-Header">CSV (with header)</option>
204 </select>
205 </label>
genia.likes.science@gmail.com2076bee2013-06-02 14:21:09 -0700206 <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 Westmann16217662013-07-09 15:37:42 -0700211 <label class="checkbox optlabel"><input type="checkbox" name="execute-query" value="true" checked/> Execute query</label>
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000212 </div>
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000213 </form>
genia.likes.science@gmail.com024749d2013-05-20 21:33:08 -0700214 </div>
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000215
genia.likes.science@gmail.com024749d2013-05-20 21:33:08 -0700216 <div class="span6">
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000217 <div class="output">
Madhusudan.C.Se7bdea62013-06-02 14:34:30 -0700218 <label id="output-heading" class="heading">Output</label>
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000219 <div id="output-message" class="message">
220 </div>
221 </div>
222 </div>
genia.likes.science@gmail.com024749d2013-05-20 21:33:08 -0700223
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000224 </div>
225 </div>
genia.likes.science@gmail.combcd0ea12013-05-13 01:34:31 -0700226</div>
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000227 <div class="footer">
228 <section class="line"><hr></section>
229 <section class="content">
230 <section class="left">
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000231 </section>
232 <section class="right">
233 &copy; Copyright 2013 University of California, Irvine
234 </section>
235 </section>
236 </div>
237</body>
238</html>
239