From da1d8f4e7c332c7109427915e6459b10209cedce Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 6 Apr 2025 09:26:46 +0800 Subject: Move the Go stuff to ./forged/ --- internal/unsorted/http_handle_index.go | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 internal/unsorted/http_handle_index.go (limited to 'internal/unsorted/http_handle_index.go') diff --git a/internal/unsorted/http_handle_index.go b/internal/unsorted/http_handle_index.go deleted file mode 100644 index 458fbb4..0000000 --- a/internal/unsorted/http_handle_index.go +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-only -// SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu - -package unsorted - -import ( - "net/http" - "runtime" - - "github.com/dustin/go-humanize" - "go.lindenii.runxiyu.org/forge/internal/web" -) - -// httpHandleIndex provides the main index page which includes a list of groups -// and some global information such as SSH keys. -func (s *Server) httpHandleIndex(writer http.ResponseWriter, request *http.Request, params map[string]any) { - var err error - var groups []nameDesc - - groups, err = s.queryNameDesc(request.Context(), "SELECT name, COALESCE(description, '') FROM groups WHERE parent_group IS NULL") - if err != nil { - web.ErrorPage500(s.templates, writer, params, "Error querying groups: "+err.Error()) - return - } - params["groups"] = groups - - // Memory currently allocated - memstats := runtime.MemStats{} //exhaustruct:ignore - runtime.ReadMemStats(&memstats) - params["mem"] = humanize.IBytes(memstats.Alloc) - s.renderTemplate(writer, "index", params) -} -- cgit v1.2.3