update
This commit is contained in:
21
src/App.vue
21
src/App.vue
@@ -19,7 +19,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
type: {},
|
||||
type: null,
|
||||
window: {}
|
||||
}
|
||||
},
|
||||
@@ -38,13 +38,15 @@ export default {
|
||||
this.updateRoute()
|
||||
},
|
||||
updateRoute() {
|
||||
this.$router.push({
|
||||
name: 'view',
|
||||
params: {
|
||||
type: this.type,
|
||||
window: this.window.label ? this.window.label.replace(' ', '-') : undefined
|
||||
}
|
||||
})
|
||||
if (this.type) {
|
||||
this.$router.push({
|
||||
name: 'view',
|
||||
params: {
|
||||
type: this.type,
|
||||
window: this.window.label ? this.window.label.replace(' ', '-') : undefined
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -53,7 +55,8 @@ export default {
|
||||
#app {
|
||||
height: 100%;
|
||||
}
|
||||
#app, .section {
|
||||
#app,
|
||||
.section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-grow: 1;
|
||||
|
||||
@@ -31,7 +31,7 @@ export default {
|
||||
try {
|
||||
const [start, end] = [this.window.getStart(), this.window.getEnd()]
|
||||
const sample = Math.round(((end - start) / 60) / 288) || 1
|
||||
const host = 'http://localhost:3000'
|
||||
const host = process.env.NODE_ENV === 'development' ? 'http://localhost:3000' : ''
|
||||
const fetchUrl = `${host}/type/${this.type}/startDate/${start}/endDate/${end}/sample/${sample}`
|
||||
const response = await fetch(fetchUrl)
|
||||
this.data = await response.json()
|
||||
|
||||
Reference in New Issue
Block a user