Mayank
5 years ago
5 changed files with 144 additions and 66 deletions
@ -0,0 +1,29 @@ |
|||
<template> |
|||
<div class="d-flex flex-column align-items-center justify-content-center min-vh100 p-2"> |
|||
<img alt="Umbrel" src="@/assets/logo.svg" class="mb-2 logo" /> |
|||
|
|||
<!-- <h1 class="text-center mb-2">loading</h1> --> |
|||
<b-spinner class="my-4" variant="primary"></b-spinner> |
|||
<p class="text-muted w-75 text-center">{{ text }}</p> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return {}; |
|||
}, |
|||
props: { text: String }, |
|||
created() {}, |
|||
methods: {}, |
|||
components: {} |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
.logo { |
|||
height: 20vh; |
|||
max-height: 200px; |
|||
width: auto; |
|||
} |
|||
</style> |
@ -0,0 +1,38 @@ |
|||
import API from '@/helpers/api'; |
|||
|
|||
// Initial state
|
|||
const state = () => ({ |
|||
api: { |
|||
operational: false, |
|||
version: "" |
|||
} |
|||
}); |
|||
|
|||
// Functions to update the state directly
|
|||
const mutations = { |
|||
setApi(state, api) { |
|||
state.api = api; |
|||
} |
|||
}; |
|||
|
|||
// Functions to get data from the API
|
|||
const actions = { |
|||
async getApi({ commit }) { |
|||
const api = await API.get(`ping`); |
|||
commit('setApi', { |
|||
operational: !!(api && api.version), |
|||
version: api && api.version ? api.version : "" |
|||
}); |
|||
} |
|||
}; |
|||
|
|||
const getters = { |
|||
}; |
|||
|
|||
export default { |
|||
namespaced: true, |
|||
state, |
|||
getters, |
|||
actions, |
|||
mutations |
|||
}; |
Loading…
Reference in new issue