web/settings/advanced: improve settings management buttons

also removed duplicate localization strings
This commit is contained in:
wukko 2024-09-06 16:18:30 +06:00
parent 494522d292
commit 5a5c9da3df
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2
5 changed files with 14 additions and 17 deletions

View file

@ -12,5 +12,6 @@
"continue": "continue", "continue": "continue",
"star": "star", "star": "star",
"follow": "follow", "follow": "follow",
"save": "save" "save": "save",
"export": "export"
} }

View file

@ -110,9 +110,6 @@
"advanced.debug.description": "gives you access to a page with various info that can be useful for debugging.", "advanced.debug.description": "gives you access to a page with various info that can be useful for debugging.",
"advanced.data": "settings data", "advanced.data": "settings data",
"advanced.reset": "reset all settings",
"advanced.import": "import",
"advanced.export": "export",
"processing.override": "default instance override", "processing.override": "default instance override",
"processing.override.title": "use the instance-provided processing server", "processing.override.title": "use the instance-provided processing server",

View file

@ -9,6 +9,7 @@
import { validateSettings } from "$lib/settings/validate"; import { validateSettings } from "$lib/settings/validate";
import ActionButton from "$components/buttons/ActionButton.svelte"; import ActionButton from "$components/buttons/ActionButton.svelte";
import ResetSettingsButton from "$components/settings/ResetSettingsButton.svelte";
import IconFileExport from "@tabler/icons-svelte/IconFileExport.svelte"; import IconFileExport from "@tabler/icons-svelte/IconFileExport.svelte";
import IconFileImport from "@tabler/icons-svelte/IconFileImport.svelte"; import IconFileImport from "@tabler/icons-svelte/IconFileImport.svelte";
@ -102,14 +103,19 @@
<div class="button-row" id="settings-data-transfer"> <div class="button-row" id="settings-data-transfer">
<ActionButton id="import-settings" click={importSettings}> <ActionButton id="import-settings" click={importSettings}>
<IconFileImport /> <IconFileImport />
{$t("settings.advanced.import")} {$t("button.import")}
</ActionButton> </ActionButton>
{#if $storedSettings.schemaVersion} {#if $storedSettings.schemaVersion}
<ActionButton id="export-settings" click={exportSettings}> <ActionButton id="export-settings" click={exportSettings}>
<IconFileExport /> <IconFileExport />
{$t("settings.advanced.export")} {$t("button.export")}
</ActionButton> </ActionButton>
{/if} {/if}
{#if $storedSettings.schemaVersion}
<ResetSettingsButton />
{/if}
</div> </div>
<style> <style>

View file

@ -1,11 +1,10 @@
<script lang="ts"> <script lang="ts">
import { t } from "$lib/i18n/translations"; import { t } from "$lib/i18n/translations";
import { createDialog } from "$lib/dialogs";
import { resetSettings } from "$lib/state/settings"; import { resetSettings } from "$lib/state/settings";
import IconTrash from "@tabler/icons-svelte/IconTrash.svelte"; import IconTrash from "@tabler/icons-svelte/IconTrash.svelte";
import { createDialog } from "$lib/dialogs";
const resetDialog = () => { const resetDialog = () => {
createDialog({ createDialog({
id: "wipe-confirm", id: "wipe-confirm",
@ -33,7 +32,7 @@
<button id="setting-button-reset" class="button" on:click={resetDialog}> <button id="setting-button-reset" class="button" on:click={resetDialog}>
<IconTrash /> <IconTrash />
{$t("settings.advanced.reset")} {$t("button.reset")}
</button> </button>
<style> <style>

View file

@ -1,12 +1,9 @@
<script lang="ts"> <script lang="ts">
import { t } from "$lib/i18n/translations"; import { t } from "$lib/i18n/translations";
import { storedSettings } from "$lib/state/settings";
import SettingsToggle from "$components/buttons/SettingsToggle.svelte"; import SettingsToggle from "$components/buttons/SettingsToggle.svelte";
import TransferSettings from "$components/settings/TransferSettings.svelte"; import ManageSettings from "$components/settings/ManageSettings.svelte";
import SettingsCategory from "$components/settings/SettingsCategory.svelte"; import SettingsCategory from "$components/settings/SettingsCategory.svelte";
import ResetSettingsButton from "$components/settings/ResetSettingsButton.svelte";
</script> </script>
<SettingsCategory sectionId="debug" title={$t("settings.advanced.debug")}> <SettingsCategory sectionId="debug" title={$t("settings.advanced.debug")}>
@ -19,8 +16,5 @@
</SettingsCategory> </SettingsCategory>
<SettingsCategory sectionId="data" title={$t("settings.advanced.data")}> <SettingsCategory sectionId="data" title={$t("settings.advanced.data")}>
<TransferSettings /> <ManageSettings />
{#if $storedSettings.schemaVersion}
<ResetSettingsButton />
{/if}
</SettingsCategory> </SettingsCategory>