mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 06:26:16 +00:00
#591 - sites
This commit is contained in:
31
app/Http/Resources/CommandExecutionResource.php
Normal file
31
app/Http/Resources/CommandExecutionResource.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use App\Models\CommandExecution;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
/** @mixin CommandExecution */
|
||||
class CommandExecutionResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'command_id' => $this->command_id,
|
||||
'server_id' => $this->server_id,
|
||||
'user_id' => $this->user_id,
|
||||
'server_log_id' => $this->server_log_id,
|
||||
'log' => ServerLogResource::make($this->serverLog),
|
||||
'variables' => $this->variables,
|
||||
'status' => $this->status,
|
||||
'status_color' => CommandExecution::$statusColors[$this->status] ?? 'gray',
|
||||
'created_at' => $this->created_at,
|
||||
'updated_at' => $this->updated_at,
|
||||
];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user