+
+ {{ snackbar.text }}
+
{
+ this.$emit('camera-name-changed')
+
+ this.snackbar = {
+ color: "success",
+ text: response.data.text || response.data
+ }
+ this.snack = true;
+ })
+ .catch(error => {
+ this.$emit('camera-name-changed')
+
+ if(error.response) {
+ this.snackbar = {
+ color: "error",
+ text: error.response.data.text || error.response.data
+ }
+ } else if(error.request) {
+ this.snackbar = {
+ color: "error",
+ text: "Error while trying to process the request! The backend didn't respond.",
+ };
+ } else {
+ this.snackbar = {
+ color: "error",
+ text: "An error occurred while trying to process the request.",
+ };
+ }
+ this.snack = true;
+ })
+ this.discardCameraNameChange();
+ }
+ },
+ discardCameraNameChange() {
+ this.isCameraNameEdit = false;
+ this.newCameraName = "";
+ },
toPipelineNameChange() {
this.newPipelineName = this.$store.getters.pipelineList[this.currentPipelineIndex - 1];
this.isPipelineNameEdit = true;
@@ -319,7 +377,3 @@ export default {
}
-
-
diff --git a/photon-client/src/views/CamerasView.vue b/photon-client/src/views/CamerasView.vue
index ff1150ea3a..8362ca864d 100644
--- a/photon-client/src/views/CamerasView.vue
+++ b/photon-client/src/views/CamerasView.vue
@@ -348,6 +348,7 @@
@@ -445,12 +446,12 @@
>
- {{ uploadSnackData.text }}
+ {{ snackbar.text }}
@@ -489,11 +490,11 @@ export default {
filteredVideomodeIndex: 0,
settingsValid: true,
unfilteredStreamDivisors: [1, 2, 4],
- uploadSnackData: {
+ snackbar: {
color: "success",
text: "",
},
- uploadSnack: false,
+ snack: false,
}
},
computed: {
@@ -711,43 +712,34 @@ export default {
};
this.axios
- .post("http://" + this.$address + "/api/calibration/import", data, {
+ .post("http://" + this.$address + "/api/calibration/importFromCalibDB", data, {
headers: { "Content-Type": "text/plain" },
})
- .then(() => {
- this.uploadSnackData = {
- color: "success",
- text:
- "Calibration imported successfully!",
- };
- this.uploadSnack = true;
+ .then((response) => {
+ this.snackbar = {
+ color: response.status === 200 ? "success" : "error",
+ text: response.data.text || response.data
+ }
+ this.snack = true;
})
.catch((err) => {
- if (err.response) {
- this.uploadSnackData = {
- color: "error",
- text:
- "Error while uploading calibration file! Could not process provided file.",
- };
- } else if (err.request) {
- this.uploadSnackData = {
+ if (err.request) {
+ this.snackbar = {
color: "error",
- text:
- "Error while uploading calibration file! No respond to upload attempt.",
+ text: "Error while uploading calibration file! The backend didn't respond to the upload attempt.",
};
} else {
- this.uploadSnackData = {
+ this.snackbar = {
color: "error",
text: "Error while uploading calibration file!",
};
}
- this.uploadSnack = true;
+ this.snack = true;
});
-
})
},
closeDialog() {
- this.snack = false;
+ this.calibrationDialog = false;
this.calibrationInProgress = false;
this.calibrationFailed = false;
},
@@ -841,15 +833,33 @@ export default {
doc.save(`calibrationTarget-${config.type}.pdf`)
},
sendCameraSettings() {
- this.axios.post("http://" + this.$address + "/api/settings/camera", {
- "settings": this.cameraSettings,
- "index": this.$store.state.currentCameraIndex
- }).then(response => {
- if (response.status === 200) {
- this.$store.state.saveBar = true;
+ this.axios.post("http://" + this.$address + "/api/settings/camera", {"settings": this.cameraSettings, "index": this.$store.state.currentCameraIndex})
+ .then(response => {
+ this.snackbar = {
+ color: "success",
+ text: response.data.text || response.data
+ }
+ this.snack = true;
+ })
+ .catch(error => {
+ if(error.response) {
+ this.snackbar = {
+ color: "error",
+ text: error.response.data.text || error.response.data
}
- }
- )
+ } else if(error.request) {
+ this.snackbar = {
+ color: "error",
+ text: "Error while trying to process the request! The backend didn't respond.",
+ };
+ } else {
+ this.snackbar = {
+ color: "error",
+ text: "An error occurred while trying to process the request.",
+ };
+ }
+ this.snack = true;
+ })
},
isCalibrated(resolution) {
return this.$store.getters.currentCameraSettings.calibrations
@@ -876,16 +886,13 @@ export default {
sendCalibrationFinish() {
console.log("finishing calibration for index " + this.$store.getters.currentCameraIndex);
- this.snack = true;
+ this.calibrationDialog = true;
this.calibrationInProgress = true;
- this.axios.post("http://" + this.$address + "/api/settings/endCalibration", {idx: this.$store.getters.currentCameraIndex})
- .then((response) => {
- if (response.status === 200) {
- this.calibrationInProgress = false;
- } else {
- this.calibrationFailed = true;
- }
+ this.axios.post("http://" + this.$address + "/api/calibration/end", {index: this.$store.getters.currentCameraIndex})
+ .then(() => {
+ // End calibration will always return a 200 code on success
+ this.calibrationInProgress = false;
}
).catch(() => {
this.calibrationFailed = true;
diff --git a/photon-client/src/views/LogsView.vue b/photon-client/src/views/LogsView.vue
index fbb9c86d53..ca05a334b2 100644
--- a/photon-client/src/views/LogsView.vue
+++ b/photon-client/src/views/LogsView.vue
@@ -23,7 +23,7 @@