blob: 40ce1611f2ee26ece0b4a897cee79a614ed8daba [file] [log] [blame]
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +00001<!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.com2e1e54c2013-03-31 02:31:10 +00007<script src="/webui/static/js/jquery.min.js"></script>
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +00008
madhusudancs@gmail.com2e1e54c2013-03-31 02:31:10 +00009<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.com99e82c62013-03-31 00:26:34 +000015
16<script type="text/javascript">
genia.likes.science@gmail.comb0680b32013-05-22 16:21:53 -070017$(document).ready(function() {
genia.likes.science@gmail.com024749d2013-05-20 21:33:08 -070018
genia.likes.science@gmail.com2076bee2013-06-02 14:21:09 -070019 var optionButtonSize = $('#checkboxes-on').width();
20 $('#clear-query-button, #run-btn').width(optionButtonSize);
21
genia.likes.science@gmail.com024749d2013-05-20 21:33:08 -070022 $('#checkboxes-on').click(function() {
genia.likes.science@gmail.com016314e2013-05-25 03:19:07 -070023 /* 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.comb0680b32013-05-22 16:21:53 -070031 return false;
genia.likes.science@gmail.com024749d2013-05-20 21:33:08 -070032 });
33
genia.likes.science@gmail.com83fb0652013-05-20 22:03:49 -070034 $('#clear-query-button').click(function() {
35 $("#qry").val('');
36 return false;
37 });
38
genia.likes.science@gmail.com016314e2013-05-25 03:19:07 -070039 $('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.comb0680b32013-05-22 16:21:53 -070050 $("form#queryform").submit(function() {
51 $('#output-message').html("");
52 $.post("/", $("form#queryform").serialize(), function(data) {
genia.likes.science@gmail.comc69cb702013-05-22 12:50:52 -070053
genia.likes.science@gmail.comb0680b32013-05-22 16:21:53 -070054 var resSet = 0;
Eugenia Gabrielovac459e2b2013-05-23 02:59:43 +000055 var resPattern = /<h4>Results:<\/h4>/g;
56 var durPattern = /<PRE>Duration/g;
Madhusudan.C.Se7bdea62013-06-02 14:34:30 -070057 var errorPattern = /<div class="accordion" id="errorblock">/g;
Eugenia Gabrielovac459e2b2013-05-23 02:59:43 +000058 var resultCount = data.match(resPattern);
genia.likes.science@gmail.comc69cb702013-05-22 12:50:52 -070059
Madhusudan.C.Se7bdea62013-06-02 14:34:30 -070060 if (!resPattern.test(data) && errorPattern.test(data)) {
61 $('#output-heading').html('Error');
62 $('#output-heading').addClass('error');
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
genia.likes.science@gmail.com024749d2013-05-20 21:33:08 -0700170 <div class="btn-group">
genia.likes.science@gmail.com2076bee2013-06-02 14:21:09 -0700171 <button id="checkboxes-on" class="btn">
172 <i id="opts" class="icon-ok" style="display:none;"></i>Select Options</button>
Eugenia Gabrielova02001952013-05-24 02:47:54 +0000173 <button id="clear-query-button" class="btn">Clear Query</button>
genia.likes.science@gmail.com016314e2013-05-25 03:19:07 -0700174 <!-- <button id="checkboxes-off" class="btn">Clear All Options</button> -->
Eugenia Gabrielova1e0d5e82013-05-24 02:37:43 +0000175 <button type="submit" id="run-btn" class="btn btn-custom-darken">Run</button>
genia.likes.science@gmail.com024749d2013-05-20 21:33:08 -0700176 </div>
177
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000178 <div>
genia.likes.science@gmail.com2076bee2013-06-02 14:21:09 -0700179 <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.com99e82c62013-03-31 00:26:34 +0000184 </div>
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000185 </form>
genia.likes.science@gmail.com024749d2013-05-20 21:33:08 -0700186 </div>
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000187
genia.likes.science@gmail.com024749d2013-05-20 21:33:08 -0700188 <div class="span6">
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000189 <div class="output">
Madhusudan.C.Se7bdea62013-06-02 14:34:30 -0700190 <label id="output-heading" class="heading">Output</label>
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000191 <div id="output-message" class="message">
192 </div>
193 </div>
194 </div>
genia.likes.science@gmail.com024749d2013-05-20 21:33:08 -0700195
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000196 </div>
197 </div>
genia.likes.science@gmail.combcd0ea12013-05-13 01:34:31 -0700198</div>
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000199 <div class="footer">
200 <section class="line"><hr></section>
201 <section class="content">
202 <section class="left">
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000203 </section>
204 <section class="right">
205 &copy; Copyright 2013 University of California, Irvine
206 </section>
207 </section>
208 </div>
209</body>
210</html>
211