Check if we have oauth information, only prompt if its missing

Also include a rough dashboard of information that we'll pull from
Fieldseeker
This commit is contained in:
Eli Ribble 2025-11-06 22:58:18 +00:00
parent fa89e0719f
commit 72cbe2de5e
No known key found for this signature in database
10 changed files with 567 additions and 100 deletions

View file

@ -2,105 +2,210 @@
{{define "title"}}Dash{{end}}
{{define "style"}}
.connect-container {
max-width: 800px;
margin: 0 auto;
}
.connect-box {
box-shadow: 0 0 15px rgba(0,0,0,0.1);
border-radius: 10px;
padding: 40px;
background-color: #fff;
}
.connect-header {
margin-bottom: 25px;
text-align: center;
}
.logo-area {
text-align: center;
margin-bottom: 30px;
}
.logo-placeholder {
width: 120px;
height: 60px;
background-color: #e9ecef;
margin: 0 auto;
display: flex;
align-items: center;
justify-content: center;
border-radius: 6px;
}
.steps-container {
margin: 30px 0;
}
.step {
margin-bottom: 20px;
padding: 15px;
border-left: 3px solid #0d6efd;
background-color: #f8f9fa;
}
.connect-btn {
margin-top: 30px;
}
body {
background-color: #f8f9fa;
}
.dashboard-container {
padding: 20px 0;
}
.stats-card {
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0,0,0,0.05);
transition: transform 0.2s;
height: 100%;
}
.stats-card:hover {
transform: translateY(-5px);
}
.map-container {
background-color: #e9ecef;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0,0,0,0.05);
height: 500px;
display: flex;
align-items: center;
justify-content: center;
margin-top: 20px;
}
.section-title {
margin: 30px 0 20px;
padding-bottom: 10px;
border-bottom: 1px solid #dee2e6;
}
.last-refreshed {
color: #6c757d;
}
.logo-placeholder {
width: 100px;
height: 40px;
background-color: #e9ecef;
display: flex;
align-items: center;
justify-content: center;
border-radius: 4px;
}
.metric-icon {
font-size: 2rem;
margin-bottom: 10px;
display: inline-block;
width: 50px;
height: 50px;
line-height: 50px;
text-align: center;
border-radius: 50%;
}
.metric-value {
font-size: 2rem;
font-weight: bold;
}
{{end}}
{{define "content"}}
<div class="container min-vh-100 d-flex align-items-center justify-content-center py-5">
<div class="connect-container">
<!-- Logo Area -->
<div class="logo-area">
<div class="logo-placeholder">
<span class="text-muted">Your Logo</span>
</div>
</div>
<div class="connect-box">
<div class="connect-header">
<h1>Connect Your ArcGIS Account</h1>
<p class="text-muted">Link your data to get started</p>
</div>
<div class="connect-content">
<p>To provide you with the best experience, we need to connect to your ArcGIS account. This allows us to securely access and visualize your spatial data within our platform.</p>
<div class="steps-container">
<h4>What to expect:</h4>
<div class="step">
<h5>1. Secure Authentication</h5>
<p>When you click the "Connect to ArcGIS" button below, you'll be redirected to the official ArcGIS login page. This connection is secure and uses OAuth 2.0 protocol.</p>
</div>
<div class="step">
<h5>2. Grant Permissions</h5>
<p>After logging in with your ArcGIS credentials, you'll be asked to approve permissions for our application to access your data. We only request access to what's needed for the platform to function.</p>
</div>
<div class="step">
<h5>3. Return to Platform</h5>
<p>Once authentication is complete, you'll be automatically redirected back to our platform where your data will be available to work with.</p>
</div>
</div>
<div class="alert alert-info">
<strong>Note:</strong> You'll need an active ArcGIS Online account or ArcGIS Enterprise account to proceed. If you don't have one, you can <a href="https://www.arcgis.com/home/signin.html" target="_blank">create an ArcGIS account here</a>.
</div>
<p>By connecting your ArcGIS account, you'll be able to:</p>
<ul>
<li>Access and visualize your spatial data</li>
<li>Perform advanced analysis using our integrated tools</li>
<li>Share results with team members securely</li>
<li>Keep your data synchronized across platforms</li>
</ul>
<div class="text-center connect-btn">
<a href="/arcgis/oauth/begin" class="btn btn-primary btn-lg">
Connect to ArcGIS
</a>
<p class="mt-2 text-muted"><small>You can disconnect your account at any time in settings</small></p>
</div>
</div>
</div>
</div>
</div>
<div class="container dashboard-container">
<!-- Dashboard Header -->
<div class="row mb-4">
<div class="col-md-6">
<h1>Mosquito District 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">
<p class="last-refreshed mb-0">
<i class="fas fa-sync-alt me-2"></i>Last updated: <span id="last-refreshed-time">3 hours ago</span>
<button class="btn btn-sm btn-outline-primary ms-3">Refresh Data</button>
</p>
</div>
</div>
<!-- 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">
<div class="metric-icon bg-info bg-opacity-10 text-info">
<i class="fas fa-clock"></i>
</div>
<h5 class="card-title">Last Data Refresh</h5>
<p class="metric-value">3h</p>
<p class="card-text text-muted">Last sync: 12:45 PM</p>
</div>
</div>
</div>
<!-- Service Requests -->
<div class="col-md-3">
<div class="card stats-card h-100">
<div class="card-body text-center">
<div class="metric-icon bg-warning bg-opacity-10 text-warning">
<i class="fas fa-ticket-alt"></i>
</div>
<h5 class="card-title">Service Requests</h5>
<p class="metric-value">48</p>
<p class="card-text text-muted">
<span class="text-success">
<i class="fas fa-arrow-up"></i> 12%
</span> since last week
</p>
</div>
</div>
</div>
<!-- Mosquito Sources -->
<div class="col-md-3">
<div class="card stats-card h-100">
<div class="card-body text-center">
<div class="metric-icon bg-danger bg-opacity-10 text-danger">
<i class="fas fa-bug"></i>
</div>
<h5 class="card-title">Mosquito Sources</h5>
<p class="metric-value">124</p>
<p class="card-text text-muted">
<span class="text-danger">
<i class="fas fa-arrow-up"></i> 8%
</span> since last month
</p>
</div>
</div>
</div>
<!-- Inspections -->
<div class="col-md-3">
<div class="card stats-card h-100">
<div class="card-body text-center">
<div class="metric-icon bg-success bg-opacity-10 text-success">
<i class="fas fa-clipboard-check"></i>
</div>
<h5 class="card-title">Inspections</h5>
<p class="metric-value">76</p>
<p class="card-text text-muted">
<span class="text-success">
<i class="fas fa-arrow-up"></i> 15%
</span> since last week
</p>
</div>
</div>
</div>
</div>
<!-- Map Section -->
<h3 class="section-title">Mosquito Activity Heatmap</h3>
<div class="row">
<div class="col-12">
<div class="map-container" id="mosquito-heatmap">
<div class="text-center">
<i class="fas fa-map-marked-alt fa-4x text-muted mb-3"></i>
<h4>Mosquito Activity Heatmap</h4>
<p class="text-muted">Map visualization will be displayed here</p>
<small>Showing activity data for the Central District area</small>
</div>
</div>
</div>
</div>
<!-- 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>
<tr>
<td>Aug 24, 2023</td>
<td>Inspection</td>
<td>River Park Area</td>
<td><span class="badge bg-success">Completed</span></td>
<td><a href="#" class="btn btn-sm btn-outline-primary">View</a></td>
</tr>
<tr>
<td>Aug 23, 2023</td>
<td>Service Request</td>
<td>Westside Community</td>
<td><span class="badge bg-warning">Pending</span></td>
<td><a href="#" class="btn btn-sm btn-outline-primary">View</a></td>
</tr>
<tr>
<td>Aug 22, 2023</td>
<td>Source Treatment</td>
<td>Lakeside Avenue</td>
<td><span class="badge bg-info">In Progress</span></td>
<td><a href="#" class="btn btn-sm btn-outline-primary">View</a></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
{{end}}