From 3cd744deadfb2383d9cc3a3e366e7ce28c204eec Mon Sep 17 00:00:00 2001 From: bagas Date: Thu, 15 Jan 2026 12:34:23 +0700 Subject: [PATCH] update: remove admin panel --- app/app.go | 17 +- go.mod | 8 - go.sum | 22 -- main.go | 12 - routes/admin/routes.go | 99 ------- view/admin/index/index.templ | 449 -------------------------------- view/admin/index/index_templ.go | 61 ----- view/admin/layout/base.templ | 19 -- view/admin/layout/base_templ.go | 48 ---- 9 files changed, 2 insertions(+), 733 deletions(-) delete mode 100644 routes/admin/routes.go delete mode 100644 view/admin/index/index.templ delete mode 100644 view/admin/index/index_templ.go delete mode 100644 view/admin/layout/base.templ delete mode 100644 view/admin/layout/base_templ.go diff --git a/app/app.go b/app/app.go index f1612fd..8e3ea95 100644 --- a/app/app.go +++ b/app/app.go @@ -1,14 +1,14 @@ package app import ( + "net/http" + "github.com/fossyy/filekeeper/email" "github.com/fossyy/filekeeper/logger" "github.com/fossyy/filekeeper/types" - "net/http" ) var Server App -var Admin App type App struct { http.Server @@ -34,16 +34,3 @@ func NewClientServer(addr string, handler http.Handler, logger logger.Aggregated Mail: &mail, } } - -func NewAdminServer(addr string, handler http.Handler, database types.Database) App { - return App{ - Server: http.Server{ - Addr: addr, - Handler: handler, - }, - // TODO: Remove the dummy struct - Logger: &logger.AggregatedLogger{}, - Database: database, - Mail: &email.SmtpServer{}, - } -} diff --git a/go.mod b/go.mod index 26cb87b..74c7b7d 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,6 @@ require ( github.com/joho/godotenv v1.5.1 github.com/minio/minio-go/v7 v7.0.98 github.com/redis/go-redis/v9 v9.17.2 - github.com/shirou/gopsutil/v3 v3.24.5 github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e github.com/xlzd/gotp v0.1.0 golang.org/x/crypto v0.47.0 @@ -25,7 +24,6 @@ require ( github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/go-ini/ini v1.67.0 // indirect - github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-sql-driver/mysql v1.8.1 // indirect github.com/google/go-cmp v0.7.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect @@ -38,19 +36,13 @@ require ( github.com/klauspost/cpuid/v2 v2.2.11 // indirect github.com/klauspost/crc32 v1.3.0 // indirect github.com/kr/text v0.2.0 // indirect - github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/minio/crc64nvme v1.1.1 // indirect github.com/minio/md5-simd v1.1.2 // indirect github.com/philhofer/fwd v1.2.0 // indirect - github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/rogpeppe/go-internal v1.14.1 // indirect github.com/rs/xid v1.6.0 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/stretchr/testify v1.11.1 // indirect github.com/tinylib/msgp v1.6.1 // indirect - github.com/tklauser/go-sysconf v0.3.16 // indirect - github.com/tklauser/numcpus v0.11.0 // indirect - github.com/yusufpapurcu/wmi v1.2.4 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/net v0.48.0 // indirect golang.org/x/sync v0.19.0 // indirect diff --git a/go.sum b/go.sum index abf15f8..1d842e4 100644 --- a/go.sum +++ b/go.sum @@ -18,11 +18,8 @@ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkp github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A= github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= -github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= -github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y= github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= @@ -54,8 +51,6 @@ github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= -github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/minio/crc64nvme v1.1.1 h1:8dwx/Pz49suywbO+auHCBpCtlW1OfpcLN7wYgVR6wAI= github.com/minio/crc64nvme v1.1.1/go.mod h1:eVfm2fAzLlxMdUGc0EEBGSMmPwmXD5XiNRpnu9J3bvg= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= @@ -66,20 +61,12 @@ github.com/philhofer/fwd v1.2.0 h1:e6DnBTl7vGY+Gz322/ASL4Gyp1FspeMvx1RNDoToZuM= github.com/philhofer/fwd v1.2.0/go.mod h1:RqIHx9QI14HlwKwm98g9Re5prTQ6LdeRQn+gXJFxsJM= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= -github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/redis/go-redis/v9 v9.17.2 h1:P2EGsA4qVIM3Pp+aPocCJ7DguDHhqrXNhVcEp4ViluI= github.com/redis/go-redis/v9 v9.17.2/go.mod h1:u410H11HMLoB+TP67dz8rL9s6QW2j76l0//kSOd3370= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/rs/xid v1.6.0 h1:fV591PaemRlL6JfRxGDEPl69wICngIQ3shQtzfy2gxU= github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= -github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1vwZ3Je0FKVCfqOLp5zO6trqMLYs0= github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e/go.mod h1:XV66xRDqSt+GTGFMVlhk3ULuV0y9ZmzeVGR4mloJI3M= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -89,14 +76,8 @@ github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/tinylib/msgp v1.6.1 h1:ESRv8eL3u+DNHUoSAAQRE50Hm162zqAnBoGv9PzScPY= github.com/tinylib/msgp v1.6.1/go.mod h1:RSp0LW9oSxFut3KzESt5Voq4GVWyS+PSulT77roAqEA= -github.com/tklauser/go-sysconf v0.3.16 h1:frioLaCQSsF5Cy1jgRBrzr6t502KIIwQ0MArYICU0nA= -github.com/tklauser/go-sysconf v0.3.16/go.mod h1:/qNL9xxDhc7tx3HSRsLWNnuzbVfh3e7gh/BmM179nYI= -github.com/tklauser/numcpus v0.11.0 h1:nSTwhKH5e1dMNsCdVBukSZrURJRoHbSEQjdEbY+9RXw= -github.com/tklauser/numcpus v0.11.0/go.mod h1:z+LwcLq54uWZTX0u/bGobaV34u6V7KNlTZejzM6/3MQ= github.com/xlzd/gotp v0.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po= github.com/xlzd/gotp v0.1.0/go.mod h1:ndLJ3JKzi3xLmUProq4LLxCuECL93dG9WASNLpHz8qg= -github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= -github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8= @@ -105,13 +86,10 @@ golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU= golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY= golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4= golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ= golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE= golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk= gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/main.go b/main.go index 4502db3..a524cc9 100644 --- a/main.go +++ b/main.go @@ -12,14 +12,12 @@ import ( "github.com/fossyy/filekeeper/db" "github.com/fossyy/filekeeper/email" "github.com/fossyy/filekeeper/middleware" - "github.com/fossyy/filekeeper/routes/admin" "github.com/fossyy/filekeeper/routes/client" "github.com/fossyy/filekeeper/utils" ) func main() { clientAddr := fmt.Sprintf("%s:%s", utils.Getenv("SERVER_HOST"), utils.Getenv("SERVER_PORT")) - adminAddr := fmt.Sprintf("%s:%s", utils.Getenv("SERVER_HOST"), "27000") dbUser := utils.Getenv("DB_USERNAME") dbPass := utils.Getenv("DB_PASSWORD") @@ -44,16 +42,6 @@ func main() { S3 := storage.NewS3(bucket, region, endpoint, accessKey, secretKey) app.Server = app.NewClientServer(clientAddr, middleware.Handler(client.SetupRoutes()), *logger.Logger(), database, cacheServer, encryption.NewAesEncryption(), S3, mailServer) - app.Admin = app.NewAdminServer(adminAddr, middleware.Handler(admin.SetupRoutes()), database) - - go func() { - fmt.Printf("Admin Web App Listening on http://%s\n", app.Admin.Addr) - err := app.Admin.ListenAndServe() - if err != nil { - panic(err) - return - } - }() fmt.Printf("Client Web App Listening on http://%s\n", app.Server.Addr) err := app.Server.ListenAndServe() diff --git a/routes/admin/routes.go b/routes/admin/routes.go deleted file mode 100644 index 1236115..0000000 --- a/routes/admin/routes.go +++ /dev/null @@ -1,99 +0,0 @@ -package admin - -import ( - "encoding/json" - adminIndex "github.com/fossyy/filekeeper/view/admin/index" - "github.com/gorilla/websocket" - "github.com/shirou/gopsutil/v3/cpu" - "github.com/shirou/gopsutil/v3/mem" - "github.com/shirou/gopsutil/v3/net" - "log" - "net/http" - "time" -) - -var upgrader = websocket.Upgrader{ - ReadBufferSize: 1024, - WriteBufferSize: 1024, -} - -type SystemStats struct { - TotalMemoryGB float64 `json:"total_memory_gb"` - MemoryUsedGB float64 `json:"memory_used_gb"` - CpuUsagePercent float64 `json:"cpu_usage_percent"` - UploadSpeedMbps float64 `json:"upload_speed_mbps"` - DownloadSpeedMbps float64 `json:"download_speed_mbps"` -} - -func SetupRoutes() *http.ServeMux { - handler := http.NewServeMux() - handler.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { - //users, err := app.Admin.Database.GetAllUsers() - //if err != nil { - // http.Error(w, "Unable to retrieve users", http.StatusInternalServerError) - // return - //} - //w.Header().Set("Content-Type", "application/json") - //if err := json.NewEncoder(w).Encode(users); err != nil { - // http.Error(w, "Failed to encode response", http.StatusInternalServerError) - // return - //} - adminIndex.Main().Render(r.Context(), w) - return - }) - - handler.HandleFunc("/ws", func(w http.ResponseWriter, r *http.Request) { - conn, err := upgrader.Upgrade(w, r, nil) - if err != nil { - log.Println(err) - return - } - for { - handlerWS(conn) - } - }) - - fileServer := http.FileServer(http.Dir("./public")) - handler.Handle("/public/", http.StripPrefix("/public", fileServer)) - return handler -} - -func handlerWS(conn *websocket.Conn) { - prevCounters, _ := net.IOCounters(false) - for { - vMem, _ := mem.VirtualMemory() - - totalMemoryGB := float64(vMem.Total) / (1024 * 1024 * 1024) - memoryUsedGB := float64(vMem.Used) / (1024 * 1024 * 1024) - - cpuPercent, _ := cpu.Percent(time.Second, false) - - currentCounters, _ := net.IOCounters(false) - - uploadBytes := currentCounters[0].BytesSent - prevCounters[0].BytesSent - downloadBytes := currentCounters[0].BytesRecv - prevCounters[0].BytesRecv - uploadSpeedMbps := float64(uploadBytes) * 8 / (1024 * 1024) / 2 - downloadSpeedMbps := float64(downloadBytes) * 8 / (1024 * 1024) / 2 - - prevCounters = currentCounters - - stats := SystemStats{ - TotalMemoryGB: totalMemoryGB, - MemoryUsedGB: memoryUsedGB, - CpuUsagePercent: cpuPercent[0], - UploadSpeedMbps: uploadSpeedMbps, - DownloadSpeedMbps: downloadSpeedMbps, - } - - statsJson, _ := json.Marshal(stats) - - err := conn.WriteMessage(websocket.TextMessage, statsJson) - if err != nil { - conn.Close() - return - } - - time.Sleep(2 * time.Second) - } - -} diff --git a/view/admin/index/index.templ b/view/admin/index/index.templ deleted file mode 100644 index 3196fb3..0000000 --- a/view/admin/index/index.templ +++ /dev/null @@ -1,449 +0,0 @@ - -package adminIndex - -import "github.com/fossyy/filekeeper/view/admin/layout" - -templ Main() { - @layout.Base() { -
-
-
-
-
-

System Usage

-

Real-time metrics for your server.

-
-
-
-
- - - - - - - - - - - - -
0%
-
CPU Usage
-
-
- - - - - - - - - - - -
0GB
-
Memory Usage
-
-
- - - - - -
0Mbps
-
Upload Speed
-
-
- - - - - -
0Mbps
-
Download Speed
-
-
-
-
-
-
-

User List

-

Manage your registered users.

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Name - - Email - - Role - - Actions -
-
John Doe
-
-
john@example.com
-
-
- Admin -
-
-
Jane Smith
-
-
jane@example.com
-
-
- Editor -
-
-
Bob Johnson
-
-
bob@example.com
-
-
- User -
-
-
-
-
-
-
-
-
-

Server Control

-

Manage your server instances.

-
-
-
-
-
-
Server 1
-
192.168.1.100
-
-
- - - -
-
-
-
-
-
Server 2
-
192.168.1.101
-
-
- - - -
-
-
-
-
-
Server 3
-
192.168.1.102
-
-
- - - -
-
-
-
-
-
-
-

Server Environment

-

Manage your server environment variables.

-
-
-
-
-
-
NODE_ENV
-
Environment mode
-
- -
-
-
-
-
-
-
- - } -} diff --git a/view/admin/index/index_templ.go b/view/admin/index/index_templ.go deleted file mode 100644 index a2c2c8e..0000000 --- a/view/admin/index/index_templ.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.3.833 - -package adminIndex - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -import "github.com/fossyy/filekeeper/view/admin/layout" - -func Main() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "

