Improve model location determination

Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
2024-03-25 08:46:01 -07:00
parent 53869aa268
commit 97706e54b9

View File

@@ -165,26 +165,27 @@
created () { created () {
var loadOtherSettings = localStorage.getItem('otherSettings') var loadOtherSettings = localStorage.getItem('otherSettings')
if (loadOtherSettings) this.otherSettings = JSON.parse(loadOtherSettings) if (loadOtherSettings) this.otherSettings = JSON.parse(loadOtherSettings)
let modelRoot = this.isCordova ? 'https://localhost' : (import.meta.env.PROD ? '.' : '..')
switch (this.f7route.params.region) { switch (this.f7route.params.region) {
case 'thorax': case 'thorax':
this.activeRegion = 0 this.activeRegion = 0
this.detectorName = 'thorax' this.detectorName = 'thorax'
/* VITE setting */ /* VITE setting */
this.modelLocation = `../models/thorax${this.otherSettings.mini ? '-mini' : ''}/model.json` this.modelLocation = `${modelRoot}/models/thorax${this.otherSettings.mini ? '-mini' : ''}/model.json`
this.miniLocation = `../models/thorax-mini/model.json` this.miniLocation = `${modelRoot}/models/thorax-mini/model.json`
/* PWA Build setting */ /* PWA Build setting */
//this.modelLocation = `./models/thorax${this.otherSettings.mini ? '-mini' : ''}/model.json` //this.modelLocation = `./models/thorax${this.otherSettings.mini ? '-mini' : ''}/model.json`
this.modelLocationCordova = `https://localhost/models/thorax${this.otherSettings.mini ? '-mini' : ''}/model.json` this.modelLocationCordova = `${modelRoot}/models/thorax${this.otherSettings.mini ? '-mini' : ''}/model.json`
break; break;
case 'abdomen': case 'abdomen':
this.activeRegion = 1 this.activeRegion = 1
this.detectorName = 'abdomen' this.detectorName = 'abdomen'
/* VITE setting */ /* VITE setting */
this.modelLocation = `../models/abdomen${this.otherSettings.mini ? '-mini' : ''}/model.json` this.modelLocation = `${modelRoot}/models/abdomen${this.otherSettings.mini ? '-mini' : ''}/model.json`
this.miniLocation = `../models/abdomen-mini/model.json` this.miniLocation = `${modelRoot}/models/abdomen-mini/model.json`
/* PWA Build setting */ /* PWA Build setting */
//this.modelLocation = `./models/abdomen${this.otherSettings.mini ? '-mini' : ''}/model.json` //this.modelLocation = `./models/abdomen${this.otherSettings.mini ? '-mini' : ''}/model.json`
this.modelLocationCordova = `https://localhost/models/abdomen${this.otherSettings.mini ? '-mini' : ''}/model.json` this.modelLocationCordova = `${modelRoot}/models/abdomen${this.otherSettings.mini ? '-mini' : ''}/model.json`
break; break;
case 'limbs': case 'limbs':
this.activeRegion = 2 this.activeRegion = 2