Skip to content

Commit

Permalink
Merge pull request #133 from SelfhostedPro/updating
Browse files Browse the repository at this point in the history
working on ability to check for updates
  • Loading branch information
SelfhostedPro authored Oct 1, 2020
2 parents bce3091 + 24688ab commit b1ff0b9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
15 changes: 12 additions & 3 deletions frontend/src/components/serverSettings/ServerUpdate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
>Update</v-card-title
>
<v-card-text class="mt-2"
>Update Yacht to the latest version. <br/> Note: This will spin up a run-once watchtower instance and update Yacht. In the process Yacht will be restarted.</v-card-text
>Update Yacht to the latest version. <br/> Note: This will spin up a run-once watchtower instance and update Yacht. In the process Yacht will be restarted and you will be logged out.</v-card-text
>
<v-btn
class="mx-5 mb-5"
Expand All @@ -26,7 +26,7 @@

<script>
import axios from "axios";
import { mapMutations } from "vuex";
import { mapMutations, mapActions } from "vuex";
export default {
data() {
return {
Expand All @@ -39,6 +39,9 @@ export default {
setMessage: "snackbar/setMessage",
setErr: "snackbar/setErr",
}),
...mapActions({
logout: "auth/AUTH_LOGOUT"
}),
update() {
this.isLoading = true
axios({
Expand All @@ -50,9 +53,15 @@ export default {
this.isLoading = false
console.log(response.data);
this.setMessage(
"Yacht is updating now"
"Yacht is updating now. You will be logged out to complete the update."
);
})
.finally(() => {
this.isLoading = true
const sleep = (delay) => new Promise((resolve) => setTimeout(resolve, delay))
sleep(5000)
this.logout()
})
.catch((err) => {
this.isLoading = false
this.setErr(err);
Expand Down
1 change: 1 addition & 0 deletions frontend/src/store/modules/apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const actions = {
axios
.get(url)
.then(response => {
console.log(response)
const apps = response.data;
commit("setApps", apps);
})
Expand Down

0 comments on commit b1ff0b9

Please sign in to comment.