1
This commit is contained in:
commit
8c95bbf909
126 files changed
+16922
No files matched your search
@@ -0,0 +1,82 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-list-item v-for="x in onlineuser"
|
||||
:key="x"
|
||||
:prepend-avatar="checkremote( `${spravURL}${x}.jpg`)"
|
||||
title="x"
|
||||
nav
|
||||
@click="whatuser(x)"
|
||||
>
|
||||
<v-dialog
|
||||
v-model="menuGetUserDialog"
|
||||
persistent
|
||||
width="600"
|
||||
>
|
||||
<Card-users
|
||||
:menuGetUserDialog="menuGetUserDialog"
|
||||
:loging="loging"
|
||||
@menusClose="menuGetUserDialog=false"
|
||||
/>
|
||||
|
||||
|
||||
</v-dialog>
|
||||
</v-list-item>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref,watch } from 'vue'
|
||||
import { baseWS } from '@/utils/axios-api'
|
||||
import {useAccountStore} from '@/store/AccountStore'
|
||||
import { spravURL } from '@/utils/axios-api'
|
||||
import {checkremote} from '@/utils/universal_functions'
|
||||
import CardUsers from '@/components/cardUsers.vue'
|
||||
|
||||
export default {
|
||||
components: { CardUsers},
|
||||
|
||||
setup(){
|
||||
const loging = ref('')
|
||||
const menuGetUserDialog=ref(false)
|
||||
const wsfuncs={onliner:function(data){
|
||||
// console.log(onlineuser)
|
||||
let newset = new Set(data)
|
||||
onlineuser.value = Array.from(newset)
|
||||
// console.log(onlineuser)
|
||||
|
||||
}}
|
||||
const accountStore = useAccountStore()
|
||||
let onlineuser= ref(['ds'])
|
||||
|
||||
const connect = new WebSocket(baseWS+"ws/watcher/?token="+localStorage.access)
|
||||
|
||||
const whatuser=(x)=> {
|
||||
loging.value = x
|
||||
menuGetUserDialog.value=true
|
||||
|
||||
}
|
||||
|
||||
connect.onmessage=(e)=>{
|
||||
let data = JSON.parse(e.data)
|
||||
wsfuncs[data['message']['action']](data.message.data)
|
||||
}
|
||||
|
||||
watch(()=>accountStore.cod2user,function(){
|
||||
// console.log('newValue')
|
||||
if (!accountStore.cod2user.value){
|
||||
connect.close()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
return {loging, menuGetUserDialog, onlineuser, checkremote,spravURL, whatuser}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
Reference in new issue
Block a user