Skip to content

Commit

Permalink
Merge pull request #146 from prometheus/superq/landing_extra
Browse files Browse the repository at this point in the history
Add generic customization to landing page
  • Loading branch information
SuperQ authored Apr 5, 2023
2 parents 22a4c39 + f213b7f commit b059844
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions web/landing_page.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ label {
display: inline-block;
width: {{.Form.Width}}em;
}
{{.ExtraCSS}}
2 changes: 2 additions & 0 deletions web/landing_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ type LandingConfig struct {
Description string // A short description about the exporter.
Form LandingForm // A POST form.
Links []LandingLinks // Links displayed on the landing page.
ExtraHTML string // Additional HTML to be embedded.
ExtraCSS string // Additional CSS to be embedded.
Version string // The version displayed.
}

Expand Down
3 changes: 2 additions & 1 deletion web/landing_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ <h1>{{.Name}}</h1>
<div>
<form action="{{ .Form.Action}}">
{{ range .Form.Inputs }}
<label>{{ .Label }}:</label>&nbsp;<input type="{{ .Type }}" name="{{ .Name }}" placeholder=" .Placeholder }}" value="{{ .Value }}"><br>
<label>{{ .Label }}:</label>&nbsp;<input type="{{ .Type }}" name="{{ .Name }}" placeholder="{{ .Placeholder }}" value="{{ .Value }}"><br>
{{ end }}
<input type="submit" value="Submit">
</form>
</div>
{{ end }}
{{ .ExtraHTML }}
</main>
</body>
</html>

0 comments on commit b059844

Please sign in to comment.