Line 119: |
Line 119: |
| So, we'll create the following files for the new SM2 panel(s) for the DHCPManager contrib. | | So, we'll create the following files for the new SM2 panel(s) for the DHCPManager contrib. |
| | | |
− | #/usr/share/smanager/lib/SrvMngr/Controller/dhcpd.pm | + | #/usr/share/smanager/lib/SrvMngr/Controller/Dhcpd.pm |
− | #/usr/share/smanager/lib/SrvMngr/I18N/Modules/dhcpd/dhcpd_en.lex | + | #/usr/share/smanager/lib/SrvMngr/I18N/Modules/Dhcpd/dhcpd_en.lex |
| #/usr/share/smanager/themes/default/templates/dhcpd.html.ep | | #/usr/share/smanager/themes/default/templates/dhcpd.html.ep |
| #/usr/share/smanager/themes/default/templates/partials/_dhcpd_scan.html.ep | | #/usr/share/smanager/themes/default/templates/partials/_dhcpd_scan.html.ep |
Line 159: |
Line 159: |
| Remember to set Mode = "development" in the mojolicious config file so that Perl run time errors are shown usefully. See above. | | Remember to set Mode = "development" in the mojolicious config file so that Perl run time errors are shown usefully. See above. |
| | | |
− | ==The Controller File (dhcpd.pm)== | + | ==The Controller File (Dhcpd.pm)== |
| | | |
| === Navigation Menu and Routing Tables === | | === Navigation Menu and Routing Tables === |
| Here is the heading for "untested" skeleton for the controller file.:<syntaxhighlight lang="perl"> | | Here is the heading for "untested" skeleton for the controller file.:<syntaxhighlight lang="perl"> |
| package SrvMngr::Controller::Dhcpd; | | package SrvMngr::Controller::Dhcpd; |
| + | |
| #---------------------------------------------------------------------- | | #---------------------------------------------------------------------- |
| # heading : Configuration | | # heading : Configuration |
Line 169: |
Line 170: |
| # navigation : 2000 2500 | | # navigation : 2000 2500 |
| # | | # |
− | # name : dhcpd, method : post, url : /dhcpd, ctlact : Dhcpd#main | + | # name : dhcpd, method : get, url : /dhcpd, ctlact : Dhcpd#main |
| # name : dhcpd1, method : get, url : /dhcpd1, ctlact : Dhcpd#do_leases | | # name : dhcpd1, method : get, url : /dhcpd1, ctlact : Dhcpd#do_leases |
| # name : dhcpd2, method : get, url : /dhcpd2, ctlact : Dhcpd#do_winpopup | | # name : dhcpd2, method : get, url : /dhcpd2, ctlact : Dhcpd#do_winpopup |
| # name : dhcpd3, method : get, url : /dhcpd3, ctlact : Dhcpd#do_scan | | # name : dhcpd3, method : get, url : /dhcpd3, ctlact : Dhcpd#do_scan |
| # name : dhcpd4, method : get, url : /dhcpd4, ctlact : Dhcpd#do_delete_all_leases | | # name : dhcpd4, method : get, url : /dhcpd4, ctlact : Dhcpd#do_delete_all_leases |
− | # name : dhcpd5, method : get, url : /dhcpd5, ctlact : Dhcpd#do_update_config | + | # name : dhcpd5, method : post, url : /dhcpd5, ctlact : Dhcpd#do_update_config |
| # name : dhcpd6, method : get, url : /dhcpd6, ctlact : Dhcpd#do_delete_one_lease | | # name : dhcpd6, method : get, url : /dhcpd6, ctlact : Dhcpd#do_delete_one_lease |
| # name : dhcpd7, method : get, url : /dhcpd7, ctlact : Dhcpd#do_refresh_leases | | # name : dhcpd7, method : get, url : /dhcpd7, ctlact : Dhcpd#do_refresh_leases |
− | # name : dhcpd8, method : get, url : /dhcpd8, ctlact : Dhcpd#winpopup | + | # name : dhcpd8, method : post, url : /dhcpd8, ctlact : Dhcpd#winpopup |
| # | | # |
| # routes : end | | # routes : end |
| # | | # |
| # | | # |
| + | # Documentation: https://wiki.koozali.org/Dhcpmanager |
| + | # |
| + | |
| | | |
| </syntaxhighlight>The Server Manager 2 system extracts these "comments" from the header of the controller file and builds the navigation menu and the routing tables accordingly. | | </syntaxhighlight>The Server Manager 2 system extracts these "comments" from the header of the controller file and builds the navigation menu and the routing tables accordingly. |