Skip to content

Commit

Permalink
Added json bar
Browse files Browse the repository at this point in the history
  • Loading branch information
jlpereira committed Sep 16, 2019
1 parent fe208be commit 12d8376
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 4 deletions.
Expand Up @@ -3,6 +3,14 @@
<div class="flex-separate middle">
<h1>Filter collecting events</h1>
<ul class="context-menu">
<li>
<label>
<input
type="checkbox"
v-model="jsonBar">
Show JSON Request
</label>
</li>
<li>
<label>
<input
Expand Down Expand Up @@ -51,12 +59,16 @@
</li>
</ul>
</div>
<header-bar
v-if="jsonBar"
:jsonUrl="jsonUrl"/>
<collecting-event
ref="ce"
:show-result-map="showMap"
:show-result-list="showList"
:show-filter="showFilter"
:append="append"
@jsonUrl="jsonUrl = $event"
@itemid="selectedItem=$event"
/>
</div>
Expand All @@ -65,10 +77,12 @@
import GetMacKey from 'helpers/getMacKey.js'
import CollectingEvent from './components/collectingEvent.vue'
import HeaderBar from './components/headerBar'
export default {
components: {
CollectingEvent,
HeaderBar
},
computed: {
getMacKey() {
Expand All @@ -80,7 +94,9 @@
append: false,
showMap: false,
showList: true,
showFilter: true
showFilter: true,
jsonBar: false,
jsonUrl: ''
}
},
methods: {
Expand Down
Expand Up @@ -73,6 +73,7 @@
};
this.$http.get('/collecting_events.json', { params: params }).then(response => {
this.collectingEventList = response.body;
this.$emit('jsonUrl', response.url)
if (this.collectingEventList) {
this.$emit('collectingEventList', this.collectingEventList)
}
Expand Down
Expand Up @@ -63,6 +63,7 @@
let shapeText = this.shapes[this.shapes.length - 1];
let params = {shape: shapeText}; // take only last shape pro tem
this.$http.get('/collecting_events.json', {params: params}).then(response => {
this.$emit('jsonUrl', response.url)
this.collectingEventList = response.body
this.$emit('collectingEventList', this.collectingEventList);
this.isLoading = false;
Expand Down
Expand Up @@ -179,6 +179,7 @@
this.isLoading = true;
this.$http.get('/collecting_events.json', { params: params }).then(response => {
this.collectingEventList = response.body;
this.$emit('jsonUrl', response.url)
if(this.collectingEventList) {
this.$emit('collectingEventList', this.collectingEventList)
}
Expand Down
Expand Up @@ -145,6 +145,7 @@
};
this.$http.get('/collecting_events.json', {params: params}).then(response => {
this.collectingEventList = response.body;
this.$emit('jsonUrl', response.url)
if (this.collectingEventList) {
this.$emit('collectingEventList', this.collectingEventList)
}
Expand All @@ -158,6 +159,7 @@
let params = {shape: shapeText}; // take only last shape pro tem
this.$http.get('/collecting_events.json', {params: params}).then(response => {
let foundEvents = response.body;
this.$emit('jsonUrl', response.url)
if(foundEvents.length > 0) {this.collectingEventList = foundEvents;}
this.$emit('collectingEventList', this.collectingEventList);
this.isLoading = false;
Expand Down
Expand Up @@ -77,6 +77,7 @@
this.isLoading = true;
this.$http.get('/collecting_events', { params: params }).then(response => {
this.collectingEventList = response.body;
this.$emit('jsonUrl', response.url)
if(this.collectingEventList) {
this.$emit('collectingEventList', this.collectingEventList);
}
Expand Down
Expand Up @@ -16,20 +16,27 @@
/>
<template>
<div v-if="view === TABS.attribute">
<ce-filter @collectingEventList="compileList($event)" />
<ce-filter
@jsonUrl="$emit('jsonUrl', $event)"
@collectingEventList="compileList($event)" />
</div>
<div v-else-if="view === TABS.namedAreaSearch">
<ce-by-area @collectingEventList="compileList($event)" />
<ce-by-area
@jsonUrl="$emit('jsonUrl', $event)"
@collectingEventList="compileList($event)" />
</div>
<div v-else-if="view === TABS.drawAreaSearch">
<ce-by-shape
@jsonUrl="$emit('jsonUrl', $event)"
@collectingEventList="compileList($event)"
@searchShape="addSearchShape"
ref="cebyshape"
/>
</div>
<div v-else-if="view === TABS.tag">
<ce-tag @collectingEventList="compileList($event)" />
<ce-tag
@jsonUrl="$emit('jsonUrl', $event)"
@collectingEventList="compileList($event)" />
</div>
<smart-list
v-if="!Object.values(TABS).includes(view)"
Expand Down
@@ -0,0 +1,22 @@
<template>
<div class="panel content separate-bottom">
<div class="flex-separate middle">
<span>
JSON Request: {{ jsonUrl }}
</span>
</div>
</div>
</template>

<script>
export default {
props: {
jsonUrl: {
type: String,
default: ''
}
}
}
</script>

0 comments on commit 12d8376

Please sign in to comment.