added admin (group, user) interface components
This commit is contained in:
55
src/components/Admin.vue
Normal file
55
src/components/Admin.vue
Normal file
@@ -0,0 +1,55 @@
|
||||
<!-- components/Admin.vue -->
|
||||
<template>
|
||||
<div>
|
||||
<section class="hero is-primary">
|
||||
<div class="hero-body">
|
||||
<div class="container has-text-centered">
|
||||
<h2 class="title">Admin Tools</h2>
|
||||
<p class="subtitle error-msg">{{ errorMsg }}</p>
|
||||
<router-link :to="{ name: 'admin.group'}">{{ $t('group') }}</router-link>
|
||||
<br>
|
||||
<router-link :to="{ name: 'admin.user'}">{{ $t('user') }}</router-link>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<hr/>
|
||||
<section>
|
||||
<router-view></router-view>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { EventBus } from '@/utils'
|
||||
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
email: '',
|
||||
errorMsg: '',
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
authenticate () {
|
||||
this.$store.dispatch('login', { email: this.email, password: this.password })
|
||||
.then(() => this.$router.push('/'));
|
||||
},
|
||||
},
|
||||
mounted () {
|
||||
this.$log.debug("Admin: mounting...");
|
||||
},
|
||||
beforeDestroy () {
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.error-msg {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
59
src/components/Group.vue
Normal file
59
src/components/Group.vue
Normal file
@@ -0,0 +1,59 @@
|
||||
<!-- components/Group.vue -->
|
||||
<template>
|
||||
<div>
|
||||
<section class="hero is-primary">
|
||||
<div class="hero-body">
|
||||
<div class="container has-text-centered">
|
||||
<h2 class="title">Groups</h2>
|
||||
<p class="subtitle error-msg">{{ errorMsg }}</p>
|
||||
<h3 class="title">Add Group</h3>
|
||||
<input v-model="group.name" placeholder="Group name">
|
||||
<p>Name is: {{ group.name }}</p>
|
||||
<span>Multiline message is:</span>
|
||||
<p style="white-space: pre-line;">{{ group.description }}</p>
|
||||
<br>
|
||||
<textarea v-model="group.message" placeholder="Description for group"></textarea>
|
||||
<button v-on:click="create_group">{{$t('create_group')}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { EventBus } from '@/utils'
|
||||
import {getRemainingJwtValiditySeconds} from "../utils";
|
||||
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
email: '',
|
||||
errorMsg: '',
|
||||
group: {},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
create_group () {
|
||||
|
||||
},
|
||||
},
|
||||
mounted () {
|
||||
|
||||
|
||||
|
||||
},
|
||||
beforeDestroy () {
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.error-msg {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
47
src/components/User.vue
Normal file
47
src/components/User.vue
Normal file
@@ -0,0 +1,47 @@
|
||||
<!-- components/User.vue -->
|
||||
<template>
|
||||
<div>
|
||||
<section class="hero is-primary">
|
||||
<div class="hero-body">
|
||||
<div class="container has-text-centered">
|
||||
<h3 class="title">Manage users</h3>
|
||||
|
||||
<p class="subtitle error-msg">{{ errorMsg }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { EventBus } from '@/utils'
|
||||
import {getRemainingJwtValiditySeconds} from "../utils";
|
||||
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
users: '',
|
||||
errorMsg: '',
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
||||
},
|
||||
mounted () {
|
||||
|
||||
},
|
||||
beforeDestroy () {
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.error-msg {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user