2021-10-23 21:34:02 +02:00
|
|
|
<template>
|
2021-11-03 09:10:23 +01:00
|
|
|
<div id="admin" class="view">
|
2021-10-23 21:34:02 +02:00
|
|
|
<div class="container" v-if="!userLoading">
|
2021-10-24 20:13:28 +02:00
|
|
|
<router-view
|
2021-10-23 21:34:02 +02:00
|
|
|
v-if="isAuthUserAmin"
|
2021-10-24 20:13:28 +02:00
|
|
|
:appConfig="appConfig"
|
2021-10-23 21:34:02 +02:00
|
|
|
:appStatistics="appStatistics"
|
|
|
|
/>
|
|
|
|
<NotFound v-else />
|
2021-10-27 18:51:59 +02:00
|
|
|
<div id="bottom" />
|
2021-10-23 21:34:02 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2021-11-10 21:19:27 +01:00
|
|
|
<script setup lang="ts">
|
|
|
|
import { computed, ComputedRef, onBeforeMount } from 'vue'
|
2021-10-23 21:34:02 +02:00
|
|
|
|
|
|
|
import NotFound from '@/components/Common/NotFound.vue'
|
2021-11-03 10:41:53 +01:00
|
|
|
import { AUTH_USER_STORE, ROOT_STORE } from '@/store/constants'
|
2021-10-24 20:13:28 +02:00
|
|
|
import { TAppConfig, IAppStatistics } from '@/types/application'
|
2021-10-23 21:34:02 +02:00
|
|
|
import { useStore } from '@/use/useStore'
|
|
|
|
|
2021-11-10 21:19:27 +01:00
|
|
|
const store = useStore()
|
|
|
|
|
|
|
|
const appConfig: ComputedRef<TAppConfig> = computed(
|
|
|
|
() => store.getters[ROOT_STORE.GETTERS.APP_CONFIG]
|
|
|
|
)
|
|
|
|
const appStatistics: ComputedRef<IAppStatistics> = computed(
|
|
|
|
() => store.getters[ROOT_STORE.GETTERS.APP_STATS]
|
|
|
|
)
|
|
|
|
const isAuthUserAmin: ComputedRef<boolean> = computed(
|
|
|
|
() => store.getters[AUTH_USER_STORE.GETTERS.IS_ADMIN]
|
|
|
|
)
|
|
|
|
const userLoading: ComputedRef<boolean> = computed(
|
|
|
|
() => store.getters[AUTH_USER_STORE.GETTERS.USER_LOADING]
|
|
|
|
)
|
|
|
|
|
|
|
|
onBeforeMount(() => store.dispatch(ROOT_STORE.ACTIONS.GET_APPLICATION_STATS))
|
2021-10-23 21:34:02 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2021-11-29 11:23:21 +01:00
|
|
|
@import '~@/scss/vars.scss';
|
2021-10-24 20:13:28 +02:00
|
|
|
|
|
|
|
#admin {
|
|
|
|
.admin-card {
|
|
|
|
width: 100%;
|
2021-10-27 18:51:59 +02:00
|
|
|
|
2021-10-24 20:13:28 +02:00
|
|
|
::v-deep(.card) {
|
|
|
|
.admin-form {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
|
|
label {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
margin: $default-margin 0;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
|
|
input {
|
|
|
|
width: 50%;
|
|
|
|
font-size: 0.9em;
|
|
|
|
margin-right: $default-margin * 5;
|
|
|
|
@media screen and (max-width: $medium-limit) {
|
|
|
|
margin-right: 0;
|
|
|
|
}
|
|
|
|
@media screen and (max-width: $small-limit) {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:disabled {
|
|
|
|
-webkit-appearance: none;
|
|
|
|
-moz-appearance: textfield;
|
|
|
|
background-color: white;
|
|
|
|
border-color: white;
|
|
|
|
color: var(--app-color);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.form-buttons {
|
|
|
|
display: flex;
|
|
|
|
gap: $default-padding;
|
|
|
|
margin-bottom: $default-margin;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-10-23 21:34:02 +02:00
|
|
|
</style>
|