Fix calendar filter, module triggers, API cleanup, consolidate get_current_admin, fix LLM schema
This commit is contained in:
@@ -106,8 +106,7 @@
|
||||
<div><span>今日任务</span><span>{{ mod.task_count }} 个</span></div>
|
||||
<div><span>成功率</span><span>{{ mod.success_rate > 0 ? mod.success_rate + '%' : '暂无' }}</span></div>
|
||||
<div style="margin-top:10px; border-bottom:none;">
|
||||
<el-button v-if="mod.id === 'scheduled_optimize_sources'" size="small" type="primary" @click="triggerModule(mod.id)" :loading="runningModule === mod.id">立即运行</el-button>
|
||||
<el-button v-if="mod.id === 'scheduled_metrics_sync'" size="small" type="primary" @click="triggerModule(mod.id)" :loading="runningModule === mod.id">立即运行</el-button>
|
||||
<el-button size="small" type="primary" @click="triggerModule(mod.id)" :loading="runningModule === mod.id">立即运行</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -271,8 +270,8 @@
|
||||
const end = new Date(today);
|
||||
end.setDate(end.getDate() + 7);
|
||||
this.upcomingEntries = (all || [])
|
||||
.filter(e => { const d = new Date(e.date); return d >= today && d < end; })
|
||||
.sort((a, b) => a.date.localeCompare(b.date));
|
||||
.filter(e => { const d = new Date(e.planned_date); return d >= today && d < end; })
|
||||
.sort((a, b) => a.planned_date.localeCompare(b.planned_date));
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('获取近期计划失败:', e);
|
||||
@@ -284,9 +283,17 @@
|
||||
},
|
||||
async triggerModule(modId) {
|
||||
this.runningModule = modId;
|
||||
const endpoints = {
|
||||
scheduled_collect: '/api/system/collect/run',
|
||||
scheduled_generate: '/api/system/generate/run',
|
||||
scheduled_optimize: '/api/system/review/run',
|
||||
scheduled_optimize_sources: '/api/system/optimize-sources/run',
|
||||
scheduled_metrics_sync: '/api/system/metrics-sync/run',
|
||||
};
|
||||
const endpoint = endpoints[modId];
|
||||
if (!endpoint) { this.$message.error('未知模块'); this.runningModule = null; return; }
|
||||
try {
|
||||
const token = localStorage.getItem('authToken');
|
||||
const endpoint = modId === 'scheduled_optimize_sources' ? '/api/system/optimize-sources/run' : '/api/system/metrics-sync/run';
|
||||
const resp = await fetch(endpoint, { method: 'POST', headers: { 'Authorization': 'Bearer ' + token } });
|
||||
if (resp.ok) {
|
||||
const data = await resp.json();
|
||||
|
||||
Reference in New Issue
Block a user