Save version to settings for compatibility

This commit is contained in:
cuigh 2018-04-04 18:46:59 +08:00
parent 2d08f97cb6
commit 4cc96bf9dd
3 changed files with 6 additions and 15 deletions

View File

@ -3,6 +3,7 @@ package biz
import (
"time"
"github.com/cuigh/auxo/app"
"github.com/cuigh/auxo/net/web"
"github.com/cuigh/swirl/dao"
"github.com/cuigh/swirl/model"
@ -24,6 +25,7 @@ func (b *settingBiz) Get() (setting *model.Setting, err error) {
func (b *settingBiz) Update(setting *model.Setting, user web.User) (err error) {
do(func(d dao.Interface) {
setting.Version = app.Version
setting.UpdatedBy = user.ID()
setting.UpdatedAt = time.Now()
err = d.SettingUpdate(setting)

View File

@ -2,19 +2,6 @@ package model
import "time"
// LDAP security policy
const (
LDAPSecurityNone = 0
LDAPSecurityTLS = 1
LDAPSecurityStartTLS = 2
)
// LDAP auth type
const (
LDAPAuthSimple = 0
LDAPAuthBind = 1
)
// Perm control scope
const (
PermNone = 0
@ -24,7 +11,8 @@ const (
// Setting represents the options of swirl.
type Setting struct {
LDAP struct {
Version string
LDAP struct {
Enabled bool `bson:"enabled" json:"enabled,omitempty"`
Address string `bson:"address" json:"address,omitempty"`
Security int32 `bson:"security" json:"security,omitempty"` // 0-None/1-TLS/2-StartTLS

View File

@ -57,8 +57,9 @@
{{if .Filter == "blocked"}}
<strong>Blocked</strong>
{{else}}
<a href="?filter=blocked">Blocked</a>
<a href="?filter=blocked">Blocked</a>
{{end}}
</p>
<p class="level-item">
<a href="new" class="button is-success"><span class="icon"><i class="fas fa-plus"></i></span><span>{{ i18n("button.new") }}</span></a>
</p>