@@ -26,7 +26,7 @@ const camerasWithRecordings = computed(() => {
2626 return cameras ;
2727});
2828
29- const confirmDeleteDialog = ref ({ show: false , recordings: {} as string [], cameraUniqueName: " " });
29+ const confirmDeleteDialog = ref ({ show: false , recordings: [] as string [], cameraUniqueName: " " });
3030
3131const deleteRecordings = async (recordingsToDelete : string [], cameraUniqueName : string ) => {
3232 axiosPost (" /recordings/delete" , " delete " + recordingsToDelete .join (" , " ), {
@@ -35,14 +35,35 @@ const deleteRecordings = async (recordingsToDelete: string[], cameraUniqueName:
3535 });
3636};
3737
38- const exportRecordings = ref ();
39- const exportCameraRecordings = ref ();
40- const exportIndividualRecording = ref ();
38+ const exportCameraRecordings = ref <HTMLAnchorElement >();
39+ const exportIndividualRecording = ref <HTMLAnchorElement >();
4140
4241const showNukeDialog = ref (false );
4342const nukeRecordings = () => {
4443 axiosPost (" /recordings/nuke" , " clear and reset all recordings" );
4544};
45+
46+ const downloadIndividualRecording = (camera : any ) => {
47+ const recording = selectedRecordings .value [camera .uniqueName ];
48+ const link = document .createElement (' a' );
49+ link .href = ` http://${address }/api/recordings/exportIndividual?recording=${recording }&camera=${camera .uniqueName } ` ;
50+ link .download = ` ${camera .nickname }_${recording }_recording.mp4 ` ;
51+ link .click ();
52+ };
53+
54+ const downloadCameraRecordings = (camera : any ) => {
55+ const link = document .createElement (' a' );
56+ link .href = ` http://${address }/api/recordings/exportCamera?cameraPath=${camera .uniqueName } ` ;
57+ link .download = ` ${camera .nickname }_recordings.zip ` ;
58+ link .click ();
59+ };
60+
61+ const downloadAllRecordings = () => {
62+ const link = document .createElement (' a' );
63+ link .href = ` http://${address }/api/recordings/export ` ;
64+ link .download = ` photonvision-recordings-export.zip ` ;
65+ link .click ();
66+ };
4667 </script >
4768
4869<template >
@@ -51,8 +72,7 @@ const nukeRecordings = () => {
5172 <div class =" pa-5 pt-0" >
5273 <pv-select
5374 v-model =" useSettingsStore().general.recordingStrategy"
54- label =" Orientation"
55- tooltip =" Rotates the camera stream. Rotation not available when camera has been calibrated."
75+ label =" Recording Strategy"
5676 :items =" useSettingsStore().general.supportedRecordingStrategies"
5777 @update:modelValue =" (args) => useSettingsStore().setRecordingStrategy(String(args ?? ''))"
5878 />
@@ -62,7 +82,7 @@ const nukeRecordings = () => {
6282 <v-btn
6383 color =" buttonPassive"
6484 :variant =" theme.global.name.value === 'LightTheme' ? 'elevated' : 'outlined'"
65- @click =" () => exportRecordings.value.click ()"
85+ @click =" downloadAllRecordings ()"
6686 >
6787 <v-icon start class =" open-icon" > mdi-export </v-icon >
6888 <span class =" open-label" >Export Recordings</span >
@@ -131,17 +151,10 @@ const nukeRecordings = () => {
131151 color =" buttonPassive"
132152 title =" Export Selected Recording"
133153 :variant =" theme.global.name.value === 'LightTheme' ? 'elevated' : 'outlined'"
134- @click =" () => exportIndividualRecording.value.click( )"
154+ @click =" downloadIndividualRecording(camera )"
135155 >
136156 <v-icon size =" large" >mdi-export</v-icon >
137157 </v-btn >
138- <a
139- ref =" exportIndividualRecording"
140- style =" color : black ; text-decoration : none ; display : none "
141- :href =" `http://${address}/api/recordings/exportIndividual?recording=${selectedRecordings[camera.uniqueName]}?camera=${camera.uniqueName}`"
142- :download =" `${camera.nickname}_${selectedRecordings[camera.uniqueName]}_recording.mp4`"
143- target =" _blank"
144- />
145158 </td >
146159 <td class =" text-right" >
147160 <v-btn
@@ -169,17 +182,10 @@ const nukeRecordings = () => {
169182 color =" buttonPassive"
170183 title =" Export Recordings"
171184 :variant =" theme.global.name.value === 'LightTheme' ? 'elevated' : 'outlined'"
172- @click =" () => exportCameraRecordings.value.click( )"
185+ @click =" downloadCameraRecordings(camera )"
173186 >
174187 <v-icon size =" large" >mdi-export</v-icon >
175188 </v-btn >
176- <a
177- ref =" exportCameraRecordings"
178- style =" color : black ; text-decoration : none ; display : none "
179- :href =" `http://${address}/api/recordings/exportCamera?cameraPath=${camera.uniqueName}`"
180- :download =" `${camera.nickname}_recordings.zip`"
181- target =" _blank"
182- />
183189 </td >
184190 </tr >
185191 </tbody >
@@ -195,7 +201,7 @@ const nukeRecordings = () => {
195201 title =" Clear All Recordings"
196202 :description =" 'This will permanently delete all recordings from all cameras. This action cannot be undone.'"
197203 delete-text =" Delete Recordings"
198- :backup =" () => exportRecordings.value.click ()"
204+ :backup =" () => downloadAllRecordings ()"
199205 @confirm =" nukeRecordings"
200206 />
201207
0 commit comments