Files
PhotonVision/chameleon-client/src/views/SettingsViewes/General.vue

58 lines
1.8 KiB
Vue
Raw Normal View History

2019-09-28 21:42:04 +03:00
<template>
<div>
2019-10-29 23:58:06 +02:00
<CVnumberinput v-model="settings.teamNumber" name="Team Number"/>
<CVradio v-model="settings.connectionType" :list="['DHCP','Static']"/>
<v-divider color="white"/>
<CVinput name="IP" v-model="settings.ip" :disabled="isDisabled"/>
<CVinput name="NetMask" v-model="settings.netmask" :disabled="isDisabled"/>
<CVinput name="Gateway" v-model="settings.gateway" :disabled="isDisabled"/>
<v-divider color="white"/>
<CVinput name="Hostname" v-model="settings.hostname"/>
<v-btn style="margin-top:10px" small color="#4baf62" @click="sendGeneralSettings">Save General Settings</v-btn>
2019-09-28 21:42:04 +03:00
</div>
</template>
<script>
2019-10-29 23:58:06 +02:00
import CVnumberinput from '../../components/cv-number-input'
import CVradio from '../../components/cv-radio'
import CVinput from '../../components/cv-input'
2019-09-28 21:42:04 +03:00
export default {
name: 'General',
2019-10-29 23:58:06 +02:00
components: {
2019-09-28 21:42:04 +03:00
CVnumberinput,
CVradio,
CVinput
},
data() {
2019-10-29 23:58:06 +02:00
return {}
2019-09-28 21:42:04 +03:00
},
2019-10-29 23:58:06 +02:00
methods: {
sendGeneralSettings() {
// this.handleInput('generalSettings', this.settings);
this.axios.post("http://" + this.$address + "/api/settings/general", this.settings).then(
function (response) {
console.log(response);
}
)
}
},
2019-10-29 23:58:06 +02:00
computed: {
isDisabled() {
if (this.settings.connectionType === 0) {
2019-09-28 21:42:04 +03:00
return true;
}
return false;
},
2019-10-29 23:58:06 +02:00
settings: {
get() {
2019-10-02 22:07:04 +03:00
return this.$store.state.settings;
}
}
2019-09-28 21:42:04 +03:00
}
}
</script>
<style lang="" scoped>
2019-10-29 23:58:06 +02:00
2019-09-28 21:42:04 +03:00
</style>