diff --git a/photon-client/src/components/cameras/CameraCalibrationInfoCard.vue b/photon-client/src/components/cameras/CameraCalibrationInfoCard.vue index 166820227d..42d4e2b551 100644 --- a/photon-client/src/components/cameras/CameraCalibrationInfoCard.vue +++ b/photon-client/src/components/cameras/CameraCalibrationInfoCard.vue @@ -5,6 +5,7 @@ import { useStateStore } from "@/stores/StateStore"; import { computed, inject, ref } from "vue"; import { getResolutionString, parseJsonFile } from "@/lib/PhotonUtils"; import { useTheme } from "vuetify"; +import axios from "axios"; const theme = useTheme(); @@ -12,6 +13,39 @@ const props = defineProps<{ videoFormat: VideoFormat; }>(); +const removeCalibration = () => { + axios + .post("/calibration/remove", { + cameraUniqueName: useCameraSettingsStore().currentCameraSettings.uniqueName, + width: props.videoFormat.resolution.width, + height: props.videoFormat.resolution.height + }) + .then((response) => { + useStateStore().showSnackbarMessage({ + message: response.data.text || response.data, + color: "success" + }); + }) + .catch((error) => { + if (error.response) { + useStateStore().showSnackbarMessage({ + color: "error", + message: error.response.data.text || error.response.data + }); + } else if (error.request) { + useStateStore().showSnackbarMessage({ + color: "error", + message: "Error while trying to process the request! The backend didn't respond." + }); + } else { + useStateStore().showSnackbarMessage({ + color: "error", + message: "An error occurred while trying to process the request." + }); + } + }); +}; + const exportCalibration = ref(); const openExportCalibrationPrompt = () => { exportCalibration.value.click(); @@ -93,18 +127,30 @@ const calibrationImageURL = (index: number) =>