Merge branch 'js-cleanup' into 'master'

JS app cleanup

See merge request openflexure/openflexure-microscope-server!91
This commit is contained in:
Joel Collins 2020-11-23 16:57:18 +00:00
commit 13cff4a0fd
38 changed files with 185 additions and 379 deletions

View file

@ -1,27 +1,42 @@
stages: stages:
- analysis - analysis
- build - build
- package
- deploy - deploy
# Cache modules in between jobs # Re-usable block to install (and cache) Poetry and openflexure-microscope-server
cache: .poetry-install-template: &poetry-install
key: ${CI_COMMIT_REF_SLUG} before_script:
paths: - curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
- node_modules/ - source $HOME/.poetry/env
- poetry config virtualenvs.in-project true
- poetry install -vv
cache:
key: "${CI_COMMIT_REF_SLUG}"
paths:
- .cache/pip
- .venv
# Re-usable block to install (and cache) openflexure-microscope-server static app
.node-install-template: &node-install
before_script:
- cd openflexure_microscope/api/static/
- npm install
cache:
key: "${CI_COMMIT_REF_SLUG}"
paths:
- openflexure_microscope/api/static/node_modules
# Python static analysis with PyLint
pylint: pylint:
stage: analysis stage: analysis
image: python:3.7 image: python:3.7
retry: 1 retry: 1
before_script: <<: *poetry-install
- curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
script: script:
# Install server - poetry run pylint ./openflexure_microscope/
- $HOME/.poetry/bin/poetry install
# Run static build script
- $HOME/.poetry/bin/poetry run pylint ./openflexure_microscope/
only: only:
- branches - branches
@ -29,19 +44,17 @@ pylint:
- tags - tags
- web - web
# Python style analysis with Black
black: black:
stage: analysis stage: analysis
image: python:3.7 image: python:3.7
retry: 1 retry: 1
before_script: <<: *poetry-install
- curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
script: script:
# Install server
- $HOME/.poetry/bin/poetry install
# Run static build script # Run static build script
- $HOME/.poetry/bin/poetry run black --check . - poetry run black --check .
only: only:
- branches - branches
@ -49,19 +62,53 @@ black:
- tags - tags
- web - web
# Electron app build # JavaScript linting with ESLint (via Vue CLI)
build: eslint:
stage: build stage: analysis
image: nikolaik/python-nodejs:python3.7-nodejs14 image: node:15
before_script: <<: *node-install
- curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
script:
# Build JS application for production
- npm run lint
only:
- merge_requests
- tags
- web
# Build JS app
build:
stage: build
image: node:15
<<: *node-install
script:
# Build JS application for production
- npm run build
artifacts:
name: "dist"
expire_in: 1 week
paths:
- "./openflexure_microscope/api/static/dist/"
only:
- merge_requests
- tags
- web
# Package application into distribution tarball
package:
stage: package
dependencies:
- build
image: ubuntu:latest
script: script:
# Install server
- $HOME/.poetry/bin/poetry install
# Run static build script
- $HOME/.poetry/bin/poetry run build_static
# Build distribution archive # Build distribution archive
- mkdir -p dist - mkdir -p dist
- tar -c --exclude-vcs --exclude-from .tarignore -vzf dist/openflexure-microscope-server-${CI_COMMIT_REF_NAME}.tar.gz . - tar -c --exclude-vcs --exclude-from .tarignore -vzf dist/openflexure-microscope-server-${CI_COMMIT_REF_NAME}.tar.gz .
@ -72,7 +119,8 @@ build:
name: "dist" name: "dist"
expire_in: 1 week expire_in: 1 week
paths: paths:
- "./dist/*" - "./dist/openflexure-microscope-server-${CI_COMMIT_REF_NAME}.tar.gz"
- "./dist/openflexure-microscope-server-${CI_COMMIT_REF_NAME}.tar.gz.sha256"
only: only:
- merge_requests - merge_requests
@ -83,7 +131,8 @@ build:
deploy: deploy:
stage: deploy stage: deploy
dependencies: dependencies:
- build - package
image: ubuntu:latest image: ubuntu:latest
before_script: before_script:

