mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 00:34:44 +02:00
Fix metadata coming from wings activity logs (#1284)
This commit is contained in:
parent
058b613c98
commit
05b1a44a34
@ -14,8 +14,6 @@ class ActivityProcessingController extends Controller
|
|||||||
{
|
{
|
||||||
public function __invoke(ActivityEventRequest $request): void
|
public function __invoke(ActivityEventRequest $request): void
|
||||||
{
|
{
|
||||||
$tz = Carbon::now()->getTimezone();
|
|
||||||
|
|
||||||
/** @var \App\Models\Node $node */
|
/** @var \App\Models\Node $node */
|
||||||
$node = $request->attributes->get('node');
|
$node = $request->attributes->get('node');
|
||||||
|
|
||||||
@ -49,11 +47,8 @@ class ActivityProcessingController extends Controller
|
|||||||
$log = [
|
$log = [
|
||||||
'ip' => empty($datum['ip']) ? '127.0.0.1' : $datum['ip'],
|
'ip' => empty($datum['ip']) ? '127.0.0.1' : $datum['ip'],
|
||||||
'event' => $datum['event'],
|
'event' => $datum['event'],
|
||||||
'properties' => json_encode($datum['metadata'] ?? []),
|
'properties' => $datum['metadata'] ?? [],
|
||||||
// We have to change the time to the current timezone due to the way Laravel is handling
|
'timestamp' => $when,
|
||||||
// the date casting internally. If we just leave it in UTC it ends up getting double-cast
|
|
||||||
// and the time is way off.
|
|
||||||
'timestamp' => $when->setTimezone($tz),
|
|
||||||
];
|
];
|
||||||
|
|
||||||
if ($user = $users->get($datum['user'])) {
|
if ($user = $users->get($datum['user'])) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user