System Usage

Real-time metrics for your server.

0%
CPU Usage
0GB
Memory Usage
0Mbps
Upload Speed
0Mbps
Download Speed

User List

Manage your registered users.

NameEmailRoleActions
John Doe
john@example.com
Admin
Jane Smith
jane@example.com
Editor
Bob Johnson
bob@example.com
User

Server Control

Manage your server instances.

Server 1
192.168.1.100
Server 2
192.168.1.101
Server 3
192.168.1.102

Server Environment

Manage your server environment variables.

NODE_ENV
Environment mode
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) - templ_7745c5c3_Err = layout.Base().Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/view/admin/layout/base.templ b/view/admin/layout/base.templ deleted file mode 100644 index dfb9ffd..0000000 --- a/view/admin/layout/base.templ +++ /dev/null @@ -1,19 +0,0 @@ -package layout - -templ Base() { - - - - - - - Admin Page - - - -
- { children... } -
- - -} \ No newline at end of file diff --git a/view/admin/layout/base_templ.go b/view/admin/layout/base_templ.go deleted file mode 100644 index c586800..0000000 --- a/view/admin/layout/base_templ.go +++ /dev/null @@ -1,48 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.3.833 -package layout - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -func Base() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "Admin Page
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -var _ = templruntime.GeneratedTemplate