database separate file
This commit is contained in:
@@ -149,6 +149,28 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h3>MIR Mission Status</h3>
|
||||
<div class="card mb-4">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Mission Execution Steps</h5>
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
Step 1: Receiving start trigger from the board input
|
||||
<span id="step-1-status" class="badge badge-secondary">Pending</span>
|
||||
</li>
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
Step 2: Posting mission to MIR server
|
||||
<span id="step-2-status" class="badge badge-secondary">Pending</span>
|
||||
</li>
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
Step 3: Mission execution status
|
||||
<span id="mission-status" class="badge badge-secondary">Pending</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
@@ -182,6 +204,20 @@
|
||||
.catch(error => console.error('Error fetching input status:', error));
|
||||
}
|
||||
|
||||
function fetchMissionStatus() {
|
||||
fetch(`/board/{{ hostname }}/mission_status`)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
document.getElementById('step-1-status').className = `badge badge-${data.step1}`;
|
||||
document.getElementById('step-1-status').innerText = data.step1;
|
||||
document.getElementById('step-2-status').className = `badge badge-${data.step2}`;
|
||||
document.getElementById('step-2-status').innerText = data.step2;
|
||||
document.getElementById('mission-status').className = `badge badge-${data.mission}`;
|
||||
document.getElementById('mission-status').innerText = data.mission;
|
||||
})
|
||||
.catch(error => console.error('Error fetching mission status:', error));
|
||||
}
|
||||
|
||||
function startTimer() {
|
||||
let timer = 5;
|
||||
const timerElement = document.getElementById('timer');
|
||||
@@ -199,6 +235,7 @@
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
startTimer();
|
||||
setInterval(fetchMissionStatus, 30000); // Fetch mission status every 30 seconds
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user