Commit 569014ba authored by Taylor Hanayik's avatar Taylor Hanayik
Browse files

update bet gui

parent 980ca45c
<template>
<v-app>
<v-container>
<!-- place content here -->
{{ title }}
</v-container>
</v-app>
</template>
<script>
import { io } from "socket.io-client"
export default {
name: "App",
props:{
},
components: {
// be sure to list imported local components here
},
created () {
},
data: function() {
return {
title: 'FSL'
}
},
computed: {
app_host() {
return this.$route.query.app_host
},
app_port() {
return this.$route.query.app_port
},
task_host() {
return this.$route.query.task_host
},
task_port() {
return this.$route.query.task_port
},
},
watch: {
},
methods:{
// setup socket callbacks here
onTaskSuccess: function(data) {
console.log(data) // do something with the data
},
onTaskError: function(data) {
console.log(data) // do something with the data
},
onTaskStdout: function(data) {
console.log(data) // do something with the data
},
onTaskStderr: function(data) {
console.log(data) // do something with the data
},
onFileReturn: function(data){
console.log(data) // do something with the data
},
onDirReturn: function(data){
console.log(data) // do something with the data
}
},
// runs when the component is ready and rendered
mounted () {
try {
// establish socket connection to electron app
this.app_server = io(`ws://${this.app_host}:${this.app_port}`)
this.task_server = io(`ws://${this.task_host}:${this.task_port}`)
// register some standard task server message handlers
this.task_server.on("success", this.onTaskSuccess)
this.task_server.on("error", this.onTaskError)
this.task_server.on("stdout", this.onTaskStdout)
this.task_server.on("stderr", this.onTaskStderr)
// register some standard app server message handlers
this.app_server.on("file-return", this.onFileReturn)
this.app_server.on("dir-return", this.onDirReturn)
} catch(e) {
console.log("task or app server not available")
}
console.log(this.$route.query) // log the query key=value pairs (remove in your own UI implementation)
}
}
</script>
<style scoped>
</style>
<template>
<v-app>
<v-container>
<v-row>
<v-col>
<v-text-field
dense
label="input image"
v-model="data.input">
</v-text-field>
</v-col>
<v-col sm=3 md=3 lg=3>
<v-btn
@click="onChooseInput">
Choose
</v-btn>
</v-col>
</v-row>
</v-container>
</v-app>
</template>
<script>
export default {
name: "Bet",
props:{
},
components: {
// be sure to list imported local components here
},
created () {
},
data: function() {
return {
title: 'FSL',
data: {
input: '',
output: ''
}
}
},
computed: {
// app_host() {
// return this.$route.query.app_host === undefined ? 'localhost' : this.$route.query.app_host
// },
// app_port() {
// return this.$route.query.app_port === undefined ? '5000' : this.$route.query.app_port
// },
// task_host() {
// return this.$route.query.task_host
// },
// task_port() {
// return this.$route.query.task_port
// },
},
watch: {
},
methods:{
// setup socket callbacks here
// onTaskSuccess: function(data) {
// console.log(data) // do something with the data
// },
// onTaskError: function(data) {
// console.log(data) // do something with the data
// },
// onTaskStdout: function(data) {
// console.log(data) // do something with the data
// },
// onTaskStderr: function(data) {
// console.log(data) // do something with the data
// },
// onFileReturn: function(data){
// console.log(data) // do something with the data
// this.data.input = data[0]
// },
// onDirReturn: function(data){
// console.log(data) // do something with the data
// },
// onChooseInput: function() {
// this.app_server.emit('file-request')
// }
},
// runs when the component is ready and rendered
mounted () {
// try {
// // establish socket connection to electron app
// this.app_server = io(`ws://${this.app_host}:${this.app_port}`)
// this.task_server = io(`ws://${this.task_host}:${this.task_port}`)
// // register some standard task server message handlers
// this.task_server.on("success", this.onTaskSuccess)
// this.task_server.on("error", this.onTaskError)
// this.task_server.on("stdout", this.onTaskStdout)
// this.task_server.on("stderr", this.onTaskStderr)
// // register some standard app server message handlers
// this.app_server.on("file-return", this.onFileReturn)
// this.app_server.on("dir-return", this.onDirReturn)
// } catch(e) {
// console.log("task or app server not available")
// }
// console.log(this.$route.query) // log the query key=value pairs (remove in your own UI implementation)
}
}
</script>
<style scoped>
</style>
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 87.5 100"><defs><style>.cls-1{fill:#1697f6;}.cls-2{fill:#7bc6ff;}.cls-3{fill:#1867c0;}.cls-4{fill:#aeddff;}</style></defs><title>Artboard 46</title><polyline class="cls-1" points="43.75 0 23.31 0 43.75 48.32"/><polygon class="cls-2" points="43.75 62.5 43.75 100 0 14.58 22.92 14.58 43.75 62.5"/><polyline class="cls-3" points="43.75 0 64.19 0 43.75 48.32"/><polygon class="cls-4" points="64.58 14.58 87.5 14.58 43.75 100 43.75 62.5 64.58 14.58"/></svg>
import 'material-design-icons-iconfont/dist/material-design-icons.css'
import Vue from 'vue'
import Router from "vue-router"
import App from './App.vue'
import Bet from './Bet.vue'
import vuetify from './plugins/vuetify'
import 'typeface-roboto/index.css'
......@@ -17,5 +17,5 @@ const router = new Router({
new Vue({
vuetify,
router,
render: h => h(App)
render: h => h(Bet)
}).$mount('#app')
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment