Files
PhotonVision/New client/chameleon-client/src/App.vue

95 lines
2.0 KiB
Vue
Raw Normal View History

2019-09-20 09:59:16 +03:00
<template>
2019-09-20 20:56:24 +03:00
<v-app>
<v-app-bar app clipped-left dark>
<img class="imgClass" src="./assets/logo.png">
<v-toolbar-title id="title">Chameleon Vision</v-toolbar-title>
<div class="flex-grow-1"></div>
<v-toolbar-items>
<v-tabs dark height="64" slider-color="#4baf62">
<v-tab to="Vision">Vision</v-tab>
<v-tab to="Settings">Settings</v-tab>
</v-tabs>
</v-toolbar-items>
</v-app-bar>
<v-content>
<v-container fluid fill-height>
<v-layout>
<v-flex>
<router-view></router-view>
</v-flex>
</v-layout>
</v-container>
2019-09-20 09:59:16 +03:00
</v-content>
</v-app>
</template>
<script>
export default {
name: 'App',
2019-10-02 00:14:37 +03:00
2019-09-20 09:59:16 +03:00
components: {
2019-10-02 00:14:37 +03:00
2019-10-02 22:07:04 +03:00
},
methods:{
2019-10-10 23:58:27 +03:00
handleMessage(key,value){
if(this.$store.state.hasOwnProperty(key)){
this.$store.commit(key,value);
} else if(this.$store.state.pipeline.hasOwnProperty(key)){
this.$store.commit('setPipeValues',{[key]:value});
}
else{
switch(key){
default:{
console.log(key + " : " + value);
}
2019-10-02 22:07:04 +03:00
}
}
}
2019-09-20 09:59:16 +03:00
},
data: () => ({
2019-10-02 00:14:37 +03:00
2019-09-20 09:59:16 +03:00
}),
2019-10-02 22:07:04 +03:00
created(){
this.$options.sockets.onmessage = (data) =>{
try{
2019-10-14 00:03:22 +03:00
let info = new Uint8Array(data.data.substring(1, data.data.length-1).split(","));//Converts incoming data to data that msgpack can decode
let message = this.$msgPack().decode(info);
2019-10-02 22:07:04 +03:00
for(let prop in message){
if(message.hasOwnProperty(prop)){
2019-10-10 23:32:55 +03:00
console.log(message);
2019-10-02 22:07:04 +03:00
}
}
}
2019-10-14 00:03:22 +03:00
catch(error){
console.error('error: ' + data.data+ " , "+ error);
2019-10-02 22:07:04 +03:00
}
}
}
2019-09-20 09:59:16 +03:00
};
</script>
<style>
html{
2019-09-20 20:56:24 +03:00
overflow-y: hidden !important;
2019-09-20 09:59:16 +03:00
}
.imgClass{
width: auto;
height: 58px;
vertical-align: middle;
padding-right: 5px;
}
2019-09-20 20:56:24 +03:00
.tabClass{
color: #4baf62;
}
.container{
background-color: #212121;
padding: 0!important;
}
#title{
color:#4baf62;
}
span{
color: white;
}
2019-10-02 00:14:37 +03:00
</style>