Skip to content

Commit

Permalink
merge with master
Browse files Browse the repository at this point in the history
  • Loading branch information
mman committed Sep 27, 2024
2 parents d1344a8 + c32f4d9 commit 3d2b5db
Show file tree
Hide file tree
Showing 14 changed files with 63 additions and 16 deletions.
34 changes: 26 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@testing-library/user-event": "^14.5.2",
"@typescript-eslint/eslint-plugin": "^5.48.2",
"@typescript-eslint/parser": "^5.48.2",
"@victronenergy/mfd-modules": "^7.0.2",
"@victronenergy/mfd-modules": "^7.1.1",
"axios": "^0.28.1",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.6.0",
Expand Down Expand Up @@ -70,6 +70,7 @@
"react-error-boundary": "^4.0.13",
"react-i18nify": "^6.1.3",
"react-refresh": "^0.14.2",
"react-qrcode-logo": "^3.0.0",
"react-svg-loader": "^3.0.3",
"resolve": "^1.22.8",
"resolve-url-loader": "^5.0.0",
Expand Down
4 changes: 2 additions & 2 deletions public/Marine/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Victron MFD",
"short_name": "Victron MFD",
"description": "Victron Marine MFD",
"start_url": ".",
"start_url": "/app",
"icons": [
{
"src": "favicon.ico",
Expand All @@ -23,4 +23,4 @@
"theme_color": "#1f2535",
"background_color": "#1f2535",
"display": "standalone"
}
}
4 changes: 2 additions & 2 deletions public/Marine2/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Victron MFD",
"short_name": "Victron MFD",
"description": "Victron Marine MFD",
"start_url": ".",
"start_url": "/app",
"icons": [
{
"src": "favicon.ico",
Expand All @@ -23,4 +23,4 @@
"theme_color": "#1f2535",
"background_color": "#1f2535",
"display": "standalone"
}
}
19 changes: 19 additions & 0 deletions src/app/Marine2/components/ui/RemoteConsole/RemoteConsole.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { observer } from "mobx-react-lite"
import classnames from "classnames"
import { translate, Translate } from "react-i18nify"
import useSize from "@react-hook/size"
import { useApp } from "@victronenergy/mfd-modules"
import { QRCode } from "react-qrcode-logo"

