Skip to content

storage visibility $1 ?? 0 doesnt work for hiding storage when no re match #424

@bzoneil

Description

@bzoneil

it is not possible to get the 0 to hide the storage, but only a match/non 0.
Found the javascript formula for reaching exactly the expected value from undefined, but it does not work.
Same with any other try to convert undefined to 0.
Here is an example for sda1:

...
dynamic.18.name=storage1_visibility
dynamic.18.source=df -T
dynamic.18.regexp=sda(1)?\s+\S+
dynamic.18.postprocess=$1 ?? 0
#or
#dynamic.18.postprocess=$1 || 0
...
should return 0 when undefinded (no match), but returns always undefined when matched or not.
without postrocessing the 1 is returned or undefined respectively.

...
web.status.1.content.10.visibility=data.storage1_visibility
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions