update
Some checks failed
Deploy / deploy (build, debian, 22, /root/OJDeploy/data/clientnext) (push) Has been cancelled
Deploy / deploy (build:staging, school, 8822, /root/OJ/data/dist) (push) Has been cancelled

This commit is contained in:
2026-06-04 08:44:54 -06:00
parent 33b6e35d6b
commit 41c4fdbc5c
5 changed files with 107 additions and 34 deletions

View File

@@ -1,6 +1,6 @@
import { DetailsData, DurationData } from "utils/types"
import { consumeJSONEventStream } from "utils/stream"
import { getAIDetailData, getAIDurationData, getAIHeatmapData } from "../api"
import { getAIDetailData, getAIDurationData, getAIHeatmapData, getAIPinnedReport } from "../api"
import { getCSRFToken } from "utils/functions"
export const useAIStore = defineStore("ai", () => {
@@ -27,6 +27,7 @@ export const useAIStore = defineStore("ai", () => {
})
const mdContent = ref("")
const pinnedReport = ref<{ analysis: string } | null>(null)
async function fetchDetailsData(start: string, end: string) {
const res = await getAIDetailData(
@@ -156,10 +157,16 @@ export const useAIStore = defineStore("ai", () => {
}
}
async function fetchPinnedReport() {
const res = await getAIPinnedReport()
pinnedReport.value = res.data
}
return {
fetchAnalysisData,
fetchHeatmapData,
fetchAIAnalysis,
fetchPinnedReport,
durationData,
detailsData,
heatmapData,
@@ -167,5 +174,6 @@ export const useAIStore = defineStore("ai", () => {
targetUsername,
loading,
mdContent,
pinnedReport,
}
})