update dhcp check
This commit is contained in:
parent
8954a2fc25
commit
5450124be9
|
@ -2,6 +2,7 @@
|
|||
|
||||
return [
|
||||
'adminEmail' => 'admin@example.com',
|
||||
"type" => "BiFace", // BiFace, BiTable
|
||||
"maxLogs" => 50000,
|
||||
"maxPicture" => 9999,
|
||||
"version" => "1.0.7",
|
||||
|
|
|
@ -159,6 +159,8 @@ class ConfigController extends Controller {
|
|||
|
||||
public function actionIndex() {
|
||||
$this->view->title = Yii::t("app", "CAU_HINH_MAY_CHU");
|
||||
if (Yii::$app->params['type'] != "BiFace")
|
||||
return $this->redirect(['cau-hinh-ip']);
|
||||
$options = [
|
||||
'http' => [
|
||||
'header' => "Content-Type: application/json",
|
||||
|
@ -260,6 +262,8 @@ class ConfigController extends Controller {
|
|||
return true;
|
||||
} else {
|
||||
$this->view->title = Yii::t("app", "CAU_HINH_NHAN_DIEN");
|
||||
if (Yii::$app->params['type'] != "BiFace")
|
||||
return $this->redirect(['cau-hinh-ip']);
|
||||
$tempConfig = json_decode(file_get_contents("http://localhost:4004/ReadEngineConfig", false, stream_context_create([
|
||||
'http' => [
|
||||
'header' => "Content-Type: application/json",
|
||||
|
@ -424,6 +428,8 @@ class ConfigController extends Controller {
|
|||
|
||||
public function actionCauHinhThietBi() {
|
||||
$this->view->title = Yii::t("app", "CAU_HINH_THIET_BI");
|
||||
if (Yii::$app->params['type'] != "BiFace")
|
||||
return $this->redirect(['cau-hinh-ip']);
|
||||
|
||||
$tempConfig = json_decode(file_get_contents("http://localhost:4004/ReadEngineConfig", false, stream_context_create([
|
||||
'http' => [
|
||||
|
@ -529,9 +535,9 @@ class ConfigController extends Controller {
|
|||
if (Yii::$app->request->post()) {
|
||||
Yii::$app->response->format = "json";
|
||||
$post = Yii::$app->request->post();
|
||||
if (!isset($this->subnet[$post['subnet_mask']]))
|
||||
if (!$post['dhcp'] && !isset($this->subnet[$post['subnet_mask']]))
|
||||
return ["status" => false];
|
||||
$post['subnet_mask'] = $this->subnet[$post['subnet_mask']];
|
||||
$post['subnet_mask'] = isset($this->subnet[$post['subnet_mask']]) ? $this->subnet[$post['subnet_mask']] : "";
|
||||
$options = [
|
||||
'http' => [
|
||||
'header' => "Content-Type: application/json",
|
||||
|
|
|
@ -41,6 +41,7 @@ use yii\widgets\ActiveForm;
|
|||
<i class="fa fa-cogs"></i> <?php echo Yii::t("app", "CAU_HINH"); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php if (Yii::$app->params['type'] === "BiFace") { ?>
|
||||
<li>
|
||||
<a href="<?php echo yii\helpers\Url::to(['/config/reset']); ?>" onclick="common.resetForm(this);return false;">
|
||||
<i class="fa fa-refresh"></i> <?php echo Yii::t("app", "RESET_THIET_BI"); ?>
|
||||
|
@ -61,6 +62,7 @@ use yii\widgets\ActiveForm;
|
|||
<li><a href="<?php echo \yii\helpers\Url::to(['/capture-logs/face-comparison']); ?>"><i class="fa fa-users"></i> <?php echo Yii::t("app", "SO_SANH_MAT"); ?></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="navbar-custom-menu">
|
||||
|
|
|
@ -23,6 +23,9 @@
|
|||
<br>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group" id="dhcp">
|
||||
<input type='checkbox' name='dhcp' id='dhcp_check' value="" {if $network.dhcp=="yes"}checked=""{/if}> DHCP
|
||||
</div>
|
||||
<div class="form-group" id="device_ip">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">{Yii::t("app", "IP Address")}</div>
|
||||
|
@ -44,13 +47,13 @@
|
|||
<div class="form-group" id="dns1">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">{Yii::t("app", "DNS1")}</div>
|
||||
<input type="input" class="form-control" name="dns1" value="{$network.dns[0]|default:""}">
|
||||
<input type="input" class="form-control" name="dns1" value="{$network.dns1|default:""}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="dns2">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">{Yii::t("app", "DNS2")}</div>
|
||||
<input type="input" class="form-control" name="dns2" value="{$network.dns[1]|default:""}">
|
||||
<input type="input" class="form-control" name="dns2" value="{$network.dns2|default:""}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{use class="yii\helpers\Url"}
|
||||
{if Yii::$app->params["type"]==="BiFace"}
|
||||
<div class="mt-element-step">
|
||||
<div class="row step-thin">
|
||||
<div class="col-md-3 bg-grey mt-step-col {if $tab=="device_config"}active{/if}">
|
||||
|
@ -31,3 +32,4 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
|
@ -125,6 +125,8 @@ function ValidateIPaddress(ipaddress) {
|
|||
|
||||
function validData(inputName) {
|
||||
var ip = $("input[name='" + inputName + "']").val();
|
||||
if (ip == "" && document.getElementById('dhcp_check').checked)
|
||||
return true;
|
||||
if (!ValidateIPaddress(ip)) {
|
||||
common.error(inputName, "");
|
||||
return false;
|
||||
|
@ -160,6 +162,7 @@ function changeIP(e) {
|
|||
gateway: $("input[name='gateway']").val(),
|
||||
dns1: $("input[name='dns1']").val(),
|
||||
dns2: $("input[name='dns2']").val(),
|
||||
dhcp: document.getElementById('dhcp_check').checked
|
||||
},
|
||||
success: function (data) {
|
||||
common.modalBlock(false);
|
||||
|
|
Loading…
Reference in New Issue
Block a user