Skip to content

Commit

Permalink
feature: add camera friendly name to UI
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricve committed Jan 30, 2024
1 parent b2589f4 commit 8fc9bc2
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 1 deletion.
5 changes: 4 additions & 1 deletion machinery/src/routers/mqtt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,13 @@ func HandleRequestConfig(mqttClient mqtt.Client, hubKey string, payload models.P
json.Unmarshal(jsonData, &configPayload)

if configPayload.Timestamp != 0 {
// Get Config from the device

// Get Config from the device
key := configuration.Config.Key
name := configuration.Config.Name
if configuration.Config.FriendlyName != "" {
name = configuration.Config.FriendlyName
}

if key != "" && name != "" {

Expand Down
1 change: 1 addition & 0 deletions ui/public/locales/de/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"description_general": "Allgemeine Einstellungen für den Kerberos Agent",
"key": "Schlüssel",
"camera_name": "Kamera Name",
"camera_friendly_name": "Kamera Anzeigename",
"timezone": "Zeitzone",
"select_timezone": "Zeitzone auswählen",
"advanced_configuration": "Erweiterte Konfiguration",
Expand Down
1 change: 1 addition & 0 deletions ui/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"description_general": "General settings for your Kerberos Agent",
"key": "Key",
"camera_name": "Camera name",
"camera_friendly_name": "Friendly name",
"timezone": "Timezone",
"select_timezone": "Select a timezone",
"advanced_configuration": "Advanced configuration",
Expand Down
1 change: 1 addition & 0 deletions ui/public/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"description_general": "General settings for your Kerberos Agent",
"key": "Key",
"camera_name": "Camera name",
"camera_friendly_name": "Camera friendly name",
"timezone": "Timezone",
"select_timezone": "Select a timezone",
"advanced_configuration": "Advanced configuration",
Expand Down
1 change: 1 addition & 0 deletions ui/public/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"description_general": "Paramètres généraux pour votre Agent Kerberos",
"key": "Clé",
"camera_name": "Nom de la caméra",
"camera_friendly_name": "Nom convivial de la caméra",
"timezone": "Fuseau horaire",
"select_timezone": "Sélectionner un fuseau horaire",
"advanced_configuration": "Configuration avancée",
Expand Down
1 change: 1 addition & 0 deletions ui/public/locales/hi/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"description_general": "आपके Kerberos एजेंट के लिए सामान्य सेटिंग्स",
"key": "की",
"camera_name": "कैमरे का नाम",
"camera_friendly_name": "कैमरे का नाम",
"timezone": "समय क्षेत्र",
"select_timezone": "समयक्षेत्र चुनें",
"advanced_configuration": "एडवांस कॉन्फ़िगरेशन",
Expand Down
1 change: 1 addition & 0 deletions ui/public/locales/it/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"description_general": "Impostazioni generali del Kerberos Agent",
"key": "Chiave",
"camera_name": "Nome videocamera",
"camera_friendly_name": "Nome amichevole videocamera",
"timezone": "Fuso orario",
"select_timezone": "Seleziona un fuso orario",
"advanced_configuration": "Configurazione avanzata",
Expand Down
1 change: 1 addition & 0 deletions ui/public/locales/ja/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"description_general": "Kerberos エージェントの一般設定",
"key": "",
"camera_name": "カメラ名",
"camera_friendly_name": "カメラのフレンドリー名",
"timezone": "タイムゾーン",
"select_timezone": "タイムゾーンを選択",
"advanced_configuration": "詳細設定",
Expand Down
1 change: 1 addition & 0 deletions ui/public/locales/nl/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"description_general": "Algemene instellingen voor jouw Kerberos Agent",
"key": "Key",
"camera_name": "Camera naam",
"camera_friendly_name": "Camera vriendelijke naam",
"timezone": "Tijdzone",
"select_timezone": "Selecteer uw tijdzone",
"advanced_configuration": "Geavanceerde instellingen",
Expand Down
1 change: 1 addition & 0 deletions ui/public/locales/pl/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"description_general": "General settings for your Kerberos Agent",
"key": "Key",
"camera_name": "Camera name",
"camera_friendly_name": "Camera friendly name",
"timezone": "Timezone",
"select_timezone": "Select a timezone",
"advanced_configuration": "Advanced configuration",
Expand Down
1 change: 1 addition & 0 deletions ui/public/locales/pt/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"description_general": "Configurações gerais para seu agente Kerberos",
"key": "Chave",
"camera_name": "Nome da câmera",
"camera_friendly_name": "Nome amigável da câmera",
"timezone": "Fuso horário",
"select_timezone": "Selecione a timezone",
"advanced_configuration": "Configurações avançadas",
Expand Down
1 change: 1 addition & 0 deletions ui/public/locales/ru/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"description_general": "Общие настройки Kerberos Agent",
"key": "Ключ",
"camera_name": "Название камеры",
"camera_friendly_name": "Дружественное название камеры",
"timezone": "Часовой пояс",
"select_timezone": "Выберите часовой пояс",
"advanced_configuration": "Расширенные настройки",
Expand Down
1 change: 1 addition & 0 deletions ui/public/locales/zh/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"description_general": "Kerberos Agent 常规设置",
"key": "Key",
"camera_name": "相机名称",
"camera_friendly_name": "相机友好名称",
"timezone": "时区",
"select_timezone": "选择时区",
"advanced_configuration": "高级配置",
Expand Down
9 changes: 9 additions & 0 deletions ui/src/pages/Settings/Settings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,15 @@ class Settings extends React.Component {
}
/>

<Input
noPadding
label={t('settings.overview.camera_friendly_name')}
defaultValue={config.friendly_name}
onChange={(value) =>
this.onUpdateField('', 'friendly_name', value, config)
}
/>

<Dropdown
isRadio
icon="world"
Expand Down

0 comments on commit 8fc9bc2

Please sign in to comment.