Changes

From SME Server
Jump to navigationJump to search
Line 439: Line 439:  
%}
 
%}
 
</syntaxhighlight>and finally the front panel details is defined:
 
</syntaxhighlight>and finally the front panel details is defined:
===Mojolicious Meta Commands===
   
<syntaxhighlight lang="perl">
 
<syntaxhighlight lang="perl">
 
else {  #PARAMS
 
else {  #PARAMS
 +
<table><tr><td>
 
%= button_to $c->l('dhcpd_CONNECTED_IP') => '/dhcpd1'
 
%= button_to $c->l('dhcpd_CONNECTED_IP') => '/dhcpd1'
 +
</td><td>
 
%= button_to $c->l('dhcpd_SCAN_YOUR_NETWORK') => '/dhcpd3'
 
%= button_to $c->l('dhcpd_SCAN_YOUR_NETWORK') => '/dhcpd3'
 +
</td><td>
 
%= button_to $c->l('dhcpd_GLOBAL_WINPOPUP') => '/dhcpd2'
 
%= button_to $c->l('dhcpd_GLOBAL_WINPOPUP') => '/dhcpd2'
   
+
<td>
 +
</tr>
 +
    </table>   
 
<hr />  
 
<hr />  
 
<h2>  
 
<h2>  
Line 455: Line 459:  
%=l 'dhcpd_CHECK_CLIENT_STATUS'
 
%=l 'dhcpd_CHECK_CLIENT_STATUS'
 
</span><span class=data>
 
</span><span class=data>
% param retrievessl=>$dhcp_data->{"params"}->{"checkclientstatus"};
+
% param checkclientstatus=>$dhcp_data->{"params"}->{"check"};
 
%=select_field  checkclientstatus=>$dhcp_data->{"check"}
 
%=select_field  checkclientstatus=>$dhcp_data->{"check"}
 
</span><br>
 
</span><br>
 
+
    <br />
 +
<span class=label>
 +
%=l 'dhcpd_STATUS_DHCP_SERVER'
 +
</span><span class=data>
 +
% param dhcpstatus=>$dhcp_data->{"params"}->{"status"};
 +
%=select_field  dhcpstatus=>$dhcp_data->{"status"}
 +
</span><br>
 +
 +
<span class=label>
 +
%=l 'dhcpd_DHCP_START'
 +
</span><span class=data>
 +
% param dhcpstart=>$dhcp_data->{"params"}->{"start"};
 +
%=text_field  'dhcpstart'
 +
</span><br>
 +
 +
<span class=label>
 +
%=l 'dhcpd_DHCP_END'
 +
</span><span class=data>
 +
% param dhcpend=>$dhcp_data->{"params"}->{"end"};
 +
%=text_field  'dhcpend'
 +
</span><br><br />
 +
====== snip =============
 
%= submit_button "$btn", class => 'action'
 
%= submit_button "$btn", class => 'action'
 
     % end
 
     % end
 
%}
 
%}
   
</div>
 
</div>
 
%end
 
%end
</syntaxhighlight>
+
</syntaxhighlight>This shows the top few controls for the panel.  Note the use of the table to keep the buttons in a row and also the structure of each parameter row involving the <nowiki><span> tags and the <br></nowiki> to create newlines.  Use of this structure will keep your panel in line with both the default and the AdminLTE themes. You need not do this of course!
   −
===Perl Commands===
+
From the form command at the top it can be seen that clicking the "Save/Restart"  button will lead to a routing through dhcpd5 which will result in the perl sub "do_update_config" being executed, which will save all 'the parameters back to the  DB.
   −
===Html===
+
=== The Partials files can be used to keep the structure in mulitple files. ===
 +
We will look at just one to display the lease table.
   −
==Translation Strings files==
+
===Translation Strings files===
 
Here is a sed script and extra commands to take a formMagick strings file and make it into a lex file suitable for SM2.
 
Here is a sed script and extra commands to take a formMagick strings file and make it into a lex file suitable for SM2.
  

Navigation menu