Skip to content

Commit bc9021c

Browse files
committed
frontend: autopilot: disable mavlink endpoint creation if autopilot is not running
1 parent 237d824 commit bc9021c

1 file changed

Lines changed: 31 additions & 5 deletions

File tree

core/frontend/src/components/autopilot/EndpointManager.vue

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,36 @@
6565
subtitle="Fetching available endpoints..."
6666
/>
6767
</v-container>
68-
<v-card
68+
<v-container
6969
v-else
7070
class="d-flex align-center justify-center pa-6"
7171
>
72-
<p class="text-h6">
73-
No endpoints available.
74-
</p>
75-
</v-card>
72+
<v-card
73+
v-if="!autopilot_board_is_running"
74+
class="d-flex align-center justify-center pa-6"
75+
>
76+
<div class="d-flex flex-column align-center justify-center">
77+
<p class="mb-2">
78+
Autopilot must be running to create endpoints.
79+
</p>
80+
<p class="mb-0">
81+
You can start it in the
82+
<router-link to="autopilot">
83+
Autopilot Firmware
84+
</router-link>
85+
tab.
86+
</p>
87+
</div>
88+
</v-card>
89+
<v-card
90+
v-else
91+
class="d-flex align-center justify-center pa-6"
92+
>
93+
<p class="text-h6">
94+
No endpoints available.
95+
</p>
96+
</v-card>
97+
</v-container>
7698

7799
<v-fab-transition>
78100
<v-btn
@@ -85,6 +107,7 @@
85107
bottom
86108
right
87109
class="v-btn--example"
110+
:disabled="!autopilot_board_is_running"
88111
@click="openCreationDialog"
89112
>
90113
<v-icon>mdi-plus</v-icon>
@@ -141,6 +164,9 @@ export default Vue.extend({
141164
are_endpoints_available(): boolean {
142165
return !this.available_endpoints.isEmpty()
143166
},
167+
autopilot_board_is_running(): boolean {
168+
return autopilot.current_board !== null && this.heartbeat_age() < 3000
169+
},
144170
},
145171
mounted() {
146172
this.fetch_available_endpoints_task.setAction(fetchAvailableEndpoints)

0 commit comments

Comments
 (0)