Compare commits
16 Commits
custom/fsi
...
LitePro_2.
| Author | SHA1 | Date | |
|---|---|---|---|
| 6ae14302fd | |||
| d8fe80034e | |||
| 7c8014ca87 | |||
| 8918a58746 | |||
| 5a3074ff4a | |||
| 8ec330d21d | |||
| 0dce5700b5 | |||
| d4cc9654d8 | |||
| a26cf27d08 | |||
| c29719d73e | |||
| e4e080266a | |||
| 82a5b0d0ad | |||
| 21cc5f2050 | |||
| ea202ccc3f | |||
| 58a5522642 | |||
| 476f01098f |
@@ -6,5 +6,7 @@ return [
|
|||||||
"maxLogs" => 50000,
|
"maxLogs" => 50000,
|
||||||
"maxPicture" => 9999,
|
"maxPicture" => 9999,
|
||||||
"version" => "1.0.7",
|
"version" => "1.0.7",
|
||||||
"autoSyncLog" => false
|
"autoSyncLog" => false,
|
||||||
|
"timeoutRequestServer" => 4,
|
||||||
|
"test" => 6
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ class ApiController extends Controller {
|
|||||||
|
|
||||||
public function actionGetLogs() {
|
public function actionGetLogs() {
|
||||||
if (Yii::$app->request->post()) {
|
if (Yii::$app->request->post()) {
|
||||||
|
Yii::$app->response->format = "json";
|
||||||
$post = Yii::$app->request->bodyParams;
|
$post = Yii::$app->request->bodyParams;
|
||||||
$time = date_format(date_create_from_format('Y-m-d H:i:s', $post['time']), 'U');
|
$time = date_format(date_create_from_format('Y-m-d H:i:s', $post['time']), 'U');
|
||||||
$key = common::generateRandomString();
|
$key = common::generateRandomString();
|
||||||
@@ -73,6 +74,11 @@ class ApiController extends Controller {
|
|||||||
@unlink("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $lastLogs->image);
|
@unlink("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $lastLogs->image);
|
||||||
$lastLogs->delete();
|
$lastLogs->delete();
|
||||||
}
|
}
|
||||||
|
$lastLogs = CaptureLogs::find()->andWhere(["staff_id" => $post['id']])->orderBy(["time" => SORT_DESC])->limit(1)->one();
|
||||||
|
if ($lastLogs && ($time - $lastLogs->time) < 1) {
|
||||||
|
file_put_contents("log_connect_server.txt", "\n[" . date("H:i:s d/m/Y") . "] duplicate face " . $post["id"], FILE_APPEND);
|
||||||
|
return ["status" => "success"];
|
||||||
|
}
|
||||||
|
|
||||||
$model = new CaptureLogs();
|
$model = new CaptureLogs();
|
||||||
$logs = $model->create([
|
$logs = $model->create([
|
||||||
@@ -85,7 +91,10 @@ class ApiController extends Controller {
|
|||||||
$ip = "https://dev-dc.beetai.com";
|
$ip = "https://dev-dc.beetai.com";
|
||||||
if ($server_ip)
|
if ($server_ip)
|
||||||
$ip = $server_ip->data;
|
$ip = $server_ip->data;
|
||||||
if ($this->is_connected() && $logs) {
|
$parseUrl = parse_url($ip);
|
||||||
|
$host = $parseUrl['host'];
|
||||||
|
$port = isset($parseUrl['port']) ? $parseUrl['port'] : 80;
|
||||||
|
if ($this->is_connected($host, $port) && $logs) {
|
||||||
$device_id = \app\models\SyncUrl::findOne(['key_config' => 'device_id']);
|
$device_id = \app\models\SyncUrl::findOne(['key_config' => 'device_id']);
|
||||||
$id_camera = 0;
|
$id_camera = 0;
|
||||||
if ($device_id)
|
if ($device_id)
|
||||||
@@ -104,23 +113,25 @@ class ApiController extends Controller {
|
|||||||
$data[] = "123"; //person_id
|
$data[] = "123"; //person_id
|
||||||
$data[] = "+7"; //timezone
|
$data[] = "+7"; //timezone
|
||||||
$text = implode("|", $data);
|
$text = implode("|", $data);
|
||||||
$res = json_decode(file_get_contents($ip . "/api/box/face_recognition_auth_v2?token=" . $tk, false, stream_context_create([
|
$res = json_decode(@file_get_contents($ip . "/api/box/face_recognition_auth_v2?token=" . $tk, false, stream_context_create([
|
||||||
'http' => [
|
'http' => [
|
||||||
'header' => "Content-Type: application/json",
|
'timeout' => Yii::$app->params['timeoutRequestServer'],
|
||||||
'method' => "POST",
|
'header' => "Content-Type: application/json",
|
||||||
'content' => json_encode([
|
'method' => "POST",
|
||||||
'image' => base64_encode(file_get_contents("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $fileName)),
|
'content' => json_encode([
|
||||||
'data' => common::rsaEncode($text),
|
'image' => base64_encode(file_get_contents("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $fileName)),
|
||||||
'confidence' => isset($post["confidence"]["percent1"]) ? $post["confidence"]["percent1"] : 0
|
'data' => common::rsaEncode($text),
|
||||||
])
|
'confidence' => isset($post["confidence"]["percent1"]) ? $post["confidence"]["percent1"] : 0
|
||||||
]
|
])
|
||||||
|
]
|
||||||
])), true);
|
])), true);
|
||||||
if ($res['status'] == 10000) {
|
if ($res && $res['status'] == 10000) {
|
||||||
$logsInfo->sync_status = 1;
|
$logsInfo->sync_status = 1;
|
||||||
$logsInfo->save();
|
$logsInfo->save();
|
||||||
|
} else {
|
||||||
|
file_put_contents("log_connect_server.txt", "\n[" . date("H:i:s d/m/Y") . "] /api/box/face_recognition_auth_v2 timeout " . $ip, FILE_APPEND);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Yii::$app->response->format = "json";
|
|
||||||
return ["status" => "success"];
|
return ["status" => "success"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -337,17 +348,19 @@ class ApiController extends Controller {
|
|||||||
|
|
||||||
public function actionSync() {
|
public function actionSync() {
|
||||||
Yii::$app->response->format = "json";
|
Yii::$app->response->format = "json";
|
||||||
if ($this->is_connected()) {
|
$server_ip = \app\models\SyncUrl::findOne(['key_config' => 'server_api']);
|
||||||
$server_ip = \app\models\SyncUrl::findOne(['key_config' => 'server_api']);
|
$ip = "https://dev-dc.beetai.com";
|
||||||
$ip = "https://dev-dc.beetai.com";
|
if ($server_ip)
|
||||||
if ($server_ip)
|
$ip = $server_ip->data;
|
||||||
$ip = $server_ip->data;
|
$parseUrl = parse_url($ip);
|
||||||
|
$host = $parseUrl['host'];
|
||||||
|
$port = isset($parseUrl['port']) ? $parseUrl['port'] : 80;
|
||||||
|
if ($this->is_connected($host, $port)) {
|
||||||
$device_id = \app\models\SyncUrl::findOne(['key_config' => 'device_id']);
|
$device_id = \app\models\SyncUrl::findOne(['key_config' => 'device_id']);
|
||||||
$id_camera = 0;
|
$id_camera = 0;
|
||||||
if ($device_id)
|
if ($device_id)
|
||||||
$id_camera = intval($device_id->data);
|
$id_camera = intval($device_id->data);
|
||||||
$ls = CaptureLogs::find()->andWhere(['sync_status' => null])->all();
|
$ls = CaptureLogs::find()->andWhere(['sync_status' => null])->all();
|
||||||
|
|
||||||
$tk = "";
|
$tk = "";
|
||||||
$token = \app\models\SyncUrl::findOne(['key_config' => 'token']);
|
$token = \app\models\SyncUrl::findOne(['key_config' => 'token']);
|
||||||
if ($token)
|
if ($token)
|
||||||
@@ -356,25 +369,31 @@ class ApiController extends Controller {
|
|||||||
if (file_exists("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $value->image)) {
|
if (file_exists("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $value->image)) {
|
||||||
$staffInfo = ListManagement::findOne($value->staff_id);
|
$staffInfo = ListManagement::findOne($value->staff_id);
|
||||||
$confidence = json_decode($value->confidence, true);
|
$confidence = json_decode($value->confidence, true);
|
||||||
$res = json_decode(file_get_contents($ip . "/api/oem/face_recognition?token=" . $tk, false, stream_context_create([
|
$data = [];
|
||||||
'http' => [
|
$data[] = strval($id_camera); //camera_id
|
||||||
'header' => "Content-Type: application/json",
|
$data[] = date("Y-m-d H:i:s", $value->time); //frametime
|
||||||
'method' => "POST",
|
$data[] = $staffInfo ? strval($staffInfo->code) : "0"; //idCard
|
||||||
'content' => json_encode([
|
$data[] = $staffInfo ? $staffInfo->staff_id : ""; //idObject
|
||||||
'image' => base64_encode(file_get_contents("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $value->image)),
|
$data[] = "123"; //person_id
|
||||||
'camera_id' => strval($id_camera),
|
$data[] = "+7"; //timezone
|
||||||
'frametime' => date("Y-m-d H:i:s", $value->time),
|
$text = implode("|", $data);
|
||||||
'idCard' => $staffInfo ? strval($staffInfo->code) : "0",
|
$res = json_decode(@file_get_contents($ip . "/api/box/face_recognition_auth_v2?token=" . $tk, false, stream_context_create([
|
||||||
'idObject' => $staffInfo ? $staffInfo->staff_id : "",
|
'http' => [
|
||||||
"person_id" => "123",
|
'timeout' => Yii::$app->params['timeoutRequestServer'],
|
||||||
"timezone" => "+7",
|
'header' => "Content-Type: application/json",
|
||||||
'confidence' => isset($confidence['percent1']) ? floatval($confidence['percent1']) : 0
|
'method' => "POST",
|
||||||
])
|
'content' => json_encode([
|
||||||
]
|
'image' => base64_encode(file_get_contents("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $value->image)),
|
||||||
|
'data' => common::rsaEncode($text),
|
||||||
|
'confidence' => isset($confidence['percent1']) ? floatval($confidence['percent1']) : 0
|
||||||
|
])
|
||||||
|
]
|
||||||
])), true);
|
])), true);
|
||||||
if ($res['status'] == 10000) {
|
if ($res && $res['status'] == 10000) {
|
||||||
$value->sync_status = 1;
|
$value->sync_status = 1;
|
||||||
$value->save();
|
$value->save();
|
||||||
|
} else {
|
||||||
|
file_put_contents("log_connect_server.txt", "\n[" . date("H:i:s d/m/Y") . "][SYNC] face_recognition_auth_v2 timeout " . $ip, FILE_APPEND);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$value->delete();
|
$value->delete();
|
||||||
@@ -384,14 +403,16 @@ class ApiController extends Controller {
|
|||||||
return ["status" => true];
|
return ["status" => true];
|
||||||
}
|
}
|
||||||
|
|
||||||
function is_connected($ip = "google.com") {
|
function is_connected($host, $port) {
|
||||||
$connected = @fsockopen($ip, 80);
|
$connected = @fsockopen($host, $port);
|
||||||
//website, port (try 80 or 443)
|
//website, port (try 80 or 443)
|
||||||
if ($connected) {
|
if ($connected) {
|
||||||
$is_conn = true; //action when connected
|
$is_conn = true; //action when connected
|
||||||
fclose($connected);
|
fclose($connected);
|
||||||
|
// file_put_contents("log_connect_server.txt", "\n" . date("H:i:s d/m/Y") . " connected " . $host . ":" . $port, FILE_APPEND);
|
||||||
} else {
|
} else {
|
||||||
$is_conn = false; //action in connection failure
|
$is_conn = false; //action in connection failure
|
||||||
|
file_put_contents("log_connect_server.txt", "\n[" . date("H:i:s d/m/Y") . "] disconnected " . $host . ":" . $port, FILE_APPEND);
|
||||||
}
|
}
|
||||||
return $is_conn;
|
return $is_conn;
|
||||||
}
|
}
|
||||||
@@ -486,12 +507,14 @@ class ApiController extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function actionTest() {
|
public function actionTest() {
|
||||||
// $updating = \app\models\SyncUrl::findOne(['key_config' => 'token']);
|
$server_ip = \app\models\SyncUrl::findOne(['key_config' => 'server_api']);
|
||||||
$updating = \app\models\SyncUrl::find()->all();
|
$ip = "https://dev-dc.beetai.com";
|
||||||
foreach ($updating as $key => $value) {
|
if ($server_ip)
|
||||||
echo $value->key_config . " " . $value->data . "<br>";
|
$ip = $server_ip->data;
|
||||||
}
|
$parseUrl = parse_url($ip);
|
||||||
exit();
|
$host = $parseUrl['host'];
|
||||||
|
$port = isset($parseUrl['port']) ? $parseUrl['port'] : 80;
|
||||||
|
$this->is_connected($host, $port);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionReGenFeature() {
|
public function actionReGenFeature() {
|
||||||
@@ -859,4 +882,20 @@ class ApiController extends Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function actionCheckTimeEngine() {
|
||||||
|
Yii::$app->response->format = "json";
|
||||||
|
$config_engine = ["start_at" => "00:00", "end_at" => "23:59"];
|
||||||
|
$engine_time_config = \app\models\SyncUrl::findOne(['key_config' => 'engine_time_config']);
|
||||||
|
if ($engine_time_config)
|
||||||
|
$config_engine = json_decode($engine_time_config->data, true);
|
||||||
|
|
||||||
|
$start_at = date_format(date_create_from_format('H:i:s d/m/Y', $config_engine['start_at'] . ":00 " . date("d/m/Y")), 'U');
|
||||||
|
$end_at = date_format(date_create_from_format('H:i:s d/m/Y', $config_engine['end_at'] . ":59 " . date("d/m/Y")), 'U');
|
||||||
|
$now = time();
|
||||||
|
if ($now < $start_at || $now > $end_at)
|
||||||
|
return ["status" => false];
|
||||||
|
|
||||||
|
return ["status" => true];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -161,6 +161,8 @@ class ConfigController extends Controller {
|
|||||||
$this->view->title = Yii::t("app", "CAU_HINH_MAY_CHU");
|
$this->view->title = Yii::t("app", "CAU_HINH_MAY_CHU");
|
||||||
if (Yii::$app->params['type'] != "BiFace")
|
if (Yii::$app->params['type'] != "BiFace")
|
||||||
return $this->redirect(['cau-hinh-ip']);
|
return $this->redirect(['cau-hinh-ip']);
|
||||||
|
if (Yii::$app->user->identity->username != "admin")
|
||||||
|
return $this->redirect(['cau-hinh-nhan-dien']);
|
||||||
$options = [
|
$options = [
|
||||||
'http' => [
|
'http' => [
|
||||||
'header' => "Content-Type: application/json",
|
'header' => "Content-Type: application/json",
|
||||||
@@ -421,6 +423,7 @@ class ConfigController extends Controller {
|
|||||||
if (!$checkConfig['status']) {
|
if (!$checkConfig['status']) {
|
||||||
return ['status' => false, 'text' => ''];
|
return ['status' => false, 'text' => ''];
|
||||||
} else {
|
} else {
|
||||||
|
@file_get_contents("http://localhost:4004/SetupMedia");
|
||||||
return ['status' => true, 'url' => Url::to(['cau-hinh-thiet-bi'])];
|
return ['status' => true, 'url' => Url::to(['cau-hinh-thiet-bi'])];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -430,6 +433,8 @@ class ConfigController extends Controller {
|
|||||||
$this->view->title = Yii::t("app", "CAU_HINH_THIET_BI");
|
$this->view->title = Yii::t("app", "CAU_HINH_THIET_BI");
|
||||||
if (Yii::$app->params['type'] != "BiFace")
|
if (Yii::$app->params['type'] != "BiFace")
|
||||||
return $this->redirect(['cau-hinh-ip']);
|
return $this->redirect(['cau-hinh-ip']);
|
||||||
|
if (Yii::$app->user->identity->username != "admin")
|
||||||
|
return $this->redirect(['cau-hinh-nhan-dien']);
|
||||||
|
|
||||||
$tempConfig = json_decode(file_get_contents("http://localhost:4004/ReadEngineConfig", false, stream_context_create([
|
$tempConfig = json_decode(file_get_contents("http://localhost:4004/ReadEngineConfig", false, stream_context_create([
|
||||||
'http' => [
|
'http' => [
|
||||||
@@ -563,4 +568,196 @@ class ConfigController extends Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function actionSystemInfo() {
|
||||||
|
if (Yii::$app->request->isAjax) {
|
||||||
|
Yii::$app->response->format = "json";
|
||||||
|
$options = [
|
||||||
|
'http' => [
|
||||||
|
'header' => "Content-Type: application/json",
|
||||||
|
'method' => "POST"
|
||||||
|
]
|
||||||
|
];
|
||||||
|
@file_get_contents("http://localhost:4004/Reboot", false, stream_context_create($options));
|
||||||
|
return ["status" => true];
|
||||||
|
} else {
|
||||||
|
$this->view->title = Yii::t("app", "THONG_TIN_HE_THONG");
|
||||||
|
$version = \app\models\SyncUrl::findOne(['key_config' => 'version']);
|
||||||
|
$info = $version ? $version->data : "Pro 4.27.13 (Jul 19 2021 11:49)";
|
||||||
|
$temp = explode("(", $info);
|
||||||
|
$ver = trim($temp[0]);
|
||||||
|
$build_time = str_replace(")", "", $temp[1]);
|
||||||
|
return $this->render('system-info', [
|
||||||
|
"version" => $ver,
|
||||||
|
"build_time" => $build_time
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getConfigJson() {
|
||||||
|
$tempConfig = json_decode(file_get_contents("http://localhost:4004/ReadEngineConfig", false, stream_context_create([
|
||||||
|
'http' => [
|
||||||
|
'header' => "Content-Type: application/json",
|
||||||
|
'method' => "POST"
|
||||||
|
]
|
||||||
|
])), true);
|
||||||
|
if (!$tempConfig['status'])
|
||||||
|
return $this->redirect(['/config']);
|
||||||
|
|
||||||
|
$engineConfig = json_decode($tempConfig['data'], true);
|
||||||
|
if (count($engineConfig['data']['engines']) == 0)
|
||||||
|
return $this->redirect(['/config']);
|
||||||
|
|
||||||
|
$checkConfig = json_decode(file_get_contents("http://localhost:4004/ReadConfig", false, stream_context_create([
|
||||||
|
'http' => [
|
||||||
|
'header' => "Content-Type: application/json",
|
||||||
|
'method' => "POST",
|
||||||
|
'content' => json_encode([
|
||||||
|
'path' => $engineConfig['data']['engines'][0]['path']
|
||||||
|
])
|
||||||
|
]
|
||||||
|
])), true);
|
||||||
|
|
||||||
|
if (!$checkConfig['status'])
|
||||||
|
return $this->redirect(['/config']);
|
||||||
|
|
||||||
|
$config_json = $this->config_json;
|
||||||
|
if ($checkConfig['status'])
|
||||||
|
$config_json = json_decode($checkConfig['data'], true);
|
||||||
|
return $config_json;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function actionDieuKhienThietBi() {
|
||||||
|
$this->view->title = Yii::t("app", "DIEU_KHIEN_THIET_BI");
|
||||||
|
$config_json = $this->getConfigJson();
|
||||||
|
|
||||||
|
$config_engine = ["start_at" => "00:00", "end_at" => "23:59"];
|
||||||
|
$engine_time_config = \app\models\SyncUrl::findOne(['key_config' => 'engine_time_config']);
|
||||||
|
if ($engine_time_config)
|
||||||
|
$config_engine = json_decode($engine_time_config->data, true);
|
||||||
|
return $this->render('dieu-khien-thiet-bi', [
|
||||||
|
"background" => $config_json['background'],
|
||||||
|
"config_engine" => $config_engine,
|
||||||
|
"config_light" => isset($config_json['open_door']['light']) ? $config_json['open_door']['light'] : false,
|
||||||
|
"engineStatus" => json_decode(@file_get_contents("http://localhost:4004/EngineStatus"), true),
|
||||||
|
"menu" => $this->renderPartial("menu", ["tab" => "device_controller"])
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function actionControlEngine($status) {
|
||||||
|
if (Yii::$app->request->isAjax) {
|
||||||
|
$options = [
|
||||||
|
'http' => [
|
||||||
|
'header' => "Content-Type: application/json",
|
||||||
|
'method' => "POST",
|
||||||
|
'content' => json_encode(["action" => $status]),
|
||||||
|
]
|
||||||
|
];
|
||||||
|
json_decode(@file_get_contents("http://localhost:4004/ControlEngine", false, stream_context_create($options)), true);
|
||||||
|
return $status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function actionSaveTimeLightConfig() {
|
||||||
|
if (Yii::$app->request->post()) {
|
||||||
|
$post = Yii::$app->request->post();
|
||||||
|
$config_json = $this->getConfigJson();
|
||||||
|
$config_json['open_door']['light'] = [
|
||||||
|
"enable" => $post['enable'],
|
||||||
|
"start_at" => $post['start_at'],
|
||||||
|
"end_at" => $post['end_at']
|
||||||
|
];
|
||||||
|
$options = [
|
||||||
|
'http' => [
|
||||||
|
'header' => "Content-Type: application/json",
|
||||||
|
'method' => "POST"
|
||||||
|
]
|
||||||
|
];
|
||||||
|
$tempConfig = json_decode(file_get_contents("http://localhost:4004/ReadEngineConfig", false, stream_context_create($options)), true);
|
||||||
|
|
||||||
|
if (!$tempConfig['status'])
|
||||||
|
return false;
|
||||||
|
|
||||||
|
$engineConfig = json_decode($tempConfig['data'], true);
|
||||||
|
$engineConfig['data']['engines'][0]['isConfig'] = "1";
|
||||||
|
|
||||||
|
file_get_contents("http://localhost:4004/SaveEngineConfig", false, stream_context_create([
|
||||||
|
'http' => [
|
||||||
|
'header' => "Content-Type: application/json",
|
||||||
|
'method' => "POST",
|
||||||
|
'content' => json_encode([
|
||||||
|
'path' => $engineConfig['data']['engines'][0]['path'],
|
||||||
|
'config' => $engineConfig,
|
||||||
|
'configEngine' => json_encode($config_json, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)
|
||||||
|
])
|
||||||
|
]
|
||||||
|
]));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function actionSaveTimeEngineConfig() {
|
||||||
|
if (Yii::$app->request->post()) {
|
||||||
|
$post = Yii::$app->request->post();
|
||||||
|
$engine_time_config = \app\models\SyncUrl::findOne(['key_config' => 'engine_time_config']);
|
||||||
|
$config_engine = ["start_at" => $post['start_at'], "end_at" => $post['end_at']];
|
||||||
|
if ($engine_time_config) {
|
||||||
|
$engine_time_config->data = json_encode($config_engine);
|
||||||
|
$engine_time_config->save();
|
||||||
|
} else {
|
||||||
|
$model = new \app\models\SyncUrl();
|
||||||
|
$model->create([
|
||||||
|
'key_config' => 'engine_time_config',
|
||||||
|
'data' => json_encode($config_engine)
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function actionBackground() {
|
||||||
|
if (Yii::$app->request->post()) {
|
||||||
|
$model = new \app\models\UploadForm();
|
||||||
|
$path = "bg";
|
||||||
|
$url = $model->UploadGlobal("image", ["PNG", "JPG", "JPEG", "GIF"], $path);
|
||||||
|
|
||||||
|
$config_json = $this->getConfigJson();
|
||||||
|
$config_json['background'] = "/uploads" . $url;
|
||||||
|
$options = [
|
||||||
|
'http' => [
|
||||||
|
'header' => "Content-Type: application/json",
|
||||||
|
'method' => "POST"
|
||||||
|
]
|
||||||
|
];
|
||||||
|
$tempConfig = json_decode(file_get_contents("http://localhost:4004/ReadEngineConfig", false, stream_context_create($options)), true);
|
||||||
|
|
||||||
|
if (!$tempConfig['status'])
|
||||||
|
return false;
|
||||||
|
|
||||||
|
$engineConfig = json_decode($tempConfig['data'], true);
|
||||||
|
$engineConfig['data']['engines'][0]['isConfig'] = "1";
|
||||||
|
|
||||||
|
file_get_contents("http://localhost:4004/SaveEngineConfig", false, stream_context_create([
|
||||||
|
'http' => [
|
||||||
|
'header' => "Content-Type: application/json",
|
||||||
|
'method' => "POST",
|
||||||
|
'content' => json_encode([
|
||||||
|
'path' => $engineConfig['data']['engines'][0]['path'],
|
||||||
|
'config' => $engineConfig,
|
||||||
|
'configEngine' => json_encode($config_json, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)
|
||||||
|
])
|
||||||
|
]
|
||||||
|
]));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function actionSound() {
|
||||||
|
if (Yii::$app->request->post()) {
|
||||||
|
$model = new \app\models\UploadForm();
|
||||||
|
$path = "audio";
|
||||||
|
$model->UploadSound("sound", ["WAV"], $path);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -297,7 +297,7 @@ class ListManagementController extends Controller {
|
|||||||
$model = $this->findModel($data['id']);
|
$model = $this->findModel($data['id']);
|
||||||
$images = json_decode($model->image, true);
|
$images = json_decode($model->image, true);
|
||||||
foreach ($images as $k => $v) {
|
foreach ($images as $k => $v) {
|
||||||
unlink("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $v['url']);
|
@unlink("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $v['url']);
|
||||||
}
|
}
|
||||||
common::updateFeature([
|
common::updateFeature([
|
||||||
"cmd" => "delete",
|
"cmd" => "delete",
|
||||||
|
|||||||
@@ -8,14 +8,14 @@
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
"CAU_HINH" => "Configuration",
|
"CAU_HINH" => "Configuration",
|
||||||
"CAU_HINH_THIET_BI" => "Device Configuration",
|
"CAU_HINH_THIET_BI" => "Device Config",
|
||||||
"CAU_HINH_MAY_CHU" => "Server Configuration",
|
"CAU_HINH_MAY_CHU" => "Server Config",
|
||||||
"CAU_HINH_NHAN_DIEN" => "Recognition Configuration",
|
"CAU_HINH_NHAN_DIEN" => "Recognition Config",
|
||||||
"CAU_HINH_IP" => "IP Configuration",
|
"CAU_HINH_IP" => "IP Config",
|
||||||
"DEVICE_CONFIG" => "",
|
"DEVICE_CONFIG" => " ",
|
||||||
"SERVER_CONFIG" => "",
|
"SERVER_CONFIG" => " ",
|
||||||
"ENGINE_CONFIG" => "",
|
"ENGINE_CONFIG" => " ",
|
||||||
"IP_CONFIG" => "",
|
"IP_CONFIG" => " ",
|
||||||
"SERVER_MQTT" => "server_mqtt",
|
"SERVER_MQTT" => "server_mqtt",
|
||||||
"URL" => "url",
|
"URL" => "url",
|
||||||
"LUU_LAI" => "Save",
|
"LUU_LAI" => "Save",
|
||||||
@@ -160,5 +160,21 @@ return [
|
|||||||
"XOA_LICH_TRINH" => "Delete schedule",
|
"XOA_LICH_TRINH" => "Delete schedule",
|
||||||
"BAN_CO_CHAC_CHAN_MUON_XOA_LICH_TRINH_NAY_KHONG" => "Are you sure you want to delete this schedule?",
|
"BAN_CO_CHAC_CHAN_MUON_XOA_LICH_TRINH_NAY_KHONG" => "Are you sure you want to delete this schedule?",
|
||||||
"SO_SANH_MAT" => "Face comparison",
|
"SO_SANH_MAT" => "Face comparison",
|
||||||
"BAN_CO_CHAC_CHAN_MUON_DOI_IP_KHONG" => "Are you sure you want to change the device's IP address?"
|
"BAN_CO_CHAC_CHAN_MUON_DOI_IP_KHONG" => "Are you sure you want to change the device's IP address?",
|
||||||
|
"THONG_TIN_HE_THONG" => "System Information",
|
||||||
|
"REBOOT" => "Reboot",
|
||||||
|
"BAN_CO_CHAC_CHAN_MUON_REBOOT_KHONG" => "Are you sure you want to reboot?",
|
||||||
|
"DIEU_KHIEN_THIET_BI" => "Device controller",
|
||||||
|
"DEVICE_CONTROLLER" => " ",
|
||||||
|
"DIEU_KHIEN_CHUONG_TRINH_NHAN_DIEN" => "Control recognition program",
|
||||||
|
"ON" => "On",
|
||||||
|
"OFF" => "Off",
|
||||||
|
"THOI_GIAN_HOAT_DONG_CUA_THIET_BI" => "Device operating time",
|
||||||
|
"THOI_GIAN_BAT_DEN" => "Time to turn on the light",
|
||||||
|
"BACKGROUND" => "Background",
|
||||||
|
"BACKGROUND_DESCRIPTION" => "Maximum size 3.5MB (recommended resolution 1280x640px)",
|
||||||
|
"AM_THANH" => "Sound",
|
||||||
|
"THOI_GIAN_KHONG_DUOC_DE_TRONG" => "Time cannot be left blank",
|
||||||
|
"THONG_TIN_DA_DUOC_LUU_LAI" => "The information has been saved",
|
||||||
|
"CHON_AM_THANH" => "Select sound"
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -160,5 +160,21 @@ return [
|
|||||||
"XOA_LICH_TRINH" => "スケジュールを削除",
|
"XOA_LICH_TRINH" => "スケジュールを削除",
|
||||||
"BAN_CO_CHAC_CHAN_MUON_XOA_LICH_TRINH_NAY_KHONG" => "このスケジュールを削除してもよろしいですか?",
|
"BAN_CO_CHAC_CHAN_MUON_XOA_LICH_TRINH_NAY_KHONG" => "このスケジュールを削除してもよろしいですか?",
|
||||||
"SO_SANH_MAT" => "顔比較",
|
"SO_SANH_MAT" => "顔比較",
|
||||||
"BAN_CO_CHAC_CHAN_MUON_DOI_IP_KHONG" => "デバイスの IP アドレスを変更してもよろしいですか?"
|
"BAN_CO_CHAC_CHAN_MUON_DOI_IP_KHONG" => "デバイスの IP アドレスを変更してもよろしいですか?",
|
||||||
|
"THONG_TIN_HE_THONG" => "システムインフォメーション",
|
||||||
|
"REBOOT" => "リブート",
|
||||||
|
"BAN_CO_CHAC_CHAN_MUON_REBOOT_KHONG" => "再起動してもよろしいですか?",
|
||||||
|
"DIEU_KHIEN_THIET_BI" => "コントローラ",
|
||||||
|
"DEVICE_CONTROLLER" => "Device controller",
|
||||||
|
"DIEU_KHIEN_CHUONG_TRINH_NHAN_DIEN" => "制御認識プログラム",
|
||||||
|
"ON" => "On",
|
||||||
|
"OFF" => "Off",
|
||||||
|
"THOI_GIAN_HOAT_DONG_CUA_THIET_BI" => "デバイスの動作時間",
|
||||||
|
"THOI_GIAN_BAT_DEN" => "ライトをつける時間です",
|
||||||
|
"BACKGROUND" => "背景",
|
||||||
|
"BACKGROUND_DESCRIPTION" => "最大サイズ 3.5MB (推奨解像度 1280x640px)",
|
||||||
|
"AM_THANH" => "音",
|
||||||
|
"THOI_GIAN_KHONG_DUOC_DE_TRONG" => "時間を空白のままにすることはできません",
|
||||||
|
"THONG_TIN_DA_DUOC_LUU_LAI" => "情報が保存されました",
|
||||||
|
"CHON_AM_THANH" => "サウンドを選択する"
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -160,5 +160,21 @@ return [
|
|||||||
"XOA_LICH_TRINH" => "Xóa lịch trình",
|
"XOA_LICH_TRINH" => "Xóa lịch trình",
|
||||||
"BAN_CO_CHAC_CHAN_MUON_XOA_LICH_TRINH_NAY_KHONG" => "Bạn có chắc chắn muốn xóa lịch trình này không?",
|
"BAN_CO_CHAC_CHAN_MUON_XOA_LICH_TRINH_NAY_KHONG" => "Bạn có chắc chắn muốn xóa lịch trình này không?",
|
||||||
"SO_SANH_MAT" => "So sánh mặt",
|
"SO_SANH_MAT" => "So sánh mặt",
|
||||||
"BAN_CO_CHAC_CHAN_MUON_DOI_IP_KHONG" => "Bạn có chắc chắn muốn thay đổi địa chỉ IP của thiết bị không?"
|
"BAN_CO_CHAC_CHAN_MUON_DOI_IP_KHONG" => "Bạn có chắc chắn muốn thay đổi địa chỉ IP của thiết bị không?",
|
||||||
|
"THONG_TIN_HE_THONG" => "Thông tin hệ thống",
|
||||||
|
"REBOOT" => "Khởi động lại thiết bị",
|
||||||
|
"BAN_CO_CHAC_CHAN_MUON_REBOOT_KHONG" => "Bạn có chắc chắn muốn khởi động lại thiết bị không?",
|
||||||
|
"DIEU_KHIEN_THIET_BI" => "Điều khiển thiết bị",
|
||||||
|
"DEVICE_CONTROLLER" => "Device controller",
|
||||||
|
"DIEU_KHIEN_CHUONG_TRINH_NHAN_DIEN" => "Điều khiển chương trình nhận diện",
|
||||||
|
"ON" => "Bật",
|
||||||
|
"OFF" => "Tắt",
|
||||||
|
"THOI_GIAN_HOAT_DONG_CUA_THIET_BI" => "Thời gian hoạt động của thiết bị",
|
||||||
|
"THOI_GIAN_BAT_DEN" => "Thời gian bật đèn",
|
||||||
|
"BACKGROUND" => "Hình nền",
|
||||||
|
"BACKGROUND_DESCRIPTION" => "Kích thước tối đa 3.5MB (độ phân giải khuyến nghị 1280x640px)",
|
||||||
|
"AM_THANH" => "Âm thanh",
|
||||||
|
"THOI_GIAN_KHONG_DUOC_DE_TRONG" => "Thời gian không được để trống",
|
||||||
|
"THONG_TIN_DA_DUOC_LUU_LAI" => "Thông tin đã được lưu lại",
|
||||||
|
"CHON_AM_THANH" => "Chọn âm thanh"
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -131,6 +131,33 @@ class UploadForm extends Model {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function UploadSound($file, $fileTypes, $path) {
|
||||||
|
$root = \Yii::getAlias('@app') . '/web/data';
|
||||||
|
$LocalPath = "/" . $path;
|
||||||
|
$RootFolder = $root . $LocalPath;
|
||||||
|
$destfile = "welcome_en.wav";
|
||||||
|
if (!empty($_FILES)) {
|
||||||
|
$tempFile = $_FILES[$file]['tmp_name'];
|
||||||
|
$targetPath = $RootFolder;
|
||||||
|
if (!file_exists($targetPath)) {
|
||||||
|
@mkdir($targetPath, 0777, true);
|
||||||
|
}
|
||||||
|
$targetFile = $targetPath . '/' . $destfile;
|
||||||
|
$targetFileLocal = $LocalPath . '/' . $destfile;
|
||||||
|
$fileParts = pathinfo($_FILES[$file]['name']);
|
||||||
|
if (in_array(strtoupper($fileParts['extension']), $fileTypes)) {
|
||||||
|
move_uploaded_file($tempFile, $targetFile);
|
||||||
|
if (file_exists($targetFile)) {
|
||||||
|
return $targetFileLocal;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//Move file
|
//Move file
|
||||||
public function MoveFile($file, $folder) {
|
public function MoveFile($file, $folder) {
|
||||||
$currentStorage = Storage::findOne(['stt' => 1])->folder;
|
$currentStorage = Storage::findOne(['stt' => 1])->folder;
|
||||||
|
|||||||
0
runtime/temp.txt
Normal file → Executable file
0
runtime/temp.txt
Normal file → Executable file
@@ -36,17 +36,19 @@ use yii\widgets\ActiveForm;
|
|||||||
<!-- Collect the nav links, forms, and other content for toggling -->
|
<!-- Collect the nav links, forms, and other content for toggling -->
|
||||||
<div class="collapse navbar-collapse pull-left" id="navbar-collapse">
|
<div class="collapse navbar-collapse pull-left" id="navbar-collapse">
|
||||||
<ul class="nav navbar-nav">
|
<ul class="nav navbar-nav">
|
||||||
<li class="<?php if (Yii::$app->controller->id == "config") echo "active"; ?>">
|
<li class="<?php if (Yii::$app->controller->id == "config" && Yii::$app->controller->action->id != "system-info") echo "active"; ?>">
|
||||||
<a href="<?php echo yii\helpers\Url::to(['/config/cau-hinh-thiet-bi']); ?>">
|
<a href="<?php echo yii\helpers\Url::to(['/config/cau-hinh-thiet-bi']); ?>">
|
||||||
<i class="fa fa-cogs"></i> <?php echo Yii::t("app", "CAU_HINH"); ?>
|
<i class="fa fa-cogs"></i> <?php echo Yii::t("app", "CAU_HINH"); ?>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php if (Yii::$app->params['type'] === "BiFace") { ?>
|
<?php if (Yii::$app->params['type'] === "BiFace") { ?>
|
||||||
<li>
|
<?php if (Yii::$app->user->identity->username == "admin") { ?>
|
||||||
<a href="<?php echo yii\helpers\Url::to(['/config/reset']); ?>" onclick="common.resetForm(this);return false;">
|
<li>
|
||||||
<i class="fa fa-refresh"></i> <?php echo Yii::t("app", "RESET_THIET_BI"); ?>
|
<a href="<?php echo yii\helpers\Url::to(['/config/reset']); ?>" onclick="common.resetForm(this);return false;">
|
||||||
</a>
|
<i class="fa fa-refresh"></i> <?php echo Yii::t("app", "RESET_THIET_BI"); ?>
|
||||||
</li>
|
</a>
|
||||||
|
</li>
|
||||||
|
<?php } ?>
|
||||||
<li class="<?php if (Yii::$app->controller->id == "list-management") echo "active"; ?>">
|
<li class="<?php if (Yii::$app->controller->id == "list-management") echo "active"; ?>">
|
||||||
<a href="<?php echo yii\helpers\Url::to(['/list-management']); ?>">
|
<a href="<?php echo yii\helpers\Url::to(['/list-management']); ?>">
|
||||||
<i class="fa fa-list"></i> <?php echo Yii::t("app", "QUAN_LY_MAU"); ?>
|
<i class="fa fa-list"></i> <?php echo Yii::t("app", "QUAN_LY_MAU"); ?>
|
||||||
@@ -62,6 +64,11 @@ 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>
|
<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>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="<?php if (Yii::$app->controller->id == "config" && Yii::$app->controller->action->id == "system-info") echo "active"; ?>">
|
||||||
|
<a href="<?php echo yii\helpers\Url::to(['/config/system-info']); ?>">
|
||||||
|
<i class="fa fa-info-circle"></i> <?php echo Yii::t("app", "THONG_TIN_HE_THONG"); ?>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -142,7 +142,7 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<br>
|
<br>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-10">
|
<div class="col-md-12">
|
||||||
{$menu}
|
{$menu}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<br>
|
<br>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-10">
|
<div class="col-md-12">
|
||||||
{$menu}
|
{$menu}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
114
views/config/dieu-khien-thiet-bi.tpl
Normal file
114
views/config/dieu-khien-thiet-bi.tpl
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
{extends file=$smarty.current_dir|cat:'/../extends.tpl'}
|
||||||
|
{use class="yii\helpers\Url"}
|
||||||
|
{use class="app\assets\ConfigAsset"}
|
||||||
|
{ConfigAsset::register($this)|void}
|
||||||
|
{block name='content'}
|
||||||
|
<style>
|
||||||
|
.input-group{
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.table-striped > tbody > tr:nth-of-type(odd) {
|
||||||
|
background-color: #d1d1d1;
|
||||||
|
}
|
||||||
|
.form-group{
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div class="container-fluid">
|
||||||
|
<br>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
{$menu}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<br>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-4 col-md-push-1">
|
||||||
|
<table class="table table-bordered table-striped" style="background: #fff;">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th style="width: 50%;">{Yii::t("app","DIEU_KHIEN_CHUONG_TRINH_NHAN_DIEN")}</th>
|
||||||
|
<td>
|
||||||
|
<div class="btn-group">
|
||||||
|
<button class="btn-control-engine btn btn-{if $engineStatus.status}success{else}default{/if}" onclick="controlEngine(this);" data-href="{Url::to(['control-engine', 'status'=>"on"])}">
|
||||||
|
{Yii::t("app","ON")}
|
||||||
|
</button>
|
||||||
|
<button class="btn-control-engine btn btn-{if $engineStatus.status}default{else}danger{/if}" onclick="controlEngine(this);" data-href="{Url::to(['control-engine', 'status'=>"off"])}">
|
||||||
|
{Yii::t("app","OFF")}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{Yii::t("app","THOI_GIAN_HOAT_DONG_CUA_THIET_BI")}</th>
|
||||||
|
<td>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-addon">{Yii::t("app","FROM")}</div>
|
||||||
|
<input type="text" class="form-control" name="EngineBegin" id="EngineBegin" value="{$config_engine.start_at|default:""}">
|
||||||
|
<div class="input-group-addon">{Yii::t("app","TO")}</div>
|
||||||
|
<input type="text" class="form-control" name="EngineEnd" id="EngineEnd" value="{$config_engine.end_at|default:""}">
|
||||||
|
<div class="input-group-btn">
|
||||||
|
<button id='btn-save-light' class="btn btn-primary" onclick="saveTimeEngineConfig(this);" data-href="{Url::to(['save-time-engine-config'])}">
|
||||||
|
<i class="fa fa-floppy-o"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{Yii::t("app","THOI_GIAN_BAT_DEN")}</th>
|
||||||
|
<td>
|
||||||
|
<div class="btn-group">
|
||||||
|
<button class="btn-control-light btn btn-{if $config_light.enable==="1"}success{else}default{/if}" onclick="controlSetupLight(this, true);">
|
||||||
|
{Yii::t("app","ON")}
|
||||||
|
</button>
|
||||||
|
<button class="btn-control-light btn btn-{if $config_light.enable==="1"}default{else}danger{/if}" onclick="controlSetupLight(this, false);">
|
||||||
|
{Yii::t("app","OFF")}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div id="time-light-config" class="form-group {if $config_light.enable==="0"}hidden{/if}">
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-addon">{Yii::t("app","FROM")}</div>
|
||||||
|
<input type="text" class="form-control" name="LightBegin" id="LightBegin" value="{$config_light.start_at|default:""}">
|
||||||
|
<div class="input-group-addon">{Yii::t("app","TO")}</div>
|
||||||
|
<input type="text" class="form-control" name="LightEnd" id="LightEnd" value="{$config_light.end_at|default:""}">
|
||||||
|
<div class="input-group-btn">
|
||||||
|
<button id='btn-save-light' class="btn btn-primary" onclick="saveTimeLightConfig(this);" data-href="{Url::to(['save-time-light-config'])}" data-enable='{$config_light.enable}'>
|
||||||
|
<i class="fa fa-floppy-o"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{Yii::t("app","BACKGROUND")}</th>
|
||||||
|
<td>
|
||||||
|
<input type="file" name="image" id="image">
|
||||||
|
<input type="hidden" name="url_upload_background" value="{Url::to(['background'])}">
|
||||||
|
<div>
|
||||||
|
{if $background!=""}
|
||||||
|
<img src="/data{$background}" width="100%" class="img-thumbnail">
|
||||||
|
{/if}
|
||||||
|
<i class="text-red"><span class="fa fa-info-circle"></span> {Yii::t("app","BACKGROUND_DESCRIPTION")}</i>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{Yii::t("app","AM_THANH")}</th>
|
||||||
|
<td>
|
||||||
|
<input type="file" name="sound" id="sound">
|
||||||
|
<input type="hidden" name="url_upload_sound" value="{Url::to(['sound'])}">
|
||||||
|
<div>
|
||||||
|
<a href="/data/audio/welcome_en.wav">welcome_en.wav</a>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/block}
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<br>
|
<br>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-10">
|
<div class="col-md-12">
|
||||||
{$menu}
|
{$menu}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<br>
|
<br>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-10">
|
<div class="col-md-12">
|
||||||
{$menu}
|
{$menu}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,35 +1,45 @@
|
|||||||
{use class="yii\helpers\Url"}
|
{use class="yii\helpers\Url"}
|
||||||
{if Yii::$app->params["type"]==="BiFace"}
|
{if Yii::$app->params["type"]==="BiFace"}
|
||||||
|
{$username=Yii::$app->user->identity->username}
|
||||||
<div class="mt-element-step">
|
<div class="mt-element-step">
|
||||||
<div class="row step-thin">
|
<div class="row step-thin">
|
||||||
<div class="col-md-3 bg-grey mt-step-col {if $tab=="device_config"}active{/if}">
|
{if $username=='admin'}
|
||||||
<div class="mt-step-number bg-white font-grey">1</div>
|
<div class="col-md-2 bg-grey mt-step-col {if $tab=="device_config"}active{/if}">
|
||||||
<div class="mt-step-title uppercase font-grey-cascade" style="cursor: pointer;" onclick="window.location = '{Url::to(['/config/cau-hinh-thiet-bi'])}';">
|
<div class="mt-step-number bg-white font-grey">1</div>
|
||||||
{Yii::t("app", "CAU_HINH_THIET_BI")}
|
<div class="mt-step-title uppercase font-grey-cascade" style="cursor: pointer;" onclick="window.location = '{Url::to(['/config/cau-hinh-thiet-bi'])}';">
|
||||||
|
{Yii::t("app", "CAU_HINH_THIET_BI")}
|
||||||
|
</div>
|
||||||
|
<div class="mt-step-content font-grey-cascade">{Yii::t("app", "DEVICE_CONFIG")}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-step-content font-grey-cascade">{Yii::t("app", "DEVICE_CONFIG")}</div>
|
<div class="col-md-2 bg-grey mt-step-col {if $tab=="server_config"}active{/if}">
|
||||||
</div>
|
<div class="mt-step-number bg-white font-grey">2</div>
|
||||||
<div class="col-md-3 bg-grey mt-step-col {if $tab=="server_config"}active{/if}">
|
<div class="mt-step-title uppercase font-grey-cascade" style="cursor: pointer;" onclick="window.location = '{Url::to(['/config'])}';">
|
||||||
<div class="mt-step-number bg-white font-grey">2</div>
|
{Yii::t("app", "CAU_HINH_MAY_CHU")}
|
||||||
<div class="mt-step-title uppercase font-grey-cascade" style="cursor: pointer;" onclick="window.location = '{Url::to(['/config'])}';">
|
</div>
|
||||||
{Yii::t("app", "CAU_HINH_MAY_CHU")}
|
<div class="mt-step-content font-grey-cascade">{Yii::t("app", "SERVER_CONFIG")}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-step-content font-grey-cascade">{Yii::t("app", "SERVER_CONFIG")}</div>
|
{/if}
|
||||||
</div>
|
<div class="col-md-2 bg-grey mt-step-col {if $tab=="engine_config"}active{/if}">
|
||||||
<div class="col-md-3 bg-grey mt-step-col {if $tab=="engine_config"}active{/if}">
|
<div class="mt-step-number bg-white font-grey">{if $username=='admin'}3{else}1{/if}</div>
|
||||||
<div class="mt-step-number bg-white font-grey">3</div>
|
|
||||||
<div class="mt-step-title uppercase font-grey-cascade" style="cursor: pointer;" onclick="window.location = '{Url::to(['/config/cau-hinh-nhan-dien'])}';">
|
<div class="mt-step-title uppercase font-grey-cascade" style="cursor: pointer;" onclick="window.location = '{Url::to(['/config/cau-hinh-nhan-dien'])}';">
|
||||||
{Yii::t("app", "CAU_HINH_NHAN_DIEN")}
|
{Yii::t("app", "CAU_HINH_NHAN_DIEN")}
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-step-content font-grey-cascade">{Yii::t("app", "ENGINE_CONFIG")}</div>
|
<div class="mt-step-content font-grey-cascade">{Yii::t("app", "ENGINE_CONFIG")}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3 bg-grey mt-step-col {if $tab=="ip_config"}active{/if}">
|
<div class="col-md-2 bg-grey mt-step-col {if $tab=="ip_config"}active{/if}">
|
||||||
<div class="mt-step-number bg-white font-grey">4</div>
|
<div class="mt-step-number bg-white font-grey">{if $username=='admin'}4{else}2{/if}</div>
|
||||||
<div class="mt-step-title uppercase font-grey-cascade" style="cursor: pointer;" onclick="window.location = '{Url::to(['/config/cau-hinh-ip'])}';">
|
<div class="mt-step-title uppercase font-grey-cascade" style="cursor: pointer;" onclick="window.location = '{Url::to(['/config/cau-hinh-ip'])}';">
|
||||||
{Yii::t("app", "CAU_HINH_IP")}
|
{Yii::t("app", "CAU_HINH_IP")}
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-step-content font-grey-cascade">{Yii::t("app", "IP_CONFIG")}</div>
|
<div class="mt-step-content font-grey-cascade">{Yii::t("app", "IP_CONFIG")}</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-md-2 bg-grey mt-step-col {if $tab=="device_controller"}active{/if}">
|
||||||
|
<div class="mt-step-number bg-white font-grey">{if $username=='admin'}5{else}3{/if}</div>
|
||||||
|
<div class="mt-step-title uppercase font-grey-cascade" style="cursor: pointer;" onclick="window.location = '{Url::to(['/config/dieu-khien-thiet-bi'])}';">
|
||||||
|
{Yii::t("app", "DIEU_KHIEN_THIET_BI")}
|
||||||
|
</div>
|
||||||
|
<div class="mt-step-content font-grey-cascade">{Yii::t("app", "DEVICE_CONTROLLER")}</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
57
views/config/system-info.tpl
Normal file
57
views/config/system-info.tpl
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
{extends file=$smarty.current_dir|cat:'/../extends.tpl'}
|
||||||
|
{use class="yii\helpers\Url"}
|
||||||
|
{use class="app\assets\ConfigAsset"}
|
||||||
|
{ConfigAsset::register($this)|void}
|
||||||
|
{block name='content'}
|
||||||
|
<style>
|
||||||
|
.input-group-addon{
|
||||||
|
width: 120px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.input-group{
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.table-striped > tbody > tr:nth-of-type(odd) {
|
||||||
|
background-color: #d1d1d1;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div class="container-fluid">
|
||||||
|
<br>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-3 col-md-push-1">
|
||||||
|
<table class="table table-bordered table-striped" style="background: #fff;">
|
||||||
|
<thead>
|
||||||
|
<tr style="background-color: #3c8dbc;color:#fff;">
|
||||||
|
<th colspan="2">{Yii::t("app", "THONG_TIN_HE_THONG")|upper}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th>CPU</th>
|
||||||
|
<td>ARM Mali-450 penta-core</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>MemTotal</th>
|
||||||
|
<td>2.0 GiB</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>DiskTotal</th>
|
||||||
|
<td>16.0 GiB</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Software version number</th>
|
||||||
|
<td>{$version}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Build time</th>
|
||||||
|
<td>{$build_time}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<button class="btn btn-danger" onclick="reboot(this);" data-href="{Url::to(['system-info'])}">
|
||||||
|
<i class="fa fa-refresh"></i> {Yii::t("app","REBOOT")}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/block}
|
||||||
@@ -33,6 +33,10 @@
|
|||||||
<input type="hidden" name="HAY_CHON_DOI_TUONG_DE_GAN_LICH_TRINH" value="{Yii::t("app", "HAY_CHON_DOI_TUONG_DE_GAN_LICH_TRINH")}">
|
<input type="hidden" name="HAY_CHON_DOI_TUONG_DE_GAN_LICH_TRINH" value="{Yii::t("app", "HAY_CHON_DOI_TUONG_DE_GAN_LICH_TRINH")}">
|
||||||
<input type="hidden" name="BAN_CO_CHAC_CHAN_MUON_XOA_LICH_TRINH_NAY_KHONG" value="{Yii::t("app", "BAN_CO_CHAC_CHAN_MUON_XOA_LICH_TRINH_NAY_KHONG")}">
|
<input type="hidden" name="BAN_CO_CHAC_CHAN_MUON_XOA_LICH_TRINH_NAY_KHONG" value="{Yii::t("app", "BAN_CO_CHAC_CHAN_MUON_XOA_LICH_TRINH_NAY_KHONG")}">
|
||||||
<input type="hidden" name="BAN_CO_CHAC_CHAN_MUON_DOI_IP_KHONG" value="{Yii::t("app", "BAN_CO_CHAC_CHAN_MUON_DOI_IP_KHONG")}">
|
<input type="hidden" name="BAN_CO_CHAC_CHAN_MUON_DOI_IP_KHONG" value="{Yii::t("app", "BAN_CO_CHAC_CHAN_MUON_DOI_IP_KHONG")}">
|
||||||
|
<input type="hidden" name="BAN_CO_CHAC_CHAN_MUON_REBOOT_KHONG" value="{Yii::t("app", "BAN_CO_CHAC_CHAN_MUON_REBOOT_KHONG")}">
|
||||||
|
<input type="hidden" name="THOI_GIAN_KHONG_DUOC_DE_TRONG" value="{Yii::t("app", "THOI_GIAN_KHONG_DUOC_DE_TRONG")}">
|
||||||
|
<input type="hidden" name="THONG_TIN_DA_DUOC_LUU_LAI" value="{Yii::t("app", "THONG_TIN_DA_DUOC_LUU_LAI")}">
|
||||||
|
<input type="hidden" name="CHON_AM_THANH" value="{Yii::t("app", "CHON_AM_THANH")}">
|
||||||
|
|
||||||
<div id="blocking" class="fade modal" role="dialog" tabindex="-1">
|
<div id="blocking" class="fade modal" role="dialog" tabindex="-1">
|
||||||
<div class="modal-dialog" style="top: 50%;margin-top: -45px;">
|
<div class="modal-dialog" style="top: 50%;margin-top: -45px;">
|
||||||
@@ -47,6 +51,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="reboot-blocking" class="fade modal" role="dialog" tabindex="-1">
|
||||||
|
<div class="modal-dialog" style="top: 50%;margin-top: -45px;">
|
||||||
|
<div class="modal-content" style="background-color: transparent;box-shadow: none;">
|
||||||
|
<div class="modal-body">
|
||||||
|
<div id='modelContent' class="text-center">
|
||||||
|
<i class="fa fa-spinner fa-pulse fa-5x fa-fw" style="color: #fff;"></i>
|
||||||
|
<br>
|
||||||
|
<b style="color: #fff;font-size: 25px;">Đang khởi động lại thiết bị, vui lòng chờ trong vài phút và tải lại trang!</b>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div id="uploadBlock" class="fade modal" role="dialog" tabindex="-1">
|
<div id="uploadBlock" class="fade modal" role="dialog" tabindex="-1">
|
||||||
<div class="modal-dialog" style="top: 50%;margin-top: -45px;">
|
<div class="modal-dialog" style="top: 50%;margin-top: -45px;">
|
||||||
<div class="modal-content" style="background-color: transparent;box-shadow: none;">
|
<div class="modal-content" style="background-color: transparent;box-shadow: none;">
|
||||||
|
|||||||
0
web/assets/temp.txt
Normal file → Executable file
0
web/assets/temp.txt
Normal file → Executable file
@@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
// comment out the following two lines when deployed to production
|
// comment out the following two lines when deployed to production
|
||||||
//defined('YII_DEBUG') or define('YII_DEBUG', true);
|
defined('YII_DEBUG') or define('YII_DEBUG', true);
|
||||||
//defined('YII_ENV') or define('YII_ENV', 'dev');
|
defined('YII_ENV') or define('YII_ENV', 'dev');
|
||||||
|
|
||||||
require __DIR__ . '/../vendor/autoload.php';
|
require __DIR__ . '/../vendor/autoload.php';
|
||||||
require __DIR__ . '/../vendor/yiisoft/yii2/Yii.php';
|
require __DIR__ . '/../vendor/yiisoft/yii2/Yii.php';
|
||||||
|
|||||||
165
web/js/config.js
165
web/js/config.js
@@ -1,5 +1,10 @@
|
|||||||
$(function () {
|
$(function () {
|
||||||
|
common.dateTimePickerHour("LightBegin");
|
||||||
|
common.dateTimePickerHour("LightEnd");
|
||||||
|
common.dateTimePickerHour("EngineBegin");
|
||||||
|
common.dateTimePickerHour("EngineEnd");
|
||||||
|
btnBackground($("input[name='url_upload_background']").val(), "", '.png,.jpg,.jpeg,.gif', 3.5);
|
||||||
|
btnSound($("input[name='url_upload_sound']").val(), "", '.wav', 3.5);
|
||||||
});
|
});
|
||||||
function saveStep1(e) {
|
function saveStep1(e) {
|
||||||
var servermqtt = $("input[name='servermqtt']").val();
|
var servermqtt = $("input[name='servermqtt']").val();
|
||||||
@@ -177,4 +182,162 @@ function changeIP(e) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function reboot(e) {
|
||||||
|
if (confirm($("input[name='BAN_CO_CHAC_CHAN_MUON_REBOOT_KHONG']").val())) {
|
||||||
|
$("#reboot-blocking").modal({
|
||||||
|
keyboard: false,
|
||||||
|
backdrop: false
|
||||||
|
});
|
||||||
|
$.ajax({
|
||||||
|
url: $(e).attr("data-href"),
|
||||||
|
type: 'POST',
|
||||||
|
success: function (data) {
|
||||||
|
|
||||||
|
},
|
||||||
|
error: function (jqXHR, textStatus, errorThrown) {
|
||||||
|
// $("#reboot-blocking").modal("hide");
|
||||||
|
// common.ajaxError();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function controlEngine(e) {
|
||||||
|
common.modalBlock(true);
|
||||||
|
$.ajax({
|
||||||
|
url: $(e).attr("data-href"),
|
||||||
|
type: 'POST',
|
||||||
|
success: function (data) {
|
||||||
|
common.modalBlock(false);
|
||||||
|
$(".btn-control-engine").removeClass("btn-success").removeClass("btn-danger").addClass("btn-default");
|
||||||
|
$(e).removeClass("btn-default").addClass(data == "on" ? "btn-success" : "btn-danger");
|
||||||
|
},
|
||||||
|
error: function (jqXHR, textStatus, errorThrown) {
|
||||||
|
common.modalBlock(false);
|
||||||
|
common.ajaxError();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function controlSetupLight(e, status) {
|
||||||
|
if (status)
|
||||||
|
$("#time-light-config").removeClass("hidden");
|
||||||
|
else
|
||||||
|
$("#time-light-config").addClass("hidden");
|
||||||
|
$("#btn-save-light").attr("data-enable", status ? "1" : "0");
|
||||||
|
$(".btn-control-light").removeClass("btn-success").removeClass("btn-danger").addClass("btn-default");
|
||||||
|
$(e).removeClass("btn-default").addClass(status ? "btn-success" : "btn-danger");
|
||||||
|
if (!status)
|
||||||
|
$("#btn-save-light").trigger("click");
|
||||||
|
}
|
||||||
|
|
||||||
|
function saveTimeLightConfig(e) {
|
||||||
|
var enable = $(e).attr("data-enable");
|
||||||
|
var start_at = $("input[name='LightBegin']").val();
|
||||||
|
var end_at = $("input[name='LightEnd']").val();
|
||||||
|
if (enable === "1" && (start_at == "" || end_at == "")) {
|
||||||
|
alert($("input[name='THOI_GIAN_KHONG_DUOC_DE_TRONG']").val());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
common.modalBlock(true);
|
||||||
|
$.ajax({
|
||||||
|
url: $(e).attr("data-href"),
|
||||||
|
type: 'POST',
|
||||||
|
data: {
|
||||||
|
enable: enable,
|
||||||
|
start_at: start_at,
|
||||||
|
end_at: end_at
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
common.modalBlock(false);
|
||||||
|
if (data)
|
||||||
|
notification.success($("input[name='THONG_TIN_DA_DUOC_LUU_LAI']").val(), 2000);
|
||||||
|
else
|
||||||
|
notification.danger($("input[name='CO_LOI_XAY_RA_HAY_THU_LAI']").val(), 2000);
|
||||||
|
},
|
||||||
|
error: function (jqXHR, textStatus, errorThrown) {
|
||||||
|
common.modalBlock(false);
|
||||||
|
common.ajaxError();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function saveTimeEngineConfig(e) {
|
||||||
|
var start_at = $("input[name='EngineBegin']").val();
|
||||||
|
var end_at = $("input[name='EngineEnd']").val();
|
||||||
|
if (start_at == "" || end_at == "") {
|
||||||
|
alert($("input[name='THOI_GIAN_KHONG_DUOC_DE_TRONG']").val());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
common.modalBlock(true);
|
||||||
|
$.ajax({
|
||||||
|
url: $(e).attr("data-href"),
|
||||||
|
type: 'POST',
|
||||||
|
data: {
|
||||||
|
start_at: start_at,
|
||||||
|
end_at: end_at
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
common.modalBlock(false);
|
||||||
|
if (data)
|
||||||
|
notification.success($("input[name='THONG_TIN_DA_DUOC_LUU_LAI']").val(), 2000);
|
||||||
|
else
|
||||||
|
notification.danger($("input[name='CO_LOI_XAY_RA_HAY_THU_LAI']").val(), 2000);
|
||||||
|
},
|
||||||
|
error: function (jqXHR, textStatus, errorThrown) {
|
||||||
|
common.modalBlock(false);
|
||||||
|
common.ajaxError();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function btnBackground(mUrl, className, extension, fileSize) {
|
||||||
|
var fData = {
|
||||||
|
UploadFile: true,
|
||||||
|
Name: className
|
||||||
|
};
|
||||||
|
fData[common.csrfParam] = common.csrf;
|
||||||
|
new afuButton({
|
||||||
|
uploadURI: mUrl,
|
||||||
|
formData: fData,
|
||||||
|
wrap: {
|
||||||
|
tagName: 'div',
|
||||||
|
classes: ''
|
||||||
|
},
|
||||||
|
fileExtension: extension,
|
||||||
|
fileSizeLimit: fileSize,
|
||||||
|
classes: 'btn btn-default btn-xs file-paperclip-' + className,
|
||||||
|
fakeInputContent: '<span class=\'fa fa-picture-o\'></span> ' + $("input[name='CHON_HINH_ANH']").val(),
|
||||||
|
onUploaded: function (data) {
|
||||||
|
common.uploadBlock(false);
|
||||||
|
window.location.reload(true);
|
||||||
|
}
|
||||||
|
}).addInstance('image' + className);
|
||||||
|
$(".file-paperclip-" + className).closest("div").attr("style", "display:inline-block;");
|
||||||
|
}
|
||||||
|
|
||||||
|
function btnSound(mUrl, className, extension, fileSize) {
|
||||||
|
var fData = {
|
||||||
|
UploadFile: true,
|
||||||
|
Name: className
|
||||||
|
};
|
||||||
|
fData[common.csrfParam] = common.csrf;
|
||||||
|
new afuButton({
|
||||||
|
uploadURI: mUrl,
|
||||||
|
formData: fData,
|
||||||
|
wrap: {
|
||||||
|
tagName: 'div',
|
||||||
|
classes: ''
|
||||||
|
},
|
||||||
|
fileExtension: extension,
|
||||||
|
fileSizeLimit: fileSize,
|
||||||
|
classes: 'btn btn-default btn-xs file-paperclip-' + className,
|
||||||
|
fakeInputContent: '<span class=\'fa fa-file\'></span> ' + $("input[name='CHON_AM_THANH']").val(),
|
||||||
|
onUploaded: function (data) {
|
||||||
|
common.uploadBlock(false);
|
||||||
|
notification.success($("input[name='THONG_TIN_DA_DUOC_LUU_LAI']").val(), 2000);
|
||||||
|
}
|
||||||
|
}).addInstance('sound' + className);
|
||||||
|
$(".file-paperclip-" + className).closest("div").attr("style", "display:inline-block;");
|
||||||
}
|
}
|
||||||
@@ -17,8 +17,10 @@ class ConfigTree extends Widget {
|
|||||||
|
|
||||||
public function run() {
|
public function run() {
|
||||||
|
|
||||||
$public_root = ['engine', 'recognition', 'open_door', 'screen', 'lang', 'camera'];
|
// $public_root = ['engine', 'recognition', 'open_door', 'screen', 'lang', 'camera'];
|
||||||
$public_cfg = ['engine|cam_id', 'engine|server_authen', 'recognition|server_recog', 'open_door|enable', 'open_door|port_name', 'screen|banner', 'lang', 'camera|rgb', 'camera|ir', 'camera|rgb|url', 'camera|ir|url'];
|
// $public_cfg = ['engine|cam_id', 'engine|server_authen', 'recognition|server_recog', 'open_door|enable', 'open_door|port_name', 'screen|banner', 'lang', 'camera|rgb', 'camera|ir', 'camera|rgb|url', 'camera|ir|url'];
|
||||||
|
$public_root = ['open_door', 'screen', 'lang', 'play_sound', 'background', 'filter', 'ads'];
|
||||||
|
$public_cfg = ['open_door|door_1', 'open_door|door_2', 'open_door|light', 'open_door|light|enable', 'open_door|light|start_at', 'open_door|light|end_at', 'filter|enable', 'filter|show_name', 'filter|urls', 'screen|banner', 'lang', 'ads|enable', 'ads|get_rules', 'ads|check_new_every', 'ads|ads_type', 'ads|show_video_after', 'ads|audio'];
|
||||||
|
|
||||||
return $this->render("config-tree", [
|
return $this->render("config-tree", [
|
||||||
"configLists" => $this->configLists,
|
"configLists" => $this->configLists,
|
||||||
|
|||||||
Reference in New Issue
Block a user