Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiesun committed May 16, 2024
2 parents 4d7c9e9 + b461135 commit df2378a
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ sudo bash -c "$(wget https://raw.githubusercontent.com/talkincode/toughradius/ma
ToughRadius provides an AI-based technical service bot that we hope can help you solve some technical problems.
<img width="1236" alt="image" src="https://github.com/talkincode/toughradius/assets/377938/b6dafb49-6850-4906-b69f-2c18196459c0">

[A&A AiBot Link](https://qa.toughradius.net/)
[Q&A AiBot Link](https://qa.toughradius.net/)

## System structure

Expand Down
8 changes: 5 additions & 3 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,9 @@ func (a *Application) BackupDatabase() error {
scriptsh = strings.ReplaceAll(scriptsh, "{dbpwd}", a.appConfig.Database.Passwd)
scriptsh = strings.ReplaceAll(scriptsh, "{dbname}", a.appConfig.Database.Name)
_ = os.WriteFile("/tmp/databackup.sh", []byte(scriptsh), 0777)
defer os.Remove("/tmp/databackup.sh")
defer func() {
_ = os.Remove("/tmp/databackup.sh")
}()
rbs, err := exec.Command("/bin/sh", "/tmp/databackup.sh").CombinedOutput()
log.Info(string(rbs))
if err != nil {
Expand All @@ -219,10 +221,10 @@ func (a *Application) BackupDatabase() error {

// checkAppVersion Check version
func (a *Application) checkAppVersion() {
cver := a.GetSettingsStringValue("system", "TeamsacsVersion")
cver := a.GetSettingsStringValue("system", "ToughradiusVersion")
buildVersion := assets.BuildVersion()
if buildVersion != cver {
_ = a.gormDB.Exec("UPDATE sys_config SET value = ? WHERE type = ? and name = ?", buildVersion, "system", "TeamsacsVersion")
_ = a.gormDB.Exec("UPDATE sys_config SET value = ? WHERE type = ? and name = ?", buildVersion, "system", "ToughradiusVersion")
}
}

Expand Down
4 changes: 2 additions & 2 deletions app/initdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ func (a *Application) checkSettings() {
case ConfigCpeAutoRegister:
checkConfig(sortid, "tr069", ConfigCpeAutoRegister, "enabled", "Auto register CPE device")
case ConfigTR069AccessAddress:
checkConfig(sortid, "tr069", ConfigTR069AccessAddress, "http://127.0.0.1:2999", "Teamsacs TR069 access address, HTTP | https://domain:port")
checkConfig(sortid, "tr069", ConfigTR069AccessAddress, "http://127.0.0.1:2999", "Toughradius TR069 access address, HTTP | https://domain:port")
case ConfigTR069AccessPassword:
checkConfig(sortid, "tr069", ConfigTR069AccessPassword, "touighradiustr069password", "Teamsacs TR069 access password, It is provided to CPE to access TeamsACS")
checkConfig(sortid, "tr069", ConfigTR069AccessPassword, "touighradiustr069password", "Toughradius TR069 access password, It is provided to CPE to access TeamsACS")
case ConfigCpeConnectionRequestPassword:
checkConfig(sortid, "tr069", ConfigCpeConnectionRequestPassword, "toughradiuscpepassword", "CPE Connection authentication password, It is provided to TeamsACS to access CPE")
case ConfigRadiusIgnorePwd:
Expand Down
10 changes: 5 additions & 5 deletions assets/buildinfo.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
BuildVersion=latest v8.0.7 2024-03-27 23:11:07
BuildVersion=latest v8.0.7 2024-05-16 16:32:57
ReleaseVersion=v8.0.7
BuildTime=2024-03-27 23:11:07
BuildTime=2024-05-16 16:32:57
BuildName=toughradius
CommitID=32441eff5ab84a65fc3c574a657602607dd44573
CommitDate=Wed, 27 Mar 2024 23:10:19 +0800
CommitID=4d7c9e9052d7fe32a9f46cbce9259feb3ee76a17
CommitDate=Wed, 27 Mar 2024 23:11:47 +0800
CommitUser=jamiesun.net@gmail.com
CommitSubject=fix template
CommitSubject=Merge branch 'develop'
4 changes: 2 additions & 2 deletions controllers/charts/charts.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ func InitRouter() {
statname := stype
switch stype {
case "model":
statname = "TeamsBox 型号统计"
statname = "CPE 型号统计"
case "version":
statname = "TeamsBox 版本统计"
statname = "CPE 版本统计"
}

return c.Render(http.StatusOK, "cpe_stat_pie", map[string]string{
Expand Down
2 changes: 1 addition & 1 deletion freeradius/freeradius.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func updateRadiusOnline(form *web.WebForm) error {
return app.GDB().Where("acct_session_id=?", sessionId).
Delete(&models.RadiusOnline{}).Error
case "Accounting-On", "Accounting-Off":
// app.GDB().Raw("truncate table radius_online")
app.GDB().Raw("truncate table radius_online")
}

return nil
Expand Down

0 comments on commit df2378a

Please sign in to comment.