Skip to content

Commit 037cad3

Browse files
committed
fix: parent device settings confusing use of config id
1 parent 233c327 commit 037cad3

2 files changed

Lines changed: 17 additions & 12 deletions

File tree

packages/webui/src/client/ui/Settings/SettingsMenu.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -530,8 +530,8 @@ function SettingsMenuPeripheralDevice({ device }: Readonly<SettingsMenuPeriphera
530530
<p>
531531
{device.connected ? t('Connected') : t('Disconnected')}, {t('Status')}:{' '}
532532
{statusCodeString(t, device.status.statusCode)}
533-
{configIdString(t, device.studioAndConfigId?.configId)}
534533
</p>
534+
<p className="text-s">{configIdString(t, device.studioAndConfigId?.configId)}</p>
535535
</NavLink>
536536
<hr className="vsubtle" />
537537
</>
@@ -561,6 +561,6 @@ function statusCodeString(t: TFunction, statusCode: StatusCode): string {
561561
}
562562

563563
function configIdString(t: TFunction, configId: string | undefined): string {
564-
if (configId) return t(', Config ID: ') + configId
565-
else return t(', Unconfigured')
564+
if (configId) return t('Config ID: ') + configId
565+
else return t('Unconfigured')
566566
}

packages/webui/src/client/ui/Settings/Studio/Devices/ParentDevices.tsx

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ function GenericParentDevicesTable({
221221
for (const device of allParentDevices) {
222222
options.push({
223223
value: device._id,
224-
name: device.studioAndConfigId?.configId || unprotectString(device._id),
224+
name: device.name || unprotectString(device._id),
225225
i: options.length,
226226
})
227227
}
@@ -239,8 +239,8 @@ function GenericParentDevicesTable({
239239
<thead>
240240
<tr className="hl">
241241
<th key="Name">{t('Name')}</th>
242+
<th key="ConfigID">{t('ID')}</th>
242243
<th key="GatewayID">{t('Gateway')}</th>
243-
<th key="ConfigID">{t('Config ID')}</th>
244244
<th key="LastSeen">{t('Last Seen')}</th>
245245
<th key="action">&nbsp;</th>
246246
</tr>
@@ -318,9 +318,9 @@ function SummaryRow({
318318
>
319319
<th className="settings-studio-device__name c2">{item.computed.name}</th>
320320

321-
<th className="settings-studio-device__parent c2">{peripheralDevice?.deviceType || '-'}</th>
321+
<th className="settings-studio-device__configID c2">{item.id}</th>
322322

323-
<th className="settings-studio-device__configID c2">{peripheralDevice?.configId || '-'}</th>
323+
<th className="settings-studio-device__parent c2">{peripheralDevice?.deviceType || '-'}</th>
324324

325325
<th className="settings-studio-device__type c2">
326326
{peripheralDevice ? <MomentFromNow date={peripheralDevice.lastSeen} /> : '-'}
@@ -349,9 +349,9 @@ function DeletedSummaryRow({ item, undeleteItemWithId }: Readonly<DeletedSummary
349349
<tr>
350350
<th className="settings-studio-device__name c2 deleted">{item.defaults.name}</th>
351351

352-
<th className="settings-studio-device__gateway c2 deleted">-</th>
352+
<th className="settings-studio-device__configID c2 deleted">{item.id}</th>
353353

354-
<th className="settings-studio-device__configID c2 deleted">-</th>
354+
<th className="settings-studio-device__gateway c2 deleted">-</th>
355355

356356
<th className="settings-studio-device__last_seen c2 deleted">-</th>
357357

@@ -376,9 +376,9 @@ function OrphanedSummaryRow({ configId, device, createItemWithId }: Readonly<Orp
376376
<tr>
377377
<th className="settings-studio-device__name c2 deleted">-</th>
378378

379-
<th className="settings-studio-device__gateway c2 deleted">{device.deviceName || unprotectString(device._id)}</th>
379+
<th className="settings-studio-device__configID c2 deleted">{configId}</th>
380380

381-
<th className="settings-studio-device__configID c2 deleted">{device.studioAndConfigId?.configId || '-'}</th>
381+
<th className="settings-studio-device__gateway c2 deleted">{device.deviceName || unprotectString(device._id)}</th>
382382

383383
<th className="settings-studio-device__last_seen c2 deleted">{<MomentFromNow date={device.lastSeen} />}</th>
384384

@@ -415,6 +415,11 @@ function ParentDeviceEditRow({
415415
<tr className="expando-details hl" key={item.id + '-details'}>
416416
<td colSpan={99}>
417417
<div className="properties-grid">
418+
<label className="field">
419+
<LabelActual label={t('ID')} />
420+
{item.id}
421+
</label>
422+
418423
<LabelAndOverrides label={t('Name')} item={item} overrideHelper={overrideHelper} itemKey={'name'}>
419424
{(value, handleUpdate) => <TextInputControl value={value} handleUpdate={handleUpdate} />}
420425
</LabelAndOverrides>
@@ -466,7 +471,7 @@ function AssignPeripheralDeviceConfigId({
466471

467472
return (
468473
<label className="field">
469-
<LabelActual label={'Config ID'} />
474+
<LabelActual label={'Peripheral Device'} />
470475
<div className="field-content">
471476
<DropdownInputControl<PeripheralDeviceId | undefined>
472477
options={peripheralDeviceOptions}

0 commit comments

Comments
 (0)