2026-02-07 17:55:25 +00:00
|
|
|
{{ template "sync/layout/authenticated.html" . }}
|
2026-02-07 05:51:21 +00:00
|
|
|
|
|
|
|
|
{{ define "title" }}Dash{{ end }}
|
|
|
|
|
{{ define "extraheader" }}
|
2026-02-16 18:19:50 +00:00
|
|
|
<script
|
|
|
|
|
type="text/javascript"
|
|
|
|
|
src="//unpkg.com/maplibre-gl@5.0.1/dist/maplibre-gl.js"
|
|
|
|
|
></script>
|
2026-02-07 05:51:21 +00:00
|
|
|
<script src="/static/js/map-aggregate.js"></script>
|
|
|
|
|
<script>
|
|
|
|
|
function onLoad() {
|
|
|
|
|
const map = document.querySelector("map-aggregate");
|
2026-03-21 03:11:22 +00:00
|
|
|
if (map) {
|
|
|
|
|
map.addEventListener("cell-click", (event) => {
|
|
|
|
|
window.location.href = "/cell/" + event.detail.cell;
|
|
|
|
|
});
|
|
|
|
|
}
|
2026-02-07 05:51:21 +00:00
|
|
|
}
|
|
|
|
|
window.addEventListener("load", onLoad);
|
|
|
|
|
</script>
|
|
|
|
|
{{ end }}
|
|
|
|
|
{{ define "content" }}
|
2026-02-07 18:26:47 +00:00
|
|
|
<!-- Dashboard Header -->
|
|
|
|
|
<div class="row mb-4">
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<h1>{{ .User.Organization.Name }} Dashboard</h1>
|
|
|
|
|
<p class="text-muted">
|
|
|
|
|
Overview of mosquito control activities in your district
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
class="col-md-6 text-md-end d-flex align-items-center justify-content-md-end"
|
|
|
|
|
>
|
2026-02-24 15:34:53 +00:00
|
|
|
{{ if .C.IsSyncOngoing }}
|
2026-02-07 18:26:47 +00:00
|
|
|
<p class="last-refreshed mb-0">
|
|
|
|
|
<i class="fas fa-sync-alt me-2 syncing"></i>Syncing now...
|
2026-02-07 05:51:21 +00:00
|
|
|
</p>
|
2026-02-07 18:26:47 +00:00
|
|
|
{{ else }}
|
|
|
|
|
<p class="last-refreshed mb-0">
|
|
|
|
|
<i class="fas fa-sync-alt me-2"></i>Last updated:
|
2026-02-13 21:42:30 +00:00
|
|
|
<span id="last-refreshed-time"
|
2026-02-24 15:34:53 +00:00
|
|
|
>{{ .C.LastSync | timeRelativePtr }}</span
|
2026-02-13 21:42:30 +00:00
|
|
|
>
|
2026-02-07 18:26:47 +00:00
|
|
|
<button class="btn btn-sm btn-outline-primary ms-3">
|
|
|
|
|
Refresh Data
|
|
|
|
|
</button>
|
|
|
|
|
</p>
|
|
|
|
|
{{ end }}
|
2026-02-07 05:51:21 +00:00
|
|
|
</div>
|
2026-02-07 18:26:47 +00:00
|
|
|
</div>
|
2026-02-07 05:51:21 +00:00
|
|
|
|
2026-02-07 18:26:47 +00:00
|
|
|
<!-- Key Metrics -->
|
|
|
|
|
<div class="row g-4">
|
|
|
|
|
<!-- Last Refreshed -->
|
|
|
|
|
<div class="col-md-3">
|
|
|
|
|
<div class="card stats-card h-100">
|
|
|
|
|
<div class="card-body text-center">
|
2026-02-10 16:27:32 +00:00
|
|
|
<div class="metric-icon bg-success text-white">
|
2026-02-07 18:26:47 +00:00
|
|
|
<i class="fas fa-clock"></i>
|
2026-02-07 05:51:21 +00:00
|
|
|
</div>
|
2026-02-07 18:26:47 +00:00
|
|
|
<h5 class="card-title">Last Data Refresh</h5>
|
2026-02-24 15:34:53 +00:00
|
|
|
<p class="metric-value">{{ .C.LastSync | timeRelativePtr }}</p>
|
2026-02-07 18:26:47 +00:00
|
|
|
<!-- <p class="card-text text-muted">Last sync: 12:45 PM</p> -->
|
2026-02-07 05:51:21 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-02-07 18:26:47 +00:00
|
|
|
</div>
|
2026-02-07 05:51:21 +00:00
|
|
|
|
2026-02-07 18:26:47 +00:00
|
|
|
<!-- Service Requests -->
|
|
|
|
|
<div class="col-md-3">
|
|
|
|
|
<div class="card stats-card h-100">
|
|
|
|
|
<div class="card-body text-center">
|
2026-02-10 16:27:32 +00:00
|
|
|
<div class="metric-icon bg-warning text-white">
|
2026-02-07 18:26:47 +00:00
|
|
|
<i class="fas fa-ticket-alt"></i>
|
|
|
|
|
</div>
|
|
|
|
|
<h5 class="card-title">Service Requests</h5>
|
2026-02-24 15:34:53 +00:00
|
|
|
{{ if .C.IsSyncOngoing }}
|
2026-02-07 18:26:47 +00:00
|
|
|
<p class="metric-value">
|
2026-02-24 15:34:53 +00:00
|
|
|
{{ .C.CountServiceRequests | bigNumber }}...?
|
2026-02-07 18:26:47 +00:00
|
|
|
</p>
|
|
|
|
|
{{ else }}
|
|
|
|
|
<p class="metric-value">
|
2026-02-24 15:34:53 +00:00
|
|
|
{{ .C.CountServiceRequests | bigNumber }}
|
2026-02-07 18:26:47 +00:00
|
|
|
</p>
|
|
|
|
|
{{ end }}
|
|
|
|
|
<!--<p class="card-text text-muted">
|
2026-02-07 05:51:21 +00:00
|
|
|
<span class="text-success">
|
|
|
|
|
<i class="fas fa-arrow-up"></i> 12%
|
|
|
|
|
</span> since last week
|
|
|
|
|
</p>-->
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-02-07 18:26:47 +00:00
|
|
|
</div>
|
2026-02-07 05:51:21 +00:00
|
|
|
|
2026-02-07 18:26:47 +00:00
|
|
|
<!-- Mosquito Sources -->
|
|
|
|
|
<div class="col-md-3">
|
|
|
|
|
<div class="card stats-card h-100">
|
|
|
|
|
<div class="card-body text-center">
|
2026-02-10 16:27:32 +00:00
|
|
|
<div class="metric-icon bg-danger text-white">
|
2026-02-07 18:26:47 +00:00
|
|
|
<i class="fas fa-bug"></i>
|
|
|
|
|
</div>
|
|
|
|
|
<h5 class="card-title">Mosquito Sources</h5>
|
2026-02-24 15:34:53 +00:00
|
|
|
{{ if .C.IsSyncOngoing }}
|
2026-02-07 18:26:47 +00:00
|
|
|
<p class="metric-value">
|
2026-02-24 15:34:53 +00:00
|
|
|
{{ .C.CountMosquitoSources | bigNumber }}..?
|
2026-02-07 18:26:47 +00:00
|
|
|
</p>
|
|
|
|
|
{{ else }}
|
|
|
|
|
<p class="metric-value">
|
2026-02-24 15:34:53 +00:00
|
|
|
{{ .C.CountMosquitoSources | bigNumber }}
|
2026-02-07 18:26:47 +00:00
|
|
|
</p>
|
|
|
|
|
{{ end }}
|
|
|
|
|
<!-- <p class="card-text text-muted">
|
2026-02-07 05:51:21 +00:00
|
|
|
<span class="text-danger">
|
|
|
|
|
<i class="fas fa-arrow-up"></i> 8%
|
|
|
|
|
</span> since last month
|
|
|
|
|
</p> -->
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-02-07 18:26:47 +00:00
|
|
|
</div>
|
2026-02-07 05:51:21 +00:00
|
|
|
|
2026-02-07 18:26:47 +00:00
|
|
|
<!-- Inspections -->
|
|
|
|
|
<div class="col-md-3">
|
|
|
|
|
<div class="card stats-card h-100">
|
|
|
|
|
<div class="card-body text-center">
|
2026-02-10 16:27:32 +00:00
|
|
|
<div class="metric-icon bg-info text-white">
|
2026-02-07 18:26:47 +00:00
|
|
|
<i class="fas fa-clipboard-check"></i>
|
|
|
|
|
</div>
|
|
|
|
|
<h5 class="card-title">Traps</h5>
|
2026-02-24 15:34:53 +00:00
|
|
|
{{ if .C.IsSyncOngoing }}
|
|
|
|
|
<p class="metric-value">{{ .C.CountTraps | bigNumber }}...?</p>
|
2026-02-07 18:26:47 +00:00
|
|
|
{{ else }}
|
2026-02-24 15:34:53 +00:00
|
|
|
<p class="metric-value">{{ .C.CountTraps | bigNumber }}</p>
|
2026-02-07 18:26:47 +00:00
|
|
|
{{ end }}
|
|
|
|
|
<!-- <p class="card-text text-muted">
|
2026-02-07 05:51:21 +00:00
|
|
|
<span class="text-success">
|
|
|
|
|
<i class="fas fa-arrow-up"></i> 15%
|
|
|
|
|
</span> since last week
|
|
|
|
|
</p> -->
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-02-07 18:26:47 +00:00
|
|
|
</div>
|
2026-02-07 05:51:21 +00:00
|
|
|
|
2026-02-07 18:26:47 +00:00
|
|
|
<!-- Map Section -->
|
|
|
|
|
<h3 class="section-title">Mosquito Activity Heatmap</h3>
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-12">
|
2026-03-13 18:21:45 +00:00
|
|
|
{{ if eq .Organization.ServiceArea.Min.X 0.0 }}
|
|
|
|
|
<p>No service area for this organization yet</p>
|
|
|
|
|
{{ else }}
|
|
|
|
|
<map-aggregate
|
|
|
|
|
organization-id="{{ .Organization.ID }}"
|
|
|
|
|
tegola="{{ .URL.Tegola }}"
|
|
|
|
|
xmin="{{ .Organization.ServiceArea.Min.X }}"
|
|
|
|
|
ymin="{{ .Organization.ServiceArea.Min.Y }}"
|
|
|
|
|
xmax="{{ .Organization.ServiceArea.Max.X }}"
|
|
|
|
|
ymax="{{ .Organization.ServiceArea.Max.Y }}"
|
|
|
|
|
/>
|
2026-02-24 15:34:53 +00:00
|
|
|
{{ end }}
|
2026-02-07 05:51:21 +00:00
|
|
|
</div>
|
2026-02-07 18:26:47 +00:00
|
|
|
</div>
|
2026-02-07 05:51:21 +00:00
|
|
|
|
2026-02-07 18:26:47 +00:00
|
|
|
<!-- Recent Activity Section -->
|
|
|
|
|
<h3 class="section-title">Recent Activity</h3>
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-12">
|
|
|
|
|
<div class="card">
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
<div class="table-responsive">
|
|
|
|
|
<table class="table table-hover">
|
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
|
|
|
|
<th>Date</th>
|
|
|
|
|
<th>Type</th>
|
|
|
|
|
<th>Location</th>
|
|
|
|
|
<th>Status</th>
|
|
|
|
|
<th>Action</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
2026-02-24 15:34:53 +00:00
|
|
|
{{ range $i, $sr := .C.RecentRequests }}
|
2026-02-07 05:51:21 +00:00
|
|
|
<tr>
|
2026-02-13 21:42:30 +00:00
|
|
|
<td>{{ $sr.Date | timeRelativePtr }}</td>
|
2026-02-07 18:26:47 +00:00
|
|
|
<td>Service Request</td>
|
|
|
|
|
<td>{{ $sr.Location }}</td>
|
|
|
|
|
<td><span class="badge bg-success">Completed</span></td>
|
|
|
|
|
<td>
|
|
|
|
|
<a href="#" class="btn btn-sm btn-outline-primary"
|
|
|
|
|
>View</a
|
|
|
|
|
>
|
|
|
|
|
</td>
|
2026-02-07 05:51:21 +00:00
|
|
|
</tr>
|
2026-02-07 18:26:47 +00:00
|
|
|
{{ end }}
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
2026-02-07 05:51:21 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
{{ end }}
|