Skip to content

Commit

Permalink
Add current server time to dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Castell committed Aug 2, 2019
1 parent 49776f5 commit 4c5fbf4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
3 changes: 3 additions & 0 deletions dkron/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"html/template"
"io/ioutil"
"net/http"
"time"

"github.com/distribworks/dkron/dkron/assets"
"github.com/distribworks/dkron/dkron/templates"
Expand All @@ -26,6 +27,7 @@ type commonDashboardData struct {
Path string
APIPath string
Name string
Time string
}

func newCommonDashboardData(a *Agent, nodeName, path string) *commonDashboardData {
Expand All @@ -43,6 +45,7 @@ func newCommonDashboardData(a *Agent, nodeName, path string) *commonDashboardDat
Path: fmt.Sprintf("%s%s", path, dashboardPathPrefix),
APIPath: fmt.Sprintf("%s%s", path, apiPathPrefix),
Name: Name,
Time: time.Now().UTC().Format("15:04:05 UTC"),
}
}

Expand Down
10 changes: 5 additions & 5 deletions dkron/templates/templates_vfsdata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions templates/dashboard.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@
<li>
<p class="navbar-text">Leader: {{ .Common.LeaderName }}</p>
</li>
<li>
<p class="navbar-text">Time: {{ .Common.Time }}</p>
</li>
</ul>
</div>
</div>
Expand Down

0 comments on commit 4c5fbf4

Please sign in to comment.