- Add hotspot_source/hotspot_item/hotspot_analysis table definitions - Add MySQL DDL for all three tables with indexes - Create hotspot dashboard UI (index.ui) with stats, tabs for CRUD - Add DSPY endpoints: stats, fetch_now (RSS/API), analyze (auto-classify) - Register paths in load_path.py with logined access - Add '热点雷达' menu entry
162 lines
8.1 KiB
XML
162 lines
8.1 KiB
XML
{% set roles = get_user_roles(get_user()) %}
|
|
{
|
|
"widgettype": "VBox",
|
|
"options": {
|
|
"children": [
|
|
{
|
|
"widgettype": "Text",
|
|
"options": {
|
|
"text": "热点雷达系统",
|
|
"style": "font-size:24px;font-weight:bold;padding:16px 16px 0 16px;"
|
|
}
|
|
},
|
|
{
|
|
"widgettype": "Text",
|
|
"options": {
|
|
"text": "指定来源的热点聚合分析平台",
|
|
"style": "font-size:14px;color:#999;padding:0 16px 16px 16px;"
|
|
}
|
|
},
|
|
{
|
|
"widgettype": "HBox",
|
|
"options": {
|
|
"children": [
|
|
{
|
|
"widgettype": "VBox",
|
|
"options": {
|
|
"id": "stat_total",
|
|
"children": [
|
|
{"widgettype": "Text", "options": {"text": "热点总数", "style": "color:#666;font-size:12px;"}},
|
|
{"widgettype": "Text", "options": {"text": "0", "style": "font-size:28px;font-weight:bold;color:#1890ff;"}}
|
|
],
|
|
"style": "padding:16px;background:#f0f5ff;border-radius:8px;margin:8px;min-width:100px;text-align:center;"
|
|
}
|
|
},
|
|
{
|
|
"widgettype": "VBox",
|
|
"options": {
|
|
"id": "stat_rising",
|
|
"children": [
|
|
{"widgettype": "Text", "options": {"text": "上升中", "style": "color:#666;font-size:12px;"}},
|
|
{"widgettype": "Text", "options": {"text": "0", "style": "font-size:28px;font-weight:bold;color:#52c41a;"}}
|
|
],
|
|
"style": "padding:16px;background:#f6ffed;border-radius:8px;margin:8px;min-width:100px;text-align:center;"
|
|
}
|
|
},
|
|
{
|
|
"widgettype": "VBox",
|
|
"options": {
|
|
"id": "stat_hot",
|
|
"children": [
|
|
{"widgettype": "Text", "options": {"text": "正热点", "style": "color:#666;font-size:12px;"}},
|
|
{"widgettype": "Text", "options": {"text": "0", "style": "font-size:28px;font-weight:bold;color:#ff4d4f;"}}
|
|
],
|
|
"style": "padding:16px;background:#fff2f0;border-radius:8px;margin:8px;min-width:100px;text-align:center;"
|
|
}
|
|
},
|
|
{
|
|
"widgettype": "VBox",
|
|
"options": {
|
|
"id": "stat_cooling",
|
|
"children": [
|
|
{"widgettype": "Text", "options": {"text": "降温中", "style": "color:#666;font-size:12px;"}},
|
|
{"widgettype": "Text", "options": {"text": "0", "style": "font-size:28px;font-weight:bold;color:#faad14;"}}
|
|
],
|
|
"style": "padding:16px;background:#fffbe6;border-radius:8px;margin:8px;min-width:100px;text-align:center;"
|
|
}
|
|
},
|
|
{
|
|
"widgettype": "VBox",
|
|
"options": {
|
|
"id": "stat_expired",
|
|
"children": [
|
|
{"widgettype": "Text", "options": {"text": "已过期", "style": "color:#666;font-size:12px;"}},
|
|
{"widgettype": "Text", "options": {"text": "0", "style": "font-size:28px;font-weight:bold;color:#999;"}}
|
|
],
|
|
"style": "padding:16px;background:#f5f5f5;border-radius:8px;margin:8px;min-width:100px;text-align:center;"
|
|
}
|
|
},
|
|
{
|
|
"widgettype": "VBox",
|
|
"options": {
|
|
"id": "stat_sources",
|
|
"children": [
|
|
{"widgettype": "Text", "options": {"text": "数据来源", "style": "color:#666;font-size:12px;"}},
|
|
{"widgettype": "Text", "options": {"text": "0", "style": "font-size:28px;font-weight:bold;color:#722ed1;"}}
|
|
],
|
|
"style": "padding:16px;background:#f9f0ff;border-radius:8px;margin:8px;min-width:100px;text-align:center;"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"widgettype": "HBox",
|
|
"options": {
|
|
"children": [
|
|
{
|
|
"widgettype": "Button",
|
|
"options": {
|
|
"label": "立即抓取全部来源",
|
|
"actiontype": "script",
|
|
"script": "fetch('/hotspot/fetch_now.dspy').then(r=>r.json()).then(d=>{alert('抓取完成: 处理'+d.total+'个来源,新增'+d.new_items+'条');setTimeout(()=>location.reload(),1000);}).catch(e=>alert('抓取出错: '+e))",
|
|
"style": "margin:8px;"
|
|
}
|
|
},
|
|
{
|
|
"widgettype": "Button",
|
|
"options": {
|
|
"label": "刷新统计",
|
|
"actiontype": "script",
|
|
"script": "fetch('/hotspot/stats.dspy').then(r=>r.json()).then(d=>{document.querySelectorAll('[id^=stat_]').forEach(el=>{const num=el.querySelectorAll('div')[1];if(num){const k=el.id.replace('stat_','');num.textContent=d[k]||0;}});}).catch(e=>console.error(e))",
|
|
"style": "margin:8px;"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"widgettype": "Tab",
|
|
"options": {
|
|
"tabs": [
|
|
{
|
|
"title": "热点条目",
|
|
"content": {
|
|
"widgettype": "urlwidget",
|
|
"options": {
|
|
"url": "{{ entire_url('hotspot_item') }}"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"title": "来源管理",
|
|
"content": {
|
|
"widgettype": "urlwidget",
|
|
"options": {
|
|
"url": "{{ entire_url('hotspot_source') }}"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"title": "分析记录",
|
|
"content": {
|
|
"widgettype": "urlwidget",
|
|
"options": {
|
|
"url": "{{ entire_url('hotspot_analysis') }}"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"widgettype": "Text",
|
|
"options": {
|
|
"text": "提示:在「来源管理」中添加 RSS/API 来源后,点击「立即抓取」获取热点数据。",
|
|
"style": "font-size:12px;color:#bbb;padding:16px;"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|