oxidized-web icon indicating copy to clipboard operation
oxidized-web copied to clipboard

Make show/hide column changes permanent

Open jarora11 opened this issue 5 years ago • 1 comments

Hello,

Is there a way to enable the IP column by default on the web app? Currently you need to toggle it on, in the show/hide columns button. But this seems to be relevant to the current session scope only. Is there a way to make it permanent? I tried looking for some config files in the web-app to make this permanent. But couldn't really find anything.

Thanks.

jarora11 avatar May 26 '20 17:05 jarora11

Currently, this is hardcoded in nodes.haml (datatables javascript). There are no configuration files for oxidized-web, maybe it could be integrated in the oxidized-configuration. I've got no time for this enhancement.

robertcheramy avatar Jun 12 '24 06:06 robertcheramy

Instead of integrating it into the oxidized-configuration we could save the selection in the browser localStorage. This way it would remember the selected columns even when restarting the browser. New users would still have to select their preferred columns once but I think that would be an improvement already.

I will look into implementing this if I find the time.

Haeki avatar Jan 22 '25 13:01 Haeki

To the original question, you can hack it via the nodes.haml file.

# change default sort order from "..,All" to "All,.." and toggle IP Address
FILES=`docker exec oxidized find /usr/local/bundle/gems -type f |
    grep -E "oxidized-web.*\/lib\/oxidized\/web\/views\/(nodes|stats)\.haml"`

for f in $FILES; do
    docker exec oxidized /bin/sed -i "s/\[20, 50, 250, 500.*\]/[{ label: 'All', value: -1 }, 20, 50, 250, 500]/" "$f"
    docker exec oxidized /bin/sed -i 's/visible: false,/visible: true,/' "$f"
done

It's not pretty, but works.

lwarnt avatar Jan 29 '25 14:01 lwarnt

Fixed by #323

robertcheramy avatar Mar 21 '25 20:03 robertcheramy