fix: append command history row in real-time after execution
This commit is contained in:
@@ -100,7 +100,7 @@ class TerminalController
|
||||
$ssh->disconnect();
|
||||
|
||||
$commandHistory = new CommandHistory();
|
||||
$commandHistory->log(
|
||||
$historyId = $commandHistory->log(
|
||||
$id,
|
||||
Session::get('user_id'),
|
||||
$command,
|
||||
@@ -115,6 +115,13 @@ class TerminalController
|
||||
'output' => $result['output'],
|
||||
'exit_status' => $result['exit_status'],
|
||||
'stderr' => $result['stderr'],
|
||||
'history' => [
|
||||
'id' => $historyId,
|
||||
'command' => $command,
|
||||
'exit_status' => $result['exit_status'] ?? 0,
|
||||
'executed_at' => date('Y-m-d H:i:s'),
|
||||
'username' => Session::get('username'),
|
||||
],
|
||||
]);
|
||||
} catch (\Throwable $e) {
|
||||
$this->view->json([
|
||||
|
||||
Reference in New Issue
Block a user