Skip to content

Commit e500d78

Browse files
authored
Merge pull request #301 from gnmyt/optimizations/1.0.8
🆕 Version 1.0.8 - Update
2 parents cb3db06 + 7b55559 commit e500d78

39 files changed

+175
-61
lines changed

client/index.html

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
<!DOCTYPE html>
2-
<html lang="de">
2+
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
5-
<link rel="icon" href="/favicon.ico" />
5+
<link rel="icon" href="/assets/img/favicon.ico" />
66
<meta name="viewport" content="width=device-width, initial-scale=1" />
77
<meta name="theme-color" content="#232835" />
8-
<meta property="og:image" content="/logo.png" />
8+
<meta property="og:image" content="/assets/img/logo.png" />
99
<meta name="description"
1010
content="A speed test analysis software that shows your internet speed for up to 30 days"
1111
/>
12-
<link rel="preconnect" href="https://fonts.googleapis.com">
13-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
14-
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700;900&display=swap" rel="stylesheet">
15-
<link rel="apple-touch-icon" href="/logo192.png" />
12+
<link rel="apple-touch-icon" href="/assets/img/logo192.png" />
1613
<link rel="manifest" href="/manifest.json" />
1714
<title>MySpeed</title>
1815
</head>

client/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "client",
3-
"version": "1.0.7",
3+
"version": "1.0.8",
44
"scripts": {
55
"dev": "vite",
66
"build": "vite build",
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.

client/public/locales/de.json renamed to client/public/assets/locales/de.json

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,20 @@
281281
"display_name": "Anzeigename",
282282
"display_name_placeholder": "MySpeed Benachrichtigung",
283283
"error_message": "Fehlernachricht",
284-
"error_message_placeholder": "Fehler: %upload%",
284+
"error_message_placeholder": "Fehler: %error%",
285+
"send_failed": "Fehlernachrichten senden",
286+
"send_finished": "Abgeschlossene senden",
287+
"finished_message": "Abgeschlossen-Nachricht",
288+
"finished_message_placeholder": "%ping% ms, %download% Mbit/s, %upload% Mbit/s"
289+
}
290+
},
291+
"gotify": {
292+
"title": "Gotify",
293+
"fields": {
294+
"url": "Server-URL",
295+
"key": "Anwendungs-Token",
296+
"error_message": "Fehlernachricht",
297+
"error_message_placeholder": "Fehler: %error%",
285298
"send_failed": "Fehlernachrichten senden",
286299
"send_finished": "Abgeschlossene senden",
287300
"finished_message": "Abgeschlossen-Nachricht",
@@ -301,7 +314,7 @@
301314
"token": "Bot Token",
302315
"chat_id": "Chat ID",
303316
"error_message": "Fehlernachricht",
304-
"error_message_placeholder": "Fehler: %upload%",
317+
"error_message_placeholder": "Fehler: %error%",
305318
"send_failed": "Fehlernachrichten senden",
306319
"send_finished": "Abgeschlossene senden",
307320
"finished_message": "Abgeschlossen-Nachricht",

client/public/locales/en.json renamed to client/public/assets/locales/en.json

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,20 @@
281281
"display_name": "Display name",
282282
"display_name_placeholder": "MySpeed Notification",
283283
"error_message": "Error message",
284-
"error_message_placeholder": "Error: %upload%",
284+
"error_message_placeholder": "Error: %error%",
285+
"send_failed": "Send error messages",
286+
"send_finished": "Send finished messages",
287+
"finished_message": "Finished message",
288+
"finished_message_placeholder": "%ping% ms, %download% Mbps, %upload% Mbps"
289+
}
290+
},
291+
"gotify": {
292+
"title": "Gotify",
293+
"fields": {
294+
"url": "Server-URL",
295+
"key": "App token",
296+
"error_message": "Error message",
297+
"error_message_placeholder": "Error: %error%",
285298
"send_failed": "Send error messages",
286299
"send_finished": "Send finished messages",
287300
"finished_message": "Finished message",
@@ -301,7 +314,7 @@
301314
"token": "Bot Token",
302315
"chat_id": "Chat ID",
303316
"error_message": "Error message",
304-
"error_message_placeholder": "Error: %upload%",
317+
"error_message_placeholder": "Error: %error%",
305318
"send_failed": "Send error messages",
306319
"send_finished": "Send finished messages",
307320
"finished_message": "Finished message",

client/public/manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
"description": "A speed test analysis software that shows your internet speed for up to 30 days",
55
"icons": [
66
{
7-
"src": "favicon.ico",
7+
"src": "/assets/img/favicon.ico",
88
"sizes": "64x64 32x32 24x24 16x16",
99
"type": "image/x-icon"
1010
},
1111
{
12-
"src": "logo192.png",
12+
"src": "/assets/img/logo192.png",
1313
"type": "image/png",
1414
"sizes": "192x192",
1515
"purpose": "maskable"
1616
},
1717
{
18-
"src": "logo.png",
18+
"src": "/assets/img/logo.png",
1919
"type": "image/png",
2020
"sizes": "512x512"
2121
}

client/src/App.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import './App.sass';
1+
import "@/common/styles/default.sass";
2+
import "@/common/styles/fonts.sass";
3+
import "@/common/styles/spinner.sass";
24
import Home from "./pages/Home";
35
import HeaderComponent from "./common/components/Header";
46
import {SpeedtestProvider} from "./common/contexts/Speedtests";
@@ -8,7 +10,6 @@ import {InputDialogProvider} from "@/common/contexts/InputDialog/InputDialog";
810
import {useContext, useState} from "react";
911
import i18n from './i18n';
1012
import Loading from "@/pages/Loading";
11-
import "@/common/styles/spinner.sass";
1213
import Error from "@/pages/Error";
1314
import {ViewContext, ViewProvider} from "@/common/contexts/View";
1415
import Statistics from "@/pages/Statistics";

client/src/common/components/IntegrationDialog/IntegrationDialog.jsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,16 @@ export const IntegrationDialog = (props) => {
5353

5454
useEffect(() => {
5555
jsonRequest("/integrations")
56-
.then(data => setIntegrationData(data))
57-
.catch(err => console.log(err));
56+
.then(data => setIntegrationData(data));
5857

5958
jsonRequest("/integrations/active")
60-
.then(data => setActiveData(data.map(item => ({...item, uuid: uuid()}))))
61-
.catch(err => console.log(err));
59+
.then(data => setActiveData(data.map(item => ({...item, uuid: uuid()}))));
6260
}, []);
6361

6462
return (
6563
<>
66-
<DialogProvider close={props.onClose}>
67-
{!integrationData || !activeData && <div className="lds-ellipsis"><div/><div/><div/><div/></div>}
64+
<DialogProvider close={props.onClose} customClass={(!integrationData || !activeData) ? "dialog-loading" : ""}>
65+
{(!integrationData || !activeData) && <div className="lds-ellipsis"><div/><div/><div/><div/></div>}
6866
{integrationData && activeData && <Dialog integrations={integrationData} active={activeData} setActive={setActiveData}/>}
6967
</DialogProvider>
7068
</>

client/src/common/components/IntegrationDialog/components/AvailableIntegrations/styles.sass

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
flex-direction: column
66
gap: 0.5rem
77
user-select: none
8+
overflow-x: hidden
9+
overflow-y: scroll
810

911
.integration-tab
1012
display: flex

client/src/common/components/IntegrationDialog/components/IntegrationItem/components/IntegrationItemHeader/IntegrationItemHeader.jsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,21 @@ import {
1010
faTrashArrowUp
1111
} from "@fortawesome/free-solid-svg-icons";
1212
import "./styles.sass";
13+
import {useEffect, useState} from "react";
1314

1415
export const IntegrationItemHeader = ({integration, displayName, unsavedChanges, changesConfirmed, saveIntegration,
15-
deleteConfirmed, deleteIntegration, open, setOpen, data}) => (
16+
deleteConfirmed, deleteIntegration, open, setOpen, data}) => {
17+
const [lastActivity, setLastActivity] = useState(generateRelativeTime(data.lastActivity));
18+
19+
useEffect(() => {
20+
const interval = setInterval(() => {
21+
if (data.lastActivity !== null) setLastActivity(generateRelativeTime(data.lastActivity));
22+
}, 1000);
23+
24+
return () => clearInterval(interval);
25+
});
26+
27+
return (
1628
<div className="integration-item-header">
1729
<div className="integration-item-left">
1830
<FontAwesomeIcon icon={integration.icon} className="integration-item-icon"/>
@@ -23,7 +35,7 @@ export const IntegrationItemHeader = ({integration, displayName, unsavedChanges,
2335
: (data.lastActivity === null || !data.lastActivity ? "inactive" : "active"))}/>
2436

2537
<p>{data.activityFailed ? t("failed") : (data.lastActivity === null || !data.lastActivity
26-
? t("integrations.activity.never_executed") : t("integrations.activity.last_run") + generateRelativeTime(data.lastActivity))}</p>
38+
? t("integrations.activity.never_executed") : t("integrations.activity.last_run") + lastActivity)}</p>
2739
</div>
2840
</div>
2941
</div>
@@ -41,4 +53,4 @@ export const IntegrationItemHeader = ({integration, displayName, unsavedChanges,
4153
className="integration-green"/>
4254
</div>
4355
</div>
44-
)
56+
)}

client/src/common/components/IntegrationDialog/styles.sass

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
gap: 0.5rem
1616
overflow-y: scroll
1717
overflow-x: clip
18-
width: 100%
18+
width: 70%
1919

2020
@media (max-width: 781px)
2121
.integration-dialog
@@ -27,4 +27,5 @@
2727
flex-direction: column
2828

2929
.integrations-tab
30-
max-height: 15rem
30+
max-height: 15rem
31+
width: 100%

client/src/common/components/LoadingDialog/LoadingDialog.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ export const LoadingDialog = (props) => {
55

66
return (
77
<>
8-
{props.isOpen && <DialogProvider disableClosing={true} customClass="dialog-speedtest">
9-
<div className="dialog-speedtest">
8+
{props.isOpen && <DialogProvider disableClosing={true} customClass="dialog-loading">
109
<div className="lds-ellipsis">
1110
<div/><div/><div/><div/>
1211
</div>
13-
</div>
1412
</DialogProvider>}
1513
</>
1614
)

client/src/App.sass renamed to client/src/common/styles/default.sass

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import "./common/styles/colors"
1+
@import "colors"
22

33
body, html
44
margin: 0

client/src/common/styles/fonts.sass

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
@font-face
2+
font-display: swap
3+
font-family: 'Inter'
4+
font-style: normal
5+
font-weight: 300
6+
src: url('/assets/fonts/inter-v12-latin-300.woff2') format("woff2"), url('/assets/fonts/inter-v12-latin-300.ttf') format("truetype")
7+
8+
@font-face
9+
font-display: swap
10+
font-family: 'Inter'
11+
font-style: normal
12+
font-weight: 400
13+
src: url('/assets/fonts/inter-v12-latin-regular.woff2') format("woff2"), url('/assets/fonts/inter-v12-latin-regular.ttf') format("truetype")
14+
15+
@font-face
16+
font-display: swap
17+
font-family: 'Inter'
18+
font-style: normal
19+
font-weight: 500
20+
src: url('/assets/fonts/inter-v12-latin-500.woff2') format("woff2"), url('/assets/fonts/inter-v12-latin-500.ttf') format("truetype")
21+
22+
@font-face
23+
font-display: swap
24+
font-family: 'Inter'
25+
font-style: normal
26+
font-weight: 700
27+
src: url('/assets/fonts/inter-v12-latin-700.woff2') format("woff2"), url('/assets/fonts/inter-v12-latin-700.ttf') format("truetype")
28+
29+
@font-face
30+
font-display: swap
31+
font-family: 'Inter'
32+
font-style: normal
33+
font-weight: 900
34+
src: url('/assets/fonts/inter-v12-latin-900.woff2') format("woff2"), url('/assets/fonts/inter-v12-latin-900.ttf') format("truetype")

client/src/i18n.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ i18n.use(initReactI18next).use(LanguageDetector).use(HttpApi).init({
1010
supportedLngs: ['en', 'de'],
1111
fallbackLng: 'en',
1212
backend: {
13-
loadPath: '/locales/{{lng}}.json'
13+
loadPath: '/assets/locales/{{lng}}.json'
1414
},
1515
detection: {
1616
order: ['localStorage'],

client/src/pages/Home/components/TestArea/TestAreaComponent.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ function TestArea() {
1717
return (
1818
<div className="speedtest-area">
1919
{speedtests.map ? speedtests.map(test => {
20-
let date = new Date(Date.parse(test.created));
20+
const dateArray = test.created.split("-").map((value) => parseInt(value));
21+
const date = test.type === "average" ? new Date(dateArray[0], dateArray[1] - 1, dateArray[2])
22+
: new Date(Date.parse(test.created));
2123

2224
let item = localStorage.getItem("testTime");
2325
if ((item === "3" || item === "4") && test.type !== "average") return;

client/src/pages/Nodes/components/NodeHeader/NodeHeader.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import "./styles.sass";
33
export const NodeHeader = () => {
44
return (
55
<div className="node-header">
6-
<img src="/logo192.png" alt="Logo"/>
6+
<img src="/assets/img/logo192.png" alt="Logo"/>
77
<h1>MySpeed</h1>
88
</div>
99
)

client/vite.config.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
1-
import react from '@vitejs/plugin-react'
2-
import path from "path";
1+
import react from "@vitejs/plugin-react";
32
import {VitePWA} from "vite-plugin-pwa";
3+
import path from "path";
44

55
export default {
66
plugins: [
7-
VitePWA({ injectRegister: 'auto' }),
7+
VitePWA({injectRegister: "auto", manifest: false}),
88
react()
99
],
1010
build: {
11-
outDir: 'build'
11+
outDir: "build",
12+
chunkSizeWarningLimit: 1600,
13+
rollupOptions: {
14+
output: {
15+
manualChunks(id) {
16+
if (id.includes('node_modules'))
17+
return id.includes('@fortawesome') ? 'icons' : 'vendor';
18+
}
19+
}
20+
}
1221
},
1322
resolve: {
1423
alias: {
15-
'@': path.resolve(__dirname, './src'),
24+
"@": path.resolve(__dirname, "./src"),
1625
},
1726
},
1827
server: {

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "myspeed",
3-
"version": "1.0.7",
3+
"version": "1.0.8",
44
"scripts": {
55
"client": "cd client && npm run dev",
66
"server": "nodemon server",
@@ -17,8 +17,8 @@
1717
"express": "^4.18.2",
1818
"node-schedule": "^2.1.1",
1919
"sequelize": "^6.31.1",
20-
"tmp": "^0.2.1",
21-
"sqlite3": "^5.1.6"
20+
"sqlite3": "^5.1.6",
21+
"tmp": "^0.2.1"
2222
},
2323
"devDependencies": {
2424
"concurrently": "^8.0.1",

server/controller/config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ const configDefaults = {
99
"serverId": "none",
1010
"password": "none",
1111
"passwordLevel": "none",
12-
"acceptOoklaLicense": "false",
13-
"healthChecksUrl": "https://hc-ping.com/<uuid>"
12+
"acceptOoklaLicense": "false"
1413
}
1514

1615
module.exports.insertDefaults = async () => {

0 commit comments

Comments
 (0)