1f141a931SRob Ashcom<div ng-show="qc.validated.valid()" class="wb-wrapper">
20b143fb7SEben Haber
30b143fb7SEben Haber  <mn-element-cargo depot="actions" ng-if="qc.validated.valid()">
40b143fb7SEben Haber    <div class="header-controls">
50b143fb7SEben Haber      <input type="file" id="loadQuery" name="files" style="display:none" accept="text/plain">
6f141a931SRob Ashcom      <a ng-if="qc.fileSupport"
7c580c273SMurtadha Hubail         id="loadQueryButton"
8c580c273SMurtadha Hubail         ng-click="qc.load_query()"
9c580c273SMurtadha Hubail         class="outline"
10c580c273SMurtadha Hubail         onchange="console.log('changed files')">IMPORT</a>
1141619f94SMichael Blow      <a href="" ng-click="qc.unified_save()">EXPORT</a>
120b143fb7SEben Haber    </div>
130b143fb7SEben Haber  </mn-element-cargo>
140b143fb7SEben Haber
15f141a931SRob Ashcom<!-- wrapper for query editor and results -->
16f141a931SRob Ashcom  <div mn-spinner="queryInProgress" class="wb-main-wrapper width-9 resp-small">
17f141a931SRob Ashcom<!-- query editor header, main editor area, and results footer -->
18f141a931SRob Ashcom    <div class="wb-query-editor">
19f141a931SRob Ashcom<!-- Editor "header row" -->
20f141a931SRob Ashcom      <div class="wb-query-editor-header">
21c580c273SMurtadha Hubail        <h4>Analytics Query Editor</h4>
22f141a931SRob Ashcom        <span>
230b143fb7SEben Haber          <button
24d7951fe8SRob Ashcom             title="View previous queries/results" ng-click="qc.prev()"
25d7951fe8SRob Ashcom             qw-long-press="qc.historyMenu"
26d7951fe8SRob Ashcom             class="outline btn-small"
27d7951fe8SRob Ashcom             ng-disabled="!qc.hasPrev()">
280b143fb7SEben Haber            &larr;
290b143fb7SEben Haber          </button>
30f141a931SRob Ashcom          <span class="wb-history-controls-inner">
31f141a931SRob Ashcom            <a ng-click="qc.historyMenu()">history</a>
320b143fb7SEben Haber            <small>({{qc.getCurrentIndex()}})</small>
330b143fb7SEben Haber          </span>
340b143fb7SEben Haber          <button
35d7951fe8SRob Ashcom             title="View subsequent queries/results"
36d7951fe8SRob Ashcom             ng-click="qc.next()"
37d7951fe8SRob Ashcom             qw-long-press="qc.historyMenu"
38d7951fe8SRob Ashcom             class="outline btn-small"
39d7951fe8SRob Ashcom             ng-disabled="!qc.hasNext()">
400b143fb7SEben Haber            &rarr;
410b143fb7SEben Haber          </button>
42f141a931SRob Ashcom        </span>
430b143fb7SEben Haber      </div>
44f141a931SRob Ashcom<!-- Ace editor *********************************************************** -->
45f141a931SRob Ashcom      <div
46f141a931SRob Ashcom         class="wb-ace-editor"
47f141a931SRob Ashcom         ui-ace="qc.aceInputOptions"
48f141a931SRob Ashcom         ng-disabled="qc.executingQuery.busy"
49f141a931SRob Ashcom         ng-model="qc.lastResult.query">{{qc.renderPage()}}
50c580c273SMurtadha Hubail      </div>
510b143fb7SEben Haber
52f141a931SRob Ashcom<!-- wrapper under query editor for button and stats -->
53f141a931SRob Ashcom      <div class="wb-query-editor-footer">
54f141a931SRob Ashcom        <span class="nowrap">
55f141a931SRob Ashcom          <button ng-click="qc.query()" class="wb-button-execute">
56f141a931SRob Ashcom            <div ng-if="!qc.executingQuery.busy">Execute</div>
57f141a931SRob Ashcom            <div ng-if="qc.executingQuery.busy" class="icon-button">
58f141a931SRob Ashcom              Cancel <span class="icon fa-spinner fa-spin fa-pulse"></span>
59f141a931SRob Ashcom            </div>
60f141a931SRob Ashcom          </button>
61f141a931SRob Ashcom          <button ng-disabled="qc.executingQuery.busy" ng-click="qc.query(true)" class="outline tight">
62f141a931SRob Ashcom             Explain
63f141a931SRob Ashcom             <span ng-if="qc.executingQuery.busy" class="icon fa-spinner fa-spin fa-pulse"></span>
64f141a931SRob Ashcom          </button>
65f141a931SRob Ashcom        </span>
660b143fb7SEben Haber
67f141a931SRob Ashcom<!-- query results stats -->
68f141a931SRob Ashcom        <div ng-hide="qc.lastResult.hide" class="wb-result-summary">
69f141a931SRob Ashcom          <span
70f141a931SRob Ashcom             class="wb-result-status"
71f141a931SRob Ashcom             ng-class="{success: qc.status_success(), error: qc.status_fail()}">
72f141a931SRob Ashcom            {{qc.lastResult.status}}
73f141a931SRob Ashcom          </span>
74ae3a8e21SMurtadha Hubail          <span ng-if="!qc.executingQuery.busy">
75ae3a8e21SMurtadha Hubail            <span ng-if="qc.lastResult.elapsedTime"> | elapsed: {{qc.lastResult.elapsedTime}} | </span>
76ae3a8e21SMurtadha Hubail            <span ng-if="qc.lastResult.executionTime">execution: {{qc.lastResult.executionTime}} | </span>
77ae3a8e21SMurtadha Hubail            <span ng-if="qc.lastResult.resultCount">count: {{qc.lastResult.resultCount}} | </span>
78ae3a8e21SMurtadha Hubail            <span ng-if="qc.lastResult.resultSize">size: {{qc.lastResult.resultSize}} | </span>
79ae3a8e21SMurtadha Hubail            <span ng-if="qc.lastResult.processedObjects == 0 || qc.lastResult.processedObjects">processed objects: {{qc.lastResult.processedObjects}}</span>
80ae3a8e21SMurtadha Hubail          </span>
81f141a931SRob Ashcom        </div>
820b143fb7SEben Haber
83f141a931SRob Ashcom<!-- run-time preferences -->
84f141a931SRob Ashcom        <a ng-if="qc.showOptions" ng-click="qc.options()"  class="row resp-hide-xsml">
85f141a931SRob Ashcom          <span class="icon fa-cog margin-right"></span>
86f141a931SRob Ashcom          <span class="text-smaller">preferences</span>
87f141a931SRob Ashcom        </a>
88f141a931SRob Ashcom      </div>
890b143fb7SEben Haber    </div>
900b143fb7SEben Haber
91c580c273SMurtadha Hubail    <!-- query results -->
92f141a931SRob Ashcom    <div class="wb-results-header">
9301bb2eefSEben M Haber      <h4>Analytics Query Results
9401bb2eefSEben M Haber        <a
9501bb2eefSEben M Haber           ng-click="qc.copyResultAsCSV()"
9601bb2eefSEben M Haber           class="margin-left-half"
9701bb2eefSEben M Haber           title="Copy results in tabular format">
9801bb2eefSEben M Haber          <span class="icon fa-copy"></span>
9901bb2eefSEben M Haber        </a>
10001bb2eefSEben M Haber      </h4>
1010b143fb7SEben Haber      <span class="pills">
1020b143fb7SEben Haber        <a ng-click="qc.selectTab(1)"
1030b143fb7SEben Haber           ng-class="{selected: qc.isSelected(1)}">JSON</a>
1040b143fb7SEben Haber        <a ng-click="qc.selectTab(2)"
1050b143fb7SEben Haber           ng-class="{selected: qc.isSelected(2)}">Table</a>
1060b143fb7SEben Haber        <a ng-click="qc.selectTab(3)"
1070b143fb7SEben Haber           ng-class="{selected: qc.isSelected(3)}">Tree</a>
108fbeaf281SMurtadha Hubail        <a ng-click="qc.selectTab(4)" ng-if="qc.isEnterprise"
1090b143fb7SEben Haber           ng-class="{selected: qc.isSelected(4)}">Plan</a>
1100b143fb7SEben Haber        <a ng-click="qc.selectTab(5)"
1110b143fb7SEben Haber           ng-class="{selected: qc.isSelected(5)}">Plan Text</a>
1120b143fb7SEben Haber      </span>
1130b143fb7SEben Haber    </div>
1140b143fb7SEben Haber
115f141a931SRob Ashcom    <div class="wb-results-wrapper">
116f141a931SRob Ashcom      <div class="wb-results-show-anyway" ng-if="!qc.showBigDatasets && qc.dataTooBig()">
117c580c273SMurtadha Hubail        <div ng-bind-html="qc.getBigDataMessage()"></div>
118f141a931SRob Ashcom        <a ng-click="qc.setShowBigData(true)" class="text-medium link-heavy">Show anyway <span class="icon fa-angle-right"></span></a>
1190b143fb7SEben Haber      </div>
120f141a931SRob Ashcom      <div class="wb-results-json" ui-ace="qc.aceOutputOptions"
121c580c273SMurtadha Hubail           ng-if="qc.isSelected(1) && (!qc.dataTooBig() || qc.showBigDatasets)"
122c580c273SMurtadha Hubail           ng-model="qc.lastResult.result"></div>
123f141a931SRob Ashcom
124f141a931SRob Ashcom      <div class="wb-results-table"
125c580c273SMurtadha Hubail           ng-if="qc.isSelected(2) && (!qc.dataTooBig() || qc.showBigDatasets)"
126f645b600SMurtadha Hubail           qw-json-data-table="qc.lastResult.data"></div>
127f141a931SRob Ashcom
128f141a931SRob Ashcom      <div class="wb-results-tree"
129c580c273SMurtadha Hubail           ng-if="qc.isSelected(3) && (!qc.dataTooBig() || qc.showBigDatasets)"
130c580c273SMurtadha Hubail           qw-json-tree="qc.lastResult.data"></div>
131f141a931SRob Ashcom
132fbeaf281SMurtadha Hubail      <div class="wb-results-explain" ng-if="qc.isSelected(4)"
133fbeaf281SMurtadha Hubail           qw-explain-viz-d3="qc.lastResult.explainResult"></div>
134f141a931SRob Ashcom
135f141a931SRob Ashcom      <div class="wb-results-explain-text"
136f141a931SRob Ashcom           ng-if="qc.isSelected(5)"
137c580c273SMurtadha Hubail           ui-ace="qc.acePlanOptions"
138c580c273SMurtadha Hubail           ng-model="qc.lastResult.explainResultText"></div>
1390b143fb7SEben Haber    </div>
1400b143fb7SEben Haber  </div>
1410b143fb7SEben Haber
1426938a1d3SRob Ashcom<!-- datasets  sidebar -->
1432ef66e10SRob Ashcom  <div class="insights-sidebar width-3 show-scrollbar resp-hide-sml">
144f141a931SRob Ashcom    <div class="insights-sidebar-body">
145d7951fe8SRob Ashcom      <div class="row">
1466938a1d3SRob Ashcom        <h4>Datasets</h4>
147d7951fe8SRob Ashcom        <span>
1481a7b11f7SMurtadha Hubail          <a title="Refresh dataset insights"
149f141a931SRob Ashcom             ng-click="qc.updateBuckets()"
150f141a931SRob Ashcom             class="margin-right-half"
151f141a931SRob Ashcom             ng-disabled="qc.qqs.loadingBuckets">
152f141a931SRob Ashcom            <span ng-if="qc.qqs.loadingBuckets" class="icon fa-refresh"></span>
153f141a931SRob Ashcom            <span ng-if="!qc.qqs.loadingBuckets" class="icon fa-refresh"></span>
1540b143fb7SEben Haber          </a>
155d7951fe8SRob Ashcom          <a title="expand or contract sidebar" ng-click="qc.toggleAnalysisSize()">
156f141a931SRob Ashcom            <span ng-if="!qc.analysisExpanded" class="icon fa-expand"></span>
157f141a931SRob Ashcom            <span ng-if="qc.analysisExpanded" class="icon fa-compress"></span>
158f141a931SRob Ashcom          </a>
159f141a931SRob Ashcom        </span>
1600b143fb7SEben Haber      </div>
161f141a931SRob Ashcom
162d7951fe8SRob Ashcom      <div mn-spinner="qc.qqs.loadingBuckets">
163d7951fe8SRob Ashcom        <div ng-if="qc.qqs.bucket_errors">
164d7951fe8SRob Ashcom          <br>
1656938a1d3SRob Ashcom          <p style="white-space:pre-wrap;" class="text-small">{{qc.qqs.bucket_errors}}
166d7951fe8SRob Ashcom          </p>
167d7951fe8SRob Ashcom        </div>
168d7951fe8SRob Ashcom        <div ng-if="!qc.qqs.bucket_errors">
169bb1cab45STill Westmann          <section class="text-small" ng-repeat="dataverse in qc.dataverses">
170bb1cab45STill Westmann            <p class="margin-bottom-0">Dataverse: {{dataverse.DataverseName}}</p>
171bb1cab45STill Westmann       <!-- <div ng-show="dataverse.links.length > 0">
172bb1cab45STill Westmann              <h5 style="line-height:1.4">Links:</h5>
173bb1cab45STill Westmann              <span ng-repeat="link in dataverse.links">
174bb1cab45STill Westmann                <div class="text-small margin-bottom-half indent-1">{{link.Name}}</div>
175bb1cab45STill Westmann              </span>
176bb1cab45STill Westmann            </div> -->
177bb1cab45STill Westmann            <span ng-repeat="shadow in qc.shadows">
178bb1cab45STill Westmann              <div ng-if="shadow.DataverseName === dataverse.DataverseName" ng-init="shadow.expanded = false">
179bb1cab45STill Westmann                <span class="row margin-bottom-0">
180bb1cab45STill Westmann                  <span ng-click="changeExpandShadow(shadow)" class="cursor-pointer">
1816938a1d3SRob Ashcom                    <span
182bb1cab45STill Westmann                       class="icon fa-caret-down fa-fw"
183bb1cab45STill Westmann                       ng-class="{'fa-caret-right': !shadow.expanded}"></span>
184bb1cab45STill Westmann                    <strong>{{shadow.id}}</strong>
185bb1cab45STill Westmann                  </span>
186bb1cab45STill Westmann                  <span
187bb1cab45STill Westmann                     ng-show="shadow.remaining === qc.datasetDisconnectedState"
188bb1cab45STill Westmann                     title="disconnected"
189bb1cab45STill Westmann                     class="icon fa-unlink"
190bb1cab45STill Westmann                     style="color: #e07f82">
191d7951fe8SRob Ashcom                  </span>
192bb1cab45STill Westmann                  <span
193bb1cab45STill Westmann                     ng-show="shadow.remaining > 0 || shadow.remaining == 0"
194bb1cab45STill Westmann                     title="connected"
195bb1cab45STill Westmann                     class="icon fa-link">
196bb1cab45STill Westmann                  </span>
197bb1cab45STill Westmann                </span>
198bb1cab45STill Westmann
199bb1cab45STill Westmann                <div class="margin-bottom-half padding-left-half" ng-show="shadow.expanded">
200bb1cab45STill Westmann                  <p class="margin-bottom-half">Bucket:<br>
201bb1cab45STill Westmann                    {{shadow.LinkName}}.{{shadow.bucketName}} <span ng-show="shadow.filter">|</span> {{shadow.filter}}
202bb1cab45STill Westmann                  </p>
203bb1cab45STill Westmann                  <p
204bb1cab45STill Westmann                     class="margin-bottom-half"
205bb1cab45STill Westmann                     ng-show="shadow.indexes.length > 0">
206bb1cab45STill Westmann                    Index<span ng-show="shadow.indexes.length > 1">es</span>:<br>
2076938a1d3SRob Ashcom                    <span ng-repeat="idx in shadow.indexes">
208bb1cab45STill Westmann                      {{idx.IndexName}} <span ng-repeat="key in idx.keys">({{key}})<br></span>
2096938a1d3SRob Ashcom                    </span>
210bb1cab45STill Westmann                  </p>
2116938a1d3SRob Ashcom                </div>
212bb1cab45STill Westmann                <div
213bb1cab45STill Westmann                   class="margin-bottom-1 padding-left-half"
214bb1cab45STill Westmann                   ng-show="shadow.remaining > 0">
215bb1cab45STill Westmann                  <em class="text-smaller">
216bb1cab45STill Westmann                    remaining mutations: {{shadow.remaining}}
217bb1cab45STill Westmann                  </em>
218bb1cab45STill Westmann                </div>
219bb1cab45STill Westmann              </div>
220d7951fe8SRob Ashcom            </span>
221bb1cab45STill Westmann
222bb1cab45STill Westmann            <span
223bb1cab45STill Westmann               ng-show="shadow.remaining === qc.datasetDisconnectedState"
224bb1cab45STill Westmann               title="disconnected"
225bb1cab45STill Westmann               class="icon fa-unlink"
226bb1cab45STill Westmann               style="color: #e07f82">
227bb1cab45STill Westmann            </span>
228bb1cab45STill Westmann            <span
229bb1cab45STill Westmann               ng-show="shadow.remaining > 0 || shadow.remaining == 0"
230bb1cab45STill Westmann               title="connected"
231bb1cab45STill Westmann               class="icon fa-link">
232bb1cab45STill Westmann            </span>
233bb1cab45STill Westmann
234d7951fe8SRob Ashcom          </section>
2350b143fb7SEben Haber
236d7951fe8SRob Ashcom          <section>
2376938a1d3SRob Ashcom            <h5>Couchbase Buckets</h5>
2386938a1d3SRob Ashcom            <span class="text-small indent-1" ng-repeat="bucket in qc.clusterBuckets">
2396938a1d3SRob Ashcom              {{bucket}}<br>
2406938a1d3SRob Ashcom            </span>
241d7951fe8SRob Ashcom          </section>
242d7951fe8SRob Ashcom        </div>
243c580c273SMurtadha Hubail      </div>
2440b143fb7SEben Haber    </div>
2450b143fb7SEben Haber  </div>
2460b143fb7SEben Haber</div>
247