initial commit
This commit is contained in:
66
frontend/news.html
Normal file
66
frontend/news.html
Normal file
@@ -0,0 +1,66 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>AI 뉴스 - KisStock AI</title>
|
||||
<link rel="stylesheet" href="/static/css/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<nav>
|
||||
<div class="logo">KisStock AI</div>
|
||||
<div class="nav-links">
|
||||
<a href="/">대시보드</a>
|
||||
<a href="/trade">매매</a>
|
||||
<a href="/news" class="active">AI뉴스</a>
|
||||
<a href="/stocks">종목</a>
|
||||
<a href="/settings">설정</a>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="container">
|
||||
<div class="card">
|
||||
<h2>📰 실시간 AI 뉴스 분석</h2>
|
||||
<div id="news-list">
|
||||
Loading...
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
async function fetchNews() {
|
||||
try {
|
||||
const res = await fetch('/api/news');
|
||||
const data = await res.json();
|
||||
const container = document.getElementById('news-list');
|
||||
container.innerHTML = '';
|
||||
|
||||
data.forEach(item => {
|
||||
const div = document.createElement('div');
|
||||
div.style.marginBottom = "1.5rem";
|
||||
div.style.borderBottom = "1px solid rgba(255,255,255,0.05)";
|
||||
div.style.paddingBottom = "1rem";
|
||||
|
||||
const scoreColor = item.impact_score > 0 ? 'text-success' : (item.impact_score < 0 ? 'text-danger' : 'text-muted');
|
||||
|
||||
div.innerHTML = `
|
||||
<div style="display:flex; justify-content:space-between; align-items:flex-start;">
|
||||
<a href="${item.link}" target="_blank" style="color:var(--text-primary); text-decoration:none; font-size:1.1rem; font-weight:600;">${item.title.replace(/<[^>]*>?/gm, '')}</a>
|
||||
<span class="badge ${scoreColor}" style="margin-left:8px; font-size:0.9rem;">AI Score: ${item.impact_score}</span>
|
||||
</div>
|
||||
<div class="text-muted" style="margin: 0.5rem 0;">${item.analysis_result || item.related_sector}</div>
|
||||
<div style="display:flex; justify-content:space-between; font-size:0.8rem; color:#64748b;">
|
||||
<span>${item.pub_date}</span>
|
||||
<span>관련종목: ${item.related_sector || '분석중'}</span>
|
||||
</div>
|
||||
`;
|
||||
container.appendChild(div);
|
||||
});
|
||||
} catch(e) { console.error(e); }
|
||||
}
|
||||
|
||||
fetchNews();
|
||||
setInterval(fetchNews, 30000);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user