diff --git a/controllers/ConfigController.php b/controllers/ConfigController.php index 4054df30..69727388 100644 --- a/controllers/ConfigController.php +++ b/controllers/ConfigController.php @@ -563,4 +563,29 @@ 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 + ]); + } + } + } diff --git a/messages/en/app.php b/messages/en/app.php index ad061347..087bf973 100644 --- a/messages/en/app.php +++ b/messages/en/app.php @@ -160,5 +160,8 @@ return [ "XOA_LICH_TRINH" => "Delete 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", - "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?" ]; diff --git a/messages/ja/app.php b/messages/ja/app.php index 04fb0e72..bbb8e3ec 100644 --- a/messages/ja/app.php +++ b/messages/ja/app.php @@ -160,5 +160,8 @@ return [ "XOA_LICH_TRINH" => "スケジュールを削除", "BAN_CO_CHAC_CHAN_MUON_XOA_LICH_TRINH_NAY_KHONG" => "このスケジュールを削除してもよろしいですか?", "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" => "再起動してもよろしいですか?" ]; diff --git a/messages/vi/app.php b/messages/vi/app.php index a2541676..e976dc30 100644 --- a/messages/vi/app.php +++ b/messages/vi/app.php @@ -160,5 +160,8 @@ return [ "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?", "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?" ]; diff --git a/vendor/dmstr/yii2-adminlte-asset/example-views/yiisoft/yii2-app/layouts/header.php b/vendor/dmstr/yii2-adminlte-asset/example-views/yiisoft/yii2-app/layouts/header.php index a5c8cc03..1234423e 100644 --- a/vendor/dmstr/yii2-adminlte-asset/example-views/yiisoft/yii2-app/layouts/header.php +++ b/vendor/dmstr/yii2-adminlte-asset/example-views/yiisoft/yii2-app/layouts/header.php @@ -36,7 +36,7 @@ use yii\widgets\ActiveForm;
diff --git a/views/config/system-info.tpl b/views/config/system-info.tpl new file mode 100644 index 00000000..014f9aed --- /dev/null +++ b/views/config/system-info.tpl @@ -0,0 +1,58 @@ +{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'} + +{Yii::t("app", "THONG_TIN_HE_THONG")|upper} | +|
---|---|
CPU | +ARM Mali-450 penta-core | +
MemTotal | +2.0 GiB | +
DiskTotal | +16.0 GiB | +
Software version number | +{$version} | +
Build time | +{$build_time} | +