Skip to content

armgit / meet

Public Imported from GitHub
0

Open source video conferencing app powered by LiveKit. Built with Django and React.

✨(frontend) display recording expiration status in frontend

lebaudantoine3636bfa70364
diff --git a/src/frontend/src/api/useConfig.ts b/src/frontend/src/api/useConfig.ts
index 825914a2..205a333e 100644
--- a/src/frontend/src/api/useConfig.ts
+++ b/src/frontend/src/api/useConfig.ts
@@ -16,6 +16,7 @@ export interface ApiConfig {
recording?: {
is_enabled?: boolean
available_modes?: RecordingMode[]
+ expiration_days?: number
}
}
diff --git a/src/frontend/src/features/recording/api/fetchRecording.ts b/src/frontend/src/features/recording/api/fetchRecording.ts
index e8c9dfe4..594db12b 100644
--- a/src/frontend/src/features/recording/api/fetchRecording.ts
+++ b/src/frontend/src/features/recording/api/fetchRecording.ts
@@ -9,6 +9,8 @@ export type RecordingApi = {
key: string
mode: RecordingMode
status: RecordingStatus
+ is_expired: boolean
+ expired_at: string
}
export const fetchRecording = ({ recordingId }: { recordingId?: string }) => {
diff --git a/src/frontend/src/features/recording/routes/RecordingDownload.tsx b/src/frontend/src/features/recording/routes/RecordingDownload.tsx
index b72f5eb6..a800f066 100644
--- a/src/frontend/src/features/recording/routes/RecordingDownload.tsx
+++ b/src/frontend/src/features/recording/routes/RecordingDownload.tsx
@@ -13,9 +13,11 @@ import { ErrorScreen } from '@/components/ErrorScreen'
import { LoadingScreen } from '@/components/LoadingScreen'
import { fetchRecording } from '../api/fetchRecording'
import { RecordingStatus } from '@/features/recording'
+import { useConfig } from '@/api/useConfig'
export const RecordingDownload = () => {
const { t } = useTranslation('recording')
+ const { data: configData } = useConfig()
const { recordingId } = useParams()
const { isLoggedIn, isLoading: isAuthLoading } = useUser()
@@ -50,6 +52,17 @@ export const RecordingDownload = () => {
return <ErrorScreen title={t('unsaved.title')} body={t('unsaved.body')} />
}
+ if (data.is_expired) {
+ return (
+ <ErrorScreen
+ title={t('expired.title')}
+ body={t('expired.body', {
+ date: formatDate(data?.expired_at, 'YYYY-MM-DD HH:mm'),
+ })}
+ />
+ )
+ }
+
return (
<UserAware>
<Screen layout="centered" footer={false}>
@@ -74,6 +87,16 @@ export const RecordingDownload = () => {
}),
}}
/>
+ <span>
+ {configData?.recording?.expiration_days && (
+ <>
+ {' '}
+ {t('success.expiration', {
+ expiration_days: configData?.recording?.expiration_days,
+ })}
+ </>
+ )}
+ </span>
</Text>
<LinkButton
href={mediaUrl(data.key)}
diff --git a/src/frontend/src/locales/de/recording.json b/src/frontend/src/locales/de/recording.json
index 7ce6aa8d..d74c993e 100644
--- a/src/frontend/src/locales/de/recording.json
+++ b/src/frontend/src/locales/de/recording.json
@@ -3,6 +3,10 @@
"title": "",
"body": ""
},
+ "expired": {
+ "title": "",
+ "body": ""
+ },
"authentication": {
"title": "",
"body": ""
@@ -14,6 +18,7 @@
"success": {
"title": "",
"body": "",
+ "expiration": "",
"button": ""
}
}
diff --git a/src/frontend/src/locales/en/recording.json b/src/frontend/src/locales/en/recording.json
index 8965465a..376fa0ad 100644
--- a/src/frontend/src/locales/en/recording.json
+++ b/src/frontend/src/locales/en/recording.json
@@ -1,7 +1,11 @@
{
"error": {
"title": "Recording unavailable",
- "body": "This recording could not be found or was deleted after its 7-day validity period."
+ "body": "This recording could not be found or was deleted."
+ },
+ "expired": {
+ "title": "Recording expired",
+ "body": "This recording was deleted on {{date}}."
},
"authentication": {
"title": "Authentication required",
@@ -14,6 +18,7 @@
"success": {
"title": "Your recording is ready!",
"body": "Recording of the meeting <b>{{room}}</b> from {{created_at}}.",
+ "expiration": "Attention, this recording will expire after {{expiration_days}} day(s).",
"button": "Download"
}
}
diff --git a/src/frontend/src/locales/fr/recording.json b/src/frontend/src/locales/fr/recording.json
index 4228afba..0032ef40 100644
--- a/src/frontend/src/locales/fr/recording.json
+++ b/src/frontend/src/locales/fr/recording.json
@@ -1,7 +1,11 @@
{
"error": {
"title": "Enregistrement indisponible",
- "body": "Cet enregistrement est introuvable ou a été supprimé après sa période de validité de 7 jours."
+ "body": "Cet enregistrement est introuvable ou a été supprimé."
+ },
+ "expired": {
+ "title": "Enregistrement expiré",
+ "body": "Cet enregistrement a été supprimé le {{date}}."
},
"authentication": {
"title": "Authentification requise",
@@ -14,6 +18,7 @@
"success": {
"title": "Votre enregistrement est prêt !",
"body": "Enregistrement de la réunion <b>{{room}}</b> du {{created_at}}.",
+ "expiration": "Attention cet enregistrement expirera au bout de {{expiration_days}} jour(s).",
"button": "Télécharger"
}
}
diff --git a/src/frontend/src/locales/nl/recording.json b/src/frontend/src/locales/nl/recording.json
index bda67456..43210731 100644
--- a/src/frontend/src/locales/nl/recording.json
+++ b/src/frontend/src/locales/nl/recording.json
@@ -1,7 +1,11 @@
{
"error": {
"title": "Opname niet beschikbaar",
- "body": "Deze opname is niet gevonden of is verwijderd na de geldigheidsperiode van 7 dagen."
+ "body": "Deze opname is niet gevonden of is verwijderd."
+ },
+ "expired": {
+ "title": "Opname verlopen",
+ "body": "Deze opname is verwijderd op {{date}}."
},
"authentication": {
"title": "Authenticatie vereist",
@@ -14,6 +18,7 @@
"success": {
"title": "Je opname is klaar!",
"body": "Opname van de vergadering <b>{{room}}</b> op {{created_at}}.",
+ "expiration": "Let op, deze opname verloopt na {{expiration_days}} dag(en).",
"button": "Downloaden"
}
}