diff --git a/src/store/modules/status.js b/src/store/modules/status.js index 8847e8bf..78646b12 100644 --- a/src/store/modules/status.js +++ b/src/store/modules/status.js @@ -1,7 +1,8 @@ -import { changeStatusScope, deleteStatus, fetchStatuses, fetchStatusesCount, fetchStatusesByInstance } from '@/api/status' +import { changeStatusScope, deleteStatus, fetchStatus, fetchStatuses, fetchStatusesCount, fetchStatusesByInstance } from '@/api/status' const status = { state: { + fetchedStatus: {}, fetchedStatuses: [], loading: false, statusesByInstance: { @@ -28,6 +29,9 @@ const status = { CHANGE_SELECTED_INSTANCE: (state, instance) => { state.statusesByInstance.selectedInstance = instance }, + SET_STATUS: (state, status) => { + state.fetchedStatus = status + }, SET_STATUSES_BY_INSTANCE: (state, statuses) => { state.fetchedStatuses = statuses }, @@ -68,6 +72,13 @@ const status = { dispatch('FetchStatusesByInstance') } }, + async FetchStatus({ commit, getters }, id) { + commit('SET_LOADING', true) + const status = await fetchStatus(id, getters.authHost, getters.token) + console.log(status) + commit('SET_STATUS', status.data) + commit('SET_LOADING', false) + }, async FetchStatusesCount({ commit, getters }) { commit('SET_LOADING', true) const { data } = await fetchStatusesCount(getters.authHost, getters.token) diff --git a/src/views/statuses/show.vue b/src/views/statuses/show.vue new file mode 100644 index 00000000..60a6cfe7 --- /dev/null +++ b/src/views/statuses/show.vue @@ -0,0 +1,39 @@ + + +