diff --git a/app/ui/index.html b/app/ui/index.html
index 675afd7..a40028d 100644
--- a/app/ui/index.html
+++ b/app/ui/index.html
@@ -29748,7 +29748,17 @@ function jlog(cd, svc, tx, j){
function renderJournalIn(g){
g.innerHTML = '
| 시각 | 화면 | 서비스 | XA | 결과 | 요약 |
' +
journal.slice(0,30).map(r=>`| ${r.t} | ${r.cd} | ${r.svc} | ${r.tx} |
- ${r.ok?'정상':'오류'} | ${r.sum} |
`).join('');
+ ${r.ok?'정상':'오류'} | ${r.sum} | `).join('')
+ + (SRVLOG.length && journal.length<30
+ ? SRVLOG.slice(0, 30-journal.length).map(r=>`| ${r[3]} | 서버 | ${r[0]} | - |
+ ${r[1]==='E'?'오류':r[1]==='W'?'경고':'정상'} | ${r[2]} |
`).join('')
+ : '');
+}
+/* 서버측 감사로그(cm_log) — 심화 서비스들이 적재한 실제 처리이력 */
+let SRVLOG = [];
+async function loadServerJournal(){
+ const j = await runQuery(`select svc_name, log_level, msg, to_char(created_at,'MM-DD HH24:MI:SS') from cm_log order by log_id desc limit 40`);
+ if (j.ok) { SRVLOG = j.rows; document.querySelectorAll('.jgrid').forEach(renderJournalIn); }
}
/* ───────── 조회/현황 화면 정의 ───────── */
@@ -29800,7 +29810,8 @@ async function renderDashIn(pane){
`;
+
+ 서비스 처리이력 (감사로그 cm_log)
로딩...
`;
const k = await runQuery(`select to_char((select max(biz_date) from purchase),'YYYY-MM-DD') 기준일,(select count(*) from purchase where biz_date=(select max(biz_date) from purchase)) 오늘건수,(select coalesce(sum(amount),0) from purchase where biz_date=(select max(biz_date) from purchase)) 오늘매입액,(select count(*) from purchase where date_trunc('month',biz_date)=date_trunc('month',(select max(biz_date) from purchase))) 당월건수,(select coalesce(sum(amount),0) from purchase where date_trunc('month',biz_date)=date_trunc('month',(select max(biz_date) from purchase))) 당월매입액,(select count(*) from merchant where status='ACTIVE') 활성가맹점,(select count(*) from purchase where status in ('A','M','H')) 미정산건`);
document.getElementById('dcards').innerHTML = k.ok
? k.cols.map((n,i)=>`${n}
${fmtN(k.rows[0][i])}
`).join('')
@@ -29811,6 +29822,9 @@ async function renderDashIn(pane){
grid(document.getElementById('dtop'), t, {psz:7});
const d = await runQuery(`select biz_date 영업일, count(*) 건수, sum(amount) 매입금액, sum(net) 정산액 from purchase group by biz_date order by biz_date desc limit 7`);
grid(document.getElementById('ddaily'), d, {psz:7});
+ const lg = await runQuery(`select to_char(created_at,'MM-DD HH24:MI:SS') 시각, svc_name 서비스, case log_level when 'E' then '오류' when 'W' then '경고' else '정상' end 구분, msg 내용 from cm_log order by log_id desc limit 40`);
+ grid(document.getElementById('dlog'), lg, {psz:12, name:'svclog'});
+ loadServerJournal();
setStatus('대시보드 로드 완료 — 운영 데이터 기준');
}
@@ -29900,7 +29914,8 @@ function renderSvcIn(pane, s, nm, note){
| 실행 전 |
`;
renderJournalIn(pane.querySelector('.jgrid'));
- document.getElementById(`${fid}_run`).onclick = async () => {
+ loadServerJournal();
+ const doRun = async () => {
const fields = {};
s.in.forEach((f,i) => { const v = document.getElementById(`${fid}_${i}`).value; if (v!=='') fields[f]=v; });
const tx = document.getElementById(`${fid}_tx`).checked;
@@ -29920,6 +29935,9 @@ function renderSvcIn(pane, s, nm, note){
}
jlog(cd, s.svc, tx, j);
};
+ document.getElementById(`${fid}_run`).onclick = doRun;
+ /* 조회성 서비스는 화면 진입 시 자동 조회 (실 업무화면처럼 즉시 데이터 표시) */
+ if (READONLY.test(s.svc)) setTimeout(doRun, 60);
}
/* ───────── 메뉴 ───────── */