Compare commits
2 Commits
LitePro_2.
...
litepro_de
Author | SHA1 | Date | |
---|---|---|---|
9960469007 | |||
6ae14302fd |
|
@ -518,6 +518,7 @@ class ApiController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionReGenFeature() {
|
public function actionReGenFeature() {
|
||||||
|
@file_get_contents("http://localhost:2305/update-feature");
|
||||||
\app\models\SyncUrl::deleteAll(['key_config' => 'log_process_status']);
|
\app\models\SyncUrl::deleteAll(['key_config' => 'log_process_status']);
|
||||||
$updating = \app\models\SyncUrl::findOne(['key_config' => 'updating']);
|
$updating = \app\models\SyncUrl::findOne(['key_config' => 'updating']);
|
||||||
if (!$updating) {
|
if (!$updating) {
|
||||||
|
@ -882,4 +883,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' => [
|
||||||
|
@ -588,4 +593,171 @@ class ConfigController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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",
|
||||||
|
@ -163,5 +163,18 @@ return [
|
||||||
"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",
|
"THONG_TIN_HE_THONG" => "System Information",
|
||||||
"REBOOT" => "Reboot",
|
"REBOOT" => "Reboot",
|
||||||
"BAN_CO_CHAC_CHAN_MUON_REBOOT_KHONG" => "Are you sure you want to 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"
|
||||||
];
|
];
|
||||||
|
|
|
@ -163,5 +163,18 @@ return [
|
||||||
"BAN_CO_CHAC_CHAN_MUON_DOI_IP_KHONG" => "デバイスの IP アドレスを変更してもよろしいですか?",
|
"BAN_CO_CHAC_CHAN_MUON_DOI_IP_KHONG" => "デバイスの IP アドレスを変更してもよろしいですか?",
|
||||||
"THONG_TIN_HE_THONG" => "システムインフォメーション",
|
"THONG_TIN_HE_THONG" => "システムインフォメーション",
|
||||||
"REBOOT" => "リブート",
|
"REBOOT" => "リブート",
|
||||||
"BAN_CO_CHAC_CHAN_MUON_REBOOT_KHONG" => "再起動してもよろしいですか?"
|
"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" => "サウンドを選択する"
|
||||||
];
|
];
|
||||||
|
|
|
@ -163,5 +163,18 @@ return [
|
||||||
"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",
|
"THONG_TIN_HE_THONG" => "Thông tin hệ thống",
|
||||||
"REBOOT" => "Khởi động lại thiết bị",
|
"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?"
|
"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;
|
||||||
|
|
|
@ -42,11 +42,13 @@ use yii\widgets\ActiveForm;
|
||||||
</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"); ?>
|
||||||
|
|
|
@ -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}
|
|
@ -54,5 +54,4 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
{/block}
|
{/block}
|
|
@ -34,7 +34,9 @@
|
||||||
<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="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;">
|
||||||
|
|
|
@ -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';
|
||||||
|
|
145
web/js/config.js
145
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();
|
||||||
|
@ -198,3 +203,141 @@ function reboot(e) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user