diff --git a/client/public/assets/locales/en.json b/client/public/assets/locales/en.json index 99c29b1d..b2dc5bb0 100644 --- a/client/public/assets/locales/en.json +++ b/client/public/assets/locales/en.json @@ -44,6 +44,8 @@ "dropdown": { "settings": "Settings", "changes_applied": "Your changes have been saved.", + "language_changed": "The language has been changed.", + "provider_changed": "The provider has been changed.", "view_changed": "The view has been changed.", "changes_unsaved": "Your changes were not applied. Check your input.", "invalid": "Input invalid", @@ -55,7 +57,7 @@ "password": "Change password", "cron": "Set frequency", "time": "Set period", - "export": "Export tests", + "storage": "Manage storage", "pause_tests": "Pause tests", "resume_tests": "Resume tests", "language": "Change language", @@ -78,10 +80,6 @@ "rare": "Rarely (every 3 hours)", "really_rare": "Very rarely (every 6 hours)" }, - "export": { - "json": "JSON file", - "csv": "CSV file" - }, "level": { "no_access": "No Access", "read_access": "Read-only Access" @@ -107,7 +105,6 @@ "cron_rules": "Cron rule", "cron_next_test": "Next Test:", "time_title": "Show tests of the last ...", - "export_title": "Export speedtests", "download": "Download", "pause_title": "Pause speedtests for...", "hours": "Hours", @@ -130,6 +127,33 @@ "description": "This feature is still in beta. If you find any bugs, please report them here." } }, + "storage": { + "speedtests": "Speedtests", + "configuration": "Configuration", + "stored_tests": "Stored tests", + "tests": "Tests", + "export_tests": "Export tests", + "tests_exported": "The tests have been exported", + "csv": "CSV", + "json": "JSON", + "import_tests": "Import tests", + "tests_imported": "The tests have been imported", + "import_error": "An error occurred while importing the tests", + "export": "Export", + "import": "Import", + "clear_history": "Clear history", + "history_cleared": "The history has been cleared", + "delete": "Delete", + "confirm_delete": "Yes, delete", + "export_settings": "Export settings", + "import_settings": "Import settings", + "factory_reset": "Factory reset", + "factory_reset_completed": "The factory reset has been completed", + "reset": "Reset", + "confirm_reset": "Yes, reset", + "settings_exported": "The settings have been exported", + "settings_imported": "The settings have been imported" + }, "latest": { "ping": "Ping", "ping_unit": "ms", @@ -140,7 +164,7 @@ "before": "before" }, "info": { - "credits": "MySpeed is provided by GNMYT and uses the Speedtest CLI from Ookla.", + "credits": "MySpeed is a open source project provided by GNMYT. Leave a star on GitHub or donate to support the project.", "recommendations_error": "You have to do at least 10 tests to get an average. It doesn't matter if the tests were done manually or automatically.", "recommendations_info": "Based on the last 10 tests, it was found that the optimal ping was {{ping}} ms, the download at {{down}} Mbps and the upload at {{up}} Mbps. It is best to orientate yourself on your internet contract and only adopt it if it matches that.", "update": "An update to version {{version}} is available. See the changes and download the update.", diff --git a/client/src/common/components/Dropdown/DropdownComponent.jsx b/client/src/common/components/Dropdown/DropdownComponent.jsx index 15c947ff..b176f82a 100644 --- a/client/src/common/components/Dropdown/DropdownComponent.jsx +++ b/client/src/common/components/Dropdown/DropdownComponent.jsx @@ -7,7 +7,6 @@ import { faCircleNodes, faClock, faClose, - faFileExport, faChartSimple, faGear, faGlobeEurope, @@ -18,15 +17,15 @@ import { faPlay, faWandMagicSparkles, faCheck, - faExclamationTriangle, faSliders + faExclamationTriangle, faSliders, faHardDrive } from "@fortawesome/free-solid-svg-icons"; import {ConfigContext} from "@/common/contexts/Config"; import {StatusContext} from "@/common/contexts/Status"; import {InputDialogContext} from "@/common/contexts/InputDialog"; import {SpeedtestContext} from "@/common/contexts/Speedtests"; -import {baseRequest, downloadRequest, jsonRequest, patchRequest, postRequest} from "@/common/utils/RequestUtil"; +import {baseRequest, jsonRequest, patchRequest, postRequest} from "@/common/utils/RequestUtil"; import {creditsInfo, recommendationsInfo} from "@/common/components/Dropdown/utils/infos"; -import {exportOptions, levelOptions, selectOptions, timeOptions} from "@/common/components/Dropdown/utils/options"; +import {levelOptions, selectOptions, timeOptions} from "@/common/components/Dropdown/utils/options"; import {parseCron, stringifyCron} from "@/common/components/Dropdown/utils/utils"; import {t} from "i18next"; import ViewDialog from "@/common/components/ViewDialog"; @@ -36,6 +35,7 @@ import {NodeContext} from "@/common/contexts/Node"; import {IntegrationDialog} from "@/common/components/IntegrationDialog"; import LanguageDialog from "@/common/components/LanguageDialog"; import ProviderDialog from "@/common/components/ProviderDialog"; +import StorageDialog from "@/common/components/StorageDialog"; let icon; @@ -66,6 +66,7 @@ function DropdownComponent() { const [showIntegrationDialog, setShowIntegrationDialog] = useState(false); const [showLanguageDialog, setShowLanguageDialog] = useState(false); const [showProviderDialog, setShowProviderDialog] = useState(false); + const [showStorageDialog, setShowStorageDialog] = useState(false); const ref = useRef(); useEffect(() => { @@ -192,17 +193,6 @@ function DropdownComponent() { }); } - function exportDialog() { - setDialog({ - select: true, - title: t("update.export_title"), - buttonText: t("update.download"), - value: "json", - selectOptions: exportOptions(), - onSuccess: value => downloadRequest("/export/" + value) - }); - } - const togglePause = () => { if (!status.paused) { setDialog({ @@ -228,9 +218,9 @@ function DropdownComponent() { {run: recommendedSettings, icon: faWandMagicSparkles, text: t("dropdown.recommendations")}, {hr: true, key: 1}, {run: () => setShowProviderDialog(true), icon: faSliders, text: t("dropdown.change_provider")}, + {run: () => setShowStorageDialog(true), icon: faHardDrive, text: t("dropdown.storage")}, {run: updatePassword, icon: faKey, text: t("dropdown.password"), previewHidden: true}, {run: updateCron, icon: faClock, text: t("dropdown.cron")}, - {run: exportDialog, icon: faFileExport, text: t("dropdown.export")}, {run: togglePause, icon: status.paused ? faPlay : faPause, text: t("dropdown." + (status.paused ? "resume_tests" : "pause_tests"))}, {run: () => setShowIntegrationDialog(true), icon: faCircleNodes, text: t("dropdown.integrations")}, {hr: true, key: 2}, @@ -247,6 +237,7 @@ function DropdownComponent() { {showIntegrationDialog && setShowIntegrationDialog(false)}/>} {showLanguageDialog && setShowLanguageDialog(false)}/>} {showProviderDialog && setShowProviderDialog(false)}/>} + {showStorageDialog && setShowStorageDialog(false)}/>}