update system information

This commit is contained in:
2023-06-29 13:49:03 +07:00
parent e4e080266a
commit c29719d73e
8 changed files with 136 additions and 4 deletions

View File

@@ -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
]);
}
}
}