Reply To: User-defined page in Zeroshell’s GUI to run specific tools

Home Page Forums Network Management Request a new feature User-defined page in Zeroshell’s GUI to run specific tools Reply To: User-defined page in Zeroshell’s GUI to run specific tools

#53792

iulyb
Member

Hi,
I think the best way is first to decide if your feature is global / useful enough to be included under the main interface or it should live separate as an independent addon.

To include a directory link under apache you can look at apache alias directive:
http://code.tutsplus.com/articles/apache-aliasing-and-redirection–net-28606

For this you will require to change http.conf. http.conf lives here:
/etc/httpd/conf/httpd.conf

Keep in mind that altered http.conf will not survive a reboot so you need to change it every time you reboot. For this you will need to add something on the preboot script. ex:

echo "Alias /dir1/ >> "/var/register/register/somedir1"

To add a new item under ZS menu we need to change the template, but first we need to find it. It lives under /root/kerbynet.cgi/template and grep is our friend:

cd /root/kerbynet.cgi/template
grep "Net Balancer" ./*
root@zs template> grep "Net Balancer" ./*
./3Gconfig:   Autostart the connection:NoYesOn Net Balancer Fault
./3Gconfig:
Note:  Autostart the connection [On Net Balancer Fault] works if the 3G interface belongs to the Gateway Pool configured in the Net Balancer.

./PPPconfig:   Autostart the connection:NoYesOn Net Balancer Fault
./PPPconfig:
Note:  Autostart the connection [On Net Balancer Fault] works if the PPPoE interface belongs to the Gateway Pool configured in the Net Balancer.

./nb_manage:Net Balancer Manager
./nb_statistics:Net Balancer Statistics
./sx:       Net Balancer

If you look closer sx is the template that generate the left menu in ZS 😉

Same thing we can guess with a different approach. In Firefox if we right click click under menu and pick show this frame only will discover the url of the frame:


https://192.168.5.5/cgi-bin/kerbynet?STk=5a9797c7e28e7ea75c9b2eac6d6b77a2c55bc0ae&Action=Render&Object=sx

Based on my other discoveries I can tell the action render will look for a template sx under templates