Skip to content

Commit 43ceeef

Browse files
nicoschmdtES-Alexander
authored andcommitted
frontend: version-chooser: show BlueOS factory version
1 parent 8eb717c commit 43ceeef

2 files changed

Lines changed: 29 additions & 3 deletions

File tree

core/frontend/src/components/version-chooser/VersionCard.vue

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
<v-list-item-avatar>
88
<v-icon :class="current ? 'green' : 'grey'">
99
{{ remote ? 'mdi-earth' : '' }}
10-
{{ current ? 'mdi-checkbox-blank-circle' : 'mdi-checkbox-blank-circle-outline' }}
10+
{{ displayIcon }}
1111
</v-icon>
1212
</v-list-item-avatar>
1313

1414
<div>
1515
<p
1616
class="text-body-1 ma-0"
17-
v-text="image.tag"
17+
v-text="displayTag"
1818
/>
1919
<p
2020
v-if="settings.is_pirate_mode"
@@ -169,7 +169,7 @@ import settings from '@/libs/settings'
169169
import helper from '@/store/helper'
170170
import { Dictionary } from '@/types/common'
171171
import { InternetConnectionState } from '@/types/helper'
172-
import { DEFAULT_REMOTE_IMAGE } from '@/utils/version_chooser'
172+
import { DEFAULT_REMOTE_IMAGE, getFactoryVersion } from '@/utils/version_chooser'
173173
174174
import SpinningLogo from '../common/SpinningLogo.vue'
175175
@@ -243,6 +243,7 @@ export default Vue.extend({
243243
return {
244244
bootstrapDialog: false,
245245
settings,
246+
factoryVersion: '',
246247
}
247248
},
248249
computed: {
@@ -261,6 +262,21 @@ export default Vue.extend({
261262
&& !this.updateAvailable && this.isFromBR && this.allImagesLoaded
262263
&& this.bootstrapVersion !== `${this.image.repository.split('/')[0]}/blueos-bootstrap:${this.image.tag}`
263264
},
265+
displayTag(): string {
266+
if (this.image.tag === 'factory') {
267+
return this.factoryVersion ? `factory [${this.factoryVersion}]` : 'factory'
268+
}
269+
return this.image.tag
270+
},
271+
displayIcon(): string {
272+
if (this.image.tag === 'factory') {
273+
return 'mdi-factory'
274+
}
275+
return this.current ? 'mdi-checkbox-blank-circle' : 'mdi-checkbox-blank-circle-outline'
276+
},
277+
},
278+
async mounted() {
279+
this.factoryVersion = await getFactoryVersion()
264280
},
265281
methods: {
266282
asTimeAgo(value: string) {

core/frontend/src/utils/version_chooser.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,15 @@ async function dockerAccounts(): Promise<DockerLoginInfo[]> {
199199
return data.data as DockerLoginInfo[]
200200
}
201201

202+
async function getFactoryVersion(): Promise<string> {
203+
const response = await back_axios({
204+
method: 'get',
205+
url: `${API_URL}/version/factory/`,
206+
})
207+
208+
return response.data as string
209+
}
210+
202211
export {
203212
DEFAULT_REMOTE_IMAGE,
204213
dockerAccounts,
@@ -216,4 +225,5 @@ export {
216225
loadLocalVersions,
217226
sortImages,
218227
sortVersions,
228+
getFactoryVersion,
219229
}

0 commit comments

Comments
 (0)