Disable ImJoy control

If the environment variable is disabling ImJoy, don't allow
the user to enable it with the tick-box.
This commit is contained in:
Richard 2021-06-22 12:08:17 +01:00
parent 33b3ffc7f7
commit d73b0afd36
2 changed files with 18 additions and 9 deletions

View file

@ -10,8 +10,8 @@
// Colors
//
@global-color: #666;
@global-emphasis-color: #333;
@global-color: #000;
@global-emphasis-color: #C32280;
@global-muted-color: #666;
@global-primary-background: #C32280;
@ -33,7 +33,7 @@
@global-medium-font-size: 20px;
@global-small-font-size: 14px;
@global-emphasis-color: #222;
//
// Base

View file

@ -14,18 +14,21 @@
for use in clinics acquiring blood smear samples using a 100x
oil-immersion objective, with a Raspberry Pi Camera v2.
</p>
<p class="uk-margin-small">
<label
><input v-model="imjoyEnabled" class="uk-checkbox" type="checkbox" />
Enable ImJoy plugin engine</label
>
<p class="uk-margin-small" :class="{'uk-text-muted': !imjoyPermitted}">
<label :disabled="!imjoyPermitted">
<input v-model="imjoyEnabled" class="uk-checkbox" type="checkbox" :disabled="!imjoyPermitted"/>
Enable ImJoy plugin engine
</label>
</p>
<p class="uk-margin-small">
<p class="uk-margin-small" v-if="imjoyPermitted">
<a href="https://imjoy.io/">ImJoy</a> enables integration with a wide
variety of microscopy and image analysis applications, including ImageJ.JS
and Kaibu. Support for ImJoy within the OFM software is currently
experimental, and it may slow down loading of the application.
</p>
<p class="uk-margin-small uk-text-muted" v-if="!imjoyPermitted">
ImJoy plugins are disabled in this build of the OpenFlexure software.
</p>
<p class="uk-margin-small">
<label
><input v-model="galleryEnabled" class="uk-checkbox" type="checkbox" />
@ -72,6 +75,12 @@ export default {
set(value) {
this.$store.commit("changeGalleryEnabled", value);
}
},
imjoyPermitted: function () {
// ImJoy may be disabled using an environment variable.
// If this function returns false, it is never possible to
// use ImJoy, so we should gray out the option.
return process.env.VUE_APP_ENABLE_IMJOY === "true";
}
},