feat: 日志内容搜索、设置分类Tabs、日报推送、删除合并/条件清理/无分片清理
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useViewport } from "@/composables/useViewport";
|
||||
import { ElMessage } from "element-plus";
|
||||
import axios from "axios";
|
||||
import apiClient, { getApiErrorMessage } from "@/api/client";
|
||||
import type { DailyReviewReport } from "@/types";
|
||||
@@ -10,6 +11,7 @@ const router = useRouter();
|
||||
const { isMobile } = useViewport();
|
||||
|
||||
const loading = ref(false);
|
||||
const pushing = ref(false);
|
||||
const loadError = ref("");
|
||||
const selectedDate = ref(defaultReviewDate());
|
||||
const report = ref<DailyReviewReport | null>(null);
|
||||
@@ -38,6 +40,23 @@ async function loadReport() {
|
||||
}
|
||||
}
|
||||
|
||||
async function pushReport() {
|
||||
pushing.value = true;
|
||||
try {
|
||||
const { data } = await apiClient.post("/reports/daily/push", null, {
|
||||
params: {
|
||||
date: selectedDate.value,
|
||||
utcOffsetMinutes: getLocalUtcOffsetMinutes()
|
||||
}
|
||||
});
|
||||
ElMessage.success(data.message);
|
||||
} catch (error) {
|
||||
ElMessage.error(getApiErrorMessage(error, "日报推送失败。"));
|
||||
} finally {
|
||||
pushing.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
function openSession(recordSessionId: string) {
|
||||
router.push({ name: "record-session-detail", params: { id: recordSessionId } });
|
||||
}
|
||||
@@ -88,7 +107,7 @@ onMounted(loadReport);
|
||||
<div>
|
||||
<h1 class="page-title">回顾日报</h1>
|
||||
<p class="page-subtitle">
|
||||
按天聚合录制时长、异常和弹幕热度。日报只做页面内查看,不会主动推送。
|
||||
按天聚合录制时长、异常和弹幕热度。支持手动推送到已配置的 Webhook。
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -103,6 +122,7 @@ onMounted(loadReport);
|
||||
@change="loadReport"
|
||||
/>
|
||||
<el-button @click="loadReport">刷新日报</el-button>
|
||||
<el-button type="primary" :loading="pushing" :disabled="!report" @click="pushReport">推送日报</el-button>
|
||||
</el-space>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user