const RemoteConsole = ({ host, width, height }: Props) => {
const iframeRef = useRef<HTMLIFrameElement>(null)
Expand All @@ -12,11 +14,28 @@ const RemoteConsole = ({ host, width, height }: Props) => {
const loading = !iframeLoaded
const protocol = (typeof window !== "undefined" && window.location.protocol) || "http:"
const url = protocol + "//" + host
const app = useApp()

useEffect(() => {
iframeRef.current?.focus()
}, [iframeLoaded])

console.log(`Venus Running GUI version: ${app.guiVersion}`)

const consoleUrl = `${window.location.protocol}//venus.local/`

if (app.guiVersion !== 1) {
return (
<div className="flex flex-col items-center w-2/3 md:w-1/3 space-y-4">
<QRCode value={consoleUrl} />
<label className="text-xs text-victron-gray-400 sm-l:text-sm dark:text-victron-gray-500">{consoleUrl}</label>
<label className="text-xs text-victron-gray-400 sm-l:text-sm dark:text-victron-gray-500 text-center">
<Translate value={"error.remoteConsole.qrCodeMessage"} />
</label>
</div>
)
}

return (
<>
{
Expand Down
3 changes: 2 additions & 1 deletion src/app/locales/languages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"off": "Aus",
"on": "Ein",
"passthru": "Durchleitung",
"pending": "Noch ausstehend",
"pending": "Ausstehend",
"powerSupplyMode": "Stromversorgungsmodus",
"remainingTime": "Restzeit",
"running": "In Betrieb",
Expand Down Expand Up @@ -143,6 +143,7 @@
"queryParams": "Abfrageparameter: %{queryParams}",
"remoteConsole": {
"connectionFailed": "Verbindung zum GX-Gerät nicht möglich",
"qrCodeMessage": "Um auf die GX-Fernbedienungskonsole zuzugreifen, vergewissern Sie sich, dass sich Ihr Telefon im selben WiFi-Netzwerk befindet wie das GX-Gerät, und scannen Sie dann diesen QR-Code.",
"screenTooSmall": "Auf einem größeren Bildschirm öffnen, um die Remote-Konsole anzuzeigen"
},
"userAgent": "User agent: %{userAgent}",
Expand Down
1 change: 1 addition & 0 deletions src/app/locales/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
"queryParams": "Query params: %{queryParams}",
"remoteConsole": {
"connectionFailed": "Unable to connect to the GX device",
"qrCodeMessage": "To access the GX Remote Console, make sure your phone is on the same WiFi network as the GX device and then scan this QR code.",
"screenTooSmall": "Open in a larger screen to view remote console"
},
"userAgent": "User agent: %{userAgent}",
Expand Down
3 changes: 2 additions & 1 deletion src/app/locales/languages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
"queryParams": "Query params: %{queryParams}",
"remoteConsole": {
"connectionFailed": "Pas possible de se connecter à l'appareil GX",
"qrCodeMessage": "Pour accéder à la console à distance GX, assurez-vous que votre téléphone est sur le même réseau Wi-Fi que l'appareil GX, puis scannez ce code QR.",
"screenTooSmall": "Ouvrir dans un écran plus large pour visualiser la console à distance"
},
"userAgent": "User agent: %{userAgent}",
Expand Down Expand Up @@ -256,7 +257,7 @@
"vrmPortID": "ID Portail VRM"
},
"widgets": {
"acLoads": "Charges AC",
"acLoads": "Charges CA",
"batteries": "Batteries",
"battery": "Batterie",
"batteryWithName": "Batterie: : %{name}",
Expand Down
1 change: 1 addition & 0 deletions src/app/locales/languages/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
"queryParams": "Zoek : %{queryParams}",
"remoteConsole": {
"connectionFailed": "Verbinding met GX apparaat mislukt",
"qrCodeMessage": "Om toegang te krijgen tot de GX Remote Console, moet ervoor gezorgd worden dat de telefoon zich op hetzelfde WiFi-netwerk bevindt als het GX-apparaat en vervolgens moet deze QR-code gescanned worden.",
"screenTooSmall": "Open in een groter scherm om het Remote Console te zien"
},
"userAgent": "Gebruiker : %{userAgent}",
Expand Down
3 changes: 2 additions & 1 deletion src/app/locales/languages/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"off": "Wył.",
"on": "Wł.",
"passthru": "Przepuszczanie",
"pending": "W oczekiwaniu...",
"pending": "W toku",
"powerSupplyMode": "Tryb zasilania",
"remainingTime": "Pozostały czas",
"running": "Działa",
Expand Down Expand Up @@ -143,6 +143,7 @@
"queryParams": "Parametry zapytania: %{queryParams}",
"remoteConsole": {
"connectionFailed": "Nie można połączyć się z urządzeniem GX",
"qrCodeMessage": "Aby uzyskać dostęp do konsoli GX Remote, upewnij się, że Twój telefon jest w tej samej sieci Wi-Fi, co urządzenie GX, a następnie zeskanuj ten kod QR.",
"screenTooSmall": "Otwórz na większym ekranie, aby wyświetlić konsolę zdalną"
},
"userAgent": "Agent użytkownika: %{userAgent}",
Expand Down
1 change: 1 addition & 0 deletions src/app/locales/languages/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
"queryParams": "queryParams",
"remoteConsole": {
"connectionFailed": "connectionFailed",
"qrCodeMessage": "qrCodeMessage",
"screenTooSmall": "screenTooSmall"
},
"userAgent": "userAgent",
Expand Down
1 change: 1 addition & 0 deletions src/app/locales/languages/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
"queryParams": "Query params: %{queryParams}",
"remoteConsole": {
"connectionFailed": "GX cihazına bağlanılamıyor",
"qrCodeMessage": "GX Remote Console'a erişmek için telefonunuzun GX cihazıyla aynı WiFi ağında olduğundan emin olun ve ardından bu QR kodunu tarayın.",
"screenTooSmall": "Uzak konsolu görüntülemek için daha büyük bir ekranda açın"
},
"userAgent": "User agent: %{userAgent}",
Expand Down
1 change: 1 addition & 0 deletions src/app/locales/languages/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
"queryParams": "параметри запиту",
"remoteConsole": {
"connectionFailed": "підключення не відбулося",
"qrCodeMessage": "Щоб отримати доступ до GX Консолі, переконайтеся, що ваш телефон у тій самій мережі Wi-Fi, що й пристрій GX, а потім відскануйте цей QR-код.",
"screenTooSmall": "занадто малий екран"
},
"userAgent": "користувацький агент",
Expand Down
1 change: 1 addition & 0 deletions src/app/locales/languages/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
"queryParams": "查询参数: %{queryParams}",
"remoteConsole": {
"connectionFailed": "无法连接到 GX 设备",
"qrCodeMessage": "要访问 GX 远程控制台,请确保您的手机与 GX 设备位于同一 WiFi 网络上,然后扫描此二维码。",
"screenTooSmall": "在大屏幕中打开以查看远程控制台"
},
"userAgent": "用户代理: %{userAgent}",
Expand Down

0 comments on commit 3d2b5db

Please sign in to comment.