Skip to content

Commit

Permalink
Added some env vars to db metadata page
Browse files Browse the repository at this point in the history
  • Loading branch information
diamondap committed Jan 29, 2024
1 parent 7b383d0 commit 041a7c6
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
44 changes: 44 additions & 0 deletions views/internal_metadata/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,50 @@

{{ template "shared/_header.html" .}}



<div class="box">
<div class="box-header">
<h1 class="h2">Environment</h1>
</div>
<table class="table is-hoverable is-fullwidth has-padding">
<thead>
<tr>
<th class="pl-5">Key</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td class="pl-5">
APT_ENV
</td>
<td>
{{ .envName }}
</td>
</tr>
<tr>
<td class="pl-5">
Redis URL
</td>
<td>
{{ .redisUrl }}
</td>
</tr>
<tr>
<td class="pl-5">
Database
</td>
<td>
{{ .dbName }}
</td>
</tr>
</tbody>
</table>
</div>



<div class="box">
<div class="box-header">
<h1 class="h2">Internal Metadata</h1>
Expand Down
5 changes: 5 additions & 0 deletions web/webui/internal_data_controller.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package webui

import (
"fmt"
"net/http"

"github.com/APTrust/registry/common"
"github.com/APTrust/registry/pgmodels"
"github.com/gin-gonic/gin"
)
Expand All @@ -25,6 +27,9 @@ func InternalMetadataIndex(c *gin.Context) {
return
}
req.TemplateData["migrations"] = migrations
req.TemplateData["envName"] = common.Context().Config.EnvName
req.TemplateData["redisUrl"] = common.Context().Config.Redis.URL
req.TemplateData["dbName"] = fmt.Sprintf("%s@%s", common.Context().Config.DB.Name, common.Context().Config.DB.Host)

c.HTML(http.StatusOK, "internal_metadata/index.html", req.TemplateData)
}

0 comments on commit 041a7c6

Please sign in to comment.