@@ -10,11 +10,13 @@ import HistoryArchiveExportSelector from "@/components/History/Archiving/History
1010import HistoryArchiveSimple from " @/components/History/Archiving/HistoryArchiveSimple.vue" ;
1111import { useHistoryStore , type HistorySummary } from " @/stores/historyStore" ;
1212import LoadingSpan from " @/components/LoadingSpan.vue" ;
13+ import { useConfig } from " @/composables/config" ;
1314import { useToast } from " @/composables/toast" ;
1415
1516library .add (faArchive );
1617
1718const historyStore = useHistoryStore ();
19+ const { config } = useConfig (true );
1820const toast = useToast ();
1921
2022const { hasWritable : hasWritableFileSources } = useFileSources ();
@@ -42,6 +44,10 @@ const isHistoryAlreadyArchived = computed(() => {
4244 return history .value ?.archived ;
4345});
4446
47+ const canFreeStorage = computed (() => {
48+ return hasWritableFileSources .value && config .value .enable_celery_tasks ;
49+ });
50+
4551const archivedHistoriesRoute = " /histories/archived" ;
4652
4753async function onArchiveHistory(exportRecordId ? : string ) {
@@ -77,20 +83,20 @@ async function onArchiveHistory(exportRecordId?: string) {
7783 <router-link :to =" archivedHistoriesRoute" >Archived Histories</router-link > section.
7884 </b-alert >
7985
80- <history-archive-simple v-if =" !hasWritableFileSources" :history =" history" @onArchive =" onArchiveHistory" />
81- <div v-else >
86+ <div v-if =" canFreeStorage" >
8287 <h2 class =" h-md" >How do you want to archive this history?</h2 >
8388 <b-card no-body class =" mt-3" >
8489 <b-tabs pills card vertical lazy class =" archival-option-tabs" >
8590 <b-tab id =" keep-storage-tab" title =" Keep storage space" active >
8691 <history-archive-simple :history =" history" @onArchive =" onArchiveHistory" />
8792 </b-tab >
88- <b-tab v-if = " hasWritableFileSources " id =" free-storage-tab" title =" Free storage space" >
93+ <b-tab id =" free-storage-tab" title =" Free storage space" >
8994 <history-archive-export-selector :history =" history" @onArchive =" onArchiveHistory" />
9095 </b-tab >
9196 </b-tabs >
9297 </b-card >
9398 </div >
99+ <history-archive-simple v-else :history =" history" @onArchive =" onArchiveHistory" />
94100 </div >
95101 </div >
96102</template >
0 commit comments