Skip to content

Commit

Permalink
- on app start, display app name and version
Browse files Browse the repository at this point in the history
  • Loading branch information
Severin Beauvais committed Dec 15, 2023
1 parent 397eb88 commit 123bdb2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 3 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,9 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
/** The About text. */
get aboutText (): string {
return import.meta.env.ABOUT_TEXT
const aboutApp = import.meta.env.ABOUT_APP
const aboutSbc = import.meta.env.ABOUT_SBC
return `${aboutApp}<br>${aboutSbc}`
}
/** Whether to use stepper view. */
Expand Down
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ async function start () {
}

// start Vue application
console.info('Starting app...') // eslint-disable-line no-console
const aboutApp = import.meta.env.ABOUT_APP
console.info(`Starting ${aboutApp}...`) // eslint-disable-line no-console
new Vue({
vuetify: new Vuetify({
iconfont: 'mdi',
Expand Down
11 changes: 4 additions & 7 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,15 @@ const appName = JSON.parse(packageJson).appName
const appVersion = JSON.parse(packageJson).version
const sbcName = JSON.parse(packageJson).sbcName
const sbcVersion = JSON.parse(packageJson).dependencies['sbc-common-components']
const aboutText1 = (appName && appVersion) ? `${appName} v${appVersion}` : ''
const aboutText2 = (sbcName && sbcVersion) ? `${sbcName} v${sbcVersion}` : ''
const aboutApp = (appName && appVersion) ? `${appName} v${appVersion}` : 'Unknown APP'
const aboutSbc = (sbcName && sbcVersion) ? `${sbcName} v${sbcVersion}` : 'Unknown SBC'

// https://vitejs.dev/config/
export default defineConfig(() => {
return {
define: {
'import.meta.env.ABOUT_TEXT':
(aboutText1 && aboutText2) ? `"${aboutText1}<br>${aboutText2}"`
: aboutText1 ? `"${aboutText1}"`
: aboutText2 ? `"${aboutText2}"`
: ''
'import.meta.env.ABOUT_APP': `"${aboutApp}"`,
'import.meta.env.ABOUT_SBC': `"${aboutSbc}"`
},
envPrefix: 'VUE_APP_', // Need to remove this after fixing vaults. Use import.meta.env with VUE_APP.
plugins: [
Expand Down

0 comments on commit 123bdb2

Please sign in to comment.