blob: ee491228a21e1e9681e638b7a79b5b9798350ea5 [file] [log] [blame]
Till Westmannea8ab392013-06-05 15:17:08 -07001<!--
Ian Maxon928bbd12015-09-14 17:12:48 -07002 ! 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 Westmannea8ab392013-06-05 15:17:08 -070018 !-->
genia.likes.science@gmail.com016314e2013-05-25 03:19:07 -070019 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.comb0680b32013-05-22 16:21:53 -070026 return false;
genia.likes.science@gmail.com024749d2013-05-20 21:33:08 -070027 });
28
genia.likes.science@gmail.com83fb0652013-05-20 22:03:49 -070029 $('#clear-query-button').click(function() {
30 $("#qry").val('');
31 return false;
32 });
33
genia.likes.science@gmail.com016314e2013-05-25 03:19:07 -070034 $('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.comb0680b32013-05-22 16:21:53 -070045 $("form#queryform").submit(function() {
46 $('#output-message').html("");
47 $.post("/", $("form#queryform").serialize(), function(data) {
genia.likes.science@gmail.comc69cb702013-05-22 12:50:52 -070048
genia.likes.science@gmail.comb0680b32013-05-22 16:21:53 -070049 var resSet = 0;
Eugenia Gabrielovac459e2b2013-05-23 02:59:43 +000050 var resPattern = /<h4>Results:<\/h4>/g;
51 var durPattern = /<PRE>Duration/g;
Madhusudan.C.Se7bdea62013-06-02 14:34:30 -070052 var errorPattern = /<div class="accordion" id="errorblock">/g;
Eugenia Gabrielovac459e2b2013-05-23 02:59:43 +000053 var resultCount = data.match(resPattern);
genia.likes.science@gmail.comc69cb702013-05-22 12:50:52 -070054
Madhusudan.C.S0ccfc922013-06-04 01:57:38 -070055 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.comb0680b32013-05-22 16:21:53 -070063 $('#output-message').html(data);
Madhusudan.C.Se7bdea62013-06-02 14:34:30 -070064 } else {
65 $('#output-heading').html('Output');
66 $('#output-heading').removeClass('error');
Eugenia Gabrielovac459e2b2013-05-23 02:59:43 +000067 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.Sc82c7ba2013-06-02 14:27:00 -070074
Eugenia Gabrielovac459e2b2013-05-23 02:59:43 +000075 for (resSet = 0; resSet < resultCount.length; resSet++) {
genia.likes.science@gmail.comb0680b32013-05-22 16:21:53 -070076
Eugenia Gabrielova7fdb1072013-05-24 03:32:54 +000077 $('#output-message').append('<h4>' + components[(resSet+1)*sections - 1]);
Eugenia Gabrielovac459e2b2013-05-23 02:59:43 +000078
Eugenia Gabrielova7fdb1072013-05-24 03:32:54 +000079 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.com2b908172013-05-25 03:41:52 -070086 .html('Result Plan #' + resNum + '<i id="ibtn' + resSet + '" class="icon-plus extarget"></i>')
Eugenia Gabrielova7fdb1072013-05-24 03:32:54 +000087 .appendTo('#output-message');
Madhusudan.C.Sc82c7ba2013-06-02 14:27:00 -070088
Eugenia Gabrielova7fdb1072013-05-24 03:32:54 +000089 $('<div/>')
90 .attr("id", "collapse" + resSet)
91 .attr("class", "collapse in")
92 .appendTo('#output-message');
Madhusudan.C.Sc82c7ba2013-06-02 14:27:00 -070093
Eugenia Gabrielova7fdb1072013-05-24 03:32:54 +000094 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.com2b908172013-05-25 03:41:52 -070099 /* Placeholder for future on show/hide result plan behavior
Eugenia Gabrielova7fdb1072013-05-24 03:32:54 +0000100 $('#collapse' + resSet).on('show', function() {
Eugenia Gabrielova7fdb1072013-05-24 03:32:54 +0000101 }).on('hide', function() {
Eugenia Gabrielova7fdb1072013-05-24 03:32:54 +0000102 });
genia.likes.science@gmail.com2b908172013-05-25 03:41:52 -0700103 */
Eugenia Gabrielova7fdb1072013-05-24 03:32:54 +0000104
Madhusudan.C.Sc82c7ba2013-06-02 14:27:00 -0700105 $('#output-message').append("<hr/>");
Eugenia Gabrielova7fdb1072013-05-24 03:32:54 +0000106 }
Eugenia Gabrielovaf885fff2013-05-23 05:09:48 +0000107
genia.likes.science@gmail.comb0680b32013-05-22 16:21:53 -0700108 }
Eugenia Gabrielovac459e2b2013-05-23 02:59:43 +0000109 $('#output-message').append('<PRE>Duration' + splitData[1]);
genia.likes.science@gmail.comc69cb702013-05-22 12:50:52 -0700110 }
Eugenia Gabrielovac459e2b2013-05-23 02:59:43 +0000111
genia.likes.science@gmail.comc69cb702013-05-22 12:50:52 -0700112 }
genia.likes.science@gmail.com99f019d2013-05-13 04:14:46 -0700113
genia.likes.science@gmail.comb0680b32013-05-22 16:21:53 -0700114 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.com99e82c62013-03-31 00:26:34 +0000124});
125</script>
126
127<meta charset=utf-8 />
genia.likes.science@gmail.com12946c42013-05-12 12:12:15 -0700128<title>AsterixDB Web Interface</title>
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000129</head>
130
131<body>
genia.likes.science@gmail.combcd0ea12013-05-13 01:34:31 -0700132 <div class="navbar navbar-fixed-top">
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000133 <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.combcd0ea12013-05-13 01:34:31 -0700140
141 <!-- Temporary logo placeholder -->
genia.likes.science@gmail.com766d9872013-05-24 12:57:48 -0700142 <a class="brand" href="#"><img src="/webui/static/img/finalasterixlogo.png"></a>
Madhusudan.C.Sc82c7ba2013-06-02 14:27:00 -0700143
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000144 <div class="nav-collapse collapse">
145 <ul class="nav">
genia.likes.science@gmail.com5db8ef22013-05-24 14:05:55 -0700146 <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.com99e82c62013-03-31 00:26:34 +0000152 </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.com024749d2013-05-20 21:33:08 -0700161
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000162 <div class="span6">
genia.likes.science@gmail.com83fb0652013-05-20 22:03:49 -0700163
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.com83fb0652013-05-20 22:03:49 -0700168 </div>
169
Chris Hillery833774e2015-03-18 23:25:04 -0700170 <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.com024749d2013-05-20 21:33:08 -0700177
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000178 <div>
Chris Hillery833774e2015-03-18 23:25:04 -0700179 <label class="checkbox optlabel"> Output Format:<br/>
180 <select name="output-format" class="btn">
Eldon Carman735bc4e2015-06-18 19:14:07 -0700181 <option selected value="ADM">ADM</option>
Chris Hillery833774e2015-03-18 23:25:04 -0700182 <option value="CSV">CSV (no header)</option>
183 <option value="CSV-Header">CSV (with header)</option>
Eldon Carman735bc4e2015-06-18 19:14:07 -0700184 <option value="JSON">JSON</option>
Chris Hillery833774e2015-03-18 23:25:04 -0700185 </select>
186 </label>
genia.likes.science@gmail.com2076bee2013-06-02 14:21:09 -0700187 <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 Westmann16217662013-07-09 15:37:42 -0700192 <label class="checkbox optlabel"><input type="checkbox" name="execute-query" value="true" checked/> Execute query</label>
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000193 </div>
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000194 </form>
genia.likes.science@gmail.com024749d2013-05-20 21:33:08 -0700195 </div>
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000196
genia.likes.science@gmail.com024749d2013-05-20 21:33:08 -0700197 <div class="span6">
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000198 <div class="output">
Madhusudan.C.Se7bdea62013-06-02 14:34:30 -0700199 <label id="output-heading" class="heading">Output</label>
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000200 <div id="output-message" class="message">
201 </div>
202 </div>
203 </div>
genia.likes.science@gmail.com024749d2013-05-20 21:33:08 -0700204
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000205 </div>
206 </div>
genia.likes.science@gmail.combcd0ea12013-05-13 01:34:31 -0700207</div>
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000208 <div class="footer">
209 <section class="line"><hr></section>
210 <section class="content">
211 <section class="left">
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000212 </section>
213 <section class="right">
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000214 </section>
215 </section>
216 </div>
217</body>
218</html>
219