Add alvinn mini settings
Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
@@ -142,6 +142,7 @@
|
||||
detectorLevel: 50,
|
||||
detectorLabels: [],
|
||||
serverSettings: {},
|
||||
otherSettings: {},
|
||||
isCordova: !!window.cordova,
|
||||
uploadUid: null,
|
||||
uploadDirty: false,
|
||||
@@ -156,16 +157,18 @@
|
||||
return store()
|
||||
},
|
||||
created () {
|
||||
var loadOtherSettings = localStorage.getItem('otherSettings')
|
||||
if (loadOtherSettings) this.otherSettings = JSON.parse(loadOtherSettings)
|
||||
switch (this.f7route.params.region) {
|
||||
case 'thorax':
|
||||
this.activeRegion = 0
|
||||
this.detectorName = 'thorax'
|
||||
//this.classesList = thoraxClasses
|
||||
/* VITE setting */
|
||||
this.modelLocation = '../models/thorax/model.json'
|
||||
this.modelLocation = `../models/thorax${this.otherSettings.mini ? '-mini' : ''}/model.json`
|
||||
/* PWA Build setting */
|
||||
//this.modelLocation = './models/thorax/model.json'
|
||||
this.modelLocationCordova = 'https://localhost/models/thorax/model.json'
|
||||
//this.modelLocation = `./models/thorax${this.otherSettings.mini ? '-mini' : ''}/model.json`
|
||||
this.modelLocationCordova = `https://localhost/models/thorax${this.otherSettings.mini ? '-mini' : ''}/model.json`
|
||||
break;
|
||||
case 'abdomen':
|
||||
this.activeRegion = 1
|
||||
|
||||
@@ -12,9 +12,12 @@
|
||||
<f7-list-item title="Light" :checked="themeSettings.darkMode.toString() == 'false'" radio name="darkmode" radio-icon="end" @change="setDarkMode(false)" ></f7-list-item>
|
||||
<f7-list-item title="Dark" :checked="themeSettings.darkMode.toString() == 'true'" radio name="darkmode" radio-icon="end" @change="setDarkMode(true)" ></f7-list-item>
|
||||
</f7-list>
|
||||
<f7-button @click="saveAllSettings">Save</f7-button>
|
||||
<f7-block-title @click="toggleSettingsView" medium>Advanced Settings</f7-block-title>
|
||||
<f7-block-title @click="toggleSettingsView" medium><f7-icon :f7="showAdvanced ? 'chevron_down' : 'chevron_right'" /> Advanced Settings </f7-block-title>
|
||||
<div ref="advancedSettings" class="settings-container">
|
||||
<div style="display:flex; justify-content:space-between; width: 100%; margin-bottom: 10px;">
|
||||
<span style="margin-left: 16px;">Use mini ALVINN<f7-icon size="16" style="padding-left: 5px;" f7="question_diamond_fill" tooltip="faster, less accurate: recommended for slower devices" /></span>
|
||||
<f7-toggle v-model:checked="otherSettings.mini" style="margin-right: 16px;" />
|
||||
</div>
|
||||
<div style="display:flex; justify-content:space-between; width: 100%">
|
||||
<span style="margin-left: 16px;">Use external server</span>
|
||||
<f7-toggle v-model:checked="serverSettings.use" style="margin-right: 16px;" />
|
||||
@@ -29,6 +32,7 @@
|
||||
<f7-list-item v-if="Object.keys(otherIp).length == 0" title="No previous server settings"></f7-list-item>
|
||||
</f7-list>
|
||||
</div>
|
||||
<f7-button fill @click="saveAllSettings">SAVE</f7-button>
|
||||
</div>
|
||||
</f7-block>
|
||||
</f7-page>
|
||||
@@ -49,6 +53,9 @@
|
||||
data () {
|
||||
return {
|
||||
showAdvanced: false,
|
||||
otherSettings: {
|
||||
mini: false
|
||||
},
|
||||
serverSettings: {
|
||||
use: false,
|
||||
address: '10.170.64.22',
|
||||
@@ -77,6 +84,8 @@
|
||||
if (!this.serverSettings.previous) this.serverSettings.previous = {}
|
||||
var loadThemeSettings = localStorage.getItem('themeSettings')
|
||||
if (loadThemeSettings) this.themeSettings = JSON.parse(loadThemeSettings)
|
||||
var loadOtherSettings = localStorage.getItem('otherSettings')
|
||||
if (loadOtherSettings) this.otherSettings = JSON.parse(loadOtherSettings)
|
||||
},
|
||||
methods: {
|
||||
saveAllSettings () {
|
||||
@@ -88,6 +97,7 @@
|
||||
}
|
||||
localStorage.setItem('serverSettings',JSON.stringify(this.serverSettings))
|
||||
localStorage.setItem('themeSettings',JSON.stringify(this.themeSettings))
|
||||
localStorage.setItem('otherSettings',JSON.stringify(this.otherSettings))
|
||||
saved()
|
||||
} catch {
|
||||
failed()
|
||||
|
||||
@@ -31,14 +31,17 @@
|
||||
abdomenDetails: { "version": "Model not available" },
|
||||
limbsDetails: { "version": "Model not available" },
|
||||
headneckDetails: { "version": "Model not available" },
|
||||
alvinnVersion: store().getVersion
|
||||
alvinnVersion: store().getVersion,
|
||||
otherSettings: {}
|
||||
}
|
||||
},
|
||||
setup() {
|
||||
return store()
|
||||
},
|
||||
created () {
|
||||
import('../models/thorax/descript.json')
|
||||
var loadOtherSettings = localStorage.getItem('otherSettings')
|
||||
if (loadOtherSettings) this.otherSettings = JSON.parse(loadOtherSettings)
|
||||
import(`../models/thorax${this.otherSettings.mini ? '-mini' : ''}/descript.json`)
|
||||
.then((mod) => {
|
||||
this.thoraxDetails = mod.default
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user