main
Ayush Mukherjee 4 years ago
parent 2cfc4d3834
commit 421e50437e

@ -17,3 +17,10 @@ npm run build
### Customize configuration ### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/). See [Configuration Reference](https://cli.vuejs.org/config/).
## Todos
- [ ] create websocket server
- [ ] handle reads and writes from/to overlay
- [ ]

11
package-lock.json generated

@ -16,7 +16,8 @@
"postcss": "^7", "postcss": "^7",
"tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.0.2", "tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.0.2",
"vue": "^3.0.0", "vue": "^3.0.0",
"vue-router": "^4.0.0-0" "vue-router": "^4.0.0-0",
"ws": "^6.2.1"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0", "@vue/cli-plugin-babel": "~4.5.0",
@ -3523,8 +3524,7 @@
"node_modules/async-limiter": { "node_modules/async-limiter": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz",
"integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ=="
"dev": true
}, },
"node_modules/asynckit": { "node_modules/asynckit": {
"version": "0.4.0", "version": "0.4.0",
@ -18267,7 +18267,6 @@
"version": "6.2.1", "version": "6.2.1",
"resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz",
"integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==",
"dev": true,
"dependencies": { "dependencies": {
"async-limiter": "~1.0.0" "async-limiter": "~1.0.0"
} }
@ -21404,8 +21403,7 @@
"async-limiter": { "async-limiter": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz",
"integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ=="
"dev": true
}, },
"asynckit": { "asynckit": {
"version": "0.4.0", "version": "0.4.0",
@ -33247,7 +33245,6 @@
"version": "6.2.1", "version": "6.2.1",
"resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz",
"integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==",
"dev": true,
"requires": { "requires": {
"async-limiter": "~1.0.0" "async-limiter": "~1.0.0"
} }

@ -20,7 +20,8 @@
"postcss": "^7", "postcss": "^7",
"tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.0.2", "tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.0.2",
"vue": "^3.0.0", "vue": "^3.0.0",
"vue-router": "^4.0.0-0" "vue-router": "^4.0.0-0",
"ws": "^6.2.1"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0", "@vue/cli-plugin-babel": "~4.5.0",

@ -51,9 +51,9 @@
<option v-for="r in store.state.rosters" :key="r._id" :value="r._id">{{ r.name }}</option> <option v-for="r in store.state.rosters" :key="r._id" :value="r._id">{{ r.name }}</option>
</select> </select>
<p class="mt-4">Started</p> <p class="mt-4">Started</p>
<input :checked="started" class="my-4 border border-gray-500 rounded-lg w-6 h-6" type="checkbox" required /> <input :checked="started" class="my-4 border border-gray-500 rounded-lg w-6 h-6" type="checkbox" />
<p class="mt-4">Done</p> <p class="mt-4">Done</p>
<input :checked="done" class="my-4 border border-gray-500 rounded-lg w-6 h-6" type="checkbox" required /> <input :checked="done" class="my-4 border border-gray-500 rounded-lg w-6 h-6" type="checkbox" />
<p class="mt-4">Best Of</p> <p class="mt-4">Best Of</p>
<input v-model="bestof" class="block my-4 border border-gray-500 rounded-lg w-64 h-8 px-4" type="number" required /> <input v-model="bestof" class="block my-4 border border-gray-500 rounded-lg w-64 h-8 px-4" type="number" required />
<p v-if="item" class="mt-4">Series Score</p> <p v-if="item" class="mt-4">Series Score</p>
@ -85,37 +85,43 @@ export default {
const setItem = (e) => { const setItem = (e) => {
item.value = e._id item.value = e._id
// name.value = e.name type.value = e.type
// logo.value = e.logo blue.value = e.blue
// players.value = e.players orange.value = e.orange
} started.value = e.started
done.value = e.done
const addPlayer = () => { bestof.value = e.bestof
players.value.push({
name: '',
account: '',
})
} }
const reset = () => { const reset = () => {
item.value = '' item.value = ''
name.value = '' type.value = ''
logo.value = '' blue.value = ''
players.value = [] orange.value = ''
orange.value = ''
started.value = false
done.value = false
bestof.value = ''
} }
const form = () => { const form = () => {
if (item.value !== '') { if (item.value !== '') {
update('rosters', item.value, { update('matches', item.value, {
name: name.value, type: type.value,
logo: logo.value, blue: blue.value,
players: players.value, orange: orange.value,
started: started.value,
done: done.value,
bestOf: bestof.value,
}) })
} else if (name.value !== '') { } else if (type.value !== '') {
create('rosters', { create('matches', {
name: name.value, type: type.value,
logo: logo.value, blue: blue.value,
players: players.value, orange: orange.value,
started: started.value,
done: done.value,
bestOf: bestof.value,
}) })
} }
reset() reset()
@ -123,7 +129,7 @@ export default {
const delForm = () => { const delForm = () => {
if (item.value) { if (item.value) {
del('rosters', item.value) del('matches', item.value)
reset() reset()
} }
} }
@ -140,7 +146,6 @@ export default {
setItem, setItem,
form, form,
delForm, delForm,
addPlayer,
} }
}, },
} }

@ -17,7 +17,7 @@ const state = reactive({
const methods = { const methods = {
authenticate: async () => { authenticate: async () => {
return axios.post('http://localhost:5000/api/v1', { return axios.post('http://178.79.128.135:5000/api/v1', {
token: state.token, token: state.token,
}) })
.then((res) => { .then((res) => {
@ -27,7 +27,7 @@ const methods = {
}) })
}, },
connect: (uri) => { connect: (uri) => {
state.ws = new WebSocket(`${uri}/${state.session}`) state.ws = new WebSocket(`ws://178.79.128.135:5000/ws/${state.session}`)
state.ws.onopen = () => { state.ws.onopen = () => {
sendSub(state.ws) sendSub(state.ws)
} }

@ -16,6 +16,9 @@
<Events v-if="nav === 'events'" /> <Events v-if="nav === 'events'" />
<Rosters v-if="nav === 'rosters'" /> <Rosters v-if="nav === 'rosters'" />
<Matches v-if="nav === 'matches'" /> <Matches v-if="nav === 'matches'" />
<Casters v-if="nav === 'casters'" />
<Hosts v-if="nav === 'hosts'" />
<Streams v-if="nav === 'streams'" />
</div> </div>
</div> </div>
</template> </template>
@ -25,12 +28,18 @@ import { inject, ref } from 'vue'
import Events from '@/components/Events.vue' import Events from '@/components/Events.vue'
import Rosters from '@/components/Rosters.vue' import Rosters from '@/components/Rosters.vue'
import Matches from '@/components/Matches.vue' import Matches from '@/components/Matches.vue'
import Casters from '@/components/Casters.vue'
import Hosts from '@/components/Hosts.vue'
import Streams from '@/components/Streams.vue'
export default { export default {
components: { components: {
Events, Events,
Rosters, Rosters,
Matches, Matches,
Casters,
Hosts,
Streams,
}, },
setup() { setup() {
const store = inject('store') const store = inject('store')

Loading…
Cancel
Save