diff --git a/src/Web/wwwroot/css/ff.css b/src/Web/wwwroot/css/ff.css index 6c1af99..ebc9ea7 100644 --- a/src/Web/wwwroot/css/ff.css +++ b/src/Web/wwwroot/css/ff.css @@ -120,3 +120,7 @@ /* WP5 2·3단계: 조성 권장SP */ .ff-comp { margin-top:4px; font-size:12px; color:#cbd5e1; background:#172033; padding:3px 8px; border-radius:4px; } .ff-comp small { color:#94a3b8; } + +/* WP5 3단계: 조성 입력 폼 */ +.ff-comp-body { display:flex; gap:8px; align-items:center; flex-wrap:wrap; } +.ff-comp-list { width:100%; margin-top:4px; font-size:12px; color:#94a3b8; } diff --git a/src/Web/wwwroot/js/ff.js b/src/Web/wwwroot/js/ff.js index acf4263..14f1dca 100644 --- a/src/Web/wwwroot/js/ff.js +++ b/src/Web/wwwroot/js/ff.js @@ -87,6 +87,32 @@ async function ffSimLoad() { } document.getElementById('ff-sim-apply').onclick = ffSimApply; document.getElementById('ff-sim-clear').onclick = ffSimClear; + const ca = document.getElementById('ff-comp-apply'); + if (ca) { ca.onclick = ffCompApply; document.getElementById('ff-comp-clear').onclick = ffCompClear; ffCompRefresh(); } +} +async function ffCompRefresh() { + try { + const d = await ffApi('GET', '/api/ff/composition'); + const el = document.getElementById('ff-comp-list'); + const ents = Object.entries(d.fractions || {}); + el.innerHTML = ents.length ? '입력됨: ' + ents.map(([k, v]) => `${esc(k)}=${v}`).join(' · ') : '입력 없음 (config K 사용)'; + } catch (e) {} +} +async function ffCompApply() { + const g = id => document.getElementById(id); + const st = g('ff-comp-status'); + try { + await ffApi('POST', '/api/ff/composition', { columnId: +g('ff-comp-col').value, streamKey: g('ff-comp-key').value, fraction: +g('ff-comp-frac').value }); + st.textContent = '입력됨'; st.className = 'ff-msg'; ffCompRefresh(); + } catch (e) { st.textContent = '실패: ' + e.message; st.className = 'ff-msg err'; } +} +async function ffCompClear() { + const g = id => document.getElementById(id); + const st = g('ff-comp-status'); + try { + await ffApi('DELETE', `/api/ff/composition/${+g('ff-comp-col').value}/${encodeURIComponent(g('ff-comp-key').value)}`); + st.textContent = '해제됨'; st.className = 'ff-msg'; ffCompRefresh(); + } catch (e) { st.textContent = '실패: ' + e.message; st.className = 'ff-msg err'; } } async function ffSimApply() { const enabled = document.getElementById('ff-sim-enabled').checked; diff --git a/src/Web/wwwroot/panes/ff.html b/src/Web/wwwroot/panes/ff.html index 2524efb..cb92562 100644 --- a/src/Web/wwwroot/panes/ff.html +++ b/src/Web/wwwroot/panes/ff.html @@ -48,4 +48,18 @@ + + +