Commit fcdb30ee authored by Joel Collins's avatar Joel Collins
Browse files

Updated to new API structure

parent 733b6f4b
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -313,7 +313,7 @@ export default {
      return `${this.$store.getters.baseUri}/api/v2/actions/camera/capture`;
    },
    pluginsUri: function() {
      return `${this.$store.getters.baseUri}/api/v2/plugins`;
      return `${this.$store.getters.baseUri}/api/v2/extensions`;
    },
    settingsFovUri: function() {
      return `${this.$store.getters.baseUri}/api/v2/settings/fov`;
@@ -395,7 +395,7 @@ export default {
          // Flash the stream (capture animation)
          this.$root.$emit("globalFlashStream");
          // Update the global capture list
          this.$root.$emit("globalUpdateCaptureList");
          this.$root.$emit("globalUpdateCaptures");
        })
        .catch(error => {
          this.modalError(error); // Let mixin handle error
@@ -407,12 +407,13 @@ export default {
        .get(this.pluginsUri) // Get a list of plugins
        .then(response => {
          var plugins = response.data;
          var foundExtension = plugins.find(
            e => e.title === "org.openflexure.scan"
          );
          // if ScanPlugin is enabled
          if ("ScanPlugin" in plugins) {
          if (foundExtension) {
            // Get plugin action link
            var link = plugins.ScanPlugin.views.tile.links.self;
            // Store plugin action URI
            this.scanUri = `${this.$store.getters.baseUri}${link}`;
            this.scanUri = foundExtension.links.tile.href;
          }
        })
        .catch(error => {
@@ -422,7 +423,7 @@ export default {

    updateScanStepSize: function() {
      axios
        .get(this.settingsFovUri) // Get a list of plugins
        .get(this.settingsFovUri) // Get the microscope FOV
        .then(response => {
          this.scanStepSize = {
            x: parseInt(0.5 * response.data[0]),
+7 −10
Original line number Diff line number Diff line
@@ -196,7 +196,7 @@ export default {
      return `${this.$store.getters.baseUri}/api/v2/status/stage/position`;
    },
    pluginsUri: function() {
      return `${this.$store.getters.baseUri}/api/v2/plugins`;
      return `${this.$store.getters.baseUri}/api/v2/extensions`;
    }
  },

@@ -352,17 +352,14 @@ export default {
        .get(this.pluginsUri) // Get a list of plugins
        .then(response => {
          var plugins = response.data;
          var foundExtension = plugins.find(
            e => e.title === "org.openflexure.autofocus"
          );
          // if ScanPlugin is enabled
          if ("AutofocusPlugin" in plugins) {
          if (foundExtension) {
            // Get plugin action link
            var fastLink =
              plugins.AutofocusPlugin.views.fast_autofocus.links.self;
            var normalLink = plugins.AutofocusPlugin.views.autofocus.links.self;
            // Store plugin action URI
            this.fastAutofocusUri = `${this.$store.getters.baseUri}${fastLink}`;
            this.normalAutofocusUri = `${
              this.$store.getters.baseUri
            }${normalLink}`;
            this.fastAutofocusUri = foundExtension.links.fast_autofocus.href;
            this.normalAutofocusUri = foundExtension.links.autofocus.href;
          }
        })
        .catch(error => {
+4 −6
Original line number Diff line number Diff line
@@ -144,16 +144,14 @@ export default {
        .get(this.actionsUri)
        .then(response => {
          if ("reboot" in response.data) {
            this.systemActionLinks.reboot = `${this.$store.getters.baseUri}${
              response.data.reboot.links.self
            }`;
            this.systemActionLinks.reboot =
              response.data.reboot.links.self.href;
          } else {
            delete this.systemActionLinks.reboot;
          }
          if ("shutdown" in response.data) {
            this.systemActionLinks.shutdown = `${this.$store.getters.baseUri}${
              response.data.shutdown.links.self
            }`;
            this.systemActionLinks.shutdown =
              response.data.shutdown.links.self.href;
          } else {
            delete this.systemActionLinks.shutdown;
          }
+6 −6
Original line number Diff line number Diff line
@@ -96,7 +96,7 @@ export default {
      return `${this.$store.getters.baseUri}/api/v2/settings`;
    },
    pluginsUri: function() {
      return `${this.$store.getters.baseUri}/api/v2/plugins`;
      return `${this.$store.getters.baseUri}/api/v2/extensions`;
    }
  },

@@ -122,13 +122,13 @@ export default {
        .get(this.pluginsUri) // Get a list of plugins
        .then(response => {
          var plugins = response.data;
          var foundExtension = plugins.find(
            e => e.title === "org.openflexure.calibration.picamera"
          );
          // if AutocalibrationPlugin is enabled
          if ("AutocalibrationPlugin" in plugins) {
          if (foundExtension) {
            // Get plugin action link
            var link =
              plugins.AutocalibrationPlugin.views.recalibrate.links.self;
            // Store plugin action URI
            this.recalibrationUri = `${this.$store.getters.baseUri}${link}`;
            this.recalibrationUri = foundExtension.links.recalibrate.href;
          }
        })
        .catch(error => {
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ export default {
    placeholder: {
      type: Number,
      required: false,
      default: NaN
      default: 0
    },
    name: {
      type: String,
Loading