From 758b8d29c3a79a7564927d2dc31d573cbab6d356 Mon Sep 17 00:00:00 2001 From: dongpd Date: Mon, 26 Oct 2020 14:58:04 +0700 Subject: [PATCH] =?UTF-8?q?fix=20bug=20nh=E1=BB=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/DeviceController.php | 6 +++++- web/js/common.js | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/controllers/DeviceController.php b/controllers/DeviceController.php index cc81b6e3..abde1abc 100644 --- a/controllers/DeviceController.php +++ b/controllers/DeviceController.php @@ -282,7 +282,11 @@ class DeviceController extends Controller { public function actionSearch() { if (Yii::$app->request->post()) { Yii::$app->response->format = "json"; - $datas = json_decode(common::requestToCardService("/SearchDevice", ["NetMask" => Yii::$app->request->post("SubnetMask")]), true); + $NetMask = "255.255.255.255"; + if (Yii::$app->request->post("SubnetMask") != "") { + $NetMask = Yii::$app->request->post("SubnetMask"); + } + $datas = json_decode(common::requestToCardService("/SearchDevice", ["NetMask" => $NetMask]), true); return [ "form" => $this->renderPartial("device-lists", [ "datas" => $datas, diff --git a/web/js/common.js b/web/js/common.js index d4030d11..8bc5973d 100644 --- a/web/js/common.js +++ b/web/js/common.js @@ -2,6 +2,7 @@ $(function () { $('[data-toggle="tooltip"]').tooltip({ container: 'body' }); + $.fn.modal.Constructor.prototype.enforceFocus = $.noop; }); /**