diff --git a/client/public/assets/locales/en.json b/client/public/assets/locales/en.json index 9e5ed747..66adf751 100644 --- a/client/public/assets/locales/en.json +++ b/client/public/assets/locales/en.json @@ -15,14 +15,16 @@ "wrong": "The password you entered is incorrect", "unlock": "Unlock" }, - "accept": { - "title": "We need your permission", - "description": "We use services from Ookla. By clicking Accept, you acknowledge that you have read and agree to Ookla's EULA, Privacy Statement and Terms of Use.", - "button": "Accept" - }, "api": { "title": "API not reachable", "description": "MySpeed could not reach the API of this instance. Please try again later." + }, + "provider": { + "server": "Server", + "server_id": "Server ID", + "choose_automatically": "Choose automatically", + "ookla_license": "I have read and accept the EULA, privacy policy and terms of service of Ookla.", + "cloudflare_note": "Cloudflare does not require any additional settings" } }, "dropdown": { @@ -35,7 +37,7 @@ "upload": "Optimal up-speed", "download": "Optimal down-speed", "recommendations": "Recommendations", - "server": "Change Server", + "change_provider": "Change provider", "password": "Change password", "cron": "Set frequency", "time": "Set period", @@ -80,10 +82,8 @@ "download_placeholder": "Down speed (Mbps)", "recommendations_title": "Optimal recommendations", "recommendations_set": "Set automatic recommendations?", - "server_title": "Set speedtest server", + "provider_title": "Set speedtest provider", "manually": "Set manually", - "manual_server_title": "Set speedtest server", - "manual_server_id": "Server ID", "new_password": "Set a new password", "password_placeholder": "New password", "password_removed": "The password lock has been removed and the set password has been removed.", diff --git a/client/src/common/components/Dropdown/DropdownComponent.jsx b/client/src/common/components/Dropdown/DropdownComponent.jsx index b80968fe..15c947ff 100644 --- a/client/src/common/components/Dropdown/DropdownComponent.jsx +++ b/client/src/common/components/Dropdown/DropdownComponent.jsx @@ -16,10 +16,9 @@ import { faPause, faPingPongPaddleBall, faPlay, - faServer, faWandMagicSparkles, faCheck, - faExclamationTriangle + faExclamationTriangle, faSliders } from "@fortawesome/free-solid-svg-icons"; import {ConfigContext} from "@/common/contexts/Config"; import {StatusContext} from "@/common/contexts/Status"; @@ -36,6 +35,7 @@ import {ToastNotificationContext} from "@/common/contexts/ToastNotification"; import {NodeContext} from "@/common/contexts/Node"; import {IntegrationDialog} from "@/common/components/IntegrationDialog"; import LanguageDialog from "@/common/components/LanguageDialog"; +import ProviderDialog from "@/common/components/ProviderDialog"; let icon; @@ -65,6 +65,7 @@ function DropdownComponent() { const [showViewDialog, setShowViewDialog] = useState(false); const [showIntegrationDialog, setShowIntegrationDialog] = useState(false); const [showLanguageDialog, setShowLanguageDialog] = useState(false); + const [showProviderDialog, setShowProviderDialog] = useState(false); const ref = useRef(); useEffect(() => { @@ -130,19 +131,6 @@ function DropdownComponent() { } else setDialog({title: t("update.recommendations_title"), description: t("info.recommendations_error"), buttonText: t("dialog.okay")}); } - const updateServer = () => patchDialog("serverId", async (value) => ({ - title: t("update.server_title"), - select: true, - selectOptions: await jsonRequest("/info/server"), - unsetButton: t("update.manually"), - onClear: updateServerManually, - value - })); - - const updateServerManually = () => patchDialog("serverId", (value) => ({ - title: t("update.manual_server_title"), placeholder: t("update.manual_server_id"), type: "number", value: value, - })); - const updatePassword = async () => { const passwordSet = currentNode !== 0 ? findNode(currentNode).password : localStorage.getItem("password") != null; @@ -239,7 +227,7 @@ function DropdownComponent() { {run: updateDownload, icon: faArrowDown, text: t("dropdown.download")}, {run: recommendedSettings, icon: faWandMagicSparkles, text: t("dropdown.recommendations")}, {hr: true, key: 1}, - {run: updateServer, icon: faServer, text: t("dropdown.server")}, + {run: () => setShowProviderDialog(true), icon: faSliders, text: t("dropdown.change_provider")}, {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")}, @@ -258,6 +246,7 @@ function DropdownComponent() { {showViewDialog && setShowViewDialog(false)}/>} {showIntegrationDialog && setShowIntegrationDialog(false)}/>} {showLanguageDialog && setShowLanguageDialog(false)}/>} + {showProviderDialog && setShowProviderDialog(false)}/>}