ioBroker.admin icon indicating copy to clipboard operation
ioBroker.admin copied to clipboard

[bug]: textIP is checked for objects, but not for states - same settings, different behaviour

Open klein0r opened this issue 1 year ago • 2 comments

No existing issues.

  • [X] There is no existing issue for my problem.

Describe the bug

/opt/iobroker/iobroker-data/iobroker.json contains:

  "objects": {
    "type": "jsonl",
    "// type": "Possible values: 'file' - [port 9001], 'jsonl' - [port 9001], 'redis' - [port 6379 or 26379 for sentinel].",
    "host": "127.0.0.1",
    "port": 9001,
    ...

and

  "states": {
    "type": "jsonl",
    "// type": "Possible values: 'file' - [port 9000], 'redis' - [port 6379].",
    "host": "127.0.0.1",
    "port": 9000,
    ...

Settings show

Screenshot 2024-01-12 at 16 35 28

https://github.com/ioBroker/ioBroker.admin/blob/89b20a71d423ebef0c2d8b85f00c31264fa193a1/packages/admin/src/src/components/BaseSettings/BaseSettingsObjects.jsx#L95

https://github.com/ioBroker/ioBroker.admin/blob/89b20a71d423ebef0c2d8b85f00c31264fa193a1/packages/admin/src/src/components/BaseSettings/BaseSettingsObjects.jsx#L115

and

Screenshot 2024-01-12 at 16 35 36

https://github.com/ioBroker/ioBroker.admin/blob/89b20a71d423ebef0c2d8b85f00c31264fa193a1/packages/admin/src/src/components/BaseSettings/BaseSettingsStates.jsx#L96

https://github.com/ioBroker/ioBroker.admin/blob/89b20a71d423ebef0c2d8b85f00c31264fa193a1/packages/admin/src/src/components/BaseSettings/BaseSettingsStates.jsx#L115

To Reproduce

  • enable expert mode
  • go to hosts
  • edit settings of host

Expected behavior

Both values are the same, so both should be checked (or unchecked).

Screenshots & Logfiles

see above

Adapter version

6.13.15

js-controller version

5.0.17

Node version

20.10.0

Operating system

Debian 12 lxc

Additional context

No response

klein0r avatar Jan 12 '24 15:01 klein0r

this.props.socket.getIpAddresses is different. This part doesn't exist in the BaseSettingsObjects

https://github.com/ioBroker/ioBroker.admin/blob/89b20a71d423ebef0c2d8b85f00c31264fa193a1/packages/admin/src/src/components/BaseSettings/BaseSettingsObjects.jsx#L131-L135

klein0r avatar Jan 12 '24 15:01 klein0r

should be refactored in a shared method used by both components and I think this is even buggy

https://github.com/ioBroker/ioBroker.admin/blob/89b20a71d423ebef0c2d8b85f00c31264fa193a1/packages/admin/src/src/components/BaseSettings/BaseSettingsObjects.jsx#L132

X.includes(X)

foxriver76 avatar Jan 16 '24 07:01 foxriver76