diff --git a/photon-client/src/App.vue b/photon-client/src/App.vue index 518ad3983..a9abc2688 100644 --- a/photon-client/src/App.vue +++ b/photon-client/src/App.vue @@ -76,6 +76,24 @@ if (!is_demo) { } } +/* Custom scrollbar styles */ +::-webkit-scrollbar { + width: 12px; +} + +::-webkit-scrollbar-track { + background: #232c37; +} + +::-webkit-scrollbar-thumb { + background-color: #ffd843; + border-radius: 10px; +} + +::-webkit-scrollbar-thumb:hover { + background-color: #e4c33c; +} + .main-container { background-color: #232c37; padding: 0 !important; diff --git a/photon-client/src/components/app/photon-camera-stream.vue b/photon-client/src/components/app/photon-camera-stream.vue index 7e225e042..03cca1108 100644 --- a/photon-client/src/components/app/photon-camera-stream.vue +++ b/photon-client/src/components/app/photon-camera-stream.vue @@ -79,10 +79,10 @@ onBeforeUnmount(() => {
({ fov: useCameraSettingsStore().currentCameraSettings.fov.value, @@ -108,6 +109,49 @@ watchEffect(() => { // Reset temp settings on remote camera settings change resetTempSettingsStruct(); }); + +const showDeleteCamera = ref(false); + +const address = inject("backendHost"); +const exportSettings = ref(); +const openExportSettingsPrompt = () => { + exportSettings.value.click(); +}; + +const yesDeleteMySettingsText = ref(""); +const deleteThisCamera = () => { + const payload = { + cameraUniqueName: useCameraSettingsStore().cameraUniqueNames[useStateStore().currentCameraIndex] + }; + + axios + .post("/utils/nukeOneCamera", payload) + .then(() => { + useStateStore().showSnackbarMessage({ + message: "Successfully dispatched the delete command. Waiting for backend to start back up", + color: "success" + }); + }) + .catch((error) => { + if (error.response) { + useStateStore().showSnackbarMessage({ + message: "The backend is unable to fulfil the request to delete this camera.", + color: "error" + }); + } else if (error.request) { + useStateStore().showSnackbarMessage({ + message: "Error while trying to process the request! The backend didn't respond.", + color: "error" + }); + } else { + useStateStore().showSnackbarMessage({ + message: "An error occurred while trying to process the request.", + color: "error" + }); + } + }); + showDeleteCamera.value = false; +}; + + diff --git a/photon-client/src/components/settings/DeviceControlCard.vue b/photon-client/src/components/settings/DeviceControlCard.vue index a9bdb9b70..31c25df36 100644 --- a/photon-client/src/components/settings/DeviceControlCard.vue +++ b/photon-client/src/components/settings/DeviceControlCard.vue @@ -201,6 +201,39 @@ const handleSettingsImport = () => { importType.value = -1; importFile.value = null; }; + +const showFactoryReset = ref(false); +const expected = "Delete Everything"; +const yesDeleteMySettingsText = ref(""); +const nukePhotonConfigDirectory = () => { + axios + .post("/utils/nukeConfigDirectory") + .then(() => { + useStateStore().showSnackbarMessage({ + message: "Successfully dispatched the reset command. Waiting for backend to start back up", + color: "success" + }); + }) + .catch((error) => { + if (error.response) { + useStateStore().showSnackbarMessage({ + message: "The backend is unable to fulfil the request to reset the device.", + color: "error" + }); + } else if (error.request) { + useStateStore().showSnackbarMessage({ + message: "Error while trying to process the request! The backend didn't respond.", + color: "error" + }); + } else { + useStateStore().showSnackbarMessage({ + message: "An error occurred while trying to process the request.", + color: "error" + }); + } + }); + showFactoryReset.value = false; +};