From 8141a9eba042e92383e2e896f9fe4911a119091d Mon Sep 17 00:00:00 2001 From: Zeni Kim Date: Thu, 24 Oct 2024 17:06:52 -0500 Subject: [PATCH 1/4] add sqlite to ignore watcher --- .env-example | 2 +- storage/sqlite.db | Bin 12288 -> 0 bytes storage/sqlite/sqlite.db | Bin 0 -> 90112 bytes 3 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 storage/sqlite.db create mode 100644 storage/sqlite/sqlite.db diff --git a/.env-example b/.env-example index 914b654..bcec21f 100644 --- a/.env-example +++ b/.env-example @@ -48,7 +48,7 @@ POSTGRES_SSL_MODE=disable POSTGRES_TIMEZONE=America/Argentina/Buenos_Aires #_____ SQLITE _____# -SQLITE_DB_PATH=storage/sqlite.db +SQLITE_DB_PATH=storage/sqlite/sqlite.db ####################################### ###### CACHE ###### diff --git a/storage/sqlite.db b/storage/sqlite.db deleted file mode 100644 index b10cc175afc8052a3eb4ebb5d212bfce5a96b1f7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI#O>fgM7zc2tVVZ^n<(3nYk$PA~7o|zNm7dmZ5gTpSQifO&Qk^x=wp4Xn5>G_j z$|vM2@I5%-WUc4{goMNe{U15@llV2io8P?dM2h(JJeGmt9(%$JgB^0t7&BLoZt^JT z`oSvC8e=2>U1~CW^7WDKEj<3lioUK85P$##AOHafKmY;|fB*y_0D*rYa8=m0>XxzG zie@3DQJ9YI5{i>iNK;Z2jslgxo5uscb>Z`~^ArD)i(icsym!t;K3eRGpYug|*)X;( z%QC+7RB$z=d`MmuR;ymLjynE&F5lJ53m(lB-B4T+H!yXpw^w!cT!%Z=X3cBXt9HX}9C$CD zJGG|c{Hb42qOxoLx;>;ckc%nVFY<6~cX8NK5N?|Fb(AP3M`(7Sx+NKXklQe0Y0EH$^wr#pSeIzNC zg1{_@h+afNFLIS4co7x32o;eE7lEQ8Dgq)Z7f?YdR;0p3K;+*4Ih&-r=bS0Dobyri z1m@c|napqYKeNA``Jey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NmP^#5{RQ&prDYQJXn%ov%hFPbdW^q7zR0ELiiqRK%@;w>6>fe? zz~?PDUj$uOr0LQAg7Y`fcSV{W?JrmlI Date: Sun, 27 Oct 2024 10:27:54 -0500 Subject: [PATCH 2/4] session cookie destroy --- .gitignore | 1 + controllers/authentication.go | 24 ++++++++++++++++++++++-- routes.go | 3 +++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 8d4682e..84146d5 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ logs/* tls/* !tls/.gitkeep .DS_Store +storage/sqlite/* diff --git a/controllers/authentication.go b/controllers/authentication.go index 25c7b31..9e7e940 100644 --- a/controllers/authentication.go +++ b/controllers/authentication.go @@ -425,8 +425,28 @@ func SetNewPassword(c *core.Context) *core.Response { } func Signout(c *core.Context) *core.Response { - tokenRaw := c.GetHeader("Authorization") - token := strings.TrimSpace(strings.Replace(tokenRaw, "Bearer", "", 1)) + + // check if template engine is enable + TemplateEnableStr := os.Getenv("TEMPLATE_ENABLE") + if TemplateEnableStr == "" { + TemplateEnableStr = "false" + } + TemplateEnable, _ := strconv.ParseBool(TemplateEnableStr) + + token := "" + + if TemplateEnable { + // get cookie + usercookie, err := c.GetCookie() + if err != nil { + + } + token = usercookie.Token + } else { + tokenRaw := c.GetHeader("Authorization") + token = strings.TrimSpace(strings.Replace(tokenRaw, "Bearer", "", 1)) + } + if token == "" { return c.Response.SetStatusCode(http.StatusUnauthorized).Json(c.MapToJson(map[string]interface{}{ "message": "unauthorized", diff --git a/routes.go b/routes.go index 610fbcb..00f1906 100644 --- a/routes.go +++ b/routes.go @@ -36,6 +36,9 @@ func registerRoutes() { controller.Get("/dashboard", controllers.WelcomeToDashboard, hooks.AuthCheck) + // templates demos + controller.Get("/signout", controllers.Signout) + controller.Get("/appsample", controllers.AppSample, hooks.AuthCheck) controller.Post("/appsample", controllers.AppSample, hooks.AuthCheck) -- 2.39.2 From 80520260c9a9edd820959556c8d7afc75c774501 Mon Sep 17 00:00:00 2001 From: Zeni Kim Date: Sun, 27 Oct 2024 12:55:12 -0500 Subject: [PATCH 3/4] detail table --- controllers/themedemo.go | 38 ++++++++++++++++++- .../templates/custom_theme_contentpage.html | 3 ++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/controllers/themedemo.go b/controllers/themedemo.go index 22ba5a5..f3699da 100644 --- a/controllers/themedemo.go +++ b/controllers/themedemo.go @@ -642,7 +642,8 @@ func Themecontent(c *core.Context) *core.Response { // first, include all compoments type templateData struct { - ContentTable components.ContentTable + ContentTable components.ContentTable + ContentTabledetail components.ContentTabledetail } // TABLES @@ -686,6 +687,34 @@ func Themecontent(c *core.Context) *core.Response { allTd = append(allTd, vals) } + // for td items in table detail + var allTdetail []components.ContentTabledetailTD + // table detail + var thd components.ContentTabledetailTD + thd.Caption = "Continent" + thd.Value = "Asia" + allTdetail = append(allTdetail, thd) + thd.Caption = "Country" + thd.Value = "South Korea" + allTdetail = append(allTdetail, thd) + thd.Caption = "Capital" + thd.Value = "Seoul" + allTdetail = append(allTdetail, thd) + thd.Caption = "Details" + thd.ValueType = "href" // column type href + thd.Value = components.ContentHref{ + Text: "edit", + Link: "#", + } + allTdetail = append(allTdetail, thd) + thd.Caption = "Notifications" + thd.ValueType = "badge" // column type href + thd.Value = components.ContentBadge{ + Text: "success", + TypeClass: "success", + } + allTdetail = append(allTdetail, thd) + // now fill data of the components tmplData := templateData{ ContentTable: components.ContentTable{ @@ -693,7 +722,14 @@ func Themecontent(c *core.Context) *core.Response { AllTH: allTh, AllTD: allTd, }, + ContentTabledetail: components.ContentTabledetail{ + ID: "table_demodetail", + Title: "Sample table detail", + //HeadClass: "table-warning", + AllTD: allTdetail, + }, } + return c.Response.Template("custom_theme_contentpage.html", tmplData) } else { diff --git a/storage/templates/custom_theme_contentpage.html b/storage/templates/custom_theme_contentpage.html index e1d71e9..a0f29cf 100644 --- a/storage/templates/custom_theme_contentpage.html +++ b/storage/templates/custom_theme_contentpage.html @@ -8,6 +8,9 @@
{{template "content_table" .ContentTable}}
+
+ {{template "content_tabledetail" .ContentTabledetail}} +
{{template "page_footer"}} -- 2.39.2 From 801c5c107f5c8e750bc00421bb7729cc6a5da677 Mon Sep 17 00:00:00 2001 From: Zeni Kim Date: Mon, 28 Oct 2024 11:34:54 -0500 Subject: [PATCH 4/4] add sample graph --- .env-example | 1 + controllers/themedemo.go | 21 +++++++++++++++---- go.mod | 7 ++++++- go.sum | 12 +++++++---- .../templates/custom_theme_contentpage.html | 8 ++++++- 5 files changed, 39 insertions(+), 10 deletions(-) diff --git a/.env-example b/.env-example index bcec21f..ded2eab 100644 --- a/.env-example +++ b/.env-example @@ -8,6 +8,7 @@ App_HTTP_HOST=localhost App_HTTP_PORT=8080 App_USE_HTTPS=false App_USE_LETSENCRYPT=false +App_USE_CORESERVICES=false APP_LETSENCRYPT_EMAIL=mail@example.com App_HTTPS_HOSTS=example.com, www.example.com App_REDIRECT_HTTP_TO_HTTPS=false diff --git a/controllers/themedemo.go b/controllers/themedemo.go index f3699da..bbde3c6 100644 --- a/controllers/themedemo.go +++ b/controllers/themedemo.go @@ -6,6 +6,7 @@ package controllers import ( "fmt" + "math/rand/v2" "os" "strconv" @@ -644,6 +645,7 @@ func Themecontent(c *core.Context) *core.Response { type templateData struct { ContentTable components.ContentTable ContentTabledetail components.ContentTabledetail + ContentGraph components.ContentGraph } // TABLES @@ -715,6 +717,12 @@ func Themecontent(c *core.Context) *core.Response { } allTdetail = append(allTdetail, thd) + // random values for pie + one := rand.IntN(50) + two := rand.IntN(50) + three := rand.IntN(50) + valuesgraph := fmt.Sprintf("%d|%d|%d", one, two, three) + // now fill data of the components tmplData := templateData{ ContentTable: components.ContentTable{ @@ -723,10 +731,15 @@ func Themecontent(c *core.Context) *core.Response { AllTD: allTd, }, ContentTabledetail: components.ContentTabledetail{ - ID: "table_demodetail", - Title: "Sample table detail", - //HeadClass: "table-warning", - AllTD: allTdetail, + ID: "table_demodetail", + Title: "Sample table detail", + HeadClass: "table-warning", + AllTD: allTdetail, + }, + ContentGraph: components.ContentGraph{ + Graph: "pie", + Labels: "Berlin|Paris|Venecia", + Values: valuesgraph, }, } diff --git a/go.mod b/go.mod index 2243d4d..6f6869e 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,8 @@ module git.smarteching.com/goffee/cup replace ( + git.smarteching.com/goffee/core => ../core + git.smarteching.com/goffee/cup/config => ./config git.smarteching.com/goffee/cup/handlers => ./handlers git.smarteching.com/goffee/cup/middlewares => ./middlewares @@ -18,6 +20,7 @@ require ( ) require ( + git.smarteching.com/zeni/go-chart/v2 v2.1.4 // indirect github.com/SparkPost/gosparkpost v0.2.0 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect @@ -26,6 +29,7 @@ require ( github.com/go-ozzo/ozzo-validation v3.6.0+incompatible // indirect github.com/go-sql-driver/mysql v1.7.0 // indirect github.com/golang-jwt/jwt/v5 v5.0.0 // indirect + github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect github.com/harranali/mailing v1.2.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect @@ -42,8 +46,9 @@ require ( github.com/sendgrid/rest v2.6.9+incompatible // indirect github.com/sendgrid/sendgrid-go v3.12.0+incompatible // indirect golang.org/x/crypto v0.11.0 // indirect + golang.org/x/image v0.21.0 // indirect golang.org/x/net v0.10.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/text v0.19.0 // indirect gorm.io/driver/mysql v1.5.1 // indirect gorm.io/driver/postgres v1.5.2 // indirect gorm.io/driver/sqlite v1.5.2 // indirect diff --git a/go.sum b/go.sum index e052570..fe35bfa 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -git.smarteching.com/goffee/core v1.7.3 h1:GlZ7B/QwAQ6eSQcYBtqlglZoqA7tFYiXqvV2z27xuQY= -git.smarteching.com/goffee/core v1.7.3/go.mod h1:QQNIHVN6qjJBtq42WCQMrLYN9oFE3wm26SLU8ZxNTec= +git.smarteching.com/zeni/go-chart/v2 v2.1.4 h1:pF06+F6eqJLIG8uMiTVPR5TygPGMjM/FHMzTxmu5V/Q= +git.smarteching.com/zeni/go-chart/v2 v2.1.4/go.mod h1:b3ueW9h3pGGXyhkormZAvilHaG4+mQti+bMNPdQBeOQ= github.com/SparkPost/gosparkpost v0.2.0 h1:yzhHQT7cE+rqzd5tANNC74j+2x3lrPznqPJrxC1yR8s= github.com/SparkPost/gosparkpost v0.2.0/go.mod h1:S9WKcGeou7cbPpx0kTIgo8Q69WZvUmVeVzbD+djalJ4= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= @@ -35,6 +35,8 @@ github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3a github.com/gogs/chardet v0.0.0-20150115103509-2404f7772561/go.mod h1:Pcatq5tYkCW2Q6yrR2VRHlbHpZ/R4/7qyL1TCF7vl14= github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -91,14 +93,16 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= +golang.org/x/image v0.21.0 h1:c5qV36ajHpdj4Qi0GnE0jUc/yuo33OLFaa0d+crTD5s= +golang.org/x/image v0.21.0/go.mod h1:vUbsLavqK/W303ZroQQVKQ+Af3Yl6Uz1Ppu5J/cLz78= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/storage/templates/custom_theme_contentpage.html b/storage/templates/custom_theme_contentpage.html index a0f29cf..67b35f9 100644 --- a/storage/templates/custom_theme_contentpage.html +++ b/storage/templates/custom_theme_contentpage.html @@ -9,7 +9,13 @@ {{template "content_table" .ContentTable}}
- {{template "content_tabledetail" .ContentTabledetail}} +
+

Pie chart

+ {{template "content_graph" .ContentGraph}} +
+
+ {{template "content_tabledetail" .ContentTabledetail}} +
-- 2.39.2