mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
LoxiLB UI: show loxilb server running status
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
This commit is contained in:
@@ -87,24 +87,35 @@ if ($loxilbsettings{'ENABLE_LOXILB'} eq "on") {
|
||||
$checked = "checked='checked'";
|
||||
}
|
||||
|
||||
# Print box to enable/disable locationblock.
|
||||
print"<form method='POST' action='$ENV{'SCRIPT_NAME'}'>\n";
|
||||
my $sactive = "<table cellpadding='2' cellspacing='0' bgcolor='${Header::colourred}' width='50%'><tr><td align='center'><b><font color='#FFFFFF'>$Lang::tr{'stopped'}</font></b></td></tr></table>";
|
||||
|
||||
my @status = &General::system_output('/usr/local/bin/loxilbctrl', 'status');
|
||||
|
||||
if (grep(/is running/, @status)){
|
||||
$sactive = "<table cellpadding='2' cellspacing='0' bgcolor='${Header::colourgreen}' width='50%'><tr><td align='center'><b><font color='#FFFFFF'>$Lang::tr{'running'}</font></b></td></tr></table>";
|
||||
}
|
||||
|
||||
&Header::openbox('100%', 'center', $Lang::tr{'loxilb status'});
|
||||
print <<END;
|
||||
<table width='95%'>
|
||||
<tr>
|
||||
<td width='50%' class='base'>$Lang::tr{'loxilb enable'}
|
||||
<td><input type='checkbox' name='ENABLE_LOXILB' $checked></td>
|
||||
<td align='center'><input type='submit' name='ACTION' value='$Lang::tr{'save'}'></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
print <<END;
|
||||
<table width='100%'>
|
||||
<form method='POST' action='$ENV{'SCRIPT_NAME'}'>
|
||||
<td width='25%'> </td>
|
||||
<td width='25%'> </td>
|
||||
<td width='25%'> </td>
|
||||
<tr><td class='boldbase'>$Lang::tr{'loxilb server status'}</td>
|
||||
<td align='left'>$sactive</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width='50%' class='boldbase'>$Lang::tr{'loxilb enable'}
|
||||
<td><input type='checkbox' name='ENABLE_LOXILB' $checked></td>
|
||||
<td align='center'><input type='submit' name='ACTION' value='$Lang::tr{'save'}'></td>
|
||||
</tr>
|
||||
END
|
||||
|
||||
&Header::closebox();
|
||||
|
||||
print "</form>\n";
|
||||
print "</form> </table>\n";
|
||||
#
|
||||
&Header::closebigbox();
|
||||
|
||||
|
||||
@@ -2455,6 +2455,7 @@
|
||||
'static routes' => 'Static Routes',
|
||||
'loxilb' => 'eBPF LoxiLB Load Balancer',
|
||||
'loxilb status' => 'Status',
|
||||
'loxilb server status' => 'Current LoxiLB server status:',
|
||||
'loxilb empty' => 'Field can not be empty',
|
||||
'loxilb enable' => 'Enable Load Balancer',
|
||||
'loxilb config' => 'LoxiLB Load Balancer Configuration',
|
||||
|
||||
@@ -2422,6 +2422,7 @@
|
||||
'static routes' => '静态路由',
|
||||
'loxilb' => 'eBPF LoxiLB 负载均衡',
|
||||
'loxilb status' => '负载均衡启用状态',
|
||||
'loxilb server status' => '负载均衡启用状态',
|
||||
'loxilb empty' => '不能空',
|
||||
'loxilb enable' => '启用 eBPF LoxiLB 负载均衡',
|
||||
'loxilb config' => 'eBPF LoxiLB 负载均衡配置',
|
||||
|
||||
@@ -48,6 +48,10 @@ case "$1" in
|
||||
fi
|
||||
;;
|
||||
|
||||
status)
|
||||
statusproc /usr/bin/loxilb
|
||||
;;
|
||||
|
||||
restart)
|
||||
$0 stop
|
||||
sleep 1
|
||||
|
||||
@@ -27,6 +27,8 @@ int main(int argc, char *argv[]) {
|
||||
safe_system("/etc/rc.d/init.d/loxilb start");
|
||||
} else if (strcmp(argv[1], "stop") == 0) {
|
||||
safe_system("/etc/rc.d/init.d/loxilb stop");
|
||||
} else if (strcmp(argv[1], "status") == 0) {
|
||||
safe_system("/etc/rc.d/init.d/loxilb status");
|
||||
} else if (strcmp(argv[1], "restart") == 0) {
|
||||
safe_system("/etc/rc.d/init.d/loxilb restart");
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user