update delete database option
This commit is contained in:
@@ -300,7 +300,7 @@ class ConfigController extends Controller {
|
||||
}
|
||||
|
||||
public function actionReset() {
|
||||
if (Yii::$app->request->isAjax) {
|
||||
if (Yii::$app->request->post()) {
|
||||
$tempConfig = json_decode(file_get_contents("http://localhost:4004/ReadEngineConfig", false, stream_context_create([
|
||||
'http' => [
|
||||
'header' => "Content-Type: application/json",
|
||||
@@ -330,7 +330,17 @@ class ConfigController extends Controller {
|
||||
])
|
||||
]
|
||||
]));
|
||||
if (Yii::$app->request->post("deleteDB") === "yes") {
|
||||
\Yii::$app->db->createCommand()->truncateTable('capture_logs')->execute();
|
||||
\Yii::$app->db->createCommand()->truncateTable('list_management')->execute();
|
||||
}
|
||||
return Url::to(['/config']);
|
||||
} else {
|
||||
Yii::$app->response->format = "json";
|
||||
return [
|
||||
"title" => "Reset thiết bị",
|
||||
"form" => $this->renderPartial("reset")
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user