2023-08-21 01:51:35 -04:00
< script setup lang = "ts" >
import { useSettingsStore } from "@/stores/settings/GeneralSettingsStore" ;
2024-01-06 09:43:29 -05:00
import { computed , ref , watchEffect } from "vue" ;
2023-10-17 16:32:59 -04:00
import PvInput from "@/components/common/pv-input.vue" ;
import PvRadio from "@/components/common/pv-radio.vue" ;
import PvSwitch from "@/components/common/pv-switch.vue" ;
import PvSelect from "@/components/common/pv-select.vue" ;
2024-01-20 18:46:47 -06:00
import { type ConfigurableNetworkSettings , NetworkConnectionType } from "@/types/SettingTypes" ;
2023-08-21 01:51:35 -04:00
import { useStateStore } from "@/stores/StateStore" ;
2025-08-04 01:15:33 -04:00
import { useTheme } from "vuetify" ;
2025-09-07 00:33:37 -04:00
import { getThemeColor , setThemeColor , resetTheme } from "@/lib/ThemeManager" ;
Force reload after restart and switch URL after IP change (#2278)
## Description
Forces a reload after restarting PhotonVision, restarting the
coprocessor, performing an offline update, or nuking the install. We
wait until we are reconnected to the coprocessor to reload, this is
accomplished by the addition of a status API endpoint.
This is being implemented due to issues experienced when the webpage is
not updated (particularly during offline updates).
---
Using the same statusCheck, we also wait until a new IP is available,
then change to it, after changing our static IP.
---
closes #2169
closes #903
## Meta
Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] If this PR changes behavior or adds a feature, user documentation
is updated
- [ ] If this PR touches photon-serde, all messages have been
regenerated and hashes have not changed unexpectedly
- [ ] If this PR touches configuration, this is backwards compatible
with settings back to v2025.3.2
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2026-01-07 01:53:05 -06:00
import { statusCheck } from "@/lib/PhotonUtils" ;
2025-08-04 01:15:33 -04:00
const theme = useTheme ( ) ;
2023-08-21 01:51:35 -04:00
2023-12-31 00:14:21 -05:00
// Copy object to remove reference to store
2024-01-20 18:46:47 -06:00
const tempSettingsStruct = ref < ConfigurableNetworkSettings > ( Object . assign ( { } , useSettingsStore ( ) . network ) ) ;
2024-01-06 09:43:29 -05:00
const resetTempSettingsStruct = ( ) => {
tempSettingsStruct . value = Object . assign ( { } , useSettingsStore ( ) . network ) ;
} ;
const settingsValid = ref ( true ) ;
2025-09-07 00:33:37 -04:00
const showThemeConfig = ref ( false ) ;
const backgroundColor = ref ( "" ) ;
const primaryColor = ref ( "" ) ;
const secondaryColor = ref ( "" ) ;
const surfaceColor = ref ( "" ) ;
const loadCurrentColors = ( ) => {
backgroundColor . value = getThemeColor ( theme , "background" ) ;
primaryColor . value = getThemeColor ( theme , "primary" ) ;
secondaryColor . value = getThemeColor ( theme , "secondary" ) ;
surfaceColor . value = getThemeColor ( theme , "surface" ) ;
} ;
2023-08-21 01:51:35 -04:00
const isValidNetworkTablesIP = ( v : string | undefined ) : boolean => {
2024-10-31 02:59:39 -04:00
// Check if it is a valid team number between 1-99999 (5 digits)
const teamNumberRegex = /^[1-9][0-9]{0,4}$/ ;
2023-08-21 01:51:35 -04:00
// Check if it is a team number longer than 5 digits
2024-10-31 02:59:39 -04:00
const badTeamNumberRegex = /^[0-9]{6,}$/ ;
2023-08-21 01:51:35 -04:00
2023-08-31 16:56:58 -04:00
if ( v === undefined ) return false ;
2023-08-21 01:51:35 -04:00
if ( teamNumberRegex . test ( v ) ) return true ;
if ( isValidIPv4 ( v ) ) return true ;
// need to check these before the hostname. "0" and "99999" are valid hostnames, but we don't want to allow then
if ( v === "0" ) return false ;
if ( badTeamNumberRegex . test ( v ) ) return false ;
return isValidHostname ( v ) ;
} ;
const isValidIPv4 = ( v : string | undefined ) => {
// https://stackoverflow.com/a/17871737
const ipv4Regex = /^((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])$/ ;
2023-08-31 16:56:58 -04:00
if ( v === undefined ) return false ;
2023-08-21 01:51:35 -04:00
return ipv4Regex . test ( v ) ;
} ;
const isValidHostname = ( v : string | undefined ) => {
// https://stackoverflow.com/a/18494710
const hostnameRegex = /^([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)+(\.([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*))*$/ ;
2023-08-31 16:56:58 -04:00
if ( v === undefined ) return false ;
2023-08-21 01:51:35 -04:00
return hostnameRegex . test ( v ) ;
} ;
2023-12-31 00:14:21 -05:00
const settingsHaveChanged = ( ) : boolean => {
const a = useSettingsStore ( ) . network ;
const b = tempSettingsStruct . value ;
return (
a . ntServerAddress !== b . ntServerAddress ||
a . connectionType !== b . connectionType ||
a . staticIp !== b . staticIp ||
a . hostname !== b . hostname ||
a . runNTServer !== b . runNTServer ||
a . shouldManage !== b . shouldManage ||
a . shouldPublishProto !== b . shouldPublishProto ||
a . networkManagerIface !== b . networkManagerIface ||
a . setStaticCommand !== b . setStaticCommand ||
2025-01-07 08:45:39 -05:00
a . setDHCPcommand !== b . setDHCPcommand
2023-12-31 00:14:21 -05:00
) ;
} ;
Force reload after restart and switch URL after IP change (#2278)
## Description
Forces a reload after restarting PhotonVision, restarting the
coprocessor, performing an offline update, or nuking the install. We
wait until we are reconnected to the coprocessor to reload, this is
accomplished by the addition of a status API endpoint.
This is being implemented due to issues experienced when the webpage is
not updated (particularly during offline updates).
---
Using the same statusCheck, we also wait until a new IP is available,
then change to it, after changing our static IP.
---
closes #2169
closes #903
## Meta
Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] If this PR changes behavior or adds a feature, user documentation
is updated
- [ ] If this PR touches photon-serde, all messages have been
regenerated and hashes have not changed unexpectedly
- [ ] If this PR touches configuration, this is backwards compatible
with settings back to v2025.3.2
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2026-01-07 01:53:05 -06:00
const saveGeneralSettings = async ( ) => {
2024-01-08 08:32:56 -05:00
// replace undefined members with empty strings for backend
const payload = {
connectionType : tempSettingsStruct . value . connectionType ,
hostname : tempSettingsStruct . value . hostname ,
networkManagerIface : tempSettingsStruct . value . networkManagerIface || "" ,
ntServerAddress : tempSettingsStruct . value . ntServerAddress ,
runNTServer : tempSettingsStruct . value . runNTServer ,
setDHCPcommand : tempSettingsStruct . value . setDHCPcommand || "" ,
setStaticCommand : tempSettingsStruct . value . setStaticCommand || "" ,
shouldManage : tempSettingsStruct . value . shouldManage ,
shouldPublishProto : tempSettingsStruct . value . shouldPublishProto ,
staticIp : tempSettingsStruct . value . staticIp
} ;
Force reload after restart and switch URL after IP change (#2278)
## Description
Forces a reload after restarting PhotonVision, restarting the
coprocessor, performing an offline update, or nuking the install. We
wait until we are reconnected to the coprocessor to reload, this is
accomplished by the addition of a status API endpoint.
This is being implemented due to issues experienced when the webpage is
not updated (particularly during offline updates).
---
Using the same statusCheck, we also wait until a new IP is available,
then change to it, after changing our static IP.
---
closes #2169
closes #903
## Meta
Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] If this PR changes behavior or adds a feature, user documentation
is updated
- [ ] If this PR touches photon-serde, all messages have been
regenerated and hashes have not changed unexpectedly
- [ ] If this PR touches configuration, this is backwards compatible
with settings back to v2025.3.2
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2026-01-07 01:53:05 -06:00
const changingStaticIP =
useSettingsStore ( ) . network . connectionType === NetworkConnectionType . Static &&
tempSettingsStruct . value . staticIp !== useSettingsStore ( ) . network . staticIp ;
try {
const response = await useSettingsStore ( ) . updateGeneralSettings ( payload ) ;
useStateStore ( ) . showSnackbarMessage ( { message : response . data . text || response . data , color : "success" } ) ;
// Update the local settings cause the backend checked their validity. Assign is to deref value
useSettingsStore ( ) . network = { ... useSettingsStore ( ) . network , ... Object . assign ( { } , tempSettingsStruct . value ) } ;
} catch ( error : any ) {
resetTempSettingsStruct ( ) ;
if ( error . response ) {
useStateStore ( ) . showSnackbarMessage ( {
color : "error" ,
message : error . response . data . text || error . response . data
} ) ;
} else if ( error . request ) {
useStateStore ( ) . showSnackbarMessage ( {
color : "error" ,
message : "Error while trying to process the request! The backend didn't respond."
} ) ;
} else {
useStateStore ( ) . showSnackbarMessage ( {
color : "error" ,
message : "An error occurred while trying to process the request."
} ) ;
}
return ;
}
if ( changingStaticIP ) {
const status = await statusCheck ( 5000 , tempSettingsStruct . value . staticIp ) ;
if ( ! status ) {
useStateStore ( ) . showSnackbarMessage ( {
message :
"Warning: Unable to verify new static IP address! You may need to manually navigate to the new address: http://" +
tempSettingsStruct . value . staticIp +
":5800" ,
color : "warning"
} ) ;
return ;
}
// Keep current hash route (e.g., #/settings)
const hash = window . location . hash || "" ;
const url = ` http:// ${ tempSettingsStruct . value . staticIp } :5800/ ${ hash } ` ;
setTimeout ( ( ) => {
window . location . href = url ;
} , 1000 ) ;
}
2023-08-21 01:51:35 -04:00
} ;
2023-09-01 12:58:35 -07:00
2025-05-06 18:21:41 -04:00
const currentNetworkInterfaceIndex = computed < number | undefined > ( {
get : ( ) => {
const index = useSettingsStore ( ) . networkInterfaceNames . indexOf (
useSettingsStore ( ) . network . networkManagerIface || ""
) ;
return index === - 1 ? undefined : index ;
} ,
set : ( v ) => v && ( tempSettingsStruct . value . networkManagerIface = useSettingsStore ( ) . networkInterfaceNames [ v ] )
2023-09-01 12:58:35 -07:00
} ) ;
2024-01-06 09:43:29 -05:00
watchEffect ( ( ) => {
// Reset temp settings on remote network settings change
resetTempSettingsStruct ( ) ;
} ) ;
2023-08-21 01:51:35 -04:00
< / script >
< template >
2025-08-04 01:15:33 -04:00
< v-card class = "mb-3 rounded-12" color = "surface" >
2025-09-07 00:33:37 -04:00
< v-card-title style = "display: flex; justify-content: space-between" >
< span > Global Settings < / span >
< v-btn
variant = "text"
@ click = "
( ) => {
loadCurrentColors ( ) ;
showThemeConfig = true ;
}
"
>
< v-icon size = "x-large" > mdi - palette - outline < / v-icon >
Theme
< / v-btn >
< / v-card-title >
Clean up spacing and other things in various parts of the UI (#1972)
## Description
After the Vue 3 upgrade, the spacing for various UI elements was left
inconsistent in many places. Dialogs were hit especially hard and had
some very inconsistent spacing. Additionally, the 24 pixels of padding
around all cards was noted as a waste of space and unnecessary, so it
has been shrunk down to 20 pixels to make the UI a tiny bit more compact
and to make it visually closer to some parts of the UI that have 16
pixels of padding (the camera views are the most notable example).
Padding between input elements has also been reduced to 20 pixels (this
required some hackery to get consistent sizes on input elements, since
switches and sliders have different heights.)
Some other minor UI tweaks were made, such as removing the divider
between dialog contents and dialog buttons because it visually looks
better, shrinking the banner padding so it doesn't displace as much
content, making the banner background one uniform color instead of a
highlight around the icon, fixing the targets tab so that the columns
stop shifting around when the values change, preserving newlines in the
log view, cleaning up the object detection UI, and making the import
dialogs have consistently inset input elements.
Old dashboard:

New dashboard:

Old Camera tab:

New Camera tab:

Old Calibration Info:

New Calibration Info:

Old Log Viewer:

New Log Viewer:

Old Pipeline Creation Dialog:

New Pipeline Creation Dialog:

Old Factory Reset:

New Factory Reset:

Old Pipeline Change:

New Pipeline Change:

Old Import Dialog:

New Import Dialog:

## Meta
Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] If this PR changes behavior or adds a feature, user documentation
is updated
- [ ] If this PR touches photon-serde, all messages have been
regenerated and hashes have not changed unexpectedly
- [ ] If this PR touches configuration, this is backwards compatible
with settings back to v2024.3.1
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-07-12 00:02:23 -04:00
< div class = "pa-5 pt-0" >
2025-09-07 00:33:37 -04:00
< v-card-title class = "pl-0 pt-0 pb-10px" > Networking < / v-card-title >
2026-03-23 18:41:11 -04:00
< v-form v-model = "settingsValid" >
2023-10-17 16:32:59 -04:00
< pv-input
2023-12-31 00:14:21 -05:00
v - model = "tempSettingsStruct.ntServerAddress"
2023-08-21 01:51:35 -04:00
label = "Team Number/NetworkTables Server Address"
tooltip = "Enter the Team Number or the IP address of the NetworkTables Server"
2023-09-01 12:58:35 -07:00
: label - cols = "4"
2023-12-31 00:14:21 -05:00
: disabled = "tempSettingsStruct.runNTServer"
2023-08-31 16:56:58 -04:00
: rules = " [
( v ) =>
isValidNetworkTablesIP ( v ) ||
'The NetworkTables Server Address must be a valid Team Number, IP address, or Hostname'
] "
2023-08-21 01:51:35 -04:00
/ >
2025-08-04 01:15:33 -04:00
< v-alert
2025-01-07 08:45:39 -05:00
v - if = "!isValidNetworkTablesIP(tempSettingsStruct.ntServerAddress) && !tempSettingsStruct.runNTServer"
2025-08-04 01:15:33 -04:00
class = "pt-3 pb-3"
color = "error"
density = "compact"
text = "The NetworkTables Server Address is not set or is invalid. NetworkTables is unable to connect."
2023-08-21 01:51:35 -04:00
icon = "mdi-alert-circle-outline"
2026-03-24 17:49:56 -05:00
: variant = "theme.global.current.value.dark ? 'tonal' : 'elevated'"
2025-08-04 01:15:33 -04:00
/ >
2023-10-17 16:32:59 -04:00
< pv-radio
2024-01-20 18:46:47 -06:00
v - show = "!useSettingsStore().network.networkingDisabled"
2023-12-31 00:14:21 -05:00
v - model = "tempSettingsStruct.connectionType"
2023-08-21 01:51:35 -04:00
label = "IP Assignment Mode"
tooltip = "DHCP will make the radio (router) automatically assign an IP address; this may result in an IP address that changes across reboots. Static IP assignment means that you pick the IP address and it won't change."
2023-09-01 12:58:35 -07:00
: input - cols = "12 - 4"
2023-08-31 16:56:58 -04:00
: list = "['DHCP', 'Static']"
2024-01-20 18:46:47 -06:00
: disabled = "
! tempSettingsStruct . shouldManage ||
! useSettingsStore ( ) . network . canManage ||
useSettingsStore ( ) . network . networkingDisabled
"
2023-08-21 01:51:35 -04:00
/ >
2023-10-17 16:32:59 -04:00
< pv-input
2024-01-20 18:46:47 -06:00
v - show = "!useSettingsStore().network.networkingDisabled"
2023-12-31 00:14:21 -05:00
v - if = "tempSettingsStruct.connectionType === NetworkConnectionType.Static"
v - model = "tempSettingsStruct.staticIp"
2023-09-01 12:58:35 -07:00
: input - cols = "12 - 4"
2023-08-21 01:51:35 -04:00
label = "Static IP"
2023-08-31 16:56:58 -04:00
: rules = "[(v) => isValidIPv4(v) || 'Invalid IPv4 address']"
2024-01-20 18:46:47 -06:00
: disabled = "
! tempSettingsStruct . shouldManage ||
! useSettingsStore ( ) . network . canManage ||
useSettingsStore ( ) . network . networkingDisabled
"
2023-08-21 01:51:35 -04:00
/ >
2023-10-17 16:32:59 -04:00
< pv-input
2024-01-20 18:46:47 -06:00
v - show = "!useSettingsStore().network.networkingDisabled"
2023-12-31 00:14:21 -05:00
v - model = "tempSettingsStruct.hostname"
2023-08-21 01:51:35 -04:00
label = "Hostname"
2023-09-01 12:58:35 -07:00
: input - cols = "12 - 4"
2023-08-31 16:56:58 -04:00
: rules = "[(v) => isValidHostname(v) || 'Invalid hostname']"
2024-01-20 18:46:47 -06:00
: disabled = "
! tempSettingsStruct . shouldManage ||
! useSettingsStore ( ) . network . canManage ||
useSettingsStore ( ) . network . networkingDisabled
"
2023-09-01 12:58:35 -07:00
/ >
Clean up spacing and other things in various parts of the UI (#1972)
## Description
After the Vue 3 upgrade, the spacing for various UI elements was left
inconsistent in many places. Dialogs were hit especially hard and had
some very inconsistent spacing. Additionally, the 24 pixels of padding
around all cards was noted as a waste of space and unnecessary, so it
has been shrunk down to 20 pixels to make the UI a tiny bit more compact
and to make it visually closer to some parts of the UI that have 16
pixels of padding (the camera views are the most notable example).
Padding between input elements has also been reduced to 20 pixels (this
required some hackery to get consistent sizes on input elements, since
switches and sliders have different heights.)
Some other minor UI tweaks were made, such as removing the divider
between dialog contents and dialog buttons because it visually looks
better, shrinking the banner padding so it doesn't displace as much
content, making the banner background one uniform color instead of a
highlight around the icon, fixing the targets tab so that the columns
stop shifting around when the values change, preserving newlines in the
log view, cleaning up the object detection UI, and making the import
dialogs have consistently inset input elements.
Old dashboard:

New dashboard:

Old Camera tab:

New Camera tab:

Old Calibration Info:

New Calibration Info:

Old Log Viewer:

New Log Viewer:

Old Pipeline Creation Dialog:

New Pipeline Creation Dialog:

Old Factory Reset:

New Factory Reset:

Old Pipeline Change:

New Pipeline Change:

Old Import Dialog:

New Import Dialog:

## Meta
Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] If this PR changes behavior or adds a feature, user documentation
is updated
- [ ] If this PR touches photon-serde, all messages have been
regenerated and hashes have not changed unexpectedly
- [ ] If this PR touches configuration, this is backwards compatible
with settings back to v2024.3.1
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-07-12 00:02:23 -04:00
< v-card-title class = "pl-0 pt-3 pb-10px" > Advanced Networking < / v-card-title >
2023-10-17 16:32:59 -04:00
< pv-switch
2024-01-20 18:46:47 -06:00
v - show = "!useSettingsStore().network.networkingDisabled"
2023-12-31 00:14:21 -05:00
v - model = "tempSettingsStruct.shouldManage"
2024-01-20 18:46:47 -06:00
: disabled = "!useSettingsStore().network.canManage || useSettingsStore().network.networkingDisabled"
2023-09-01 12:58:35 -07:00
label = "Manage Device Networking"
tooltip = "If enabled, Photon will manage device hostname and network settings."
: label - cols = "4"
/ >
2023-10-17 16:32:59 -04:00
< pv-select
2024-01-20 18:46:47 -06:00
v - show = "!useSettingsStore().network.networkingDisabled"
2023-09-01 12:58:35 -07:00
v - model = "currentNetworkInterfaceIndex"
label = "NetworkManager interface"
2024-01-20 18:46:47 -06:00
: disabled = "
! tempSettingsStruct . shouldManage ||
! useSettingsStore ( ) . network . canManage ||
useSettingsStore ( ) . network . networkingDisabled
"
2023-09-01 12:58:35 -07:00
: select - cols = "12 - 4"
tooltip = "Name of the interface PhotonVision should manage the IP address of"
: items = "useSettingsStore().networkInterfaceNames"
2023-08-21 01:51:35 -04:00
/ >
2025-08-04 01:15:33 -04:00
< v-alert
2025-01-07 08:45:39 -05:00
v - if = "
2023-09-01 12:58:35 -07:00
! useSettingsStore ( ) . networkInterfaceNames . length &&
2023-12-31 00:14:21 -05:00
tempSettingsStruct . shouldManage &&
2024-01-20 18:46:47 -06:00
useSettingsStore ( ) . network . canManage &&
! useSettingsStore ( ) . network . networkingDisabled
2023-09-01 12:58:35 -07:00
"
2025-08-04 01:15:33 -04:00
class = "pt-3 pb-3"
color = "error"
density = "compact"
text = "Cannot detect any wired connections! Send program logs to the developers for help."
icon = "mdi-alert-circle-outline"
2026-03-24 17:49:56 -05:00
: variant = "theme.global.current.value.dark ? 'tonal' : 'elevated'"
2025-08-04 01:15:33 -04:00
/ >
2023-10-17 16:32:59 -04:00
< pv-switch
2023-12-31 00:14:21 -05:00
v - model = "tempSettingsStruct.runNTServer"
2023-08-21 01:51:35 -04:00
label = "Run NetworkTables Server (Debugging Only)"
tooltip = "If enabled, this device will create a NT server. This is useful for home debugging, but should be disabled on-robot."
2023-09-01 12:58:35 -07:00
: label - cols = "4"
2023-08-21 01:51:35 -04:00
/ >
2025-08-04 01:15:33 -04:00
< v-alert
2025-01-07 08:45:39 -05:00
v - if = "tempSettingsStruct.runNTServer"
2025-08-04 01:15:33 -04:00
color = "buttonActive"
density = "compact"
text = "This mode is intended for debugging and should be off for proper usage. PhotonLib will NOT work!"
2023-08-21 01:51:35 -04:00
icon = "mdi-information-outline"
2026-03-24 17:49:56 -05:00
: variant = "theme.global.current.value.dark ? 'tonal' : 'elevated'"
2025-08-04 01:15:33 -04:00
/ >
Clean up spacing and other things in various parts of the UI (#1972)
## Description
After the Vue 3 upgrade, the spacing for various UI elements was left
inconsistent in many places. Dialogs were hit especially hard and had
some very inconsistent spacing. Additionally, the 24 pixels of padding
around all cards was noted as a waste of space and unnecessary, so it
has been shrunk down to 20 pixels to make the UI a tiny bit more compact
and to make it visually closer to some parts of the UI that have 16
pixels of padding (the camera views are the most notable example).
Padding between input elements has also been reduced to 20 pixels (this
required some hackery to get consistent sizes on input elements, since
switches and sliders have different heights.)
Some other minor UI tweaks were made, such as removing the divider
between dialog contents and dialog buttons because it visually looks
better, shrinking the banner padding so it doesn't displace as much
content, making the banner background one uniform color instead of a
highlight around the icon, fixing the targets tab so that the columns
stop shifting around when the values change, preserving newlines in the
log view, cleaning up the object detection UI, and making the import
dialogs have consistently inset input elements.
Old dashboard:

New dashboard:

Old Camera tab:

New Camera tab:

Old Calibration Info:

New Calibration Info:

Old Log Viewer:

New Log Viewer:

Old Pipeline Creation Dialog:

New Pipeline Creation Dialog:

Old Factory Reset:

New Factory Reset:

Old Pipeline Change:

New Pipeline Change:

Old Import Dialog:

New Import Dialog:

## Meta
Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] If this PR changes behavior or adds a feature, user documentation
is updated
- [ ] If this PR touches photon-serde, all messages have been
regenerated and hashes have not changed unexpectedly
- [ ] If this PR touches configuration, this is backwards compatible
with settings back to v2024.3.1
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-07-12 00:02:23 -04:00
< v-card-title class = "pl-0 pt-3 pb-10px" > Miscellaneous < / v-card-title >
2023-12-31 00:14:21 -05:00
< pv-switch
v - model = "tempSettingsStruct.shouldPublishProto"
label = "Also Publish Protobuf"
tooltip = "If enabled, Photon will publish all pipeline results in both the Packet and Protobuf formats. This is useful for visualizing pipeline results from NT viewers such as glass and logging software such as AdvantageScope. Note: photon-lib will ignore this value and is not recommended on the field for performance."
: label - cols = "4"
/ >
2025-08-04 01:15:33 -04:00
< v-alert
2025-01-07 08:45:39 -05:00
v - if = "tempSettingsStruct.shouldPublishProto"
2025-08-04 01:15:33 -04:00
color = "buttonActive"
density = "compact"
text = "This mode is intended for debugging and may reduce performance; it should be off for field use."
2023-12-31 00:14:21 -05:00
icon = "mdi-information-outline"
2026-03-24 17:49:56 -05:00
: variant = "theme.global.current.value.dark ? 'tonal' : 'elevated'"
2025-08-04 01:15:33 -04:00
/ >
2023-08-21 01:51:35 -04:00
< / v-form >
< v-btn
2025-08-04 01:15:33 -04:00
color = "primary"
2025-09-07 00:33:37 -04:00
class = "mt-3"
2026-03-24 17:49:56 -05:00
: variant = "theme.global.current.value.dark ? 'outlined' : 'elevated'"
2023-08-31 16:56:58 -04:00
style = "color: black; width: 100%"
2023-12-31 00:14:21 -05:00
: disabled = "!settingsValid || !settingsHaveChanged()"
2023-08-21 01:51:35 -04:00
@ click = "saveGeneralSettings"
>
Save
< / v-btn >
< / div >
2025-09-07 00:33:37 -04:00
< v-dialog v-model = "showThemeConfig" width="800" dark >
< v-card color = "surface" flat >
< v-card-title class = "text-center" > Theme Configuration < / v-card-title >
< v-card-text class = "pt-0 pb-10px" >
< v-row >
< v-col class = "text-center" >
Background
< v-color-picker
2025-10-30 18:52:14 -05:00
v - model : model - value = "backgroundColor"
2025-09-07 00:33:37 -04:00
class = "ma-auto pt-3"
elevation = "0"
mode = "hex"
: modes = "['hex']"
2025-10-30 18:52:14 -05:00
@ update : model - value = "(hex) => setThemeColor(theme, 'background', hex)"
2025-09-07 00:33:37 -04:00
> < / v-color-picker >
< / v-col >
< v-col class = "text-center" >
Surface
< v-color-picker
2025-10-30 18:52:14 -05:00
v - model : model - value = "surfaceColor"
2025-09-07 00:33:37 -04:00
class = "ma-auto pt-3"
elevation = "0"
mode = "hex"
: modes = "['hex']"
2025-10-30 18:52:14 -05:00
@ update : model - value = "(hex) => setThemeColor(theme, 'surface', hex)"
2025-09-07 00:33:37 -04:00
> < / v-color-picker >
< / v-col >
< / v-row >
< v-row >
< v-col class = "text-center" >
Primary
< v-color-picker
2025-10-30 18:52:14 -05:00
v - model : model - value = "primaryColor"
2025-09-07 00:33:37 -04:00
class = "ma-auto pt-3"
elevation = "0"
mode = "hex"
: modes = "['hex']"
2025-10-30 18:52:14 -05:00
@ update : model - value = "(hex) => setThemeColor(theme, 'primary', hex)"
2025-09-07 00:33:37 -04:00
> < / v-color-picker >
< / v-col >
< v-col class = "text-center" >
Secondary
< v-color-picker
2025-10-30 18:52:14 -05:00
v - model : model - value = "secondaryColor"
2025-09-07 00:33:37 -04:00
class = "ma-auto pt-3"
elevation = "0"
mode = "hex"
: modes = "['hex']"
2025-10-30 18:52:14 -05:00
@ update : model - value = "(hex) => setThemeColor(theme, 'secondary', hex)"
2025-09-07 00:33:37 -04:00
> < / v-color-picker >
< / v-col >
< / v-row >
< / v-card-text >
< v-card-actions class = "pa-5 pt-0" >
< v-btn
2026-03-24 17:49:56 -05:00
: variant = "theme.global.current.value.dark ? 'outlined' : 'elevated'"
2025-09-07 00:33:37 -04:00
color = "buttonPassive"
class = "text-black"
@ click = "showThemeConfig = false"
>
Close
< / v-btn >
< v-btn
2026-03-24 17:49:56 -05:00
: variant = "theme.global.current.value.dark ? 'outlined' : 'elevated'"
2025-09-07 00:33:37 -04:00
color = "buttonActive"
class = "text-black"
@ click = "
( ) => {
resetTheme ( theme ) ;
loadCurrentColors ( ) ;
}
"
>
Reset Default
< / v-btn >
< / v-card-actions >
< / v-card >
< / v-dialog >
2023-08-21 01:51:35 -04:00
< / v-card >
< / template >
< style >
Clean up spacing and other things in various parts of the UI (#1972)
## Description
After the Vue 3 upgrade, the spacing for various UI elements was left
inconsistent in many places. Dialogs were hit especially hard and had
some very inconsistent spacing. Additionally, the 24 pixels of padding
around all cards was noted as a waste of space and unnecessary, so it
has been shrunk down to 20 pixels to make the UI a tiny bit more compact
and to make it visually closer to some parts of the UI that have 16
pixels of padding (the camera views are the most notable example).
Padding between input elements has also been reduced to 20 pixels (this
required some hackery to get consistent sizes on input elements, since
switches and sliders have different heights.)
Some other minor UI tweaks were made, such as removing the divider
between dialog contents and dialog buttons because it visually looks
better, shrinking the banner padding so it doesn't displace as much
content, making the banner background one uniform color instead of a
highlight around the icon, fixing the targets tab so that the columns
stop shifting around when the values change, preserving newlines in the
log view, cleaning up the object detection UI, and making the import
dialogs have consistently inset input elements.
Old dashboard:

New dashboard:

Old Camera tab:

New Camera tab:

Old Calibration Info:

New Calibration Info:

Old Log Viewer:

New Log Viewer:

Old Pipeline Creation Dialog:

New Pipeline Creation Dialog:

Old Factory Reset:

New Factory Reset:

Old Pipeline Change:

New Pipeline Change:

Old Import Dialog:

New Import Dialog:

## Meta
Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] If this PR changes behavior or adds a feature, user documentation
is updated
- [ ] If this PR touches photon-serde, all messages have been
regenerated and hashes have not changed unexpectedly
- [ ] If this PR touches configuration, this is backwards compatible
with settings back to v2024.3.1
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-07-12 00:02:23 -04:00
. mt - 10 px {
margin - top : 10 px ! important ;
}
2023-08-21 01:51:35 -04:00
< / style >