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