mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 12:30:19 +08:00
fix: add aheadCnt in sysinfo (#1632)
* feat: add sync module to bi-sync mysql * feat: fix the delay problem * feat: fix go mod * feat: fix the varchar(100) parse error * fix: fix go.mod space inconsistency * fix: fix go.mod space inconsistency * fix: use sql builder instead of concatenation * fix: remove serverId * fix: fix file is not `gofumpt`-ed (gofumpt) error * feat: add mysql bi-sync * feat: fix some data inconsistency problems * feat: add function atuo get server uuid * fix: encapsulate the struct to optimize the code * fix: fix incorrect Casdoor version in system info page * fix: fix incorrect root path * Update sysytem_test.go * feat: add aheadCnt means that the commit is ahead of version several times --------- Co-authored-by: hsluoyz <hsluoyz@qq.com>
This commit is contained in:
@ -26,8 +26,9 @@ type SystemInfo struct {
|
||||
}
|
||||
|
||||
type GitRepoInfo struct {
|
||||
Commit string `json:"commit"`
|
||||
Version string `json:"version"`
|
||||
AheadCnt int `json:"ahead_cnt"`
|
||||
Commit string `json:"commit"`
|
||||
Version string `json:"version"`
|
||||
}
|
||||
|
||||
// GetSystemInfo
|
||||
@ -76,15 +77,16 @@ func (c *ApiController) GetSystemInfo() {
|
||||
// @Success 200 {string} local latest version hash of casdoor
|
||||
// @router /get-release [get]
|
||||
func (c *ApiController) GitRepoVersion() {
|
||||
commit, version, err := util.GetGitRepoVersion()
|
||||
aheadCnt, commit, version, err := util.GetGitRepoVersion()
|
||||
if err != nil {
|
||||
c.ResponseError(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
c.Data["json"] = GitRepoInfo{
|
||||
Commit: commit,
|
||||
Version: version,
|
||||
AheadCnt: aheadCnt,
|
||||
Commit: commit,
|
||||
Version: version,
|
||||
}
|
||||
c.ServeJSON()
|
||||
}
|
||||
|
Reference in New Issue
Block a user