cleanup of soft deleted items

vacuuming database
consolidation of "advanced" operations in settings
This commit is contained in:
azivner
2017-12-23 09:35:00 -05:00
parent eba00e6ff8
commit 215c3a414f
8 changed files with 127 additions and 47 deletions

View File

@@ -155,6 +155,9 @@ settings.addModule((async function () {
settings.addModule((async function () {
const forceFullSyncButton = $("#force-full-sync-button");
const fillSyncRowsButton = $("#fill-sync-rows-button");
const anonymizeButton = $("#anonymize-button");
const cleanupSoftDeletedButton = $("#cleanup-soft-deleted-items-button");
const vacuumDatabaseButton = $("#vacuum-database-button");
forceFullSyncButton.click(async () => {
await server.post('sync/force-full-sync');
@@ -168,11 +171,6 @@ settings.addModule((async function () {
showMessage("Sync rows filled successfully");
});
return {};
})());
settings.addModule((async function () {
const anonymizeButton = $("#anonymize-button");
anonymizeButton.click(async () => {
await server.post('anonymization/anonymize');
@@ -180,5 +178,19 @@ settings.addModule((async function () {
showMessage("Created anonymized database");
});
cleanupSoftDeletedButton.click(async () => {
if (confirm("Do you really want to clean up soft-deleted items?")) {
await server.post('cleanup/cleanup-soft-deleted-items');
showMessage("Soft deleted items have been cleaned up");
}
});
vacuumDatabaseButton.click(async () => {
await server.post('cleanup/vacuum-database');
showMessage("Database has been vacuumed");
});
return {};
})());