Removed old console logs

This commit is contained in:
Joel Collins 2020-11-23 13:08:44 +00:00
parent 358d44189b
commit 2e34722d6e
23 changed files with 21 additions and 103 deletions

View file

@ -199,15 +199,13 @@ export default {
(state, getters) => { (state, getters) => {
return getters.uriV2; return getters.uriV2;
}, },
uriV2 => { () => {
this.checkConnection(); this.checkConnection();
console.log(uriV2);
} }
); );
// Keyboard shortcuts // Keyboard shortcuts
Mousetrap.bind("?", () => { Mousetrap.bind("?", () => {
console.log(this.keyboardManual);
this.toggleModalElement(this.$refs["keyboardManualModal"]); // Calls the mixin this.toggleModalElement(this.$refs["keyboardManualModal"]); // Calls the mixin
}); });
@ -290,7 +288,6 @@ export default {
// Remove origin watcher // Remove origin watcher
this.unwatchOriginFunction(); this.unwatchOriginFunction();
// Remove key listeners // Remove key listeners
console.log("Resetting Mousetrap");
Mousetrap.reset(); Mousetrap.reset();
}, },
@ -313,7 +310,6 @@ export default {
}, },
handleExit: function() { handleExit: function() {
console.log("Triggered beforeunload");
this.$root.$emit("globalTogglePreview", false); this.$root.$emit("globalTogglePreview", false);
}, },

View file

