diff --git a/README.md b/README.md index 7ae599fd4..0106deff7 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ The icons may not be reused in other projects without the proper flaticon licens -### 7.2.3 (2024-10-08) +### **WORK IN PROGRESS** - (@GermanBluefox) Corrected some GUI errors - (@GermanBluefox) Ignore error by opening `0_userdata.0` diff --git a/package-lock.json b/package-lock.json index 57d0945ef..dc249eeef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4607,9 +4607,9 @@ "license": "MIT" }, "node_modules/@iobroker/ws-server": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@iobroker/ws-server/-/ws-server-3.0.2.tgz", - "integrity": "sha512-yAAMEUZfFOiHq10Fxn+YOIZidB7tWGQUKnZ70SVEzOvAQX2eCsz4tmCahbQLcagsQGbGq3CR4wU4aHn3NtmqHQ==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@iobroker/ws-server/-/ws-server-3.0.3.tgz", + "integrity": "sha512-MX+zNjl2YGMq4DrF8Kv9tIXXQr1sWWLgMvEXFJriPHQgR4gCevPcLALjU65CRbE/ITw/BzJiHDJJBvZKDxL3Mg==", "license": "MIT", "dependencies": { "ws": "^8.18.0" @@ -52590,7 +52590,7 @@ "@iobroker/socket-classes": "^1.6.1", "@iobroker/webserver": "^1.0.6", "@iobroker/ws": "^2.0.0", - "@iobroker/ws-server": "3.0.2", + "@iobroker/ws-server": "3.0.3", "ajv": "^8.17.1", "archiver": "^7.0.1", "axios": "^1.7.7", diff --git a/packages/admin/io-package.json b/packages/admin/io-package.json index 8076f4834..2a0992a1e 100644 --- a/packages/admin/io-package.json +++ b/packages/admin/io-package.json @@ -19,19 +19,6 @@ "connectionType": "local", "dataSource": "push", "news": { - "7.2.3": { - "en": "Corrected some GUI errors\nIgnore error by opening `0_userdata.0`", - "de": "Einige GUI-Fehler korrigiert\nFehler ignorieren durch Öffnen von `0_userdata.0`", - "ru": "Исправлены некоторые ошибки GUI\nИгнорировать ошибку, открывая `0_userdata.0`", - "pt": "Corrigido alguns erros GUI\nIgnorar erro ao abrir `0_userdata.0`", - "nl": "Enkele GUI-fouten gecorrigeerd\nFout negeren door het openen van ", - "fr": "Correction de certaines erreurs d'interface graphique\nIgnorer l'erreur en ouvrant `0_userdata.0`", - "it": "Corretto alcuni errori GUI\nIgnora errore aprendo `0_userdata.0`", - "es": "Corregido algunos errores de GUI\nIgnora el error al abrir `0_userdata.0`", - "pl": "Poprawiono niektóre błędy GUI\nIgnoruj błąd otwierając '0 _ userdata.0'", - "uk": "Виправлено деякі помилки інтерфейсу\nІм’я користувача `0_userdata.0`", - "zh-cn": "更正了一些图形用户界面错误\n打开 '0_userdata.0' 忽略错误" - }, "7.2.0": { "en": "Added the check of well-known passwords for the linux systems\nAdded the history for the installation from URL\nfixed wrongly displayed repository warning", "de": "Hinzugefügt die Überprüfung der bekannten Passwörter für die Linux-Systeme\nDie Geschichte der Installation von URL hinzugefügt\nfalsch angezeigte repository-warnung", diff --git a/packages/admin/package.json b/packages/admin/package.json index 241c0526b..7b857a07d 100644 --- a/packages/admin/package.json +++ b/packages/admin/package.json @@ -28,7 +28,7 @@ "@iobroker/socket-classes": "^1.6.1", "@iobroker/webserver": "^1.0.6", "@iobroker/ws": "^2.0.0", - "@iobroker/ws-server": "3.0.2", + "@iobroker/ws-server": "3.0.3", "ajv": "^8.17.1", "archiver": "^7.0.1", "axios": "^1.7.7", diff --git a/packages/admin/src-admin/src/components/Instances/InstanceGeneric.tsx b/packages/admin/src-admin/src/components/Instances/InstanceGeneric.tsx index 1d7a1e6cd..b92a15eff 100644 --- a/packages/admin/src-admin/src/components/Instances/InstanceGeneric.tsx +++ b/packages/admin/src-admin/src/components/Instances/InstanceGeneric.tsx @@ -411,6 +411,7 @@ export interface InstanceGenericProps { item: InstanceItem; context: InstanceContext; idx: number; + saveScrollPosition: () => void; } export interface InstanceGenericState { @@ -1255,6 +1256,7 @@ export default abstract class InstanceGeneric< onClick={event => { event.stopPropagation(); event.preventDefault(); + this.props.saveScrollPosition(); Router.doNavigate('tab-instances', 'config', this.props.id); }} > diff --git a/packages/admin/src-admin/src/tabs/Config.tsx b/packages/admin/src-admin/src/tabs/Config.tsx index b13b54223..f9cff5d21 100644 --- a/packages/admin/src-admin/src/tabs/Config.tsx +++ b/packages/admin/src-admin/src/tabs/Config.tsx @@ -30,6 +30,7 @@ import { PlayArrow as PlayArrowIcon, Refresh as RefreshIcon, Edit as EditIcon, + ArrowBack, } from '@mui/icons-material'; import { @@ -608,11 +609,31 @@ class Config extends Component { color="default" position="static" > - + + { + if (this.props.easyMode) { + Router.doNavigate('easy'); + } else { + Router.doNavigate('tab-instances'); + } + }} + onFocus={event => event.stopPropagation()} + style={{ + marginRight: 10, + display: 'none', + }} + > + + {this.props.jsonConfig ? ( { + static lastScrollPosition = 0; + private readonly localStorage: Storage; private statePromise: Promise> | null = null; @@ -161,6 +163,8 @@ class Instances extends Component { private readonly inputRef: React.RefObject; + private readonly refTabContent: React.RefObject; + private subscribed: boolean = false; private _cacheList: InstanceItem[] | null = null; @@ -243,6 +247,7 @@ class Instances extends Component { this.t = this.translate; this.inputRef = createRef(); + this.refTabContent = createRef(); } translate = (word: string, arg1?: any, arg2?: any): string => { @@ -861,6 +866,10 @@ class Instances extends Component { this.closeCommands[panel] = closeCommand; }; + saveScrollPosition = (): void => { + Instances.lastScrollPosition = (this.refTabContent.current?.parentNode as HTMLDivElement)?.scrollTop; + }; + getPanels(): JSX.Element[] | JSX.Element { if (!this._cacheList) { this.cacheInstances(); @@ -894,6 +903,7 @@ class Instances extends Component { category: item.category, render: ( { category: item.category, render: ( { if (!this.state.instances) { return ; } - console.log(`Width: ${this.props.width}`); if (this.props.currentHost !== this.state.currentHost) { this.hostsTimer = @@ -1135,6 +1145,17 @@ class Instances extends Component { ); } + } else if (Instances.lastScrollPosition) { + setTimeout( + (scrollPos: number): void => { + if (this.refTabContent.current?.parentNode) { + (this.refTabContent.current?.parentNode as HTMLDivElement).scrollTop = scrollPos; + } + }, + 200, + Instances.lastScrollPosition, + ); + Instances.lastScrollPosition = 0; } if (this.shouldUpdateAfterDialogClosed) { @@ -1377,7 +1398,12 @@ class Instances extends Component { -
{this.getPanels()}
+
+ {this.getPanels()} +
);