Skip to content

Commit

Permalink
More dashboard report work
Browse files Browse the repository at this point in the history
  • Loading branch information
diamondap committed Nov 28, 2023
1 parent e9288b8 commit 7a6afaa
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions core/aptrust_client_v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion core/remote_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions server/controllers/dashboard_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions server/views/dashboard/show.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@

<script>
$(function(){
var repoReports = `{{ .reportListJson }}`
var reports = {{ .reportListJson }}

})
</script>

Expand Down

0 comments on commit 7a6afaa

Please sign in to comment.