@ -230,7 +230,6 @@ export default {
pluginsGuiList: function() { pluginsGuiList: function() {
// List of plugin GUIs, obtained from this.plugins values // List of plugin GUIs, obtained from this.plugins values
console.log("Recalculating plugins");
var pluginGuis = []; var pluginGuis = [];
for (let plugin of Object.values(this.plugins)) { for (let plugin of Object.values(this.plugins)) {
if (plugin.meta.gui) { if (plugin.meta.gui) {
@ -304,11 +303,9 @@ export default {
methods: { methods: {
updatePlugins: function() { updatePlugins: function() {
console.log("Updating plugin forms");
return axios return axios
.get(this.pluginsUri) .get(this.pluginsUri)
.then(response => { .then(response => {
console.log(response);
this.plugins = response.data; this.plugins = response.data;
}) })
.catch(error => { .catch(error => {
@ -333,8 +330,6 @@ export default {
}, },
enterApp: function() { enterApp: function() {
// Stuff to do once connected and all init modals are finished // Stuff to do once connected and all init modals are finished
console.log("Entering main application");
//this.currentTab = "view";
} }
} }
}; };

View file

@ -111,11 +111,6 @@ export default {
this.$delete(newSelected, key); this.$delete(newSelected, key);
this.$emit("input", newSelected); this.$emit("input", newSelected);
},
modifyValue: function(e, v) {
console.log(e);
console.log(v);
} }
} }
}; };

View file

@ -138,7 +138,6 @@ export default {
checkExistingTasks: function() { checkExistingTasks: function() {
axios.get(this.submitUrl).then(response => { axios.get(this.submitUrl).then(response => {
console.log(response.data);
for (const task of response.data) { for (const task of response.data) {
if (task.status == "pending" || task.status == "running") { if (task.status == "pending" || task.status == "running") {
this.taskStarted = true; this.taskStarted = true;
@ -165,10 +164,10 @@ export default {
startTask: function() { startTask: function() {
// Starts a new Action task // Starts a new Action task
console.log("Task start clicked");
this.$emit("submit", this.submitData); this.$emit("submit", this.submitData);
// Send a request to start a task // Send a request to start a task
console.log("Submitting to ", this.submitUrl);
this.taskStarted = true; this.taskStarted = true;
this.$emit("taskStarted", this.taskId); this.$emit("taskStarted", this.taskId);
axios axios
@ -191,7 +190,7 @@ export default {
this.pollTask(this.taskId, this.pollInterval) this.pollTask(this.taskId, this.pollInterval)
.then(response => { .then(response => {
// Do something with the final response // Do something with the final response
console.log("Emitting onResponse: ", response);
this.$emit("response", response); this.$emit("response", response);
this.$emit("finished"); this.$emit("finished");
}) })
@ -199,12 +198,11 @@ export default {
if (!error) { if (!error) {
error = Error("Unknown error"); error = Error("Unknown error");
} }
console.log("Emitting onError: ", error);
this.$emit("error", error); this.$emit("error", error);
this.$emit("finished"); this.$emit("finished");
}) })
.finally(() => { .finally(() => {
console.log("Cleaning up after task.");
// Reset taskRunning and taskId // Reset taskRunning and taskId
this.taskRunning = false; this.taskRunning = false;
this.taskStarted = false; this.taskStarted = false;
@ -223,7 +221,6 @@ export default {
var checkCondition = (resolve, reject) => { var checkCondition = (resolve, reject) => {
// If the condition is met, we're done! // If the condition is met, we're done!
axios.get(this.taskUrl).then(response => { axios.get(this.taskUrl).then(response => {
console.log(response.data.status);
var result = response.data.status; var result = response.data.status;
// If the task ends with success // If the task ends with success
if (result == "completed") { if (result == "completed") {
@ -232,13 +229,13 @@ export default {
// If task ends with an error // If task ends with an error
else if (result == "error") { else if (result == "error") {
// Pass the error string back with reject // Pass the error string back with reject
console.log("Rejecting pollTask due to error");
reject(new Error(response.data.output)); reject(new Error(response.data.output));
} }
// If task ends with termination // If task ends with termination
else if (result == "cancelled") { else if (result == "cancelled") {
// Pass a generic termination error back with reject // Pass a generic termination error back with reject
console.log("Rejecting pollTask due to cancellation");
reject(new Error("Task cancelled")); reject(new Error("Task cancelled"));
} else { } else {
// Since the task is still running, we can update the progress bar // Since the task is still running, we can update the progress bar
@ -253,19 +250,13 @@ export default {
}, },
pollProgress: function() { pollProgress: function() {
console.log("Starting progress polling");
axios.get(this.taskUrl).then(response => { axios.get(this.taskUrl).then(response => {
console.log("PROGRESS RESPONSE: ", response.data.progress);
this.progress = response.data.progress; this.progress = response.data.progress;
}); });
}, },
terminateTask: function() { terminateTask: function() {
console.log("Terminating task..."); axios.delete(this.taskUrl);
axios.delete(this.taskUrl).then(response => {
console.log("TERMINATION RESPONSE: ", response.data);
});
} }
} }
}; };

View file

@ -265,7 +265,6 @@ export default {
}, },
onHide: function() { onHide: function() {
console.log("UIKit modal hidden");
this.$emit("onClose"); this.$emit("onClose");
}, },

View file

@ -201,8 +201,6 @@ export default {
}, },
updateForm() { updateForm() {
// Trigger a plugin form update
console.log("Emitting reloadForms");
this.$emit("reloadForms"); this.$emit("reloadForms");
}, },
@ -214,14 +212,10 @@ export default {
}, },
newQuickRequest: function(params) { newQuickRequest: function(params) {
console.log(this.submitApiUri);
console.log(params);
// Send a quick request // Send a quick request
axios axios
.post(this.submitApiUri, params) .post(this.submitApiUri, params)
.then(response => { .then(() => {
// Do something with the response
console.log(response);
// Do all the finished request stuff // Do all the finished request stuff
this.onSubmissionCompleted(); this.onSubmissionCompleted();
}) })
@ -232,8 +226,7 @@ export default {
onTaskSubmit: function() {}, onTaskSubmit: function() {},
onTaskResponse: function(responseData) { onTaskResponse: function() {
console.log("Task finished with response data: ", responseData);
// Do all the finished request stuff // Do all the finished request stuff
this.onSubmissionCompleted(); this.onSubmissionCompleted();
}, },

View file

@ -165,9 +165,8 @@ export default {
() => { () => {
if ("shutdown" in this.systemActionLinks) { if ("shutdown" in this.systemActionLinks) {
this.$store.commit("resetState"); this.$store.commit("resetState");
axios.post(this.systemActionLinks.shutdown).catch(error => { // Post and silence errors
console.log(error); // Be quiet when empty response is recieved axios.post(this.systemActionLinks.shutdown).catch(() => {});
});
} }
}, },
() => {} () => {}
@ -178,9 +177,8 @@ export default {
() => { () => {
if ("reboot" in this.systemActionLinks) { if ("reboot" in this.systemActionLinks) {
this.$store.commit("resetState"); this.$store.commit("resetState");
axios.post(this.systemActionLinks.reboot).catch(error => { // Post and silence errors
console.log(error); // Be quiet when empty response is recieved axios.post(this.systemActionLinks.reboot).catch(() => {});
});
} }
}, },
() => {} () => {}

View file

@ -356,8 +356,6 @@ export default {
payload.annotations["Notes"] = this.captureNotes; payload.annotations["Notes"] = this.captureNotes;
} }
console.log(payload);
return payload; return payload;
}, },
@ -437,8 +435,7 @@ export default {
onScanSubmit: function() {}, onScanSubmit: function() {},
onScanResponse: function(responseData) { onScanResponse: function() {
console.log("Scan finished with response data: ", responseData);
this.modalNotify("Finished scan."); this.modalNotify("Finished scan.");
}, },

View file

@ -241,7 +241,6 @@ export default {
methods: { methods: {
getMetadata: function() { getMetadata: function() {
// Send metadata request // Send metadata request
console.log("Loading capture metadata...");
axios axios
.get(this.captureURL) .get(this.captureURL)
.then(response => { .then(response => {
@ -322,7 +321,6 @@ export default {
}, },
delTagRequest: function(tagString) { delTagRequest: function(tagString) {
console.log(tagString);
// Send tag DELETE request // Send tag DELETE request
axios axios
.delete(this.tagsURL, { data: [tagString] }) .delete(this.tagsURL, { data: [tagString] })

View file

@ -17,7 +17,6 @@
:submit-url="zipBuilderUri" :submit-url="zipBuilderUri"
:submit-label="'Create ZIP'" :submit-label="'Create ZIP'"
:submit-data="captureIds" :submit-data="captureIds"
@submit="onSubmit"
@response="onResponse" @response="onResponse"
@error="onError" @error="onError"
> >
@ -155,14 +154,9 @@ export default {
}, },
deleteLastZip() { deleteLastZip() {
axios axios.delete(this.downloadUrl).catch(error => {
.delete(this.downloadUrl) this.modalError(error); // Let mixin handle error
.then(response => { });
console.log(response);
})
.catch(error => {
this.modalError(error); // Let mixin handle error
});
}, },
onResponse: function(response) { onResponse: function(response) {
@ -171,11 +165,6 @@ export default {
this.downloadReady = true; this.downloadReady = true;
}, },
onSubmit: function(submitData) {
console.log("SUBMITTED");
console.log(submitData);
},
onError: function(error) { onError: function(error) {
this.modalError(error); // Let mixin handle error this.modalError(error); // Let mixin handle error
} }

View file

@ -349,7 +349,6 @@ export default {
updateCaptures: function() { updateCaptures: function() {
if (this.$store.state.available) { if (this.$store.state.available) {
console.log("Updating capture list...");
axios axios
.get(this.capturesUri) .get(this.capturesUri)
.then(response => { .then(response => {
@ -358,8 +357,6 @@ export default {
.catch(error => { .catch(error => {
this.modalError(error); // Let mixin handle error this.modalError(error); // Let mixin handle error
}); });
} else {
console.log("Delaying capture update until connection is available");
} }
}, },

View file

@ -122,7 +122,6 @@ export default {
} }
}, },
updateLogs: function() { updateLogs: function() {
console.log("Updating logs...");
axios axios
.get(this.loggingUri) .get(this.loggingUri)
.then(response => { .then(response => {

View file

@ -239,7 +239,6 @@ export default {
}, },
moveRequest: function(x, y, z, absolute) { moveRequest: function(x, y, z, absolute) {
console.log(`Sending move request of ${x}, ${y}, ${z}`);
// If not movement-locked // If not movement-locked
if (!this.moveLock) { if (!this.moveLock) {
// Lock move requests // Lock move requests
@ -266,7 +265,6 @@ export default {
}, },
moveInImageCoordinatesRequest: function(x, y) { moveInImageCoordinatesRequest: function(x, y) {
console.log(`Sending move request in image coordinates: ${x}, ${y}`);
// If not movement-locked // If not movement-locked
if (!this.moveLock) { if (!this.moveLock) {
// Lock move requests // Lock move requests

View file

@ -84,8 +84,6 @@ export default {
axios axios
.get(this.recalibrationLinks.get_calibration.href) .get(this.recalibrationLinks.get_calibration.href)
.then(response => { .then(response => {
console.log("CSM data:");
console.log(response.data);
if (Object.keys(response.data).length === 0) { if (Object.keys(response.data).length === 0) {
this.dataAvailable = false; this.dataAvailable = false;
} else { } else {

View file

@ -93,8 +93,6 @@ export default {
axios axios
.get(this.recalibrationLinks.get_calibration.href) .get(this.recalibrationLinks.get_calibration.href)
.then(response => { .then(response => {
console.log("CSM data:");
console.log(response.data);
if (Object.keys(response.data).length === 0) { if (Object.keys(response.data).length === 0) {
this.dataAvailable = false; this.dataAvailable = false;
} else { } else {

View file

@ -36,7 +36,6 @@ export default {
watch: { watch: {
appTheme() { appTheme() {
console.log("Saving appTheme setting");
this.setLocalStorageObj("appTheme", this.appTheme); this.setLocalStorageObj("appTheme", this.appTheme);
} }
}, },

View file

@ -110,7 +110,6 @@ export default {
}, },
applyConfigRequest: function() { applyConfigRequest: function() {
console.log("Applying config to the microscope");
var payload = { var payload = {
camera: { camera: {
picamera: { picamera: {

View file

@ -40,7 +40,6 @@ export default {
watch: { watch: {
IHIEnabled() { IHIEnabled() {
console.log("Saving IHIEnabled setting");
this.setLocalStorageObj("IHIEnabled", this.IHIEnabled); this.setLocalStorageObj("IHIEnabled", this.IHIEnabled);
} }
}, },

View file

@ -108,8 +108,6 @@ export default {
} }
}; };
console.log(payload);
// Send request to update config // Send request to update config
axios axios
.put(this.settingsUri, payload) .put(this.settingsUri, payload)

View file

@ -56,11 +56,9 @@ export default {
methods: { methods: {
getStageType: function() { getStageType: function() {
console.log("Getting stage type");
axios axios
.get(this.stageTypeUri) .get(this.stageTypeUri)
.then(response => { .then(response => {
console.log("Stage type is " + response.data);
this.stageType = response.data; this.stageType = response.data;
}) })
.catch(error => { .catch(error => {
@ -68,7 +66,6 @@ export default {
}); });
}, },
setStageType: function() { setStageType: function() {
console.log("Setting stage type");
axios axios
.put(this.stageTypeUri, this.stageType, { .put(this.stageTypeUri, this.stageType, {
headers: { headers: {
@ -77,7 +74,7 @@ export default {
}) })
.then(response => { .then(response => {
this.stageType = response.data; this.stageType = response.data;
console.log("Stage type set to " + this.stageType);
this.modalNotify("Stage geometry changed."); this.modalNotify("Stage geometry changed.");
}) })
.catch(error => { .catch(error => {

View file

@ -174,7 +174,6 @@ export default {
return this.currentTime.substr(0, 19); return this.currentTime.substr(0, 19);
}, },
set(val) { set(val) {
console.log(val);
// Get timezone // Get timezone
var dt = new Date(); var dt = new Date();
var tzo = -dt.getTimezoneOffset(), var tzo = -dt.getTimezoneOffset(),

View file

@ -73,7 +73,6 @@ export default {
}, },
mounted() { mounted() {
console.log(`${this._uid} mounted`);
// A global signal listener to change the GPU preview state // A global signal listener to change the GPU preview state
this.$root.$on("globalTogglePreview", state => { this.$root.$on("globalTogglePreview", state => {
this.previewRequest(state); this.previewRequest(state);
@ -97,13 +96,11 @@ export default {
}, },
created: function() { created: function() {
console.log(`${this._uid} created`);
// Send a request to start/stop GPU preview based on global setting // Send a request to start/stop GPU preview based on global setting
this.safePreviewRequest(this.$store.state.autoGpuPreview); this.safePreviewRequest(this.$store.state.autoGpuPreview);
}, },
beforeDestroy: function() { beforeDestroy: function() {
console.log(`${this._uid} being destroyed`);
// Remove global signal listener to change the GPU preview state // Remove global signal listener to change the GPU preview state
this.$root.$off("globalTogglePreview"); this.$root.$off("globalTogglePreview");
// Remove global signal listener to flash the stream element // Remove global signal listener to flash the stream element
@ -163,15 +160,12 @@ export default {
handleDoneResize: function() { handleDoneResize: function() {
// Recalculate size // Recalculate size
console.log(`Recalculating frame size for ${this._uid}`);
this.recalculateSize(); this.recalculateSize();
// Handle closed stream // Handle closed stream
if (this.displaySize[0] == 0 && this.displaySize[1] == 0) { if (this.displaySize[0] == 0 && this.displaySize[1] == 0) {
console.log(`${this._uid} is zero`);
// If this stream was previously active // If this stream was previously active
if (this.$store.state.activeStreams[this._uid] == true) { if (this.$store.state.activeStreams[this._uid] == true) {
console.log(`${this._uid} was active`);
console.log(`STREAM ${this._uid} CLOSED`);
this.$store.commit("removeStream", this._uid); this.$store.commit("removeStream", this._uid);
// If all streams are closed, request the GPU preview close // If all streams are closed, request the GPU preview close
var a = Object.values(this.$store.state.activeStreams); var a = Object.values(this.$store.state.activeStreams);
@ -182,7 +176,6 @@ export default {
} }
// If resized to anything other than zero // If resized to anything other than zero
} else { } else {
console.log(`STREAM ${this._uid} OPEN`);
this.$store.commit("addStream", this._uid); this.$store.commit("addStream", this._uid);
if (this.$store.state.autoGpuPreview == true) { if (this.$store.state.autoGpuPreview == true) {
// Start the preview immediately // Start the preview immediately
@ -282,7 +275,7 @@ export default {
} }
// Send preview request // Send preview request
console.log(`${this._uid} toggled preview to ${state}`);
axios axios
.post(requestUri, payload) .post(requestUri, payload)
.then(() => {}) .then(() => {})

View file

@ -53,9 +53,7 @@ Vue.mixin({
) )
.finally(function() { .finally(function() {
// Reenable the GPU preview, if it was active before the modal // Reenable the GPU preview, if it was active before the modal
console.log("Re-enabling GPU preview");
if (context.$store.state.autoGpuPreview) { if (context.$store.state.autoGpuPreview) {
console.log("Re-enabling preview");
context.$root.$emit("globalTogglePreview", true); context.$root.$emit("globalTogglePreview", true);
} }
}); });
@ -102,21 +100,17 @@ Vue.mixin({
// If the response is a nicely formatted JSON response from the server // If the response is a nicely formatted JSON response from the server
if (error.response.data.message) { if (error.response.data.message) {
errormsg = `${error.response.status}: ${error.response.data.message}`; errormsg = `${error.response.status}: ${error.response.data.message}`;
console.log(errormsg);
} }
// If the response is just some generic error response // If the response is just some generic error response
else { else {
errormsg = `${error.response.status}: ${error.response.data}`; errormsg = `${error.response.status}: ${error.response.data}`;
console.log(errormsg);
} }
// If the error occured during the request // If the error occured during the request
} else if (error.request) { } else if (error.request) {
errormsg = `${error.message}`; errormsg = `${error.message}`;
console.log(errormsg);
// Everything else // Everything else
} else { } else {
errormsg = `${error.message}`; errormsg = `${error.message}`;
console.log(errormsg);
} }
return errormsg; return errormsg;
}, },
@ -138,7 +132,6 @@ Vue.mixin({
try { try {
return JSON.parse(localStorage.getItem(keyName)); return JSON.parse(localStorage.getItem(keyName));
} catch (e) { } catch (e) {
console.log("Malformed entry. Removing from localStorage");
localStorage.removeItem(keyName); localStorage.removeItem(keyName);
return null; return null;
} }