From 7a6afaa2bb1050aa7993e6a30abd02f1a6bf8bd0 Mon Sep 17 00:00:00 2001 From: "A. Diamond" Date: Tue, 28 Nov 2023 14:44:22 -0500 Subject: [PATCH] More dashboard report work --- core/aptrust_client_v3.go | 2 ++ core/remote_repository.go | 2 +- server/controllers/dashboard_controller.go | 6 +++--- server/views/dashboard/show.html | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/core/aptrust_client_v3.go b/core/aptrust_client_v3.go index 94f0206..f8196ca 100644 --- a/core/aptrust_client_v3.go +++ b/core/aptrust_client_v3.go @@ -186,6 +186,8 @@ func (client *APTrustClientV3) connect() error { return err } +// We check this because we don't want our depositors accidentally sending +// their API credentials to just anyone. func (client *APTrustClientV3) isValidDomain() bool { parsedUrl, err := url.Parse(client.config.Url) if err != nil { diff --git a/core/remote_repository.go b/core/remote_repository.go index ac868df..da7f78a 100644 --- a/core/remote_repository.go +++ b/core/remote_repository.go @@ -164,7 +164,7 @@ func (repo *RemoteRepository) TestConnection() error { // from this remote repository. func (repo *RemoteRepository) ReportsAvailable() ([]util.NameValuePair, error) { reports := make([]util.NameValuePair, 0) - if util.LooksLikeUUID(repo.PluginID) { + if !util.LooksLikeUUID(repo.PluginID) { return reports, fmt.Errorf("no client exists for this repo because plugin id is not a uuid") } client, err := GetRemoteRepoClient(repo) diff --git a/server/controllers/dashboard_controller.go b/server/controllers/dashboard_controller.go index ac59b92..f7e9fbc 100644 --- a/server/controllers/dashboard_controller.go +++ b/server/controllers/dashboard_controller.go @@ -38,9 +38,9 @@ func DashboardShow(c *gin.Context) { } data := gin.H{ - "jobs": result.Jobs, - "reports": string(reportListJson), - "reportsErr": err, + "jobs": result.Jobs, + "reportListJson": string(reportListJson), + "reportsErr": err, } c.HTML(http.StatusOK, "dashboard/show.html", data) diff --git a/server/views/dashboard/show.html b/server/views/dashboard/show.html index b0d495a..8e45c39 100644 --- a/server/views/dashboard/show.html +++ b/server/views/dashboard/show.html @@ -38,8 +38,8 @@