add version in login page

This commit is contained in:
MaysWind
2020-10-31 19:12:29 +08:00
parent 15b93ade02
commit 453e41b052
6 changed files with 40 additions and 1 deletions
+7
View File
@@ -0,0 +1,7 @@
export default {
getVersion: () => {
let version = process.env.VERSION || 'unknown';
let commitHash = process.env.COMMIT_HASH || 'unknown';
return `${version}-${commitHash.substr(0, Math.min(10, commitHash.length))}`;
}
};
+2
View File
@@ -12,6 +12,7 @@ import 'framework7/css/framework7.bundle.css';
import 'framework7-icons';
import { getAllLanguages, getLanguage, getDefaultLanguage, getI18nOptions, getLocalizedError } from './lib/i18n.js';
import version from './lib/version.js';
import settings from './lib/settings.js';
import services from './lib/services.js';
import userstate from './lib/userstate.js';
@@ -24,6 +25,7 @@ Framework7.use(Framework7Vue);
const i18n = new VueI18n(getI18nOptions());
Vue.prototype.$version = version.getVersion;
Vue.prototype.$settings = settings;
Vue.prototype.$getDefaultLanguage = getDefaultLanguage;
Vue.prototype.$getAllLanguages = getAllLanguages;
+12
View File
@@ -31,6 +31,15 @@
</f7-block-footer>
</f7-list>
<f7-button small popover-open=".popover-menu" :text="currentLanguageName"></f7-button>
<f7-list>
<f7-block-footer>
<span>Powered by </span>
<f7-link external href="https://github.com/mayswind/lab" target="_blank">lab</f7-link>&nbsp;
<span>{{ version }}</span>
</f7-block-footer>
<f7-block-footer>
</f7-block-footer>
</f7-list>
<f7-popover class="popover-menu">
<f7-list>
<f7-list-item
@@ -98,6 +107,9 @@ export default {
};
},
computed: {
version() {
return this.$version();
},
isUserRegistrationEnabled() {
return this.$isUserRegistrationEnabled();
},