From 4bbf33e119ec1a7a9a1da89efe5bc23fab5bfeb6 Mon Sep 17 00:00:00 2001 From: Vincent Li Date: Sat, 15 Jun 2024 00:39:22 +0000 Subject: [PATCH] LoxiLB: lb config requires lb name since now we delete lb by name, so lb name is required field. Signed-off-by: Vincent Li --- html/cgi-bin/loxilbconfig.cgi | 5 ++++- langs/en/cgi-bin/en.pl | 1 + langs/zh/cgi-bin/zh.pl | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/html/cgi-bin/loxilbconfig.cgi b/html/cgi-bin/loxilbconfig.cgi index 2bbc05595..1947a6280 100644 --- a/html/cgi-bin/loxilbconfig.cgi +++ b/html/cgi-bin/loxilbconfig.cgi @@ -133,6 +133,9 @@ if ($settings{'ACTION'} eq $Lang::tr{'add'}) { if ($settings{'EXTIP'} =~ /^0\.0\.0\.0/){ $errormessage = $Lang::tr{'invalid ip'}." - 0.0.0.0"; } + if ($settings{'NAME'} eq ''){ + $errormessage = "LB Name: ".$Lang::tr{'loxilb empty'}; + } # Escape input in REMARK field $settings{'NAME'} = &Header::escape($settings{'NAME'}); @@ -265,7 +268,7 @@ my %checked=(); # Checkbox manipulations if ($errormessage) { &Header::openbox('100%', 'left', $Lang::tr{'error messages'}); - print "$errormessage "; + print "$errormessage "; &Header::closebox(); } diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 5840e442a..7fd17c42b 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -2455,6 +2455,7 @@ 'static routes' => 'Static Routes', 'loxilb' => 'eBPF LoxiLB Load Balancer', 'loxilb status' => 'Status', +'loxilb empty' => 'Field can not be empty', 'loxilb enable' => 'Enable Load Balancer', 'loxilb config' => 'LoxiLB Load Balancer Configuration', 'loxilb lb config changed' => 'LoxiLB LB configuration is changed', diff --git a/langs/zh/cgi-bin/zh.pl b/langs/zh/cgi-bin/zh.pl index e42b22a24..71708bafc 100644 --- a/langs/zh/cgi-bin/zh.pl +++ b/langs/zh/cgi-bin/zh.pl @@ -2422,6 +2422,7 @@ 'static routes' => '静态路由', 'loxilb' => 'eBPF LoxiLB 负载均衡', 'loxilb status' => '负载均衡启用状态', +'loxilb empty' => '不能空', 'loxilb enable' => '启用 eBPF LoxiLB 负载均衡', 'loxilb config' => 'eBPF LoxiLB 负载均衡配置', 'loxilb lb config changed' => 'LoxiLB 负载均衡 配置修改',