This website works better with JavaScript.
Home
Issues
Pull Requests
Milestones
Repositories
Datasets
Forum
实训
竞赛
大数据
应用
Register
Sign In
OpenI
/
aiforge
Not watched
Unwatch
Watch all
Watch but not notify
1
Star
0
Fork
0
Code
Releases
128
Wiki
Activity
Issues
0
Pull Requests
0
Datasets
Model
Cloudbrain
Browse Source
Log config pretty printer (
#1097
)
Signed-off-by: Jonas Östanbäck <jonas.ostanback@gmail.com>
master
Jonas
Lunny Xiao
8 years ago
parent
0380ce269f
commit
f3bf409082
2 changed files
with
10 additions
and
1 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+9
-0
modules/templates/helper.go
+1
-1
templates/admin/config.tmpl
+ 9
- 0
modules/templates/helper.go
View File
@@ -5,6 +5,7 @@
package templates
import (
"bytes"
"container/list"
"encoding/json"
"fmt"
@@ -133,6 +134,14 @@ func NewFuncMap() []template.FuncMap {
}
return path
},
"JsonPrettyPrint": func(in string) string {
var out bytes.Buffer
err := json.Indent(&out, []byte(in), "", " ")
if err != nil {
return ""
}
return out.String()
},
}}
}
+ 1
- 1
templates/admin/config.tmpl
View File
@@ -270,7 +270,7 @@
<dt>{{$.i18n.Tr "admin.config.log_mode"}}</dt>
<dd>{{.Mode}}</dd>
<dt>{{$.i18n.Tr "admin.config.log_config"}}</dt>
<dd><
code>{{.Config}}</cod
e></dd>
<dd><
pre>{{.Config | JsonPrettyPrint}}</pr
e></dd>
{{end}}
</dl>
</div>
Write
Preview
Loading…
Cancel
Save