From 87a2f3dfe208a0339fa234e86e8ecdac93fdc1bc Mon Sep 17 00:00:00 2001 From: Javier Date: Fri, 8 Feb 2019 16:06:26 -0300 Subject: [PATCH 01/27] URL per object and dates in search fixed --- src/components/results/objectDetailsModal.vue | 13 +++++++-- src/components/results/tabData.vue | 17 +++++++---- src/components/search/dateOptions.vue | 19 +++++++------ src/router.js | 11 +++++++- src/store/modules/results.js | 8 +++++- src/store/modules/search.js | 28 ++++++++++++++++++- 6 files changed, 76 insertions(+), 20 deletions(-) diff --git a/src/components/results/objectDetailsModal.vue b/src/components/results/objectDetailsModal.vue index 410e0f18..5aa48ffa 100644 --- a/src/components/results/objectDetailsModal.vue +++ b/src/components/results/objectDetailsModal.vue @@ -5,7 +5,9 @@ v-on:hidden="$emit('modalClosed')" v-model="showModal" lazy="lazy" - > + no-close-on-backdrop> +
+
@@ -104,7 +106,8 @@
- Close + + Close
@@ -114,7 +117,7 @@ import lightCurve from "./lightCurve.vue"; import aladin from './aladin.vue'; export default { name: "object-details-modal", - props: ["show"], + props: ["id", "show"], data() { return { lazy: true, @@ -157,6 +160,10 @@ export default { var date = new Date(Date.UTC(year, month, day, hour, minute, second)); return date.toISOString().slice(0,10).replace("-","/").replace("-","/") + " - " + date.toTimeString().slice(0,8); }, + closeModal: function() { + this.$emit('modalClosed'); + this.$router.replace("/"); + } }, computed: { title(){ diff --git a/src/components/results/tabData.vue b/src/components/results/tabData.vue index 43a92878..a051fe67 100644 --- a/src/components/results/tabData.vue +++ b/src/components/results/tabData.vue @@ -171,7 +171,6 @@ import objectDetailsModal from "./objectDetailsModal"; export default { name: "tabData", components: { downloadModal, columnOptionsModal, objectDetailsModal }, - data() { return { showObjectDetailsModal: false, @@ -187,13 +186,19 @@ export default { onRowClicked(item) { this.showObjectDetailsModal = true; this.$store.dispatch('objectSelected', item); + this.$router.push({ name: 'object-details-modal', params: { id: item.oid } }); }, + getUrlObject() { + if(this.$route.params.id) { + this.$store.dispatch('objectSelectedFromURL', {oid: this.$route.params.id}); + this.showObjectDetailsModal = true; + //this.$store.state.search.query_status = 200; + } + }, + }, + mounted: function() { + this.getUrlObject(); }, - /*computed: { - items(){ - return this.$store.state.search.objects.slice((this.currentPage - 1) * this.pageSize, (this.currentPage -1) * this.pageSize + this.pageSize) - } - }*/ }; diff --git a/src/components/search/dateOptions.vue b/src/components/search/dateOptions.vue index 2f68c293..0adf5214 100644 --- a/src/components/search/dateOptions.vue +++ b/src/components/search/dateOptions.vue @@ -169,12 +169,12 @@ value: this.jdToGregorian(value) }) } - else { + //else { this.$store.dispatch('updateFlag', { flag: "flagFirst", value: false }) - } + //} } }, lastjd: { @@ -198,12 +198,12 @@ value: this.jdToGregorian(value) }) } - else { + //else { this.$store.dispatch('updateFlag', { flag: "flagLast", value: false }) - } + //} } }, firstGreg: { @@ -211,7 +211,9 @@ return this.$store.state.search.dates.firstGreg }, set(value){ + console.log("Greg 1") if(! this.$store.state.search.flagFirst){ + console.log("Greg 2") this.$store.dispatch('updateFlag', { flag: "flagFirst", value: true @@ -227,12 +229,13 @@ value: this.gregorianToJd(value) }) } - else { + //else { + console.log("Greg 3") this.$store.dispatch('updateFlag', { flag: "flagFirst", value: false }) - } + //} } }, lastGreg: { @@ -256,12 +259,12 @@ value: this.gregorianToJd(value) }) } - else { + //else { this.$store.dispatch('updateFlag', { flag: "flagLast", value: false }) - } + //} } }, deltamin: { diff --git a/src/router.js b/src/router.js index ea6eca29..5ca8456d 100644 --- a/src/router.js +++ b/src/router.js @@ -4,6 +4,7 @@ import AboutUs from './views/AboutUs.vue' import ExploreData from "./views/ExploreData.vue" import HowTo from './views/HowTo.vue' import UserAccount from './views/UserAccount.vue' +import ObjectModal from './components/results/objectDetailsModal.vue' Vue.use(Router); @@ -14,7 +15,15 @@ export default new Router({ routes: [{ path: '/', name: 'exploreData', - component: ExploreData + component: ExploreData, + children: [ + { + path: 'object/:id', + component: ObjectModal, + name: 'object-details-modal', + props: true, + } + ] }, { diff --git a/src/store/modules/results.js b/src/store/modules/results.js index d9a94d14..a2437579 100644 --- a/src/store/modules/results.js +++ b/src/store/modules/results.js @@ -1,6 +1,6 @@ export const state = { selectedObject: { - oid: null + oid: null, }, objectDetails: { object_details: null, @@ -51,6 +51,12 @@ export const actions = { dispatch('queryAlerts', object); } }, + objectSelectedFromURL({commit, dispatch, state}, object){ + if(state.selectedObject.oid !== object.oid){ + commit('SET_SELECTED_OBJECT', object); + dispatch('queryAlertsFromURL', object); + } + }, setObjectDetails({commit}, details){ commit('SET_OBJECT_DETAILS', details.result); } diff --git a/src/store/modules/search.js b/src/store/modules/search.js index b18936d9..4963c7e4 100644 --- a/src/store/modules/search.js +++ b/src/store/modules/search.js @@ -82,7 +82,7 @@ export const actions = { QueryService.checkQueryStatus(taskId).then(response => { if (response.data.status === "SUCCESS") { clearInterval(state.interval); - //commit('SET_QUERY_STATUS', 200); + commit('SET_QUERY_STATUS', 200); dispatch('getResults',taskId); } else if (response.data.status === "TIMEDOUT"){ @@ -136,6 +136,32 @@ export const actions = { dispatch('loading', false); }) }, + queryAlertsFromURL({commit, dispatch}, object){ + dispatch('loading', true); + QueryService.executeObjectQuery(object.oid).then( response => { + let taskId = response.data["task-id"] + state.interval = setInterval(() => { + QueryService.checkQueryStatus(taskId).then(response => { + if (response.data.status === "SUCCESS") { + clearInterval(state.interval); + commit('SET_QUERY_STATUS', 200); + dispatch('getObjectDetails', taskId); + } + else if (response.data.status === "TIMEDOUT") { + clearInterval(state.interval); + commit('SET_QUERY_STATUS', 504); + dispatch('loading', false); + } + }).catch(error => { + commit('SET_ERROR', error); + dispatch('loading', false); + }) + }, 500); + }).catch(error => { + commit('SET_ERROR', error); + dispatch('loading', false); + }) + }, getObjectDetails({commit, dispatch}, taskId){ QueryService.getResult(taskId).then( response => { dispatch('setObjectDetails', response.data); From 9e8ea3fbc1cb57c9a51a691ccf5c45acc33dee07 Mon Sep 17 00:00:00 2001 From: Javier Date: Tue, 12 Feb 2019 16:46:37 -0300 Subject: [PATCH 02/27] Download service done (works). --- src/components/results/downloadModal.vue | 107 +++++------------------ src/store/modules/search.js | 47 ++++++++++ 2 files changed, 71 insertions(+), 83 deletions(-) diff --git a/src/components/results/downloadModal.vue b/src/components/results/downloadModal.vue index fd43e39c..d3baf460 100644 --- a/src/components/results/downloadModal.vue +++ b/src/components/results/downloadModal.vue @@ -7,7 +7,10 @@
- Download + Download + +
+

{{ startDownload }}

@@ -16,7 +19,7 @@ diff --git a/src/store/modules/search.js b/src/store/modules/search.js index b18936d9..efc27b82 100644 --- a/src/store/modules/search.js +++ b/src/store/modules/search.js @@ -12,6 +12,7 @@ export const state = { flagLast: false, query_status: 0, error: null, + file: null } export const mutations = { @@ -54,6 +55,10 @@ export const mutations = { SET_ERROR(state, error){ state.error = error; }, + SET_FILE(state, file){ + console.log(file); + state.file = file; + }, CLEAR_QUERY(state){ state.filters = { } state.dates = { } @@ -150,6 +155,48 @@ export const actions = { }, clearQuery({commit}){ commit('CLEAR_QUERY'); + }, + getFile({commit, dispatch},taskId){ + QueryService.getResult(taskId).then(result => { + commit('SET_QUERY_STATUS', result.status); + commit('SET_FILE', result.data.result); + }).catch(error => { + commit('SET_ERROR', error); + }) + }, + downloadFile({commit, dispatch, state}, format){ + let query_parameters = { + filters: state.filters, + } + if(!$.isEmptyObject(state.bands)){ + query_parameters.bands = state.bands; + } + if(!$.isEmptyObject(state.dates)){ + query_parameters.dates = state.dates; + } + if(!$.isEmptyObject(state.dates)){ + query_parameters.dates = state.dates; + } + QueryService.executeDownloadQuery(query_parameters, format).then( response => { + let taskId = response.data["task-id"]; + console.log(taskId) + state.interval = setInterval(() => { + QueryService.checkQueryStatus(taskId).then(response => { + if (response.data.status === "SUCCESS") { + clearInterval(state.interval); + commit('SET_QUERY_STATUS', 200); + dispatch('getFile',taskId); + } + else if (response.data.status === "TIMEDOUT") { + clearInterval(state.interval); + } + }).catch(error => { + commit('SET_ERROR', error); + }) + }, 500); + }).catch(error => { + commit('SET_ERROR', error); + }) } } From 2f34b3065ed95a98836bdc396ec85f2c76487c85 Mon Sep 17 00:00:00 2001 From: Javier Date: Tue, 12 Feb 2019 18:05:47 -0300 Subject: [PATCH 03/27] Datas of light curve fixed. (NA values) --- src/components/results/lightCurve.vue | 41 +++++++++++++-------------- src/services/QueryService.js | 2 +- 2 files changed, 20 insertions(+), 23 deletions(-) diff --git a/src/components/results/lightCurve.vue b/src/components/results/lightCurve.vue index 7509e253..14b9cb14 100644 --- a/src/components/results/lightCurve.vue +++ b/src/components/results/lightCurve.vue @@ -123,7 +123,6 @@ export default { { name: "g magnitude", value: "gmag", - // linkedTo: 'rmag', type: "scatter", color: "#22d100", data: [], @@ -142,29 +141,27 @@ export default { methods: { processLightCurveData: function(alerts) { - /*this.chartOptions.series.forEach(element => { - element.data = []; - });*/ - alerts.forEach(dataItem => { - this.chartOptions.series.find(item => item.name === 'r magnitude').data.push([dataItem.jd, dataItem.magr]); - this.chartOptions.series.find(item => item.name === 'g magnitude').data.push([dataItem.jd, dataItem.magg]); - let magg_error = [null, null]; - if (dataItem.magg != null) { - magg_error = [dataItem.jd, dataItem.magg - dataItem.rmsg, dataItem.magg + dataItem.rmsg]; + var rband = []; + var gband = []; + var rbandError = []; + var gbandError = []; + alerts.forEach(function(item) + { + if(item.magg) + { + gband.push([item.jd, item.magg]); + gbandError.push([item.jd, item.magg - item.rmsg, item.magg + item.rmsg]); } - this.chartOptions.series.find(item => item.name === 'g magnitude error').data.push(magg_error); - - let magr_error = [null, null]; - if (dataItem.magr) { - magr_error = [dataItem.jd, dataItem.magr - dataItem.rmsr, dataItem.magr + dataItem.rmsr]; + else if(item.magr) + { + rband.push([item.jd, item.magr]); + rbandError.push([item.jd, item.magr - item.rmsr, item.magr + item.rmsr]); } - this.chartOptions.series.find(item => item.name === 'r magnitude error').data.push(magr_error); - }); - let firstData = this.$store.state.results.objectDetails.alerts.map(function(x){return x.jd;})[0] - this.chartOptions.series[0].pointStart = firstData; - this.chartOptions.series[1].pointStart = firstData; - this.chartOptions.series[2].pointStart = firstData; - this.chartOptions.series[3].pointStart = firstData; + }) + this.chartOptions.series[0].data = rband; + this.chartOptions.series[1].data = rbandError; + this.chartOptions.series[2].data = gband; + this.chartOptions.series[3].data = gbandError; }, }, computed: { diff --git a/src/services/QueryService.js b/src/services/QueryService.js index e2611d26..6ff69ea8 100644 --- a/src/services/QueryService.js +++ b/src/services/QueryService.js @@ -1,7 +1,7 @@ import axios from 'axios' const apiClient = axios.create({ - baseURL: "http://52.91.72.134:8084/v2", + baseURL: "http://3.94.236.52:8084/v2", withCredentials: false, headers: { Accept: "application/json", From 59e166d9a10715321494417e0c3a75f40dd8f0fa Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 12 Feb 2019 21:14:21 +0000 Subject: [PATCH 04/27] scatter point size fixed: from 0.1 to 1.0 --- src/components/results/scatter.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/results/scatter.vue b/src/components/results/scatter.vue index 33c8bda4..a9f70659 100644 --- a/src/components/results/scatter.vue +++ b/src/components/results/scatter.vue @@ -48,7 +48,7 @@ color: '#3C347E', data: [[1,2]], marker: { - radius: 0.1 + radius: 1 }, tooltip: { followPointer: false, @@ -80,4 +80,4 @@ } } } - \ No newline at end of file + From dedf1b35dc403d60506d892151680af08d3bbcbe Mon Sep 17 00:00:00 2001 From: Javier Date: Tue, 12 Feb 2019 19:00:02 -0300 Subject: [PATCH 05/27] Aesthetic changes --- src/components/results/downloadModal.vue | 18 ++++++++++-------- src/store/modules/search.js | 12 +++++------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/components/results/downloadModal.vue b/src/components/results/downloadModal.vue index d3baf460..4b0b1a38 100644 --- a/src/components/results/downloadModal.vue +++ b/src/components/results/downloadModal.vue @@ -1,5 +1,5 @@ diff --git a/src/components/search/dateOptions.vue b/src/components/search/dateOptions.vue index 0adf5214..0a787883 100644 --- a/src/components/search/dateOptions.vue +++ b/src/components/search/dateOptions.vue @@ -169,12 +169,10 @@ value: this.jdToGregorian(value) }) } - //else { - this.$store.dispatch('updateFlag', { - flag: "flagFirst", - value: false - }) - //} + this.$store.dispatch('updateFlag', { + flag: "flagFirst", + value: false + }) } }, lastjd: { @@ -198,12 +196,10 @@ value: this.jdToGregorian(value) }) } - //else { - this.$store.dispatch('updateFlag', { - flag: "flagLast", - value: false - }) - //} + this.$store.dispatch('updateFlag', { + flag: "flagLast", + value: false + }) } }, firstGreg: { @@ -229,13 +225,10 @@ value: this.gregorianToJd(value) }) } - //else { - console.log("Greg 3") - this.$store.dispatch('updateFlag', { - flag: "flagFirst", - value: false - }) - //} + this.$store.dispatch('updateFlag', { + flag: "flagFirst", + value: false + }) } }, lastGreg: { From 8f16d5c9ef942c5560f289528cf8d54ead46c126 Mon Sep 17 00:00:00 2001 From: Javier Date: Wed, 13 Feb 2019 13:43:41 -0300 Subject: [PATCH 09/27] Components of search has been compacted --- src/components/search/advancedOptions.vue | 3 +- src/components/search/coordinateOptions.vue | 72 +++++++- src/components/search/dateOptions.vue | 176 +++++++++----------- src/components/search/defaultOptions.vue | 29 +++- src/components/search/magnitudeOptions.vue | 24 ++- src/components/search/searchOptions.vue | 64 ++++--- src/components/search/tabBand.vue | 23 ++- 7 files changed, 228 insertions(+), 163 deletions(-) diff --git a/src/components/search/advancedOptions.vue b/src/components/search/advancedOptions.vue index 5250c1cc..204a21f0 100644 --- a/src/components/search/advancedOptions.vue +++ b/src/components/search/advancedOptions.vue @@ -1,8 +1,7 @@ diff --git a/src/components/search/coordinateOptions.vue b/src/components/search/coordinateOptions.vue index b03b9aa5..dafb6ea1 100644 --- a/src/components/search/coordinateOptions.vue +++ b/src/components/search/coordinateOptions.vue @@ -1,7 +1,70 @@ + + \ No newline at end of file diff --git a/src/components/search/searchOptions.vue b/src/components/search/searchOptions.vue index e54698d7..43a76d70 100644 --- a/src/components/search/searchOptions.vue +++ b/src/components/search/searchOptions.vue @@ -2,49 +2,45 @@

- + +
- - -

Search Options

-
-
+

Search Options

+ - - - Clear all options - + + Clear all options +
- + - - - - - {{ moreOptsLabel }} - + + + {{ moreOptsLabel }} + + + +
+ - - - - - - - +
diff --git a/src/components/search/tabBand.vue b/src/components/search/tabBand.vue index 541a20bb..00b5e224 100644 --- a/src/components/search/tabBand.vue +++ b/src/components/search/tabBand.vue @@ -1,11 +1,12 @@