add weather reload button for dev

pull/1/head
Thomas Ballmann 4 years ago
parent 54ed1b27fd
commit f4eae5a164

@ -145,4 +145,14 @@ export default {
.get('/stats')
.then(response => cb(response.data))
},
/**
* @param cb
* @returns {PromiseLike<any> | Promise<any>}
*/
updateWeather(cb) {
return axios
.get('/api/update?weather=1')
.then(response => cb(response.data))
},
}

@ -1,28 +1,30 @@
<template>
<v-container
fluid
grid-list-md
pa-2
>
<v-card
class="mx-auto my-12"
max-width="400"
elevation="24"
>
<v-img class="device-screen-image" :aspect-ratio="16/9" src="/fs/screen.bmp"></v-img>
</v-card>
</v-container>
<v-container fluid grid-list-md pa-2>
<v-card class="mx-auto my-12" max-width="400" elevation="24">
<!--<v-img class="device-screen-image" :aspect-ratio="16/9" src="/fs/screen.bmp"></v-img>-->
</v-card>
<v-btn class="ma-2" :loading="isLoading" color="secondary" @click="updateData">load weather data</v-btn>
</v-container>
</template>
<script>
//import api from '../api/core'
import apiDevice from "@/api/device";
export default {
data: () => ({
isLoading: false
}),
methods: {
updateData() {
this.isLoading = true;
export default {
name: "Dashboard",
apiDevice.updateWeather(() => {
this.isLoading = false;
});
}
}
};
</script>
<style scoped>
</style>
Loading…
Cancel
Save