View file

@ -1,10 +1,12 @@
Distribution archive rules
node_modules node_modules
.gitlab-ci.yml .gitlab-ci.yml
.gitlab/ .gitlab
./dist ./dist
!openflexure_microscope/api/static/dist !openflexure_microscope/api/static/dist
# VCS files
.pre-commit-config.yaml
# Pyenv files # Pyenv files
.python-version .python-version
.venv* .venv*

View file

@ -5,26 +5,14 @@ module.exports = {
node: true node: true
}, },
extends: [ parserOptions: {
"plugin:vue/recommended", parser: "babel-eslint"
"eslint:recommended", },
"prettier/vue",
"plugin:prettier/recommended",
"plugin:vue/essential",
"@vue/prettier"
],
rules: { rules: {
"vue/component-name-in-template-casing": ["error", "PascalCase"],
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off", "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off" "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off"
}, },
globals: { extends: ["plugin:vue/recommended", "eslint:recommended", "@vue/prettier"]
$nuxt: true
},
parserOptions: {
parser: "babel-eslint"
}
}; };

View file

@ -17,7 +17,7 @@ Please note we have a working flow, and a code of conduct. Please follow it in a
* Once we've merged a few things in and want to make a release, we tag it on master. * Once we've merged a few things in and want to make a release, we tag it on master.
* Not every commit on master will get a tag, we'll accumulate a few changes before making a release, unless there's a reason to release straight away. * Not every commit on master will get a tag, we'll accumulate a few changes before making a release, unless there's a reason to release straight away.
* Once we're confident that the tagged release is building and stable, we merge it into the stable branch. * Once the tagged release passes checks, it is deployed to the build server.
## Code of Conduct ## Code of Conduct

View file

