mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-19 09:14:27 +08:00
add build time in about page
This commit is contained in:
@@ -3,5 +3,8 @@ export default {
|
|||||||
let version = process.env.VERSION || 'unknown';
|
let version = process.env.VERSION || 'unknown';
|
||||||
let commitHash = process.env.COMMIT_HASH || 'unknown';
|
let commitHash = process.env.COMMIT_HASH || 'unknown';
|
||||||
return `${version}-${commitHash.substr(0, Math.min(10, commitHash.length))}`;
|
return `${version}-${commitHash.substr(0, Math.min(10, commitHash.length))}`;
|
||||||
|
},
|
||||||
|
getBuildTime: () => {
|
||||||
|
return process.env.BUILD_UNIXTIME;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -414,6 +414,7 @@ export default {
|
|||||||
'Exchange rates data has been updated': 'Exchange rates data has been updated',
|
'Exchange rates data has been updated': 'Exchange rates data has been updated',
|
||||||
'Unable to get exchange rates data': 'Unable to get exchange rates data',
|
'Unable to get exchange rates data': 'Unable to get exchange rates data',
|
||||||
'About': 'About',
|
'About': 'About',
|
||||||
|
'Build Time': 'Build Time',
|
||||||
'Official Website': 'Official Website',
|
'Official Website': 'Official Website',
|
||||||
'License': 'License',
|
'License': 'License',
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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': '编译时间',
|
||||||
'Official Website': '官方网站',
|
'Official Website': '官方网站',
|
||||||
'License': '许可协议',
|
'License': '许可协议',
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ Framework7.use(Framework7Vue);
|
|||||||
const i18n = new VueI18n(getI18nOptions());
|
const i18n = new VueI18n(getI18nOptions());
|
||||||
|
|
||||||
Vue.prototype.$version = version.getVersion;
|
Vue.prototype.$version = version.getVersion;
|
||||||
|
Vue.prototype.$buildTime = version.getBuildTime;
|
||||||
Vue.prototype.$licenses = licenses;
|
Vue.prototype.$licenses = licenses;
|
||||||
Vue.prototype.$constants = {
|
Vue.prototype.$constants = {
|
||||||
currency: currency,
|
currency: currency,
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
<f7-card-content :padding="false">
|
<f7-card-content :padding="false">
|
||||||
<f7-list>
|
<f7-list>
|
||||||
<f7-list-item :title="$t('Version')" :after="version"></f7-list-item>
|
<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"
|
<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>
|
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>
|
<f7-list-item :title="$t('License')" link="#" popup-open=".license-popup"></f7-list-item>
|
||||||
@@ -67,6 +68,9 @@ export default {
|
|||||||
version() {
|
version() {
|
||||||
return 'v' + this.$version();
|
return 'v' + this.$version();
|
||||||
},
|
},
|
||||||
|
buildTime() {
|
||||||
|
return this.$buildTime();
|
||||||
|
},
|
||||||
licenses() {
|
licenses() {
|
||||||
return this.$licenses;
|
return this.$licenses;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ module.exports = {
|
|||||||
const gitRevisionPlugin = new GitRevisionPlugin();
|
const gitRevisionPlugin = new GitRevisionPlugin();
|
||||||
definitions[0]['process.env']['VERSION'] = JSON.stringify(pkgFile.version);
|
definitions[0]['process.env']['VERSION'] = JSON.stringify(pkgFile.version);
|
||||||
definitions[0]['process.env']['COMMIT_HASH'] = JSON.stringify(gitRevisionPlugin.commithash());
|
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;
|
return definitions;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user