mirror of
https://github.com/PhotonVision/photonvision
synced 2026-07-05 03:21:40 +00:00
* Implement new UI backend stuff * Kinda partially add resolution accuracy list * camera calibration go brrrrrrrr * ayyyy calibration works * Maybe fix grouping * Reorganize camera view * Fix settings not getting sent * Make pretty (#4) * Reorganize camera view * Apply some cosmetic layout changes to the cameras page * Fix pipeline rollback bug when starting on non-dashboard pages Co-authored-by: Matt <matthew.morley.ca@gmail.com> * Fix naming mismatch * Mostly make stuff work * rename robot-relative pose to camera-relative pose * SolvePNP memes, fix isFovConfigurable * Change config path to photonvision_config * netmask go poof, fix zip download? * Update index.js * Fix multi cam stuff? * Use LinearFilter instead * Fix multicam * aaa * start adding restart device and restart program, fix square size bug * Add some debug stuff * oop * Start fixing tests * Fix tests * Make target box proportinal * run spotless * Make crosshair h o t p i n k * Address review comments * Address review 2 electric booaloo * Possibly implement vendor FOV? * Make centroid crosshair gren * actually use FOV * Fix tests * actually fix tests Co-authored-by: Declan Freeman-Gleason <declanfreemangleason@gmail.com>
136 lines
3.3 KiB
Vue
136 lines
3.3 KiB
Vue
<template>
|
|
<div>
|
|
<span>Version: {{ settings.version }}</span>
|
|
—
|
|
<span>Hardware model: {{ settings.hardwareModel }}</span>
|
|
—
|
|
<span>Platform: {{ settings.hardwarePlatform }}</span>
|
|
—
|
|
<span>GPU Acceleration: {{ settings.gpuAcceleration ? "Enabled" : "Unsupported" }}{{ settings.gpuAcceleration ? " (" + settings.gpuAcceleration + " mode)" : "" }}</span>
|
|
<v-row>
|
|
<v-col
|
|
cols="12"
|
|
sm="6"
|
|
lg="3"
|
|
>
|
|
<v-btn
|
|
color="secondary"
|
|
@click="$refs.exportSettings.click()"
|
|
>
|
|
<v-icon left>
|
|
mdi-download
|
|
</v-icon> Export Settings
|
|
</v-btn>
|
|
</v-col>
|
|
<v-col
|
|
cols="12"
|
|
sm="6"
|
|
lg="3"
|
|
>
|
|
<v-btn
|
|
color="secondary"
|
|
@click="$refs.importSettings.click()"
|
|
>
|
|
<v-icon left>
|
|
mdi-upload
|
|
</v-icon> Import Settings
|
|
</v-btn>
|
|
</v-col>
|
|
<v-col
|
|
cols="12"
|
|
lg="3"
|
|
>
|
|
<v-btn
|
|
color="red"
|
|
@click="axios.post('http://' + this.$address + '/api/restartProgram')"
|
|
>
|
|
<v-icon left>
|
|
mdi-restart
|
|
</v-icon> Restart Photon
|
|
</v-btn>
|
|
</v-col>
|
|
<v-col
|
|
cols="12"
|
|
lg="3"
|
|
>
|
|
<v-btn
|
|
color="red"
|
|
@click="axios.post('http://' + this.$address + '/api/restartDevice')"
|
|
>
|
|
<v-icon left>
|
|
mdi-restart
|
|
</v-icon> Restart Device
|
|
</v-btn>
|
|
</v-col>
|
|
</v-row>
|
|
<v-snackbar
|
|
v-model="snack"
|
|
top
|
|
:color="snackbar.color"
|
|
>
|
|
<span>{{ snackbar.text }}</span>
|
|
</v-snackbar>
|
|
|
|
<!-- Special hidden upload input that gets 'clicked' when the user imports settings -->
|
|
<input
|
|
ref="importSettings"
|
|
type="file"
|
|
accept=".zip"
|
|
style="display: none;"
|
|
|
|
@change="readImportedSettings"
|
|
>
|
|
<!-- Special hidden link that gets 'clicked' when the user exports settings -->
|
|
<a
|
|
ref="exportSettings"
|
|
style="color: black; text-decoration: none; display: none"
|
|
:href="'http://' + this.$address + '/api/settings/photonvision_config.zip'"
|
|
download="photonvision-settings.zip"
|
|
/>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: 'General',
|
|
data() {
|
|
return {
|
|
snack: false,
|
|
snackbar: {
|
|
color: "success",
|
|
text: ""
|
|
},
|
|
}
|
|
},
|
|
computed: {
|
|
settings() {
|
|
return this.$store.state.settings.general;
|
|
}
|
|
},
|
|
methods: {
|
|
readImportedSettings(event) {
|
|
let formData = new FormData();
|
|
formData.append("zipData", event.target.files[0]);
|
|
this.axios.post("http://" + this.$address + "/api/settings/import", formData,
|
|
{headers: {"Content-Type": "multipart/form-data"}}).then(() => {
|
|
this.snackbar = {
|
|
color: "success",
|
|
text: "Settings imported successfully",
|
|
};
|
|
}).catch(() => {
|
|
this.snackbar = {
|
|
color: "error",
|
|
text: "Couldn't import settings",
|
|
}
|
|
});
|
|
this.snack = true;
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="css" scoped>
|
|
.v-btn {
|
|
width: 100%;
|
|
}
|
|
</style> |