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; }); /**