Make show/hide column changes permanent
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.
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.
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.
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.
Fixed by #323