mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 03:20:12 +08:00
refactor: use SocketWrapper to wrap the instance
This commit is contained in:
1 parent
313d30edda
commit
5d9951a3a2
5 files changed
+75
-38
No files matched your search
+14
-1
@@ -1,5 +1,5 @@
|
||||
<script setup>
|
||||
// Import components
|
||||
import { onMounted } from 'vue'
|
||||
import CommandlistPart from './components/CommandlistPart.vue'
|
||||
import HeaderPart from './components/HeaderPart.vue'
|
||||
import HintPart from './components/HintPart.vue'
|
||||
@@ -7,6 +7,19 @@ import QuestPart from './components/QuestPart.vue'
|
||||
import TerminalPart from './components/TerminalPart.vue'
|
||||
import VisualizationPart from './components/VisualizationPart.vue'
|
||||
import ControlPalette from './components/ControlPalette.vue'
|
||||
import socket from './utils/socket'
|
||||
import sessionManager from './utils/session'
|
||||
|
||||
onMounted(async () => {
|
||||
await sessionManager.lastOrCreate()
|
||||
socket.connect(sessionManager.getSession())
|
||||
socket.on('connect', function open() {
|
||||
console.log('Connected to the server.')
|
||||
})
|
||||
socket.on('disconnect', function close() {
|
||||
console.log('Disconnected from the server.')
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in new issue
Block a user