diff --git a/src/components/inventory/EditViewContext.tsx b/src/components/inventory/EditViewContext.tsx index f5b78ba7..182f2eac 100644 --- a/src/components/inventory/EditViewContext.tsx +++ b/src/components/inventory/EditViewContext.tsx @@ -22,6 +22,7 @@ export interface IInput { name: string; location: string; type: SourceType | ''; + lastConnected: Date | ''; audioMapping?: Numbers[]; } @@ -41,7 +42,10 @@ interface IContext { } export const EditViewContext = createContext({ - input: [{ name: '', location: '', type: '', audioMapping: [] }, () => null], + input: [ + { name: '', location: '', type: '', lastConnected: '', audioMapping: [] }, + () => null + ], saved: [undefined, () => null], loading: false, isSame: true, @@ -66,6 +70,7 @@ export default function Context({ name: source.name, location: source.tags.location, type: source.type, + lastConnected: source.lastConnected, // audioMapping: source?.stream_settings?.audio_mapping || [] audioMapping: source?.audio_stream.audio_mapping || [] }); @@ -81,6 +86,7 @@ export default function Context({ name: source.name, location: source.tags.location, type: source.type, + lastConnected: source.lastConnected, // audioMapping: source?.stream_settings?.audio_mapping || [] audioMapping: source?.audio_stream.audio_mapping || [] })); diff --git a/src/components/inventory/editView/GeneralSettings.tsx b/src/components/inventory/editView/GeneralSettings.tsx index 0090d17d..2210064a 100644 --- a/src/components/inventory/editView/GeneralSettings.tsx +++ b/src/components/inventory/editView/GeneralSettings.tsx @@ -70,6 +70,15 @@ export default function GeneralSettings() { +
+

+ {t('source.last_connected')} +

+
+

{new Date(input.location).toLocaleString()}

+
+
+ {height && width && (

{t('video')}

diff --git a/src/components/sourceListItem/SourceListItem.tsx b/src/components/sourceListItem/SourceListItem.tsx index a76ca053..6e9aadf7 100644 --- a/src/components/sourceListItem/SourceListItem.tsx +++ b/src/components/sourceListItem/SourceListItem.tsx @@ -129,6 +129,10 @@ function InventoryListItem({ : capitalize(source.tags.location) })} +

+ {t('source.last_connected')}:{' '} + {new Date(source.lastConnected).toLocaleString()} +

{t('source.ingest', { ingest: source.ingest_name diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.ts index bd67b67c..2467307c 100644 --- a/src/i18n/locales/en.ts +++ b/src/i18n/locales/en.ts @@ -45,7 +45,8 @@ export const en = { audio: 'Audio: {{audio}}', orig: 'Original Name: {{name}}', metadata: 'Source Metadata', - location_unknown: 'Unknown' + location_unknown: 'Unknown', + last_connected: 'Last connection' }, delete_source_status: { delete_stream: 'Delete stream', diff --git a/src/i18n/locales/sv.ts b/src/i18n/locales/sv.ts index e4619fd5..585d3739 100644 --- a/src/i18n/locales/sv.ts +++ b/src/i18n/locales/sv.ts @@ -47,7 +47,8 @@ export const sv = { audio: 'Ljud: {{audio}}', orig: 'Enhetsnamn: {{name}}', metadata: 'Käll-metadata', - location_unknown: 'Okänd' + location_unknown: 'Okänd', + last_connected: 'Senast uppkoppling' }, delete_source_status: { delete_stream: 'Radera ström',