From 306677e56fef17c21f2cf0415fcd963f3159a877 Mon Sep 17 00:00:00 2001 From: Matt Date: Fri, 1 Sep 2023 12:58:35 -0700 Subject: [PATCH] Advanced networking settings (#899) Exposes NetworkManager interface name and more robustly handles device/interface names internally. --------- Co-authored-by: Sriman Achanta <68172138+srimanachanta@users.noreply.github.com> --- .../src/components/app/photon-sidebar.vue | 2 +- .../src/components/common/cv-select.vue | 5 + .../components/settings/NetworkingCard.vue | 54 ++++++-- .../stores/settings/GeneralSettingsStore.ts | 23 ++- photon-client/src/types/SettingTypes.ts | 10 +- photon-core/build.gradle | 3 + .../common/configuration/ConfigManager.java | 8 +- .../common/configuration/ConfigProvider.java | 6 +- .../common/configuration/NetworkConfig.java | 51 ++++--- .../configuration/PhotonConfiguration.java | 25 ++-- .../configuration/SqlConfigProvider.java | 1 - .../common/networking/NetworkManager.java | 17 +-- .../common/networking/NetworkUtils.java | 131 ++++++++++++++++++ .../src/main/java/org/photonvision/Main.java | 71 +++++----- 14 files changed, 315 insertions(+), 92 deletions(-) create mode 100644 photon-core/src/main/java/org/photonvision/common/networking/NetworkUtils.java diff --git a/photon-client/src/components/app/photon-sidebar.vue b/photon-client/src/components/app/photon-sidebar.vue index 938eb14b96..ac8636d521 100644 --- a/photon-client/src/components/app/photon-sidebar.vue +++ b/photon-client/src/components/app/photon-sidebar.vue @@ -104,7 +104,7 @@ const mdAndUp = computed(() => getCurrentInstance()?.proxy.$vuetify.bre - {{ useStateStore().backendConnected ? "Backend Connected" : "Trying to connect to Backend" }} + {{ useStateStore().backendConnected ? "Backend connected" : "Trying to connect to backend" }} diff --git a/photon-client/src/components/common/cv-select.vue b/photon-client/src/components/common/cv-select.vue index bf9e35aa20..cc5ee815e3 100644 --- a/photon-client/src/components/common/cv-select.vue +++ b/photon-client/src/components/common/cv-select.vue @@ -35,6 +35,11 @@ const localValue = computed({ // Computed in case items changes const items = computed(() => { + // Trivial case for empty list; we have no data + if (!props.items.length) { + return []; + } + // Check if the prop exists on the object to infer object type if ((props.items[0] as SelectItem).name) { return props.items as SelectItem[]; diff --git a/photon-client/src/components/settings/NetworkingCard.vue b/photon-client/src/components/settings/NetworkingCard.vue index 3e7070cf60..93bb330165 100644 --- a/photon-client/src/components/settings/NetworkingCard.vue +++ b/photon-client/src/components/settings/NetworkingCard.vue @@ -1,9 +1,10 @@