diff --git a/server/public.go b/server/public.go index 5470fa6f..1a9d1dde 100644 --- a/server/public.go +++ b/server/public.go @@ -440,6 +440,7 @@ func (s *PublicServer) parseTemplates() []*template.Template { "setTxToTemplateData": setTxToTemplateData, "isOwnAddress": isOwnAddress, "isOwnAddresses": isOwnAddresses, + "toJSON": toJSON, } var createTemplate func(filenames ...string) *template.Template if s.debug { @@ -507,6 +508,14 @@ func formatTime(t time.Time) string { return t.Format(time.RFC1123) } +func toJSON(data interface{}) string { + json, err := json.Marshal(data) + if err != nil { + return "" + } + return string(json) +} + // for now return the string as it is // in future could be used to do coin specific formatting func (s *PublicServer) formatAmount(a *api.Amount) string { diff --git a/static/templates/index.html b/static/templates/index.html index ff36faa8..2dc6a826 100644 --- a/static/templates/index.html +++ b/static/templates/index.html @@ -100,6 +100,12 @@ {{$be.SizeOnDisk}} {{- end -}} + {{- if $be.Consensus -}} + + Consensus + {{toJSON $be.Consensus}} + + {{- end -}} {{- if $be.Warnings -}} Warnings