Show tokens that have expired

This commit is contained in:
Eli Ribble 2026-02-13 21:24:39 +00:00
parent b654198e3f
commit f9d4206bab
No known key found for this signature in database
3 changed files with 14 additions and 6 deletions

View file

@ -20,6 +20,7 @@ import (
func addFuncMap(t *template.Template) {
funcMap := template.FuncMap{
"bigNumber": bigNumber,
"hasPassed": hasPassed,
"html": unescapeHTML,
"json": unescapeJS,
"GISStatement": gisStatement,
@ -62,6 +63,10 @@ func timeAsRelativeDate(d time.Time) string {
return d.Format("01-02")
}
func hasPassed(t time.Time) bool {
return t.Before(time.Now())
}
// FormatTimeDuration returns a human-readable string representing a time.Duration
// as "X units early" or "X units late"
func timeDelta(d time.Duration) string {

View file

@ -69,13 +69,17 @@
<tr>
<td width="30%"><strong>OAuth Token Status</strong></td>
<td>
{{ if .ArcGISOAuth.InvalidatedAt.IsNull }}
<span class="status-active">
<i class="bi bi-check-circle-fill me-1"></i> Active
{{ if not .ArcGISOAuth.InvalidatedAt.IsNull }}
<span class="status-inactive">
<i class="bi bi-x-circle-fill me-1"></i> Invalidated
</span>
{{ else if hasPassed .ArcGISOAuth.AccessTokenExpires }}
<span class="status-inactive">
<i class="bi bi-x-circle-fill me-1"></i> Expired
</span>
{{ else }}
<span class="status-inactive">
<i class="bi bi-x-circle-fill me-1"></i> Active
<span class="status-active">
<i class="bi bi-check-circle-fill me-1"></i> Active
</span>
{{ end }}
</td>