diff --git a/platform/backend/app/api/assets.py b/platform/backend/app/api/assets.py index 39bf322..efbbd38 100644 --- a/platform/backend/app/api/assets.py +++ b/platform/backend/app/api/assets.py @@ -4,6 +4,7 @@ import hashlib from pathlib import Path from fastapi import APIRouter, Depends, HTTPException, UploadFile, File, Query from sqlalchemy.orm import Session +from sqlalchemy import func from typing import List, Optional from ..database import get_db @@ -68,7 +69,7 @@ def get_counts( ): total = db.query(MediaAsset).count() by_type = {} - rows = db.query(MediaAsset.file_type, db.func.count(MediaAsset.id)).group_by(MediaAsset.file_type).all() + rows = db.query(MediaAsset.file_type, func.count(MediaAsset.id)).group_by(MediaAsset.file_type).all() for ftype, cnt in rows: by_type[ftype] = cnt return {"total": total, "by_type": by_type} diff --git a/platform/frontend/assets.html b/platform/frontend/assets.html new file mode 100644 index 0000000..02ecec0 --- /dev/null +++ b/platform/frontend/assets.html @@ -0,0 +1,261 @@ + + + + + + 宇之然内容创作平台 - 素材库 + + + + + + +
+ + +
+
+

🖼️ 素材库

+
+
+ + + + + + + + + + + + + 🔄 刷新 + 📤 上传素材 +
+
+ 总计: {{ assetStats.total }} 个 + {{ getTypeName(type) }}: {{ count }} +
+
加载中...
+
+
📂
+
暂无素材,点击上方按钮上传
+
+
+
+
+ + + +
+
{{ asset.filename }}
+
{{ formatSize(asset.size) }} | {{ formatDate(asset.created_at) }}
+
+ {{ tag }} +
+
+ 复制 + 删除 +
+
+
+
+
+
+ + +
+
📤
+
将文件拖到此处,或点击上传
+
支持: JPG, PNG, GIF, WebP, PDF, Word, PPT, MP4
+
+
+
+ + +
+ +
+ +
+
+ + + +
+
{{ previewAssetData.filename }}
+
{{ formatSize(previewAssetData.size) }} | {{ formatDate(previewAssetData.created_at) }}
+
{{ previewAssetData.alt_text }}
+
+ {{ tag }} +
+
使用次数: {{ previewAssetData.usage_count || 0 }}
+
+
+
+ + + + + diff --git a/platform/frontend/calendar.html b/platform/frontend/calendar.html new file mode 100644 index 0000000..206b85c --- /dev/null +++ b/platform/frontend/calendar.html @@ -0,0 +1,296 @@ + + + + + + 宇之然内容创作平台 - 内容日历 + + + + + + +
+ + +
+
+
+
+

📅 内容日历

+
+ + {{ currentYear }}年 {{ currentMonth }}月 + + 今天 +
+
+ +
+
待发布: {{ stats.planned }}
+
已发布: {{ stats.published }}
+
延迟: {{ stats.delayed }}
+
取消: {{ stats.cancelled }}
+
+ +
+
{{ day }}
+
+
{{ day.day }}
+
+
+ {{ entry.platform_icon }} {{ entry.title || '未命名' }} +
+
+
+
+
+
+
+ + +
+ + 添加日程 + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + \ No newline at end of file diff --git a/platform/frontend/metrics.html b/platform/frontend/metrics.html new file mode 100644 index 0000000..13d9c1d --- /dev/null +++ b/platform/frontend/metrics.html @@ -0,0 +1,231 @@ + + + + + + 宇之然内容创作平台 - 数据分析 + + + + + + +
+ + +
+
+

📊 数据分析

+
+
+
{{ dashboard.total_topics }}
+
选题总数
+
+
+
{{ dashboard.total_published }}
+
已发布
+
+
+
{{ dashboard.total_views }}
+
总阅读
+
+
+
{{ dashboard.avg_engagement_rate }}%
+
平均互动率
+
+
+
+

📈 选题状态分布

+
+
+
{{ count }}
+
{{ getStatusLabel(status) }}
+
+
+
+
+

🔥 热门选题 TOP10

+ + + + + + + + + + +
+
+

📉 数据趋势

+
+ + 7天 + 30天 + 90天 + +
+
+
+
+
{{ item.period }}
+
+
+
+
{{ item.views || 0 }} 阅读
+
+
暂无数据
+
+
+
+
+

🏆 平台对比

+ + + + + + + + + + + + + + +
+
+

💡 选题推荐

+ + + + + + + + + + +
+
+
+
+ + + + + diff --git a/platform/frontend/navigation-component.js b/platform/frontend/navigation-component.js index 20f679a..2282ed3 100644 --- a/platform/frontend/navigation-component.js +++ b/platform/frontend/navigation-component.js @@ -35,6 +35,11 @@