@ -2613,12 +2613,12 @@
} }
}, },
"@vue/cli-plugin-eslint": { "@vue/cli-plugin-eslint": {
"version": "4.5.8", "version": "4.5.9",
"resolved": "https://registry.npmjs.org/@vue/cli-plugin-eslint/-/cli-plugin-eslint-4.5.8.tgz", "resolved": "https://registry.npmjs.org/@vue/cli-plugin-eslint/-/cli-plugin-eslint-4.5.9.tgz",
"integrity": "sha512-1lg3K2D/harXbN4FvRoA1b0X9947H+G4Ql/43rxJY39OqswfK/d1ck438Fo9M4l1+zhBSUNDmcjn7Q2EH6qWmA==", "integrity": "sha512-wTsWRiRWPW5ik4bgtlh4P4h63Zgjsyvqx2FY0kcj+bSAnQGPJ3bKUOMU9KQP5EyNH6pAXMVGh2LEXK9WwJMf1w==",
"dev": true, "dev": true,
"requires": { "requires": {
"@vue/cli-shared-utils": "^4.5.8", "@vue/cli-shared-utils": "^4.5.9",
"eslint-loader": "^2.2.1", "eslint-loader": "^2.2.1",
"globby": "^9.2.0", "globby": "^9.2.0",
"inquirer": "^7.1.0", "inquirer": "^7.1.0",
@ -2627,9 +2627,9 @@
}, },
"dependencies": { "dependencies": {
"@vue/cli-shared-utils": { "@vue/cli-shared-utils": {
"version": "4.5.8", "version": "4.5.9",
"resolved": "https://registry.npmjs.org/@vue/cli-shared-utils/-/cli-shared-utils-4.5.8.tgz", "resolved": "https://registry.npmjs.org/@vue/cli-shared-utils/-/cli-shared-utils-4.5.9.tgz",
"integrity": "sha512-pa6oenhBO/5HeDLRSokiwVN01gROACEDy3ESXWuPmragOREGNmmFKtkPHlqeYavGEX6LFp7f0VK3uMX6UYS5mQ==", "integrity": "sha512-anvsrv+rkQC+hgxaT2nQQxnSWSsIzyysZ36LO7qPjXvDRBvcvKLAAviFlUkYbZ+ntbV8puzJ3zw+gUhQw4SEVA==",
"dev": true, "dev": true,
"requires": { "requires": {
"@hapi/joi": "^15.0.1", "@hapi/joi": "^15.0.1",
@ -13760,9 +13760,9 @@
} }
}, },
"vue-loader-v16": { "vue-loader-v16": {
"version": "npm:vue-loader@16.0.0-rc.1", "version": "npm:vue-loader@16.0.0-rc.2",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.0.0-rc.1.tgz", "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.0.0-rc.2.tgz",
"integrity": "sha512-yR+BS90EOXTNieasf8ce9J3TFCpm2DGqoqdbtiwQ33hon3FyIznLX7sKavAq1VmfBnOeV6It0Htg4aniv8ph1g==", "integrity": "sha512-cz8GK4dgIf1UTC+do80pGvh8BHcCRHLIQVHV9ONVQ8wtoqS9t/+H02rKcQP+TVNg7khgLyQV2+8eHUq7/AFq3g==",
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
@ -13862,12 +13862,6 @@
"resolved": "https://registry.npmjs.org/vue-observe-visibility/-/vue-observe-visibility-0.4.6.tgz", "resolved": "https://registry.npmjs.org/vue-observe-visibility/-/vue-observe-visibility-0.4.6.tgz",
"integrity": "sha512-xo0CEVdkjSjhJoDdLSvoZoQrw/H2BlzB5jrCBKGZNXN2zdZgMuZ9BKrxXDjNP2AxlcCoKc8OahI3F3r3JGLv2Q==" "integrity": "sha512-xo0CEVdkjSjhJoDdLSvoZoQrw/H2BlzB5jrCBKGZNXN2zdZgMuZ9BKrxXDjNP2AxlcCoKc8OahI3F3r3JGLv2Q=="
}, },
"vue-plugin-load-script": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/vue-plugin-load-script/-/vue-plugin-load-script-1.3.2.tgz",
"integrity": "sha512-UQcFanuWBf72/339LxgsPZbMsT5LKUjBzkQfV3xf4ni5fc6Nnx5GNYclODFaQ9FHtOjWhu423bhHrlBHz4MIFg==",
"dev": true
},
"vue-style-loader": { "vue-style-loader": {
"version": "4.1.2", "version": "4.1.2",
"resolved": "https://registry.npmjs.org/vue-style-loader/-/vue-style-loader-4.1.2.tgz", "resolved": "https://registry.npmjs.org/vue-style-loader/-/vue-style-loader-4.1.2.tgz",

View file

@ -8,7 +8,7 @@
"serve": "vue-cli-service serve --mode development", "serve": "vue-cli-service serve --mode development",
"build": "vue-cli-service build --mode production", "build": "vue-cli-service build --mode production",
"lint": "vue-cli-service lint", "lint": "vue-cli-service lint",
"prettier": "vue-cli-service lint --fix" "lint:fix": "vue-cli-service lint --fix"
}, },
"dependencies": { "dependencies": {
"material-design-icons": "^3.0.1", "material-design-icons": "^3.0.1",
@ -17,14 +17,13 @@
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "^3.12.1", "@vue/cli-plugin-babel": "^3.12.1",
"@vue/cli-plugin-eslint": "^4.5.8", "@vue/cli-plugin-eslint": "^4.5.9",
"@vue/cli-service": "^4.5.8", "@vue/cli-service": "^4.5.8",
"@vue/eslint-config-prettier": "^6.0.0", "@vue/eslint-config-prettier": "^6.0.0",
"axios": "^0.19.2", "axios": "^0.19.2",
"babel-eslint": "^10.1.0", "babel-eslint": "^10.1.0",
"css-loader": "^3.6.0", "css-loader": "^3.6.0",
"eslint": "^6.8.0", "eslint": "^6.8.0",
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-prettier": "^3.1.4", "eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-vue": "^6.2.2", "eslint-plugin-vue": "^6.2.2",
"less": "^3.12.2", "less": "^3.12.2",
@ -34,7 +33,6 @@
"uikit": "^3.5.9", "uikit": "^3.5.9",
"vue": "^2.6.12", "vue": "^2.6.12",
"vue-friendly-iframe": "^0.17.0", "vue-friendly-iframe": "^0.17.0",
"vue-plugin-load-script": "^1.3.2",
"vue-template-compiler": "^2.6.12", "vue-template-compiler": "^2.6.12",
"vue-tour": "^1.5.0", "vue-tour": "^1.5.0",
"vuejs-paginate": "^2.1.0", "vuejs-paginate": "^2.1.0",

View file

@ -102,9 +102,9 @@ export default {
}, },
handleTheme: function() { handleTheme: function() {
var isDark = false; var isDark = false;
if (this.$store.state.globalSettings.appTheme == "dark") { if (this.$store.state.appTheme == "dark") {
isDark = true; isDark = true;
} else if (this.$store.state.globalSettings.appTheme == "system") { } else if (this.$store.state.appTheme == "system") {
if (this.systemDark) { if (this.systemDark) {
isDark = true; isDark = true;
} }
@ -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

@ -1,18 +0,0 @@
// Theming specific to the electron app
.menubar-menu-container {
box-shadow: 0.5px 1px 4px 0px rgba(0, 0, 0, 0.3) !important;
}
.menubar-menu-container>* {
box-shadow: none !important;
}
.menubar-menu-container .action-menu-item,
.menubar-menu-container .action-label {
cursor: default
}
.menubar-menu-container a:hover {
text-decoration: none;
}

View file

@ -4,9 +4,6 @@
// Highlight.js // Highlight.js
@import "./highlight.less"; @import "./highlight.less";
// Electron app theming
@import "./app.less";
// Custom OpenFlexure theming // Custom OpenFlexure theming
// //

View file

@ -214,7 +214,7 @@ export default {
computed: { computed: {
enabledTopTabs: function() { enabledTopTabs: function() {
var enabledTabs = this.topTabs; var enabledTabs = this.topTabs;
if (this.$store.state.globalSettings.IHIEnabled) { if (this.$store.state.IHIEnabled) {
enabledTabs.push({ enabledTabs.push({
id: "slidescan", id: "slidescan",
icon: "settings_overscan", icon: "settings_overscan",
@ -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) {
@ -267,9 +266,9 @@ export default {
window.location.hostname window.location.hostname
) )
) { ) {
this.$store.commit("changeSetting", ["disableStream", true]); this.$store.commit("changeDisableStream", true);
this.$store.commit("changeSetting", ["autoGpuPreview", true]); this.$store.commit("changeAutoGpuPreview", true);
this.$store.commit("changeSetting", ["trackWindow", true]); this.$store.commit("changeTrackWindow", true);
} }
// Update plugins // Update plugins
this.updatePlugins().then(() => { this.updatePlugins().then(() => {
@ -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

@ -1,61 +0,0 @@
<template>
<div class="uk-padding-small">
<div v-if="error" class="uk-padding-small uk-text-danger">
<b>{{ error }}</b>
</div>
<component
:is="componentName"
v-if="ready"
:component-base-u-r-l="ApiRootURL"
></component>
</div>
</template>
<script>
export default {
name: "WebComponentLoader",
props: {
componentURL: {
type: String,
required: true
},
componentName: {
type: String,
required: true
}
},
data: function() {
return {
ready: false,
error: null
};
},
computed: {
ApiRootURL: function() {
return `${this.$store.getters.baseUri}/api/v2`;
}
},
mounted() {
// Method 2
this.$loadScript(this.componentURL)
.then(() => {
const el = customElements.get(this.componentName);
if (el) {
this.ready = true;
} else {
this.error = `Error: No component ${this.componentName} found.`;
}
this.ready = true;
})
.catch(() => {
this.ready = false;
});
}
};
</script>
<style scoped></style>

View file

@ -23,6 +23,12 @@ export default {
}; };
}, },
mounted() {
if (!this.$store.getters.ready) {
this.currentOrigin = "http://microscope.local:5000";
}
},
methods: { methods: {
overrideAPIHost: function() { overrideAPIHost: function() {
this.$store.commit("changeOrigin", this.currentOrigin); this.$store.commit("changeOrigin", this.currentOrigin);

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

@ -242,7 +242,7 @@
</li> </li>
</ul> </ul>
<div v-if="scanCapture" class="uk-margin uk-margin-remove-top "> <div v-if="scanCapture" class="uk-margin uk-margin-remove-top">
<taskSubmitter <taskSubmitter
:submit-url="scanUri" :submit-url="scanUri"
:submit-data="scanPayload" :submit-data="scanPayload"
@ -296,9 +296,9 @@ export default {
scanStyle: "Raster", scanStyle: "Raster",
namingStyle: "Coordinates", namingStyle: "Coordinates",
scanStepSize: { scanStepSize: {
x: 0, x: 800,
y: 0, y: 640,
z: 0 z: 50
}, },
scanSteps: { scanSteps: {
x: 3, x: 3,
@ -308,7 +308,7 @@ export default {
resizeDims: [640, 480], resizeDims: [640, 480],
tags: [], tags: [],
annotations: { annotations: {
Client: `${process.env.PACKAGE.name}.${process.env.PACKAGE.version}` Client: "openflexure-microscope-jsclient:builtin"
}, },
scanUri: null scanUri: null
}; };
@ -326,9 +326,6 @@ export default {
pluginsUri: function() { pluginsUri: function() {
return `${this.$store.getters.baseUri}/api/v2/extensions`; return `${this.$store.getters.baseUri}/api/v2/extensions`;
}, },
settingsFovUri: function() {
return `${this.$store.getters.baseUri}/api/v2/instrument/settings/fov`;
},
basePayload: function() { basePayload: function() {
var payload = {}; var payload = {};
@ -359,8 +356,6 @@ export default {
payload.annotations["Notes"] = this.captureNotes; payload.annotations["Notes"] = this.captureNotes;
} }
console.log(payload);
return payload; return payload;
}, },
@ -395,7 +390,6 @@ export default {
mounted() { mounted() {
this.updateScanUri(); this.updateScanUri();
this.updateScanStepSize();
// A global signal listener to perform a capture action // A global signal listener to perform a capture action
this.$root.$on("globalCaptureEvent", () => { this.$root.$on("globalCaptureEvent", () => {
this.handleCapture(); this.handleCapture();
@ -439,25 +433,9 @@ export default {
}); });
}, },
updateScanStepSize: function() {
axios
.get(this.settingsFovUri) // Get the microscope FOV
.then(response => {
this.scanStepSize = {
x: parseInt(0.5 * response.data[0]),
y: parseInt(0.5 * response.data[1]),
z: 50
};
})
.catch(error => {
this.modalError(error); // Let mixin handle error
});
},
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

@ -3,12 +3,6 @@
<div uk-grid class="uk-height-1-1 uk-margin-remove uk-padding-remove"> <div uk-grid class="uk-height-1-1 uk-margin-remove uk-padding-remove">
<div class="control-component"> <div class="control-component">
<vue-friendly-iframe v-if="frame" :src="frame.href"></vue-friendly-iframe> <vue-friendly-iframe v-if="frame" :src="frame.href"></vue-friendly-iframe>
<div v-else-if="webComponent">
<WebComponentLoader
:component-u-r-l="webComponent.href"
:component-name="webComponent.name"
/>
</div>
<!-- Handle OpenFlexure Forms --> <!-- Handle OpenFlexure Forms -->
<div <div
v-for="form in forms" v-for="form in forms"
@ -37,7 +31,6 @@
<script> <script>
import JsonForm from "../pluginComponents/JsonForm"; import JsonForm from "../pluginComponents/JsonForm";
import WebComponentLoader from "../pluginComponents/WebComponentLoader";
import streamDisplay from "./streamContent.vue"; import streamDisplay from "./streamContent.vue";
import galleryContent from "../tabContentComponents/galleryContent.vue"; import galleryContent from "../tabContentComponents/galleryContent.vue";
import settingsContent from "../tabContentComponents/settingsContent.vue"; import settingsContent from "../tabContentComponents/settingsContent.vue";
@ -47,7 +40,6 @@ export default {
components: { components: {
JsonForm, JsonForm,
WebComponentLoader,
streamDisplay, streamDisplay,
galleryContent, galleryContent,
settingsContent settingsContent
@ -59,11 +51,6 @@ export default {
required: false, required: false,
default: () => [] default: () => []
}, },
webComponent: {
type: Object,
required: false,
default: null
},
frame: { frame: {
type: Object, type: Object,
required: false, required: false,

View file

@ -1,7 +1,7 @@
<template> <template>
<div <div
class="capture-card uk-card uk-card-default uk-padding-remove uk-width-medium" class="capture-card uk-card uk-card-default uk-padding-remove uk-width-medium"
:class="{ 'uk-card-secondary': $store.state.globalSettings.darkMode }" :class="{ 'uk-card-secondary': $store.state.darkMode }"
> >
<div class="uk-card-media-top"> <div class="uk-card-media-top">
<a class="lightbox-link" :href="imgURL" :data-caption="name"> <a class="lightbox-link" :href="imgURL" :data-caption="name">
@ -70,8 +70,7 @@
<div <div
class="uk-modal-dialog uk-modal-body" class="uk-modal-dialog uk-modal-body"
:class="{ :class="{
'uk-light uk-background-secondary': 'uk-light uk-background-secondary': $store.state.darkMode
$store.state.globalSettings.darkMode
}" }"
> >
<button class="uk-modal-close-default" type="button" uk-close></button> <button class="uk-modal-close-default" type="button" uk-close></button>
@ -112,8 +111,7 @@
<form <form
class="uk-modal-dialog uk-modal-body uk-margin-auto-vertical" class="uk-modal-dialog uk-modal-body uk-margin-auto-vertical"
:class="{ :class="{
'uk-light uk-background-secondary': 'uk-light uk-background-secondary': $store.state.darkMode
$store.state.globalSettings.darkMode
}" }"
@submit.prevent="handleTagSubmit" @submit.prevent="handleTagSubmit"
> >
@ -243,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 => {
@ -324,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

@ -24,8 +24,7 @@
<a href="#">Filter</a> <a href="#">Filter</a>
<div <div
:class="{ :class="{
'uk-light uk-background-secondary': 'uk-light uk-background-secondary': $store.state.darkMode
$store.state.globalSettings.darkMode
}" }"
class="uk-navbar-dropdown" class="uk-navbar-dropdown"
> >
@ -342,12 +341,14 @@ export default {
methods: { methods: {
scrollToTop() { scrollToTop() {
document.querySelector("#container-left").scrollTop = 0; const el = document.querySelector("#container-left");
if (el) {
el.scrollTop = 0;
}
}, },
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 => {
@ -356,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

@ -111,7 +111,10 @@ export default {
methods: { methods: {
scrollToTop() { scrollToTop() {
document.querySelector("#container-left").scrollTop = 0; const el = document.querySelector("#container-left");
if (el) {
el.scrollTop = 0;
}
}, },
visibilityChanged(isVisible) { visibilityChanged(isVisible) {
if (isVisible) { if (isVisible) {
@ -119,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

@ -26,17 +26,16 @@ export default {
computed: { computed: {
appTheme: { appTheme: {
get() { get() {
return this.$store.state.globalSettings.appTheme; return this.$store.state.appTheme;
}, },
set(value) { set(value) {
this.$store.commit("changeSetting", ["appTheme", value]); this.$store.commit("changeAppTheme", value);
} }
} }
}, },
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

@ -29,10 +29,10 @@ export default {
computed: { computed: {
IHIEnabled: { IHIEnabled: {
get() { get() {
return this.$store.state.globalSettings.IHIEnabled; return this.$store.state.IHIEnabled;
}, },
set(value) { set(value) {
this.$store.commit("changeSetting", ["IHIEnabled", value]); this.$store.commit("changeIHIEnabled", value);
this.$root.$emit("globalSafeTogglePreview", value); this.$root.$emit("globalSafeTogglePreview", value);
} }
} }
@ -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

@ -61,29 +61,29 @@ export default {
computed: { computed: {
disableStream: { disableStream: {
get() { get() {
return this.$store.state.globalSettings.disableStream; return this.$store.state.disableStream;
}, },
set(value) { set(value) {
this.$store.commit("changeSetting", ["disableStream", value]); this.$store.commit("changeDisableStream", value);
} }
}, },
autoGpuPreview: { autoGpuPreview: {
get() { get() {
return this.$store.state.globalSettings.autoGpuPreview; return this.$store.state.autoGpuPreview;
}, },
set(value) { set(value) {
this.$store.commit("changeSetting", ["autoGpuPreview", value]); this.$store.commit("changeAutoGpuPreview", value);
this.$root.$emit("globalSafeTogglePreview", value); this.$root.$emit("globalSafeTogglePreview", value);
} }
}, },
trackWindow: { trackWindow: {
get() { get() {
return this.$store.state.globalSettings.trackWindow; return this.$store.state.trackWindow;
}, },
set(value) { set(value) {
this.$store.commit("changeSetting", ["trackWindow", value]); this.$store.commit("changeTrackWindow", value);
} }
} }
} }

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

@ -21,7 +21,7 @@
</div> </div>
<div <div
v-else-if="$store.state.globalSettings.disableStream" v-else-if="$store.state.disableStream"
class="uk-position-center position-relative text-center" class="uk-position-center position-relative text-center"
> >
Stream preview disabled Stream preview disabled
@ -46,17 +46,13 @@ export default {
isVisible: false, isVisible: false,
displaySize: [0, 0], displaySize: [0, 0],
displayPosition: [0, 0], displayPosition: [0, 0],
fov: [0, 0],
resizeTimeoutId: setTimeout(this.doneResizing, 500) resizeTimeoutId: setTimeout(this.doneResizing, 500)
}; };
}, },
computed: { computed: {
streamEnabled: function() { streamEnabled: function() {
return ( return this.$store.getters.ready && !this.$store.state.disableStream;
this.$store.getters.ready &&
!this.$store.state.globalSettings.disableStream
);
}, },
thisStreamOpen: function() { thisStreamOpen: function() {
// Only a single MJPEG connection should be open at a time // Only a single MJPEG connection should be open at a time
@ -77,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);
@ -101,15 +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.globalSettings.autoGpuPreview); this.safePreviewRequest(this.$store.state.autoGpuPreview);
// Get FOV from settings
this.updateFov();
}, },
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
@ -136,7 +127,7 @@ export default {
}, },
clickMonitor: function(event) { clickMonitor: function(event) {
// Calculate steps from event coordinates and store config FOV // Calculate steps from event coordinates
let xCoordinate = event.offsetX; let xCoordinate = event.offsetX;
let yCoordinate = event.offsetY; let yCoordinate = event.offsetY;
@ -169,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);
@ -188,9 +176,8 @@ 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.globalSettings.autoGpuPreview == true) { if (this.$store.state.autoGpuPreview == true) {
// Start the preview immediately // Start the preview immediately
this.safePreviewRequest(true); this.safePreviewRequest(true);
// Send another start preview request after a timeout // Send another start preview request after a timeout
@ -261,7 +248,7 @@ export default {
// If requesting starting the stream, but this component is inactive, skip // If requesting starting the stream, but this component is inactive, skip
if ( if (
this.$store.getters.ready == true && this.$store.getters.ready == true &&
this.$store.state.globalSettings.autoGpuPreview == true this.$store.state.autoGpuPreview == true
) { ) {
var requestUri = null; var requestUri = null;
// Create URI // Create URI
@ -273,10 +260,7 @@ export default {
// Generate payload if tracking window position // Generate payload if tracking window position
var payload = {}; var payload = {};
if ( if (this.$store.state.trackWindow == true && state == true) {
this.$store.state.globalSettings.trackWindow == true &&
state == true
) {
// Recalculate frame dimensions and position // Recalculate frame dimensions and position
this.recalculateSize(); this.recalculateSize();
// Copy data into payload array // Copy data into payload array
@ -291,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(() => {})
@ -299,21 +283,6 @@ export default {
this.modalError(error); // Let mixin handle error this.modalError(error); // Let mixin handle error
}); });
} }
},
updateFov: function() {
console.log("Updating FOV");
// Get the current field-of-view setting from the server
axios
.get(`${this.settingsUri}/fov`)
.then(response => {
if (response.data) {
this.fov = response.data;
}
})
.catch(error => {
this.modalError(error); // Let mixin handle error
});
} }
} }
}; };

View file

@ -3,7 +3,6 @@ import App from "./App.vue";
import store from "./store"; import store from "./store";
import UIkit from "uikit"; import UIkit from "uikit";
import VueTour from "vue-tour"; import VueTour from "vue-tour";
import LoadScript from "vue-plugin-load-script";
import VueFriendlyIframe from "vue-friendly-iframe"; import VueFriendlyIframe from "vue-friendly-iframe";
import VueObserveVisibility from "vue-observe-visibility"; import VueObserveVisibility from "vue-observe-visibility";
@ -22,9 +21,6 @@ UIkit.mixin(
"accordion" "accordion"
); );
// Use load-script module
Vue.use(LoadScript);
// Use vue-tour module // Use vue-tour module
Vue.use(VueTour); Vue.use(VueTour);
@ -57,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.globalSettings.autoGpuPreview) {
console.log("Re-enabling preview");
context.$root.$emit("globalTogglePreview", true); context.$root.$emit("globalTogglePreview", true);
} }
}); });
@ -106,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;
}, },
@ -142,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;
} }

View file

@ -9,13 +9,11 @@ export default new Vuex.Store({
available: false, available: false,
waiting: false, waiting: false,
error: "", error: "",
globalSettings: { disableStream: false,
disableStream: false, autoGpuPreview: false,
autoGpuPreview: false, trackWindow: true,
trackWindow: true, IHIEnabled: false,
IHIEnabled: false, appTheme: "system",
appTheme: "system"
},
activeStreams: {} activeStreams: {}
}, },
@ -26,8 +24,20 @@ export default new Vuex.Store({
changeWaiting(state, waiting) { changeWaiting(state, waiting) {
state.waiting = waiting; state.waiting = waiting;
}, },
changeSetting(state, [key, value]) { changeDisableStream(state, disabled) {
state.globalSettings[key] = value; state.disableStream = disabled;
},
changeAutoGpuPreview(state, enabled) {
state.autoGpuPreview = enabled;
},
changeTrackWindow(state, enabled) {
state.trackWindow = enabled;
},
changeAppTheme(state, theme) {
state.appTheme = theme;
},
changeIHIEnabled(state, enabled) {
state.IHIEnabled = enabled;
}, },
resetState(state) { resetState(state) {
state.waiting = false; state.waiting = false;

View file

@ -1,15 +0,0 @@
var webpack = require("webpack");
module.exports = {
configureWebpack: {
plugins: [
new webpack.DefinePlugin({
"process.env": {
PACKAGE: JSON.stringify(require("./package.json"))
}
})
]
},
publicPath: ""
};

View file

@ -37,8 +37,6 @@ class Microscope:
self.captures = CaptureManager() self.captures = CaptureManager()
self.fov = [0, 0] #: Microscope field-of-view in stage motor steps
# Store settings and configuration files # Store settings and configuration files
self.settings_file = settings self.settings_file = settings
self.configuration_file = configuration self.configuration_file = configuration
@ -217,8 +215,6 @@ class Microscope:
self.id = settings.pop("id") self.id = settings.pop("id")
if "name" in settings: if "name" in settings:
self.name = settings.pop("name") self.name = settings.pop("name")
if "fov" in settings:
self.fov = settings.pop("fov")
# Extension settings # Extension settings
if "extensions" in settings: if "extensions" in settings:
@ -241,7 +237,6 @@ class Microscope:
settings_current = { settings_current = {
"id": self.id, "id": self.id,
"name": self.name, "name": self.name,
"fov": self.fov,
"extensions": self.extension_settings, "extensions": self.extension_settings,
} }