add build time in about page

This commit is contained in:
MaysWind
2020-11-18 23:48:33 +08:00
parent d873778357
commit 9673cd28c6
6 changed files with 11 additions and 0 deletions
+3
View File
@@ -3,5 +3,8 @@ export default {
let version = process.env.VERSION || 'unknown';
let commitHash = process.env.COMMIT_HASH || 'unknown';
return `${version}-${commitHash.substr(0, Math.min(10, commitHash.length))}`;
},
getBuildTime: () => {
return process.env.BUILD_UNIXTIME;
}
};
+1
View File
@@ -414,6 +414,7 @@ export default {
'Exchange rates data has been updated': 'Exchange rates data has been updated',
'Unable to get exchange rates data': 'Unable to get exchange rates data',
'About': 'About',
'Build Time': 'Build Time',
'Official Website': 'Official Website',
'License': 'License',
};
+1
View File
@@ -414,6 +414,7 @@ export default {
'Exchange rates data has been updated': '汇率数据已更新',
'Unable to get exchange rates data': '无法获取汇率数据',
'About': '关于',
'Build Time': '编译时间',
'Official Website': '官方网站',
'License': '许可协议',
};
+1
View File
@@ -39,6 +39,7 @@ Framework7.use(Framework7Vue);
const i18n = new VueI18n(getI18nOptions());
Vue.prototype.$version = version.getVersion;
Vue.prototype.$buildTime = version.getBuildTime;
Vue.prototype.$licenses = licenses;
Vue.prototype.$constants = {
currency: currency,
+4
View File
@@ -6,6 +6,7 @@
<f7-card-content :padding="false">
<f7-list>
<f7-list-item :title="$t('Version')" :after="version"></f7-list-item>
<f7-list-item :title="$t('Build Time')" :after="buildTime | moment($t('format.datetime.long'))"></f7-list-item>
<f7-list-item external :title="$t('Official Website')" after="https://github.com/mayswind/lab"
link="https://github.com/mayswind/lab" target="_blank"></f7-list-item>
<f7-list-item :title="$t('License')" link="#" popup-open=".license-popup"></f7-list-item>
@@ -67,6 +68,9 @@ export default {
version() {
return 'v' + this.$version();
},
buildTime() {
return this.$buildTime();
},
licenses() {
return this.$licenses;
}
+1
View File
@@ -51,6 +51,7 @@ module.exports = {
const gitRevisionPlugin = new GitRevisionPlugin();
definitions[0]['process.env']['VERSION'] = JSON.stringify(pkgFile.version);
definitions[0]['process.env']['COMMIT_HASH'] = JSON.stringify(gitRevisionPlugin.commithash());
definitions[0]['process.env']['BUILD_UNIXTIME'] = JSON.stringify(parseInt((new Date().getTime() / 1000).toString()));
return definitions;
});