From a559fa2303df12f8aac2097311c508de51aa71f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B6=8C=ED=98=81=EC=84=B1?= Date: Tue, 3 Feb 2026 11:20:47 +0900 Subject: [PATCH] =?UTF-8?q?feat:=EC=8B=9C=EC=8A=A4=ED=85=9C=20=EC=95=8C?= =?UTF-8?q?=EB=A6=BC=20AI=20=EB=B6=84=EC=84=9D=EC=9A=A9=20=EB=B3=B5?= =?UTF-8?q?=EC=82=AC=20=EB=B2=84=ED=8A=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - StatAlert 모델에 ai_analysis_summary accessor 추가 - 알림 상세 아코디언에 'AI 분석용 복사' 버튼 추가 - 클립보드 복사 시 심각도/도메인/유형/메시지 등 포맷팅 Co-Authored-By: Claude Opus 4.5 --- app/Models/Stats/StatAlert.php | 32 +++++++++++++++++++ resources/views/system/alerts/index.blade.php | 32 +++++++++++++++++-- 2 files changed, 61 insertions(+), 3 deletions(-) diff --git a/app/Models/Stats/StatAlert.php b/app/Models/Stats/StatAlert.php index b1875b7a..ab3e6df7 100644 --- a/app/Models/Stats/StatAlert.php +++ b/app/Models/Stats/StatAlert.php @@ -67,4 +67,36 @@ public function getDomainLabelAttribute(): string default => $this->domain, }; } + + /** + * AI 분석용 요약 텍스트 + */ + public function getAiAnalysisSummaryAttribute(): string + { + $lines = []; + $lines[] = "=== SAM 시스템 알림 분석 요청 ==="; + $lines[] = ""; + $lines[] = "■ 심각도: {$this->severity} ({$this->severity_label})"; + $lines[] = "■ 도메인: {$this->domain} ({$this->domain_label})"; + $lines[] = "■ 알림 유형: {$this->alert_type}"; + $lines[] = "■ 제목: {$this->title}"; + $lines[] = "■ 발생 시간: {$this->created_at?->format('Y-m-d H:i:s')}"; + + if ($this->message) { + $lines[] = ""; + $lines[] = "■ 상세 메시지:"; + $lines[] = $this->message; + } + + if ($this->current_value || $this->threshold_value) { + $lines[] = ""; + $lines[] = "■ 현재값: {$this->current_value}"; + $lines[] = "■ 임계값: {$this->threshold_value}"; + } + + $lines[] = ""; + $lines[] = "위 시스템 알림의 원인과 해결 방법을 분석해주세요."; + + return implode("\n", $lines); + } } \ No newline at end of file diff --git a/resources/views/system/alerts/index.blade.php b/resources/views/system/alerts/index.blade.php index 7ab751eb..997a3508 100644 --- a/resources/views/system/alerts/index.blade.php +++ b/resources/views/system/alerts/index.blade.php @@ -169,9 +169,18 @@ class="text-green-600 hover:text-green-800 text-xs">
-
- 유형: - {{ $alert->alert_type }} +
+
+ 유형: + {{ $alert->alert_type }} +
+
@if($alert->message)
@@ -206,6 +215,11 @@ class="text-green-600 hover:text-green-800 text-xs"> @endif
+ +@foreach($alerts as $alert) + +@endforeach + @endsection \ No newline at end of file