Tutorial Modifying 'listing device' page and adding Aliasses - genieacs/genieacs GitHub Wiki
This tutorial only applies to the v1.0 releases of GenieACS. For v1.1, please see the Virtual Parameters page.
By default GenieACS is setup to display a certain set of columns in the "Listing Device" table on the Device tab. Similar look as the following table (generated by genieacs-gui/app/views/devices/index.html.erb:
To add a column to the table we will need to modify genieacs-gui/config/index_parameters.yml Here is the default contents:
Serial number: summary.serialNumber Product class: summary.productClass Software version: summary.softwareVersion MAC: summary.mac IP: summary.ip WLAN SSID: summary.wlanSsid
The list follows "table Header : device path". If you have any know direct path (for example: InternetGatewayDevice.WANDevice.1.WANConnectionDevice.3.WANPPPConnection.1.Username), you can use it here and a new column will be added. Listed in this file are defined aliasses instead of paths which we will get back to shortly.
In most cases devices don't use the same paths as other devices for the same item. Device A may use InternetGatewayDevice.WANDevice.1.WANConnectionDevice.3.WANPPPConnection.1.Username but device B may be using InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.13.Username. Here is where we come back to using aliasses.
To add Aliasses accessible to use under the device and device sub pages we will need to access the genieacs/config/parameters.json. Here is a snippit of the file:
... "_lastInform" : {"alias" : "summary.lastInform", "type" : "date"}, "_lastBoot" : {"alias" : "summary.lastBoot", "type" : "date"}, "_lastBootstrap" : {"alias" : "summary.lastBootstrap", "type" : "date"}, "_deviceId._SerialNumber" : {"alias" : "summary.serialNumber"}, "_deviceId._ProductClass" : {"alias" : "summary.productClass"}, "InternetGatewayDevice.WANDevice./^\\d+$/.WANConnectionDevice./^\\d+$/.WANIPConnection./^\\d+$/.MACAddress" : {"alias" : "summary.mac", "type" : "mac"}, "InternetGatewayDevice.WANDevice./^\\d+$/.WANConnectionDevice./^\\d+$/.WANIPConnection./^\\d+$/.ExternalIPAddress" : {"alias" : "summary.ip"}, ...
We now can see some of the aliasses and their path being used in the original table. "_deviceId._SerialNumber" : {"alias" : "summary.serialNumber"} is being used as: Serial number: summary.serialNumber. Using regular expression we can add our custom alias. In this case We'll be adding a PPPoE username and since as previously mentioned the paths are not always the same we'll be adding the following line: "InternetGatewayDevice.WANDevice.1.WANConnectionDevice./[0-9]+/.WANPPPConnection./[0-9]+/.Username" : {"alias" : "summary.username"}.
We're not done. This won't display the column. yet. Lets save the changes and access the genieacs-gui/config/index_parameters.yml file. Now we can add:
PPPoE: summary.username
Again, save changes. You will require to run npm run compile in the genieacs folder. Start GenieACS and you should see the extra column "PPPoE" now.