From de13e64f491fc03d9b52c7377e49332f02f44a63 Mon Sep 17 00:00:00 2001 From: govolokatliai Date: Sun, 29 Dec 2024 12:40:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BA=86=E5=80=BC=E7=8F=AD?= =?UTF-8?q?=E8=A1=A8=E6=A8=A1=E6=9D=BF=EF=BC=8C=E7=8E=B0=E5=9C=A8=E5=9F=BA?= =?UTF-8?q?=E6=9C=AC=E4=B8=8A=E6=98=AF=E5=8F=AF=E4=BB=A5=E6=9C=80=E5=9F=BA?= =?UTF-8?q?=E6=9C=AC=E7=9A=84=E4=BD=BF=E7=94=A8=E4=BA=86=EF=BC=8C=E5=8F=A6?= =?UTF-8?q?=E5=A4=96=E5=A2=9E=E5=8A=A0=E4=BA=86Makefile,=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E4=B8=80=E9=94=AE=E6=9E=84=E5=BB=BA=EF=BC=8C=E5=92=8C=E9=83=A8?= =?UTF-8?q?=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FrontEnd/assignment.html | 8 ++++---- FrontEnd/index.html | 10 +++++----- Makefile | 9 +++++++++ handler/assignments.go | 3 +++ main.go | 4 ++-- route/route.go | 2 +- templates/renderer.go | 4 ++-- templates/table.html | 21 +++++++++------------ 8 files changed, 35 insertions(+), 26 deletions(-) create mode 100644 Makefile diff --git a/FrontEnd/assignment.html b/FrontEnd/assignment.html index be9a314..749d439 100644 --- a/FrontEnd/assignment.html +++ b/FrontEnd/assignment.html @@ -1,11 +1,11 @@ - - -

今日值班表

-
+
+ +
+ diff --git a/FrontEnd/index.html b/FrontEnd/index.html index 213f4dd..b257685 100644 --- a/FrontEnd/index.html +++ b/FrontEnd/index.html @@ -2,17 +2,17 @@

网维排班系统

-查看今日值班表
+查看今日值班表

-发起换班
-发起补班
-发起蹭班
+发起换班
+发起补班
+发起蹭班


-管理
+管理
有任何问题和建议,都可以联系开发组组长:)
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2030b60 --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +build: + go build + +deploy: + go build -o scheduler + cp scheduler /opt/zscww_scheduler/scheduler + cp -r FrontEnd /opt/zscww_scheduler/FrontEnd + chmod +x /opt/zscww_scheduler/scheduler + diff --git a/handler/assignments.go b/handler/assignments.go index 1591f19..c48bae6 100644 --- a/handler/assignments.go +++ b/handler/assignments.go @@ -86,6 +86,9 @@ func generateTable() (*[7][]string, error) { } fmt.Printf("today:%v\n", today) fmt.Printf("table:%v\n", table) + + //测试的时候先注释掉这里 + //signals.Table.LastUpdated = carbon.Now() return &table, nil } func readTableData(m *[]*model.Member) error { diff --git a/main.go b/main.go index f1c662c..b60eb44 100644 --- a/main.go +++ b/main.go @@ -7,7 +7,7 @@ import ( "zsxyww.com/scheduler/config" "zsxyww.com/scheduler/database" "zsxyww.com/scheduler/route" - "zsxyww.com/scheduler/tl" + "zsxyww.com/scheduler/templates" ) func main() { @@ -25,7 +25,7 @@ func main() { func register(app *echo.Echo) { route.Route(app) route.Middleware(app) - renderer := tl.tlw{ + renderer := tl.Tlw{ Tl: template.Must(template.ParseGlob("templates/*.html")), } app.Renderer = renderer diff --git a/route/route.go b/route/route.go index 4ba4a27..e79c51a 100644 --- a/route/route.go +++ b/route/route.go @@ -8,7 +8,7 @@ import ( func Route(app *echo.Echo) { // here is the route for our site - staticFiles := app.Group("/") + staticFiles := app.Group("/*") staticFiles.Use(middleware.Static("./FrontEnd")) api := app.Group("/api/") diff --git a/templates/renderer.go b/templates/renderer.go index 200723d..c949b3f 100644 --- a/templates/renderer.go +++ b/templates/renderer.go @@ -7,10 +7,10 @@ import ( ) // template wrapper -type tlw struct { +type Tlw struct { Tl *template.Template } -func (t tlw) Render(w io.Writer, name string, data interface{}, c echo.Context) error { +func (t Tlw) Render(w io.Writer, name string, data interface{}, c echo.Context) error { return t.Tl.ExecuteTemplate(w, name, data) } diff --git a/templates/table.html b/templates/table.html index e1d39f0..cf066fe 100644 --- a/templates/table.html +++ b/templates/table.html @@ -1,12 +1,9 @@ - - - - - - - -
-
- - - + + {{range .}} + + {{range .}} + + {{end}} + + {{end}} +
{{.}}