diff --git a/core/frontend/bun.lockb b/core/frontend/bun.lockb index b74d69f312..4aabf49f45 100755 Binary files a/core/frontend/bun.lockb and b/core/frontend/bun.lockb differ diff --git a/core/frontend/package.json b/core/frontend/package.json index 00b12e0440..ede7660ef0 100644 --- a/core/frontend/package.json +++ b/core/frontend/package.json @@ -12,6 +12,7 @@ "build": "NODE_ENV=production vite build", "serve": "echo 'This is a preview server for testing the built website. Please use `dev` command over `serve`.\nStarting preview server in 5 seconds..\n';sleep 5; vite preview", "lint": "eslint --max-warnings=0 --ext .js,.vue --ignore-path .gitignore --ignore-pattern src/components/vue-tour src && stylelint 'src/**/*.{vue,css,scss}'", + "type-check": "vue-tsc --noEmit", "lint:css": "stylelint 'src/**/*.{vue,css,scss}'", "lint:css:fix": "stylelint 'src/**/*.{vue,css,scss}' --fix" }, @@ -77,6 +78,7 @@ "wifi-qr-code-generator": "^1.1.1" }, "devDependencies": { + "@types/three": "0.156.0", "@typescript-eslint/eslint-plugin": "^5.51.0", "@typescript-eslint/parser": "^5.51.0", "@vitejs/plugin-vue": "^1.6.1", @@ -96,7 +98,7 @@ "stylelint-config-recommended-vue": "^1.6.1", "stylelint-config-standard": "^40.0.0", "stylelint-config-standard-scss": "^17.0.0", - "typescript": "~4.9.5", + "typescript": "5.4.5", "unplugin-vue-components": "^0.25.2", "vite": "3", "vite-plugin-compression": "^0.5.1", @@ -104,6 +106,7 @@ "vite-plugin-wasm": "^3.4.1", "vue-cli-plugin-vuetify": "~2.4.1", "vue-template-babel-compiler": "^2.0.0", + "vue-tsc": "2.0.29", "vuetify-loader": "^1.7.0", "workbox-build": "7.0.0" } diff --git a/core/frontend/src/App.vue b/core/frontend/src/App.vue index 8a1ff20a5a..1054ed8d54 100644 --- a/core/frontend/src/App.vue +++ b/core/frontend/src/App.vue @@ -13,11 +13,11 @@ diff --git a/core/frontend/src/components/app/VehicleBanner.vue b/core/frontend/src/components/app/VehicleBanner.vue index 5ba42f9a01..f19e11e308 100755 --- a/core/frontend/src/components/app/VehicleBanner.vue +++ b/core/frontend/src/components/app/VehicleBanner.vue @@ -131,7 +131,7 @@ export default Vue.extend({ } }, async load_company_logo() { - this.logo_image = (await bag.getData('vehicle.logo_image_path'))?.url as (string | undefined) + this.logo_image = (await bag.getData('vehicle.logo_image_path'))?.url as string | undefined ?? null if (this.logo_image && !this.logo_image.startsWith('/')) { this.logo_image = `/${this.vehicle_image}` } diff --git a/core/frontend/src/components/autopilot/AutopilotSerialConfiguration.vue b/core/frontend/src/components/autopilot/AutopilotSerialConfiguration.vue index 4b4aef16b3..f3797acce7 100644 --- a/core/frontend/src/components/autopilot/AutopilotSerialConfiguration.vue +++ b/core/frontend/src/components/autopilot/AutopilotSerialConfiguration.vue @@ -94,7 +94,8 @@ import { OneMoreTime } from '@/one-more-time' import autopilot from '@/store/autopilot_manager' import system_information from '@/store/system-information' import { SerialEndpoint } from '@/types/autopilot' -import { Dictionary, JSONValue } from '@/types/common' +import { Dictionary } from '@/types/common' +import { UdevProperties } from '@/types/system-information/serial' import back_axios from '@/utils/api' import { isIpAddress } from '@/utils/pattern_validators' @@ -119,7 +120,7 @@ export default Vue.extend({ G: 'Serial 6', H: 'Serial 7', I: 'Serial 8', - }, + } as Record, ports: {} as Dictionary, fetch_autopilot_serial_config_task: new OneMoreTime({ delay: 10000, disposeWith: this }), fetch_serial_task: new OneMoreTime({ delay: 10000, disposeWith: this }), @@ -166,7 +167,7 @@ export default Vue.extend({ const names = [device, driver, serial].filter((name) => name !== undefined) return names.join(' - ') }, - deviceInfo(path: string): JSONValue { + deviceInfo(path: string): UdevProperties { return system_information.serial?.ports?.find((port) => port.by_path === path)?.udev_properties ?? {} }, update_ports(new_ports: SerialEndpoint[]) { diff --git a/core/frontend/src/components/bridges/BridgeCard.vue b/core/frontend/src/components/bridges/BridgeCard.vue index 80034d2fb0..86e79e3813 100644 --- a/core/frontend/src/components/bridges/BridgeCard.vue +++ b/core/frontend/src/components/bridges/BridgeCard.vue @@ -43,9 +43,9 @@

Info: - {{ bridgeSerialInfo.serial_info.udev_properties["ID_VENDOR"] }} + {{ bridgeSerialInfo.serial_info.udev_properties?.["ID_VENDOR"] }} / - {{ bridgeSerialInfo.serial_info.udev_properties["ID_MODEL"] }} + {{ bridgeSerialInfo.serial_info.udev_properties?.["ID_MODEL"] }}

diff --git a/core/frontend/src/components/bridges/BridgeCreationDialog.vue b/core/frontend/src/components/bridges/BridgeCreationDialog.vue index b9394c717a..cebf33f0e9 100644 --- a/core/frontend/src/components/bridges/BridgeCreationDialog.vue +++ b/core/frontend/src/components/bridges/BridgeCreationDialog.vue @@ -22,8 +22,8 @@ no-data-text="No serial ports available" :loading="updating_serial_ports" item-text="name" - :item-value="(item) => item.by_path ? item.by_path : item.name" - :item-disabled="(item) => item.current_user !== null" + :item-value="serial_port_value" + :item-disabled="is_serial_port_in_use" dense > diff --git a/core/frontend/src/components/parameter-editor/ParameterEditor.vue b/core/frontend/src/components/parameter-editor/ParameterEditor.vue index b6b5d2649c..3cc3c79fc5 100644 --- a/core/frontend/src/components/parameter-editor/ParameterEditor.vue +++ b/core/frontend/src/components/parameter-editor/ParameterEditor.vue @@ -17,8 +17,8 @@ :sort-by="'name'" disable-sort :custom-filter="() => true" - :item-class="(value) => value.item?.readonly ? undefined : 'hand-cursor'" - @click:row="(value) => editParam(value.item)" + :item-class="rowClass" + @click:row="onRowClick" > >, key: string): string { const name = item.item[key] const indices_array = item?.matches?.find((i: Fuse.FuseResultMatch) => i.key === key)?.indices ?? [] diff --git a/core/frontend/src/components/parameter-editor/ParameterLoader.vue b/core/frontend/src/components/parameter-editor/ParameterLoader.vue index b62cba6d2a..f2c2bc0e1c 100755 --- a/core/frontend/src/components/parameter-editor/ParameterLoader.vue +++ b/core/frontend/src/components/parameter-editor/ParameterLoader.vue @@ -159,12 +159,12 @@