Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Williangalvani committed Sep 24, 2024
1 parent ce5dbcc commit 6abff5a
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 21 deletions.
1 change: 0 additions & 1 deletion core/frontend/src/store/wifi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { sorted_networks } from '@/utils/wifi'
store,
name: 'wifi',
})

class WifiStore extends VuexModule {
API_URL = '/wifi-manager/v1.0'

Expand Down
2 changes: 0 additions & 2 deletions core/frontend/src/types/shims-general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@ declare module '*.jpg' {
declare module '*.png' {
const value: string
}

declare module 'vue-tooltip-directive'
5 changes: 0 additions & 5 deletions core/frontend/src/types/shims-vue.d.ts

This file was deleted.

14 changes: 9 additions & 5 deletions core/frontend/src/views/Autopilot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<v-btn
v-if="settings.is_pirate_mode"
color="secondary"
:block="$vuetify.breakpoint.xs"
:block="vuetify.breakpoint.xs"
class="ma-1"
:disabled="restarting"
@click="openBoardChangeDialog"
Expand All @@ -65,7 +65,7 @@
<v-btn
v-if="settings.is_pirate_mode"
class="ma-1"
:block="$vuetify.breakpoint.xs"
:block="vuetify.breakpoint.xs"
color="secondary"
:disabled="restarting"
@click="start_autopilot"
Expand All @@ -75,7 +75,7 @@
<v-btn
v-if="settings.is_pirate_mode"
class="ma-1"
:block="$vuetify.breakpoint.xs"
:block="vuetify.breakpoint.xs"
color="secondary"
:disabled="restarting"
@click="stop_autopilot"
Expand All @@ -85,7 +85,7 @@
<v-btn
color="primary"
class="ma-1"
:block="$vuetify.breakpoint.xs"
:block="vuetify.breakpoint.xs"
:disabled="restarting"
@click="restart_autopilot"
>
Expand Down Expand Up @@ -122,6 +122,7 @@ import autopilot from '@/store/autopilot_manager'
import { FirmwareInfo, FlightController } from '@/types/autopilot'
import { autopilot_service } from '@/types/frontend_services'
import back_axios from '@/utils/api'
import Vuetify from 'vuetify/lib'
const notifier = new Notifier(autopilot_service)
Expand All @@ -144,6 +145,9 @@ export default Vue.extend({
}
},
computed: {
vuetify(): any {
return (this as any).$route as any
},
autopilot_info(): Record<string, string> {
let version = 'Unknown'
if (this.firmware_info) {
Expand All @@ -164,7 +168,7 @@ export default Vue.extend({
return record
},
banner(): string {
banner(): string | undefined {
switch (autopilot_data.autopilot_type) {
case MavAutopilot.MAV_AUTOPILOT_ARDUPILOTMEGA:
return ArduPilotBanner
Expand Down
12 changes: 8 additions & 4 deletions core/frontend/src/views/ExtensionView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import helper from '@/store/helper'
import { Service } from '@/types/helper'
import PageNotFound from './PageNotFound.vue'
import { Route } from 'vue-router'
export default Vue.extend({
name: 'ExtensionView',
Expand All @@ -33,20 +34,23 @@ export default Vue.extend({
}
},
computed: {
route(): Route {
return (this as any).$route as Route
},
fullpage(): boolean {
return this.$route.query.full_page === 'true'
return this.route.query.full_page === 'true'
},
service(): Service | undefined {
return helper.services.filter(
(service) => service?.metadata?.sanitized_name === this.$route.params.name,
(service) => service?.metadata?.sanitized_name === this.route.params.name,
)[0] ?? undefined
},
port(): number | undefined | null {
if (helper.services.length === 0) {
return undefined
}
return helper.services.filter(
(service) => service?.metadata?.sanitized_name === this.$route.params.name,
(service) => service?.metadata?.sanitized_name === this.route.params.name,
)[0]?.port ?? null
},
service_path(): string {
Expand All @@ -73,7 +77,7 @@ export default Vue.extend({
this.detected_port = this.port
}
// eslint-disable-next-line
this.remaining_path = this.$route.params.pathMatch
this.remaining_path = this.route.params.pathMatch
},
})
</script>
Expand Down
8 changes: 6 additions & 2 deletions core/frontend/src/views/FileBrowserView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import Vue from 'vue'
import BrIframe from '@/components/utils/BrIframe.vue'
import { Route } from 'vue-router';
export default Vue.extend({
name: 'FileBrowserView',
Expand All @@ -20,8 +21,11 @@ export default Vue.extend({
}
},
computed: {
full_path() {
return `${this.service_path}${this.$route.params.path ?? ''}`
route(): Route {
return (this as any).$route as Route
},
full_path() : string {
return `${this.service_path}${this.route.params.path ?? ''}`
},
},
})
Expand Down
9 changes: 7 additions & 2 deletions core/frontend/src/views/VehicleSetupView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
:value="page.value"
>
<parameter-loading-spinner>
<component :is="page.component" :subtab="$route.params.subtab" />
<component :is="page.component" :subtab="route.params.subtab" />
</parameter-loading-spinner>
</v-tab-item>
</v-tabs-items>
Expand All @@ -39,6 +39,8 @@ import Configure from '@/components/vehiclesetup/Configure.vue'
import PwmSetup from '@/components/vehiclesetup/PwmSetup.vue'
import setupOverview from '@/components/vehiclesetup/SetupOverview.vue'
import { OneMoreTime } from '@/one-more-time'
import router from '@/router'
import VueRouter, { Route } from 'vue-router'
export interface Item {
title: string,
Expand Down Expand Up @@ -73,8 +75,11 @@ export default Vue.extend({
}
},
computed: {
route(): Route {
return (this as any).$route as Route
},
currentTab(): string {
return this.$route.params.tab || 'overview'
return this.route.params.tab || 'overview'
},
},
mounted() {
Expand Down
1 change: 1 addition & 0 deletions core/frontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"sourceMap": true,
"baseUrl": ".",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"types": [
"vite/client"
],
Expand Down

0 comments on commit 6abff5a

Please sign in to comment.