|
|
|
@ -12,7 +12,21 @@
|
|
|
|
|
<img class="block w-16 h-16 absolute bottom-10" src="https://cms.aplesports.com/storage/uploads/2020/04/23/5ea178d6570e1APL_New.png" alt="APL Logo">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="bg-gray-200 w-full px-10 py-4 overflow-y-auto">
|
|
|
|
|
<div v-if="nav === 'dash'">Coming soon</div>
|
|
|
|
|
<div v-if="nav === 'dash'" class="flex flex-col justify-center items-center h-full">
|
|
|
|
|
<h1 class="text-4xl font-bold mb-4"> Welcome, Ayush</h1>
|
|
|
|
|
<p class="text-xl">Select Stream for ingame overlay</p>
|
|
|
|
|
<select v-model="streamid" class="block my-4 border border-gray-500 rounded-lg bg-white w-64 h-8 px-4">
|
|
|
|
|
<option v-for="s in store.state.streams" :value="s._id" :key="s._id">{{ s.name }}</option>
|
|
|
|
|
</select>
|
|
|
|
|
<button :disabled="streamid === ''" @click.prevent="serverDo(true)" class="block w-64 h-10 text-white bg-red-700 rounded-lg hover:bg-red-600">
|
|
|
|
|
<span v-if="store.state.server">Update</span>
|
|
|
|
|
<span v-if="!store.state.server">Start</span>
|
|
|
|
|
overlay
|
|
|
|
|
</button>
|
|
|
|
|
<!-- <button v-if="store.state.server" :disabled="streamid === ''" @click.prevent="serverDo" class="block mt-4 w-64 h-10 text-white bg-red-700 rounded-lg hover:bg-red-600">
|
|
|
|
|
Stop overlay
|
|
|
|
|
</button> -->
|
|
|
|
|
</div>
|
|
|
|
|
<Events v-if="nav === 'events'" />
|
|
|
|
|
<Rosters v-if="nav === 'rosters'" />
|
|
|
|
|
<Matches v-if="nav === 'matches'" />
|
|
|
|
@ -24,6 +38,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { update } from '../utils/websocket'
|
|
|
|
|
import { inject, ref } from 'vue'
|
|
|
|
|
import Events from '@/components/Events.vue'
|
|
|
|
|
import Rosters from '@/components/Rosters.vue'
|
|
|
|
@ -45,11 +60,57 @@ export default {
|
|
|
|
|
const store = inject('store')
|
|
|
|
|
store.methods.connect('ws://localhost:5000/ws')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const check = async () => {
|
|
|
|
|
const status = await window.ipcRenderer.invoke('status')
|
|
|
|
|
if (status) {
|
|
|
|
|
store.state.server = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
check()
|
|
|
|
|
|
|
|
|
|
const nav = ref('dash')
|
|
|
|
|
|
|
|
|
|
const streamid = ref('')
|
|
|
|
|
|
|
|
|
|
window.ipcRenderer.on('test', (e, msg) => {
|
|
|
|
|
const data = JSON.parse(msg)
|
|
|
|
|
const m = store.state.matches.filter(x => x._id === data.id)[0]
|
|
|
|
|
|
|
|
|
|
// const games = m.hasOwnProperty('games') ? m.games.push(data.game) : [data.game]
|
|
|
|
|
|
|
|
|
|
update('matches', data.id, {
|
|
|
|
|
started: data.started,
|
|
|
|
|
done: data.done,
|
|
|
|
|
series: data.series,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
console.warn('RUNNING UPDATE!', data)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const serverDo = (x) => {
|
|
|
|
|
if (x === true) {
|
|
|
|
|
console.log(streamid.value)
|
|
|
|
|
store.state.overlayStream = store.state.streamsFull.filter(x => x._id === streamid.value)[0]
|
|
|
|
|
console.log(store.state.overlayStream)
|
|
|
|
|
window.ipcRenderer.invoke('state', JSON.stringify(store.state.overlayStream))
|
|
|
|
|
if (!store.state.server) {
|
|
|
|
|
window.ipcRenderer.invoke('server', true)
|
|
|
|
|
store.state.server = true
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
store.state.server = false
|
|
|
|
|
window.ipcRenderer.invoke('server', false)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
store,
|
|
|
|
|
nav,
|
|
|
|
|
streamid,
|
|
|
|
|
serverDo,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|