Merge branch 'master' of ubkavh-192.ubka.uni-karlsruhe.de:kbtoku/lrc-frontend
This commit is contained in:
@@ -88,6 +88,7 @@
|
||||
});
|
||||
EventBus.$on('storedTokens', () => {
|
||||
this.$store.dispatch('loadUsers');
|
||||
this.$store.dispatch('loadProfile');
|
||||
});
|
||||
|
||||
this.$store.dispatch('loadLoginProviders');
|
||||
|
||||
@@ -39,12 +39,15 @@
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
<p><strong>{{$t('first_name')}}: </strong>{{profile.first_name}}</p>
|
||||
<p><strong>{{$t('last_name')}}: </strong>{{profile.last_name}}</p>
|
||||
|
||||
<hr/>
|
||||
<p v-if="profile.role"><strong>{{$t('role')}}: </strong>{{profile.role}}</p>
|
||||
<p><strong>{{$t('groups')}}: </strong><span v-for="g in profile.groups">{{g.name}}, </span></p>
|
||||
<p><strong>{{$t('permissions')}}: </strong><span v-for="p in profile.effective_permissions">{{p}}</span></p>
|
||||
|
||||
<hr/>
|
||||
|
||||
|
||||
@@ -1,7 +1,19 @@
|
||||
<!-- components/Profile.vue -->
|
||||
<!-- components/Test.vue -->
|
||||
<template>
|
||||
<div>
|
||||
<h1>Toller Test</h1>
|
||||
<b-alert
|
||||
:show="dismissCountDown"
|
||||
dismissible
|
||||
variant="warning"
|
||||
@dismissed="dismissCountDown=0"
|
||||
@dismiss-count-down="countDownChanged"
|
||||
>
|
||||
This alert will dismiss after {{ dismissCountDown }} seconds...
|
||||
</b-alert>
|
||||
<b-button @click="showAlert" variant="info" class="m-1">
|
||||
Show alert with count-down timer
|
||||
</b-button>
|
||||
<h1>Toller Test</h1>
|
||||
<span>{{ $socket.connected ? 'Connected' : 'Disconnected' }}</span>
|
||||
<button v-if="$socket.connected" @click="disconnectWebsocket">Disconnect</button>
|
||||
<button v-else="$socket.connected" @click="connectWebsocket">Connect</button>
|
||||
@@ -9,16 +21,20 @@
|
||||
<button v-if="$socket.connected" @click="sendWsMessage('Tolle Test Nachricht')">Send Message</button>
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {EventBus} from '@/utils';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
email: '',
|
||||
dismissSecs: 5,
|
||||
dismissCountDown: 0,
|
||||
|
||||
};
|
||||
},
|
||||
@@ -27,18 +43,24 @@
|
||||
this.$i18n.locale = locale;
|
||||
// Vue.$moment.locale(locale);
|
||||
},
|
||||
sendWsMessage(msg){
|
||||
console.log("sending msg: "+ msg);
|
||||
sendWsMessage(msg) {
|
||||
console.log("sending msg: " + msg);
|
||||
this.$socket.client.emit('my_event', msg, (resp) => {
|
||||
console.log(resp);
|
||||
});
|
||||
},
|
||||
connectWebsocket(){
|
||||
connectWebsocket() {
|
||||
this.$socket.client.connect();
|
||||
},
|
||||
disconnectWebsocket(){
|
||||
disconnectWebsocket() {
|
||||
this.$socket.client.disconnect();
|
||||
}
|
||||
},
|
||||
countDownChanged(dismissCountDown) {
|
||||
this.dismissCountDown = dismissCountDown;
|
||||
},
|
||||
showAlert() {
|
||||
this.dismissCountDown = this.dismissSecs;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.$socket.client.on('my_event', (msg) => {
|
||||
@@ -71,6 +93,7 @@
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.lang-btn {
|
||||
padding: 15px;
|
||||
border: 2px solid green;
|
||||
|
||||
Reference in New Issue
Block a user