|
172 | 172 | <!-- Advanced Tab Content --> |
173 | 173 | <div v-if="currentSection === 'advanced'" class="settings-panel"> |
174 | 174 | <div class="section-header"> |
175 | | - <h3>{{ t("settings.retentionPolicy") }}</h3> |
176 | | - <p class="description">{{ t("settings.retentionPolicyDescription") }}</p> |
| 175 | + <h3>{{ t("settings.tabs.advanced") }}</h3> |
| 176 | + <p class="description"> |
| 177 | + {{ t("settings.manage-where-the-app-stores-temporary-and-cache-files") }} |
| 178 | + </p> |
177 | 179 | </div> |
178 | 180 |
|
179 | 181 | <div v-if="storageInfo && storageInfo.disk" class="storage-card mb-4"> |
|
284 | 286 | </div> |
285 | 287 | </div> |
286 | 288 | </div> |
287 | | - |
288 | | - <div class="settings-group"> |
289 | | - <div class="setting-item"> |
290 | | - <div class="setting-content"> |
291 | | - <label for="retention-enabled" class="setting-title">{{ |
292 | | - t("settings.retentionEnabled") |
293 | | - }}</label> |
294 | | - <div class="setting-description"> |
295 | | - Automatically delete old pipelines builds to save space. |
296 | | - </div> |
297 | | - </div> |
298 | | - <div class="setting-action"> |
299 | | - <ToggleSwitch |
300 | | - :disabled="!settingsRef" |
301 | | - input-id="retention-enabled" |
302 | | - :model-value="settingsRef?.buildHistory?.retentionPolicy?.enabled ?? false" |
303 | | - @update:model-value="updateRetentionEnabled" |
304 | | - /> |
305 | | - </div> |
306 | | - </div> |
307 | | - |
308 | | - <div |
309 | | - class="setting-item" |
310 | | - :class="{ |
311 | | - 'opacity-50 pointer-events-none': |
312 | | - !settingsRef?.buildHistory?.retentionPolicy?.enabled, |
313 | | - }" |
314 | | - > |
315 | | - <div class="setting-content"> |
316 | | - <label for="max-entries" class="setting-title">{{ |
317 | | - t("settings.retentionMaxEntries") |
318 | | - }}</label> |
319 | | - <div class="setting-description"> |
320 | | - {{ t("settings.retentionMaxEntriesDescription") }} |
321 | | - </div> |
322 | | - </div> |
323 | | - <div class="setting-action"> |
324 | | - <InputNumber |
325 | | - v-model="retentionMaxEntries" |
326 | | - :disabled="!settingsRef || !settingsRef?.buildHistory?.retentionPolicy?.enabled" |
327 | | - input-id="max-entries" |
328 | | - show-buttons |
329 | | - :min="1" |
330 | | - :max="1000" |
331 | | - class="w-[120px]" |
332 | | - /> |
333 | | - </div> |
334 | | - </div> |
335 | | - |
336 | | - <div |
337 | | - class="setting-item" |
338 | | - :class="{ |
339 | | - 'opacity-50 pointer-events-none': |
340 | | - !settingsRef?.buildHistory?.retentionPolicy?.enabled, |
341 | | - }" |
342 | | - > |
343 | | - <div class="setting-content"> |
344 | | - <label for="max-age" class="setting-title">{{ t("settings.retentionMaxAge") }}</label> |
345 | | - <div class="setting-description"> |
346 | | - {{ t("settings.retentionMaxAgeDescription") }} |
347 | | - </div> |
348 | | - </div> |
349 | | - <div class="setting-action"> |
350 | | - <InputNumber |
351 | | - v-model="retentionMaxAge" |
352 | | - :disabled="!settingsRef || !settingsRef?.buildHistory?.retentionPolicy?.enabled" |
353 | | - input-id="max-age" |
354 | | - show-buttons |
355 | | - :min="1" |
356 | | - :max="365" |
357 | | - class="w-[120px]" |
358 | | - /> |
359 | | - </div> |
360 | | - </div> |
361 | | - </div> |
362 | 289 | </div> |
363 | 290 |
|
364 | 291 | <!-- Versions Tab Content --> |
@@ -734,72 +661,6 @@ const updateAutosave = (value: boolean) => { |
734 | 661 | }); |
735 | 662 | }; |
736 | 663 |
|
737 | | -const updateRetentionEnabled = (value: boolean) => { |
738 | | - const currentBuildHistory = settingsRef.value.buildHistory || {}; |
739 | | - const currentPolicy = currentBuildHistory.retentionPolicy || { |
740 | | - enabled: false, |
741 | | - maxEntries: 50, |
742 | | - maxAge: 30, |
743 | | - }; |
744 | | -
|
745 | | - return appSettings.updateSettings({ |
746 | | - ...(toRaw(settingsRef.value) as any), |
747 | | - buildHistory: { |
748 | | - ...currentBuildHistory, |
749 | | - retentionPolicy: { |
750 | | - ...currentPolicy, |
751 | | - enabled: value, |
752 | | - }, |
753 | | - }, |
754 | | - }); |
755 | | -}; |
756 | | -
|
757 | | -const retentionMaxEntries = computed({ |
758 | | - get: () => settingsRef.value?.buildHistory?.retentionPolicy?.maxEntries ?? 50, |
759 | | - set: (value: number) => { |
760 | | - const currentBuildHistory = settingsRef.value.buildHistory || {}; |
761 | | - const currentPolicy = currentBuildHistory.retentionPolicy || { |
762 | | - enabled: false, |
763 | | - maxEntries: 50, |
764 | | - maxAge: 30, |
765 | | - }; |
766 | | -
|
767 | | - appSettings.updateSettings({ |
768 | | - ...(toRaw(settingsRef.value) as any), |
769 | | - buildHistory: { |
770 | | - ...currentBuildHistory, |
771 | | - retentionPolicy: { |
772 | | - ...currentPolicy, |
773 | | - maxEntries: value, |
774 | | - }, |
775 | | - }, |
776 | | - }); |
777 | | - }, |
778 | | -}); |
779 | | -
|
780 | | -const retentionMaxAge = computed({ |
781 | | - get: () => settingsRef.value?.buildHistory?.retentionPolicy?.maxAge ?? 30, |
782 | | - set: (value: number) => { |
783 | | - const currentBuildHistory = settingsRef.value.buildHistory || {}; |
784 | | - const currentPolicy = currentBuildHistory.retentionPolicy || { |
785 | | - enabled: false, |
786 | | - maxEntries: 50, |
787 | | - maxAge: 30, |
788 | | - }; |
789 | | -
|
790 | | - appSettings.updateSettings({ |
791 | | - ...(toRaw(settingsRef.value) as any), |
792 | | - buildHistory: { |
793 | | - ...currentBuildHistory, |
794 | | - retentionPolicy: { |
795 | | - ...currentPolicy, |
796 | | - maxAge: value, |
797 | | - }, |
798 | | - }, |
799 | | - }); |
800 | | - }, |
801 | | -}); |
802 | | -
|
803 | 664 | const isBillingPortalUrlLoading = ref(false); |
804 | 665 |
|
805 | 666 | const openBillingPortal = async () => { |
|
0 commit comments