Move assets to vite public folder #152
|
Before Width: | Height: | Size: 1.8 MiB After Width: | Height: | Size: 1.8 MiB |
|
Before Width: | Height: | Size: 1.6 MiB After Width: | Height: | Size: 1.6 MiB |
|
Before Width: | Height: | Size: 714 KiB After Width: | Height: | Size: 714 KiB |
@@ -120,7 +120,6 @@
|
|||||||
import submitMixin from './submit-mixin'
|
import submitMixin from './submit-mixin'
|
||||||
import detectionMixin from './detection-mixin'
|
import detectionMixin from './detection-mixin'
|
||||||
import cameraMixin from './camera-mixin'
|
import cameraMixin from './camera-mixin'
|
||||||
import App from 'framework7-vue/components/app'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [submitMixin, detectionMixin, cameraMixin],
|
mixins: [submitMixin, detectionMixin, cameraMixin],
|
||||||
@@ -168,7 +167,7 @@ import App from 'framework7-vue/components/app'
|
|||||||
created () {
|
created () {
|
||||||
let loadOtherSettings = localStorage.getItem('otherSettings')
|
let 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 ? '.' : '..')
|
let modelRoot = this.isCordova ? 'https://localhost' : '.'
|
||||||
switch (this.f7route.params.region) {
|
switch (this.f7route.params.region) {
|
||||||
case 'thorax':
|
case 'thorax':
|
||||||
this.activeRegion = 0
|
this.activeRegion = 0
|
||||||
@@ -188,10 +187,12 @@ import App from 'framework7-vue/components/app'
|
|||||||
}
|
}
|
||||||
this.modelLocation = `${modelRoot}/models/${this.detectorName}${this.otherSettings.mini ? '-mini' : ''}/model.json`
|
this.modelLocation = `${modelRoot}/models/${this.detectorName}${this.otherSettings.mini ? '-mini' : ''}/model.json`
|
||||||
this.miniLocation = `${modelRoot}/models/${this.detectorName}-mini/model.json`
|
this.miniLocation = `${modelRoot}/models/${this.detectorName}-mini/model.json`
|
||||||
import(`../models/${this.detectorName}/classes.json`).then((mod) => {
|
fetch(`${this.isCordova ? 'https://localhost' : '.'}/models/${this.detectorName}/classes.json`)
|
||||||
this.classesList = mod.default
|
.then((mod) => { return mod.json() })
|
||||||
this.detectorLabels = this.classesList.map( l => { return {'name': l, 'detect': true} } )
|
.then((classes) => {
|
||||||
})
|
this.classesList = classes
|
||||||
|
this.detectorLabels = this.classesList.map( l => { return {'name': l, 'detect': true} } )
|
||||||
|
})
|
||||||
var loadServerSettings = localStorage.getItem('serverSettings')
|
var loadServerSettings = localStorage.getItem('serverSettings')
|
||||||
if (loadServerSettings) this.serverSettings = JSON.parse(loadServerSettings)
|
if (loadServerSettings) this.serverSettings = JSON.parse(loadServerSettings)
|
||||||
},
|
},
|
||||||
@@ -385,7 +386,7 @@ import App from 'framework7-vue/components/app'
|
|||||||
resolve(reader.result)
|
resolve(reader.result)
|
||||||
})
|
})
|
||||||
if (this.imageLoadMode == 'sample') {
|
if (this.imageLoadMode == 'sample') {
|
||||||
fetch(`${this.isCordova ? 'https://localhost' : '..'}/samples/${this.detectorName}-${searchImage}.jpeg`).then( resp => {
|
fetch(`${this.isCordova ? 'https://localhost' : '.'}/samples/${this.detectorName}-${searchImage}.jpeg`).then( resp => {
|
||||||
return resp.blob()
|
return resp.blob()
|
||||||
}).then(respBlob => {
|
}).then(respBlob => {
|
||||||
reader.readAsDataURL(respBlob)
|
reader.readAsDataURL(respBlob)
|
||||||
|
|||||||
@@ -45,6 +45,7 @@
|
|||||||
limbsDetails: { "version": "N/A" },
|
limbsDetails: { "version": "N/A" },
|
||||||
headneckDetails: { "version": "N/A" },
|
headneckDetails: { "version": "N/A" },
|
||||||
alvinnVersion: store().getVersion,
|
alvinnVersion: store().getVersion,
|
||||||
|
isCordova: !!window.cordova,
|
||||||
otherSettings: {}
|
otherSettings: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -54,22 +55,18 @@
|
|||||||
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)
|
||||||
import('../models/thorax/descript.json')
|
fetch(`${this.isCordova ? 'https://localhost' : '.'}/models/thorax/descript.json`)
|
||||||
.then((mod) => {
|
.then((mod) => { return mod.json() })
|
||||||
this.thoraxDetails = mod.default
|
.then((desc) => { this.thoraxDetails = desc })
|
||||||
})
|
fetch(`${this.isCordova ? 'https://localhost' : '.'}/models/thorax-mini/descript.json`)
|
||||||
import('../models/thorax-mini/descript.json')
|
.then((mod) => { return mod.json() })
|
||||||
.then((mod) => {
|
.then((desc) => { this.miniThoraxDetails = desc })
|
||||||
this.miniThoraxDetails = mod.default
|
fetch(`${this.isCordova ? 'https://localhost' : '.'}/models/abdomen/descript.json`)
|
||||||
})
|
.then((mod) => { return mod.json() })
|
||||||
import('../models/abdomen/descript.json')
|
.then((desc) => { this.abdomenDetails = desc })
|
||||||
.then((mod) => {
|
fetch(`${this.isCordova ? 'https://localhost' : '.'}/models/abdomen-mini/descript.json`)
|
||||||
this.abdomenDetails = mod.default
|
.then((mod) => { return mod.json() })
|
||||||
})
|
.then((desc) => { this.miniAbdomenDetails = desc })
|
||||||
import('../models/abdomen-mini/descript.json')
|
|
||||||
.then((mod) => {
|
|
||||||
this.miniAbdomenDetails = mod.default
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user