Онлайн правое меню
This commit is contained in:
1 parent
3e9d7272e0
commit
5a664524d8
1 file changed
+26
-18
@@ -4,7 +4,8 @@
|
|||||||
variant="text"
|
variant="text"
|
||||||
v-for="x in onlineuser"
|
v-for="x in onlineuser"
|
||||||
:key="x"
|
:key="x"
|
||||||
class="my-1"
|
|
||||||
|
height="50"
|
||||||
>
|
>
|
||||||
<v-avatar
|
<v-avatar
|
||||||
size="36px"
|
size="36px"
|
||||||
@@ -32,6 +33,7 @@ import {checkremote} from '@/utils/universal_functions'
|
|||||||
import InfoUserCard from './UI/infoUserCard.vue'
|
import InfoUserCard from './UI/infoUserCard.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
components: { InfoUserCard},
|
components: { InfoUserCard},
|
||||||
|
|
||||||
setup(){
|
setup(){
|
||||||
@@ -45,29 +47,35 @@ export default {
|
|||||||
}}
|
}}
|
||||||
const accountStore = useAccountStore()
|
const accountStore = useAccountStore()
|
||||||
let onlineuser= ref([])
|
let onlineuser= ref([])
|
||||||
const connect = new WebSocket(baseWS+"ws/watcher/?token="+localStorage.access)
|
|
||||||
|
|
||||||
const whatuser=(x)=> {
|
const connect = new WebSocket(baseWS+"ws/watcher/?token="+localStorage.access)
|
||||||
loging.value = x
|
|
||||||
open.value = true
|
|
||||||
}
|
|
||||||
|
|
||||||
connect.onmessage=(e)=>{
|
const whatuser=(x)=> {
|
||||||
let data = JSON.parse(e.data)
|
loging.value = x
|
||||||
wsfuncs[data['message']['action']](data.message.data)
|
open.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
connect.onmessage=(e)=>{
|
||||||
|
let data = JSON.parse(e.data)
|
||||||
|
wsfuncs[data['message']['action']](data.message.data)
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(()=>accountStore.cod2user,function(){
|
||||||
|
if (!accountStore.cod2user.value){
|
||||||
|
connect.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(()=>accountStore.cod2user,function(){
|
|
||||||
if (!accountStore.cod2user.value){
|
|
||||||
connect.close()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
return {
|
||||||
|
loging,
|
||||||
|
open,
|
||||||
return {loging,open, onlineuser, checkremote,spravURL, whatuser, accountStore}
|
onlineuser,
|
||||||
|
checkremote,
|
||||||
|
spravURL,
|
||||||
|
whatuser,
|
||||||
|
accountStore
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in new issue
Block a user