From 3a790484916d43423ec2f7ca92e5e73804ff688e Mon Sep 17 00:00:00 2001 From: "choi.jh" Date: Thu, 13 Nov 2025 15:16:03 +0900 Subject: [PATCH] trafficmonitor init...1 --- app/Views/admin/traffic/dashboard.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/Views/admin/traffic/dashboard.php b/app/Views/admin/traffic/dashboard.php index e67c688..18f7a67 100644 --- a/app/Views/admin/traffic/dashboard.php +++ b/app/Views/admin/traffic/dashboard.php @@ -46,20 +46,24 @@

+
+

getCustomTitle() ?>데이터 조회 설정

+
+
@@ -101,6 +105,7 @@ let trafficChart = null; document.addEventListener('DOMContentLoaded', () => { + // DOM 로드 후 바로 차트를 불러옵니다. fetchDataAndDrawChart(); }); @@ -109,7 +114,8 @@ // ----------------------------------------------------------- async function fetchAggregatedData(startDate, endDate) { - const baseEndpoint = 'getPK()}") ?>'; // CI4 라우트로 지정된 기본 엔드포인트 + // PHP 변수를 사용하여 엔드포인트 URL을 구성합니다. + const baseEndpoint = 'getPK()}") ?>'; // GET 요청을 위해 쿼리 파라미터를 생성합니다. const params = new URLSearchParams({ @@ -117,7 +123,7 @@ endDate: endDate }); - // 최종 엔드포인트 URL: /traffic/data?startDate=...&endDate=... + // 최종 엔드포인트 URL: /admin/traffic/data/{PK}?startDate=...&endDate=... const endpoint = `${baseEndpoint}?${params.toString()}`; const maxRetries = 3; @@ -126,8 +132,7 @@ for (let i = 0; i < maxRetries; i++) { try { const response = await fetch(endpoint, { - method: 'GET', // GET 방식으로 변경 - // GET 요청이므로 body는 포함하지 않습니다. + method: 'GET', // GET 방식으로 유지 }); const result = await response.json();