Skip to content

Build your personal knowledge base with Trilium Notes

chore(options/advanced): merge database-related options

Elian Doran3dc0d25c4d70
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index 31024c5a74..39de45b8a3 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -1167,8 +1167,13 @@
"finished-successfully": "Sync finished successfully.",
"failed": "Sync failed: {{message}}"
},
+ "database": {
+ "title": "Database"
+ },
"vacuum_database": {
"title": "Vacuum Database",
+ "vacuum_label": "Vacuum database",
+ "vacuum_description": "Rebuild the database to reduce file size. No data will be changed.",
"description": "This will rebuild the database which will typically result in a smaller database file. No data will be actually changed.",
"button_text": "Vacuum database",
"vacuuming_database": "Vacuuming database...",
diff --git a/apps/client/src/widgets/type_widgets/options/advanced.tsx b/apps/client/src/widgets/type_widgets/options/advanced.tsx
index 2b15ff14fd..53203a5903 100644
--- a/apps/client/src/widgets/type_widgets/options/advanced.tsx
+++ b/apps/client/src/widgets/type_widgets/options/advanced.tsx
@@ -15,9 +15,8 @@ import OptionsSection from "./components/OptionsSection";
export default function AdvancedSettings() {
return <>
<AdvancedSyncOptions />
- <DatabaseIntegrityOptions />
+ <DatabaseOptions />
<DatabaseAnonymizationOptions />
- <VacuumDatabaseOptions />
<ExperimentalOptions />
</>;
}
@@ -47,9 +46,9 @@ function AdvancedSyncOptions() {
);
}
-function DatabaseIntegrityOptions() {
+function DatabaseOptions() {
return (
- <OptionsSection title={t("database_integrity_check.title")}>
+ <OptionsSection title={t("database.title")}>
<OptionsRowWithButton
label={t("database_integrity_check.check_integrity_label")}
description={t("database_integrity_check.check_integrity_description")}
@@ -75,6 +74,16 @@ function DatabaseIntegrityOptions() {
toast.showMessage(t("consistency_checks.issues_fixed_message"));
}}
/>
+
+ <OptionsRowWithButton
+ label={t("vacuum_database.vacuum_label")}
+ description={t("vacuum_database.vacuum_description")}
+ onClick={async () => {
+ toast.showMessage(t("vacuum_database.vacuuming_database"));
+ await server.post("database/vacuum-database");
+ toast.showMessage(t("vacuum_database.database_vacuumed"));
+ }}
+ />
</OptionsSection>
);
}
@@ -164,22 +173,6 @@ function ExistingAnonymizedDatabases({ databases }: { databases: AnonymizedDbRes
);
}
-function VacuumDatabaseOptions() {
- return (
- <OptionsSection title={t("vacuum_database.title")}>
- <FormText>{t("vacuum_database.description")}</FormText>
-
- <Button
- text={t("vacuum_database.button_text")}
- onClick={async () => {
- toast.showMessage(t("vacuum_database.vacuuming_database"));
- await server.post("database/vacuum-database");
- toast.showMessage(t("vacuum_database.database_vacuumed"));
- }}
- />
- </OptionsSection>
- );
-}
function ExperimentalOptions() {
const [enabledFeatures, setEnabledFeatures] = useTriliumOptionJson<ExperimentalFeatureId[]>("experimentalFeatures", true);