mirror of
https://github.com/mentos1386/zdravko.git
synced 2024-11-22 07:43:33 +00:00
fix(index): bucket calculation
This commit is contained in:
parent
07c7c716c5
commit
820e597d72
3 changed files with 8 additions and 8 deletions
|
@ -31,7 +31,7 @@ type History struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func getHour(date time.Time) string {
|
func getHour(date time.Time) string {
|
||||||
return date.UTC().Format("2006-01-02T15:04")
|
return date.UTC().Format("2006-01-02T15:04:05")
|
||||||
}
|
}
|
||||||
|
|
||||||
func getHistory(history []*models.MonitorHistory, period time.Duration, buckets int) *History {
|
func getHistory(history []*models.MonitorHistory, period time.Duration, buckets int) *History {
|
||||||
|
@ -45,7 +45,7 @@ func getHistory(history []*models.MonitorHistory, period time.Duration, buckets
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, _history := range history {
|
for _, _history := range history {
|
||||||
hour := getHour(_history.CreatedAt.Time.Truncate(time.Hour))
|
hour := getHour(_history.CreatedAt.Time.Truncate(period))
|
||||||
|
|
||||||
// Skip if not part of the "buckets"
|
// Skip if not part of the "buckets"
|
||||||
if _, ok := historyMap[hour]; !ok {
|
if _, ok := historyMap[hour]; !ok {
|
||||||
|
|
|
@ -900,9 +900,9 @@ video {
|
||||||
background-color: rgb(243 244 246 / var(--tw-bg-opacity));
|
background-color: rgb(243 244 246 / var(--tw-bg-opacity));
|
||||||
}
|
}
|
||||||
|
|
||||||
.bg-gray-400 {
|
.bg-gray-200 {
|
||||||
--tw-bg-opacity: 1;
|
--tw-bg-opacity: 1;
|
||||||
background-color: rgb(156 163 175 / var(--tw-bg-opacity));
|
background-color: rgb(229 231 235 / var(--tw-bg-opacity));
|
||||||
}
|
}
|
||||||
|
|
||||||
.bg-gray-50 {
|
.bg-gray-50 {
|
||||||
|
@ -1612,9 +1612,9 @@ code {
|
||||||
background-color: rgb(243 244 246 / var(--tw-bg-opacity));
|
background-color: rgb(243 244 246 / var(--tw-bg-opacity));
|
||||||
}
|
}
|
||||||
|
|
||||||
.hover\:bg-gray-500:hover {
|
.hover\:bg-gray-300:hover {
|
||||||
--tw-bg-opacity: 1;
|
--tw-bg-opacity: 1;
|
||||||
background-color: rgb(107 114 128 / var(--tw-bg-opacity));
|
background-color: rgb(209 213 219 / var(--tw-bg-opacity));
|
||||||
}
|
}
|
||||||
|
|
||||||
.hover\:bg-green-500:hover {
|
.hover\:bg-green-500:hover {
|
||||||
|
|
|
@ -96,7 +96,7 @@
|
||||||
{{ else if eq .Status "FAILURE" }}
|
{{ else if eq .Status "FAILURE" }}
|
||||||
<span class="flex w-3 h-3 me-2 bg-red-400 rounded-full"></span>
|
<span class="flex w-3 h-3 me-2 bg-red-400 rounded-full"></span>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<span class="flex w-3 h-3 me-2 bg-gray-400 rounded-full"></span>
|
<span class="flex w-3 h-3 me-2 bg-gray-200 rounded-full"></span>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<p>{{ .Name }}</p>
|
<p>{{ .Name }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -112,7 +112,7 @@
|
||||||
{{ else if eq . "FAILURE" }}
|
{{ else if eq . "FAILURE" }}
|
||||||
<div class="bg-red-400 hover:bg-red-500 flex-auto"></div>
|
<div class="bg-red-400 hover:bg-red-500 flex-auto"></div>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<div class="bg-gray-400 hover:bg-gray-500 flex-auto"></div>
|
<div class="bg-gray-200 hover:bg-gray-300 flex-auto"></div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue