show waiting game
This commit is contained in:
@@ -31,20 +31,6 @@ Vue.component('search-bar-query', {
|
|||||||
data.searchBar.proposals = [];
|
data.searchBar.proposals = [];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
document.onkeydown = function(evt) {
|
|
||||||
evt = evt || window.event;
|
|
||||||
var isEscape = false;
|
|
||||||
if ("key" in evt) {
|
|
||||||
isEscape = (evt.key == "Escape" || evt.key == "Esc");
|
|
||||||
} else {
|
|
||||||
isEscape = (evt.keyCode == 27);
|
|
||||||
}
|
|
||||||
if (isEscape) {
|
|
||||||
data.searchBar.proposals = [];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
},
|
},
|
||||||
data: function() {
|
data: function() {
|
||||||
return {
|
return {
|
||||||
@@ -56,7 +42,6 @@ Vue.component('search-bar-query', {
|
|||||||
if (event.key == 'ArrowDown' || event.key == 'ArrowUp' || event.key == 'Enter' || event.key == 'Escape'){
|
if (event.key == 'ArrowDown' || event.key == 'ArrowUp' || event.key == 'Enter' || event.key == 'Escape'){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log(event);
|
|
||||||
|
|
||||||
this.autocomplete(this, event);
|
this.autocomplete(this, event);
|
||||||
},
|
},
|
||||||
@@ -111,8 +96,6 @@ Vue.component('search-bar-query', {
|
|||||||
data.searchBar.query = proposal.newQuery;
|
data.searchBar.query = proposal.newQuery;
|
||||||
data.searchBar.proposals = [];
|
data.searchBar.proposals = [];
|
||||||
|
|
||||||
console.log(proposal.newCaretPosition);
|
|
||||||
|
|
||||||
Vue.nextTick(function () {
|
Vue.nextTick(function () {
|
||||||
var el = document.getElementById('search-input');
|
var el = document.getElementById('search-input');
|
||||||
el.select();
|
el.select();
|
||||||
@@ -143,7 +126,7 @@ Vue.component('search-bar-query', {
|
|||||||
@keyup="onChange"
|
@keyup="onChange"
|
||||||
@keyup.down.up="selectUpDown"
|
@keyup.down.up="selectUpDown"
|
||||||
@keydown.enter="selectOrSubmit"
|
@keydown.enter="selectOrSubmit"
|
||||||
@keyup.esc="showProposals = false"
|
@keyup.esc="searchBar.proposals = []"
|
||||||
@keyup.enter="noop"
|
@keyup.enter="noop"
|
||||||
@keydown.prevent.arrowUp.arrowDown="noop"
|
@keydown.prevent.arrowUp.arrowDown="noop"
|
||||||
@focus="onChange"
|
@focus="onChange"
|
||||||
@@ -215,10 +198,15 @@ Vue.component('result-view', {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
showPrevNext: function() {
|
||||||
|
return data.searchBar.splitBy.values.length > 0 && data.resultView.imageUrl;
|
||||||
|
}
|
||||||
|
},
|
||||||
template: `
|
template: `
|
||||||
<div id="result">
|
<div id="result">
|
||||||
<div id="prev_image" v-show="searchBar.splitBy.field" v-on:click="prev_image" title="Previous Plot"><i class="fa fa-angle-double-left" aria-hidden="true"></i></div>
|
<div id="prev_image" v-show="showPrevNext" v-on:click="prev_image" title="Previous Plot"><i class="fa fa-angle-double-left" aria-hidden="true"></i></div>
|
||||||
<div id="next_image" v-show="searchBar.splitBy.field" v-on:click="next_image" title="Next Plot"><i class="fa fa-angle-double-right" aria-hidden="true"></i></div>
|
<div id="next_image" v-show="showPrevNext" v-on:click="next_image" title="Next Plot"><i class="fa fa-angle-double-right" aria-hidden="true"></i></div>
|
||||||
<div id="result-image"><img v-bind:src="resultView.imageUrl" v-if="resultView.imageUrl"/></div>
|
<div id="result-image"><img v-bind:src="resultView.imageUrl" v-if="resultView.imageUrl"/></div>
|
||||||
<div id="result-error-message" v-if="resultView.errorMessage">{{ resultView.errorMessage }}</div>
|
<div id="result-error-message" v-if="resultView.errorMessage">{{ resultView.errorMessage }}</div>
|
||||||
</div>`
|
</div>`
|
||||||
@@ -601,12 +589,14 @@ var rootView = new Vue({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
initInvaders('result-image');
|
||||||
|
|
||||||
|
} // end window.on-load
|
||||||
|
|
||||||
var data = {
|
var data = {
|
||||||
|
|
||||||
searchBar: {
|
searchBar: {
|
||||||
query: 'pod=vapf and method = ViewService.findFieldViewGroup',
|
query: 'pod=vapfinra01 and method = ViewService.findFieldViewGroup',
|
||||||
proposals: [],
|
proposals: [],
|
||||||
groupByKeys: [],
|
groupByKeys: [],
|
||||||
splitByKeys: {
|
splitByKeys: {
|
||||||
@@ -617,7 +607,7 @@ var data = {
|
|||||||
'selected': 'NO_LIMIT',
|
'selected': 'NO_LIMIT',
|
||||||
'number': 10
|
'number': 10
|
||||||
},
|
},
|
||||||
dateFrom: '2018-01-05 09:03:00', //Date.now().add({ days: -7 }).toString("yyyy-MM-dd HH:mm:ss"),
|
dateFrom: Date.now().add({ days: -7 }).toString("yyyy-MM-dd HH:mm:ss"), // '2018-01-05 09:03:00'
|
||||||
dateRange: '1 week',
|
dateRange: '1 week',
|
||||||
axisScale: 'LOG10',
|
axisScale: 'LOG10',
|
||||||
plotType: 'SCATTER',
|
plotType: 'SCATTER',
|
||||||
@@ -643,10 +633,17 @@ var data = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
function showLoadingIcon()
|
||||||
|
{
|
||||||
|
data.resultView.imageUrl = '';
|
||||||
|
data.resultView.errorMessage = '';
|
||||||
|
|
||||||
|
startInvaders();
|
||||||
|
}
|
||||||
|
|
||||||
function plotCurrent()
|
function plotCurrent()
|
||||||
{
|
{
|
||||||
//showLoadingIcon();
|
showLoadingIcon();
|
||||||
|
|
||||||
if (data.searchBar.splitBy['field']) {
|
if (data.searchBar.splitBy['field']) {
|
||||||
var query = createQuery();
|
var query = createQuery();
|
||||||
@@ -700,6 +697,7 @@ function sendPlotRequest(query){
|
|||||||
var success = function(response){
|
var success = function(response){
|
||||||
data.resultView.imageUrl = response.imageUrl;
|
data.resultView.imageUrl = response.imageUrl;
|
||||||
data.resultView.errorMessage = '';
|
data.resultView.errorMessage = '';
|
||||||
|
pauseInvaders();
|
||||||
};
|
};
|
||||||
var error = function(e) {
|
var error = function(e) {
|
||||||
data.resultView.imageUrl = '';
|
data.resultView.imageUrl = '';
|
||||||
@@ -712,10 +710,10 @@ function sendPlotRequest(query){
|
|||||||
else{
|
else{
|
||||||
data.resultView.errorMessage = "FAILED: " + JSON.parse(e.responseText).message;
|
data.resultView.errorMessage = "FAILED: " + JSON.parse(e.responseText).message;
|
||||||
}
|
}
|
||||||
|
pauseInvaders();
|
||||||
};
|
};
|
||||||
|
|
||||||
postJson("plots", request, success, error);
|
postJson("plots", request, success, error);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -729,7 +727,6 @@ function postJson(url, requestData, successCallback, errorCallback) {
|
|||||||
})
|
})
|
||||||
.done(successCallback)
|
.done(successCallback)
|
||||||
.fail(errorCallback)
|
.fail(errorCallback)
|
||||||
//.always(pauseInvaders)
|
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user