-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from gnmyt/updates/optimizations
🚀 Optimierungen am Code
- Loading branch information
Showing
33 changed files
with
6,695 additions
and
1,705 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
380 changes: 142 additions & 238 deletions
380
client/src/common/components/Dropdown/DropdownComponent.jsx
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export const healthChecksInfo = <>MySpeed verwendet <a href="https://healthchecks.io/" target="_blank">Healthchecks</a>, | ||
um dich zu benachrichtigen, wenn dein Internet ausfällt. Um dies zu aktivieren, setze deine Ping URL in das Textfeld | ||
ein. Mehr dazu <a href="https://myspeed.gnmyt.dev/instructions/settings/" target="_blank">hier</a></>; | ||
|
||
export const creditsInfo = <><a href="https://github.com/gnmyt/myspeed" target="_blank" | ||
rel="noreferrer">MySpeed</a> wird von GNMYT bereitgestellt und verwendet die <a | ||
href="https://www.speedtest.net/apps/cli" target="_blank" rel="noreferrer">Speedtest-CLI</a> von Ookla.</>; | ||
|
||
export const recommendationsError = <>Du musst mindestens 10 Tests machen, damit ein Durchschnitt ermittelt werden kann. | ||
Ob die Tests manuell oder automatisch durchgeführt wurden ist egal.</>; | ||
|
||
export const recommendationsInfo = (ping, download, upload) => <>Anhand der letzten 10 Testergebnisse wurde | ||
festgestellt, dass der optimale Ping bei <span className="dialog-value">{ping} ms</span>, der Download bei <span | ||
className="dialog-value">{download} Mbit/s </span>und der Upload bei <span | ||
className="dialog-value">{upload} Mbit/s</span> liegt. <br/>Orientiere dich am besten an deinem Internetvertrag | ||
und übernehme es nur, wenn es mit dem übereinstimmt.</>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export const timeOptions = { | ||
1: "24 Stunden (Standard)", | ||
2: "2 Tage (Insgesamt)", | ||
3: "7 Tage (Durchschnitt)", | ||
4: "30 Tage (Durchschnitt)" | ||
}; | ||
|
||
export const selectOptions = { | ||
"* * * * *": "Durchgehend (jede Minute)", | ||
"0,30 * * * *": "Sehr häufig (alle 30 Minuten)", | ||
"0 * * * *": "Standard (jede Stunde)", | ||
"0 0,3,6,9,12,15,18,21 * * *": "Selten (alle 3 Stunden)", | ||
"0 0,6,12,18 * * *": "Sehr selten (alle 6 Stunden)" | ||
} | ||
|
||
export const exportOptions = { | ||
json: "JSON-Datei", | ||
csv: "CSV-Datei" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {parseExpression} from "cron-parser"; | ||
|
||
// Parses cron as a locale string | ||
export const parseCron = (cron) => { | ||
try { | ||
return parseExpression(cron).next().toDate().toLocaleString() | ||
} catch (e) { | ||
return <span className="icon-orange">Eingabe ungültig</span>; | ||
} | ||
} | ||
|
||
// Fixes the cron provided by the user | ||
export const stringifyCron = (cron) => { | ||
try { | ||
return parseExpression(cron).stringify(); | ||
} catch (e) { | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export const updateInfo = (update) => <>Ein Update auf die Version {update} ist verfügbar. Sieh dir <a target="_blank" | ||
href="https://github.com/gnmyt/myspeed/releases/latest" | ||
rel="noreferrer">die | ||
Änderungen an</a> und <a target="_blank" href="https://myspeed.gnmyt.dev/setup/linux/" rel="noreferrer">lade dir das | ||
Update herunter</a>.</>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export const passwordRequiredDialog = { | ||
title: "Passwort erforderlich", | ||
placeholder: "Dein Passwort", | ||
description: localStorage.getItem("password") ? <span className="icon-red">Das von dir eingegebene Passwort ist falsch</span> : "", | ||
type: "password", | ||
buttonText: "Fertig", | ||
onClose: () => window.location.reload(), | ||
onSuccess: (value) => { | ||
localStorage.setItem("password", value); | ||
window.location.reload(); | ||
} | ||
} |
Oops, something went wrong.