🎨 add halo version to database

pull/137/head
ruibaby 2019-03-06 08:34:25 +08:00
parent db0193b176
commit da1696bdb9
3 changed files with 9 additions and 2 deletions

View File

@ -1,7 +1,7 @@
package cc.ryanc.halo.listener;
import cc.ryanc.halo.model.support.Theme;
import cc.ryanc.halo.model.enums.BlogPropertiesEnum;
import cc.ryanc.halo.model.support.Theme;
import cc.ryanc.halo.service.OptionsService;
import cc.ryanc.halo.utils.HaloUtils;
import cc.ryanc.halo.web.controller.core.BaseController;
@ -39,6 +39,8 @@ public class StartedListener implements ApplicationListener<ApplicationStartedEv
@Override
public void onApplicationEvent(ApplicationStartedEvent event) {
// save halo version to database
optionsService.saveOption("version", HALO_VERSION);
try {
this.loadActiveTheme();
} catch (TemplateModelException e) {

View File

@ -15,6 +15,11 @@ import java.util.Map;
*/
public class HaloConst {
/**
* version constant
*/
public static final String HALO_VERSION = "0.4.2";
/**
* key,value
*/

View File

@ -1,5 +1,5 @@
<footer class="main-footer">
<#-- 虽然Halo使用了宽松的GPL协议但开发不易希望您可以保留一下版权声明。笔芯~ -->
<div class="pull-right hidden-xs"><a target="_blank" href="https://github.com/ruibaby/halo/releases/tag/v0.4.2">0.4.2</a></div>
<div class="pull-right hidden-xs"><a target="_blank" href="https://github.com/ruibaby/halo/releases/tag/v${options.version!}">${options.version!}</a></div>
Thanks for using <strong><a data-pjax="true" href="/admin/halo">Halo</a>.</strong>
</footer>