blob: 8cc8d2973d915775dbc588f122fa6a03d119f9ce [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
19 $('#checkboxes-on').click(function() {
genia.likes.science@gmail.com016314e2013-05-25 03:19:07 -070020 /* Displays a checkmark to indicate selection/clearing */
21 if ($('#opts').is(":visible")) {
22 $('#opts').hide();
23 $('#queryform :input').prop('checked', false);
24 } else {
25 $('#opts').show();
26 $('#queryform :input').prop('checked', true);
27 }
genia.likes.science@gmail.comb0680b32013-05-22 16:21:53 -070028 return false;
genia.likes.science@gmail.com024749d2013-05-20 21:33:08 -070029 });
30
genia.likes.science@gmail.com83fb0652013-05-20 22:03:49 -070031 $('#clear-query-button').click(function() {
32 $("#qry").val('');
33 return false;
34 });
35
genia.likes.science@gmail.com016314e2013-05-25 03:19:07 -070036 $('form#queryform :input').click( function () {
37 /* Hides selection check on uncheck, shows when all 5 selected */
38 if ($(this).val()) {
39 if ($(this).is(':checked') && $('input[type=checkbox]').filter(':checked').length == 5) {
40 $('#opts').show();
41 } else {
42 $('#opts').hide();
43 }
44 }
45 });
46
genia.likes.science@gmail.comb0680b32013-05-22 16:21:53 -070047 $("form#queryform").submit(function() {
48 $('#output-message').html("");
49 $.post("/", $("form#queryform").serialize(), function(data) {
genia.likes.science@gmail.comc69cb702013-05-22 12:50:52 -070050
genia.likes.science@gmail.comb0680b32013-05-22 16:21:53 -070051 var resSet = 0;
Eugenia Gabrielovac459e2b2013-05-23 02:59:43 +000052 var resPattern = /<h4>Results:<\/h4>/g;
53 var durPattern = /<PRE>Duration/g;
Madhusudan.C.Se7bdea62013-06-02 14:34:30 -070054 var errorPattern = /<div class="accordion" id="errorblock">/g;
Eugenia Gabrielovac459e2b2013-05-23 02:59:43 +000055 var resultCount = data.match(resPattern);
genia.likes.science@gmail.comc69cb702013-05-22 12:50:52 -070056
Madhusudan.C.Se7bdea62013-06-02 14:34:30 -070057 if (!resPattern.test(data) && errorPattern.test(data)) {
58 $('#output-heading').html('Error');
59 $('#output-heading').addClass('error');
genia.likes.science@gmail.comb0680b32013-05-22 16:21:53 -070060 $('#output-message').html(data);
Madhusudan.C.Se7bdea62013-06-02 14:34:30 -070061 } else {
62 $('#output-heading').html('Output');
63 $('#output-heading').removeClass('error');
Eugenia Gabrielovac459e2b2013-05-23 02:59:43 +000064 if (resultCount.length <= 1) {
65 $('#output-message').html(data);
66 } else {
67 var splitData = data.split('<PRE>Duration');
68 var results = splitData[0].split('<h4>');
69 var components = results.slice(1, results.length);
70 var sections = components.length / resultCount.length;
Madhusudan.C.Sc82c7ba2013-06-02 14:27:00 -070071
Eugenia Gabrielovac459e2b2013-05-23 02:59:43 +000072 for (resSet = 0; resSet < resultCount.length; resSet++) {
genia.likes.science@gmail.comb0680b32013-05-22 16:21:53 -070073
Eugenia Gabrielova7fdb1072013-05-24 03:32:54 +000074 $('#output-message').append('<h4>' + components[(resSet+1)*sections - 1]);
Eugenia Gabrielovac459e2b2013-05-23 02:59:43 +000075
Eugenia Gabrielova7fdb1072013-05-24 03:32:54 +000076 if (sections > 1) {
77 var resNum = resSet + 1;
78 $('<button/>')
79 .attr("class", "btn")
80 .attr("data-toggle", "collapse")
81 .attr("data-target", "#collapse" + resSet)
82 .css("margin-bottom", "1em")
genia.likes.science@gmail.com2b908172013-05-25 03:41:52 -070083 .html('Result Plan #' + resNum + '<i id="ibtn' + resSet + '" class="icon-plus extarget"></i>')
Eugenia Gabrielova7fdb1072013-05-24 03:32:54 +000084 .appendTo('#output-message');
Madhusudan.C.Sc82c7ba2013-06-02 14:27:00 -070085
Eugenia Gabrielova7fdb1072013-05-24 03:32:54 +000086 $('<div/>')
87 .attr("id", "collapse" + resSet)
88 .attr("class", "collapse in")
89 .appendTo('#output-message');
Madhusudan.C.Sc82c7ba2013-06-02 14:27:00 -070090
Eugenia Gabrielova7fdb1072013-05-24 03:32:54 +000091 for (var c = 0; c < sections - 1; c++) {
92 var pos = resSet*sections + c;
93 $('#collapse' + resSet).append('<h4>' + components[pos]);
94 }
95
genia.likes.science@gmail.com2b908172013-05-25 03:41:52 -070096 /* Placeholder for future on show/hide result plan behavior
Eugenia Gabrielova7fdb1072013-05-24 03:32:54 +000097 $('#collapse' + resSet).on('show', function() {
Eugenia Gabrielova7fdb1072013-05-24 03:32:54 +000098 }).on('hide', function() {
Eugenia Gabrielova7fdb1072013-05-24 03:32:54 +000099 });
genia.likes.science@gmail.com2b908172013-05-25 03:41:52 -0700100 */
Eugenia Gabrielova7fdb1072013-05-24 03:32:54 +0000101
Madhusudan.C.Sc82c7ba2013-06-02 14:27:00 -0700102 $('#output-message').append("<hr/>");
Eugenia Gabrielova7fdb1072013-05-24 03:32:54 +0000103 }
Eugenia Gabrielovaf885fff2013-05-23 05:09:48 +0000104
genia.likes.science@gmail.comb0680b32013-05-22 16:21:53 -0700105 }
Eugenia Gabrielovac459e2b2013-05-23 02:59:43 +0000106 $('#output-message').append('<PRE>Duration' + splitData[1]);
genia.likes.science@gmail.comc69cb702013-05-22 12:50:52 -0700107 }
Eugenia Gabrielovac459e2b2013-05-23 02:59:43 +0000108
genia.likes.science@gmail.comc69cb702013-05-22 12:50:52 -0700109 }
genia.likes.science@gmail.com99f019d2013-05-13 04:14:46 -0700110
genia.likes.science@gmail.comb0680b32013-05-22 16:21:53 -0700111 var contentString = data.toString();
112 if (contentString.indexOf("<PRE>Duration") !== -1) {
113 $('<div/>')
114 .addClass("alert alert-success")
115 .html("Success: Query Complete")
116 .appendTo('#output-message');
117 }
118 });
119 return false;
120 });
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000121});
122</script>
123
124<meta charset=utf-8 />
genia.likes.science@gmail.com12946c42013-05-12 12:12:15 -0700125<title>AsterixDB Web Interface</title>
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000126</head>
127
128<body>
genia.likes.science@gmail.combcd0ea12013-05-13 01:34:31 -0700129 <div class="navbar navbar-fixed-top">
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000130 <div class="navbar-inner">
131 <div class="container">
132 <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
133 <span class="icon-bar"></span>
134 <span class="icon-bar"></span>
135 <span class="icon-bar"></span>
136 </a>
genia.likes.science@gmail.combcd0ea12013-05-13 01:34:31 -0700137
138 <!-- Temporary logo placeholder -->
genia.likes.science@gmail.com766d9872013-05-24 12:57:48 -0700139 <a class="brand" href="#"><img src="/webui/static/img/finalasterixlogo.png"></a>
Madhusudan.C.Sc82c7ba2013-06-02 14:27:00 -0700140
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000141 <div class="nav-collapse collapse">
142 <ul class="nav">
genia.likes.science@gmail.com5db8ef22013-05-24 14:05:55 -0700143 <li><a href="http://code.google.com/p/asterixdb/" target="_blank">
144 Open source<img class="extarget" src="/webui/static/img/targetlink.png"/></a></li>
145 <li><a href="http://code.google.com/p/asterixdb/issues/list" target="_blank">
146 File issues<img class="extarget" src="/webui/static/img/targetlink.png"/></a></li>
147 <li><a href="https://groups.google.com/forum/?fromgroups#!forum/asterixdb-users" target="_blank">
148 Contact<img class="extarget" src="/webui/static/img/targetlink.png"/></a></li>
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000149 </ul>
150 </div><!--/.nav-collapse -->
151 </div>
152 </div>
153 </div>
154
155 <div class="content">
156 <div class="container">
157 <div class="row-fluid">
genia.likes.science@gmail.com024749d2013-05-20 21:33:08 -0700158
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000159 <div class="span6">
genia.likes.science@gmail.com83fb0652013-05-20 22:03:49 -0700160
161 <form id="queryform" class="form-horizontal" method="post">
162 <div style="margin-bottom: 1em;">
163 <label class="query">Query</label>
164 <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 -0700165 </div>
166
genia.likes.science@gmail.com024749d2013-05-20 21:33:08 -0700167 <div class="btn-group">
genia.likes.science@gmail.com016314e2013-05-25 03:19:07 -0700168 <button id="checkboxes-on" class="btn"><i id="opts" class="icon-ok" ></i>Select Options</button>
Eugenia Gabrielova02001952013-05-24 02:47:54 +0000169 <button id="clear-query-button" class="btn">Clear Query</button>
genia.likes.science@gmail.com016314e2013-05-25 03:19:07 -0700170 <!-- <button id="checkboxes-off" class="btn">Clear All Options</button> -->
Eugenia Gabrielova1e0d5e82013-05-24 02:37:43 +0000171 <button type="submit" id="run-btn" class="btn btn-custom-darken">Run</button>
genia.likes.science@gmail.com024749d2013-05-20 21:33:08 -0700172 </div>
173
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000174 <div>
genia.likes.science@gmail.com016314e2013-05-25 03:19:07 -0700175 <label class="checkbox optlabel"><input type="checkbox" checked="checked" name="print-expr-tree" value="true" /> Print parsed expressions</label>
176 <label class="checkbox optlabel"><input type="checkbox" checked="checked" name="print-rewritten-expr-tree" value="true" /> Print rewritten expressions</label>
177 <label class="checkbox optlabel"><input type="checkbox" checked="checked" name="print-logical-plan" value="true" /> Print logical plan</label>
178 <label class="checkbox optlabel"><input type="checkbox" checked="checked" name="print-optimized-logical-plan" value="true" /> Print optimized logical plan</label>
179 <label class="checkbox optlabel"><input type="checkbox" checked="checked" name="print-job" value="true" /> Print Hyracks job</label>
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000180 </div>
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000181 </form>
genia.likes.science@gmail.com024749d2013-05-20 21:33:08 -0700182 </div>
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000183
genia.likes.science@gmail.com024749d2013-05-20 21:33:08 -0700184 <div class="span6">
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000185 <div class="output">
Madhusudan.C.Se7bdea62013-06-02 14:34:30 -0700186 <label id="output-heading" class="heading">Output</label>
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000187 <div id="output-message" class="message">
188 </div>
189 </div>
190 </div>
genia.likes.science@gmail.com024749d2013-05-20 21:33:08 -0700191
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000192 </div>
193 </div>
genia.likes.science@gmail.combcd0ea12013-05-13 01:34:31 -0700194</div>
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000195 <div class="footer">
196 <section class="line"><hr></section>
197 <section class="content">
198 <section class="left">
madhusudancs@gmail.com99e82c62013-03-31 00:26:34 +0000199 </section>
200 <section class="right">
201 &copy; Copyright 2013 University of California, Irvine
202 </section>
203 </section>
204 </div>
205</body>
206</html>
207