From 1532cecedcf9f67b09b6cd71395dc0ed25308a71 Mon Sep 17 00:00:00 2001 From: Leonid Nikitin Date: Sun, 28 Apr 2024 02:12:09 +0500 Subject: [PATCH] For demo mode, I hid the display of IP and UserAgent. --- app/application/app/Events/CreatedCaptchaLog.php | 12 ++++++++++-- .../views/private/dashboard/index.blade.php | 16 ++++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/app/application/app/Events/CreatedCaptchaLog.php b/app/application/app/Events/CreatedCaptchaLog.php index 3a99380..cbdc7e6 100644 --- a/app/application/app/Events/CreatedCaptchaLog.php +++ b/app/application/app/Events/CreatedCaptchaLog.php @@ -29,13 +29,21 @@ public function __construct(CaptchaLog $captchaLog) { $link = route('captcha-tokens.edit', ['captcha_token' => $captchaLog->captcha->captcha_token_id], false); $title = $captchaLog->captcha->captchaToken->title; } + + $ip = $captchaLog->ip; + $userAgent = $captchaLog->user_agent; + if (Helpers::isDemoMode()) { + $ip = __('Demo Mode'); + $userAgent = __('Demo Mode'); + } + $this->captchaLog = [ 'created_at' => $captchaLog->created_at->format("d.m.Y H:i:s"), 'link' => $link, 'title' => $title, 'type' => $captchaLog->type->getTitle(), - 'ip' => $captchaLog->ip, - 'user_agent' => $captchaLog->user_agent, + 'ip' => $ip, + 'user_agent' => $userAgent, 'referer' => $captchaLog->referer, ]; } diff --git a/app/application/resources/views/private/dashboard/index.blade.php b/app/application/resources/views/private/dashboard/index.blade.php index 7624168..39cde16 100644 --- a/app/application/resources/views/private/dashboard/index.blade.php +++ b/app/application/resources/views/private/dashboard/index.blade.php @@ -25,8 +25,20 @@

{{ $item->type->getTitle() }}

-

IP: {{ $item->ip }}

-

User Agent: {{ $item->user_agent }}

+

IP: + @demo + {{ __('Demo Mode') }} + @else + {{ $item->ip }} + @endif +

+

User Agent: + @demo + {{ __('Demo Mode') }} + @else + {{ $item->user_agent }} + @endif +

referer: {{ $item->referer }}