al-caughey/YAMon-v4

users.js export then import does not work

Opened this issue · 4 comments

Exporting users.js has some issues. The Info description is the following

If you do not want to use the database integration but do want view the YAMon reports from multiple devices, click the export icon () and save the file to your router. NB - you must stop the yamon*.sh script on your router before replacing or editing users.js!

It is maybe not up to date, since it does not specify the path on the loca user where the file should be saved, it should be /opt/YAMon4/data/users.js
It also says that yamon*.sh script should be stopped, which I think does not exist in version 4.0.7, but instead /etc/init.d/yamon4 stop should be used, then after the update of the file /etc/init.d/yamon4 start .

Exporting users.js from the GUI then stopping yamon, replacing the file on the router and starting yamon does not work as expected. After this procedure the "Devices" tab does not work anymore.
I compared the format of the exported users.js and the local file on the router and they seems to be different.
The exported users.js contains lines like this:
ud_a({"mac":"un:kn:ow:n0:0m:ac","ip":"::/0,0.0.0.0/0","owner":"Unknown","name":"No Matching Device","colour":"","added":"2020-09-04 11:25:56","updated":"","last-seen":"undefined"})
and the local users.js file on the router looks like this:
mac2ip({ "id":"un:kn:ow:n0:0m:ac-0.0.0.0/0", "name":"No Matching Device", "active":"1", "added":"2020-09-04 11:25:56", "updated":"" })

Same experience here - manually editing in the names in users.js appears to work, but haven't found how to add new groups either way. CORS error prevents using the database mode which is apparently the author's preferred mechanism.

The description for the exporting of the "users.js" file is wrong and applies to version 3 only, not version 4.
For version 4 export, you have to select the other little icon next to it, a file symbol with ".JS" in it.
This will open the actual users.js file from your /opt/YAMon4/data/users.js.

The old export for the users.js file gives you unusable stuff with 'ud_a({"mac":"a0:56:f3:38:b7:cd","ip":'...

Follow up question then. We can use the export button to get the list of devices as we have edited them including colors. But does the new user.js format support colors as well? The old version did. Really helpful with pie charts to see the bandwidth hogs.

I had this same issue with exporting users try ecdye's working version info here. Worked for me.