mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-22 01:11:40 +00:00
Redirects I want eventually ( @Bankst ) demo.photonvision.org redirected to https://photonvision.github.io/photonvision/built-client/ javadocs.photonvision.org redirected to https://photonvision.github.io/photonvision/built-docs/javadoc/ cppdocs.photonvision.org redirected to https://photonvision.github.io/photonvision/built-docs/doxygen/html/ For now this runs on all commits to master. Once we confirm it works, let's pull back to only tagged releases --------- Co-authored-by: Mohammad Durrani <46766905+mdurrani808@users.noreply.github.com> Co-authored-by: Chris <chrisgerth010592@gmail.com>
88 lines
2.7 KiB
Vue
88 lines
2.7 KiB
Vue
<script setup lang="ts">
|
|
import { useStateStore } from "@/stores/StateStore";
|
|
import { useSettingsStore } from "@/stores/settings/GeneralSettingsStore";
|
|
import { useCameraSettingsStore } from "@/stores/settings/CameraSettingsStore";
|
|
import { AutoReconnectingWebsocket } from "@/lib/AutoReconnectingWebsocket";
|
|
import { inject } from "vue";
|
|
import PhotonSidebar from "@/components/app/photon-sidebar.vue";
|
|
import PhotonLogView from "@/components/app/photon-log-view.vue";
|
|
import PhotonErrorSnackbar from "@/components/app/photon-error-snackbar.vue";
|
|
|
|
const is_demo = import.meta.env.MODE === "demo";
|
|
if (!is_demo) {
|
|
const websocket = new AutoReconnectingWebsocket(
|
|
`ws://${inject("backendHost")}/websocket_data`,
|
|
() => {
|
|
useStateStore().$patch({ backendConnected: true });
|
|
},
|
|
(data) => {
|
|
if (data.log !== undefined) {
|
|
useStateStore().addLogFromWebsocket(data.log);
|
|
}
|
|
if (data.settings !== undefined) {
|
|
useSettingsStore().updateGeneralSettingsFromWebsocket(data.settings);
|
|
}
|
|
if (data.cameraSettings !== undefined) {
|
|
useCameraSettingsStore().updateCameraSettingsFromWebsocket(data.cameraSettings);
|
|
}
|
|
if (data.ntConnectionInfo !== undefined) {
|
|
useStateStore().updateNTConnectionStatusFromWebsocket(data.ntConnectionInfo);
|
|
}
|
|
if (data.metrics !== undefined) {
|
|
useSettingsStore().updateMetricsFromWebsocket(data.metrics);
|
|
}
|
|
if (data.updatePipelineResult !== undefined) {
|
|
useStateStore().updateBackendResultsFromWebsocket(data.updatePipelineResult);
|
|
}
|
|
if (data.mutatePipelineSettings !== undefined && data.cameraIndex !== undefined) {
|
|
useCameraSettingsStore().changePipelineSettingsInStore(data.mutatePipelineSettings, data.cameraIndex);
|
|
}
|
|
if (data.calibrationData !== undefined) {
|
|
useStateStore().updateCalibrationStateValuesFromWebsocket(data.calibrationData);
|
|
}
|
|
},
|
|
() => {
|
|
useStateStore().$patch({ backendConnected: false });
|
|
}
|
|
);
|
|
useStateStore().$patch({ websocket: websocket });
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<v-app>
|
|
<photon-sidebar />
|
|
<v-main>
|
|
<v-container class="main-container" fluid fill-height>
|
|
<v-layout>
|
|
<v-flex>
|
|
<router-view />
|
|
</v-flex>
|
|
</v-layout>
|
|
</v-container>
|
|
</v-main>
|
|
|
|
<photon-log-view />
|
|
<photon-error-snackbar />
|
|
</v-app>
|
|
</template>
|
|
|
|
<style lang="scss">
|
|
@import "vuetify/src/styles/settings/_variables";
|
|
|
|
@media #{map-get($display-breakpoints, 'md-and-down')} {
|
|
html {
|
|
font-size: 14px !important;
|
|
}
|
|
}
|
|
|
|
.main-container {
|
|
background-color: #232c37;
|
|
padding: 0 !important;
|
|
}
|
|
|
|
#title {
|
|
color: #ffd843;
|
|
}
|
|
</style>
|