From 5171f55aa23cd5f1a072d8a12c3ef2fd63e00347 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 27 Oct 2023 23:00:54 +0800 Subject: [PATCH] =?UTF-8?q?login=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/config.toml | 2 +- cmd/haoadm/template/default/layout_index.html | 20 +-- cmd/haoadm/template/default/login.html | 150 ++++++++++++++++++ .../template/default/varieties_list.html | 2 +- cmd/haoadm/view/template_func.go | 15 +- 5 files changed, 176 insertions(+), 13 deletions(-) create mode 100644 cmd/haoadm/template/default/login.html diff --git a/cmd/config.toml b/cmd/config.toml index d54bbab4..d87355c3 100644 --- a/cmd/config.toml +++ b/cmd/config.toml @@ -30,7 +30,7 @@ symbols=[] [haoadm] -site_name="HaoTrader运营管理系统" +site_name="HaoTrader 运营管理系统" listen="0.0.0.0:8079" diff --git a/cmd/haoadm/template/default/layout_index.html b/cmd/haoadm/template/default/layout_index.html index e566a5c7..819d8ad0 100644 --- a/cmd/haoadm/template/default/layout_index.html +++ b/cmd/haoadm/template/default/layout_index.html @@ -3,8 +3,8 @@ {{ site_name }} - {{ app_power_by }} - - + + @@ -12,12 +12,12 @@ - - - - - - + + + + + + + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/cmd/haoadm/template/default/varieties_list.html b/cmd/haoadm/template/default/varieties_list.html index a0887793..8bf24f62 100644 --- a/cmd/haoadm/template/default/varieties_list.html +++ b/cmd/haoadm/template/default/varieties_list.html @@ -79,7 +79,7 @@ {field: 'symbol', width: 80, title: '代号'}, {field: 'name', width: 80, title: '名称'}, {field: 'show_precision', title: '展示精度', minWidth: 150}, - {field: 'min_precision', width: 80, title: '最小精度', sort: true}, + {field: 'min_precision', title: '最小精度', sort: true}, {field: 'create_time', width: 280, title: '创建时间', sort: true}, {field: 'update_time', width: 280, title: '更新时间'}, {field: 'status', width: 135, title: '状态', sort: true}, diff --git a/cmd/haoadm/view/template_func.go b/cmd/haoadm/view/template_func.go index b4329856..8ef7eed5 100644 --- a/cmd/haoadm/view/template_func.go +++ b/cmd/haoadm/view/template_func.go @@ -3,6 +3,7 @@ package view import ( "fmt" "html/template" + "time" "github.com/yzimhao/trading_engine/utils/app" "github.com/yzimhao/trading_engine/utils/app/config" @@ -11,7 +12,7 @@ import ( func templateFuncMap() template.FuncMap { return template.FuncMap{ "app_power_by": func() string { - return fmt.Sprintf("powered by Haotrader %s", app.Version) + return fmt.Sprintf("powered by HaoTrader %s", app.Version) }, "app_short_name": func() string { return "HT" @@ -19,6 +20,18 @@ func templateFuncMap() template.FuncMap { "version": func() string { return app.Version }, + "author": func() string { + return "yzimhao" + }, + "author_link": func() string { + return "https://github.com/yzimhao" + }, + "year": func() string { + return time.Now().Format("2006") + }, + "unsafe": func(s string) template.HTML { + return template.HTML(s) + }, "site_name": func() string { return config.App.Haoadm.SiteName },