63 lines
2.0 KiB
HTML
63 lines
2.0 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>{% block title %}新闻智能跟踪系统{% endblock %}</title>
|
|
<link rel="stylesheet" href="/static/style.css">
|
|
</head>
|
|
<body>
|
|
<div class="layout">
|
|
<aside class="sidebar">
|
|
<div class="brand">
|
|
<div class="brand-icon">📡</div>
|
|
<div>
|
|
<div class="brand-name">新闻智能跟踪</div>
|
|
<div class="brand-sub">AI News Tracker</div>
|
|
</div>
|
|
</div>
|
|
<nav>
|
|
<a href="/dashboard" class="{{ 'active' if active=='dashboard' }}">📊 仪表盘</a>
|
|
<a href="/news" class="{{ 'active' if active=='news' }}">📰 资讯列表</a>
|
|
<a href="/sources" class="{{ 'active' if active=='sources' }}">📡 数据源</a>
|
|
<a href="/profile" class="{{ 'active' if active=='profile' }}">🎯 兴趣画像</a>
|
|
<a href="/logs" class="{{ 'active' if active=='logs' }}">✉️ 通知日志</a>
|
|
<a href="/settings" class="{{ 'active' if active=='settings' }}">⚙️ 设置</a>
|
|
</nav>
|
|
<div class="sidebar-foot">由大模型智能分析驱动 · 可一键切换</div>
|
|
</aside>
|
|
<main class="main">
|
|
{% block content %}{% endblock %}
|
|
</main>
|
|
</div>
|
|
<script>
|
|
const API = {
|
|
json: async (url, body) => {
|
|
const r = await fetch(url, {
|
|
method: 'POST', headers: {'Content-Type': 'application/json'},
|
|
body: JSON.stringify(body)
|
|
});
|
|
return r.json();
|
|
},
|
|
get: async (url, params) => {
|
|
if (params){
|
|
const qs = Object.entries(params).filter(([k,v])=>v!==''&&v!=null)
|
|
.map(([k,v])=>encodeURIComponent(k)+'='+encodeURIComponent(v)).join('&');
|
|
if (qs) url += (url.includes('?')?'&':'?') + qs;
|
|
}
|
|
const r = await fetch(url);
|
|
return r.json();
|
|
}
|
|
};
|
|
function toast(msg, ok=true) {
|
|
const el = document.createElement('div');
|
|
el.className = 'toast ' + (ok ? 'ok' : 'err');
|
|
el.textContent = msg;
|
|
document.body.appendChild(el);
|
|
setTimeout(() => el.remove(), 2600);
|
|
}
|
|
</script>
|
|
{% block script %}{% endblock %}
|
|
</body>
|
|
</html>
|