fix: set the duration and scroll position for on-demand logs (#104)

This commit is contained in:
Fine0830
2022-06-07 21:54:29 +08:00
committed by GitHub
parent c875c95c20
commit 3c37d7c197
4 changed files with 59 additions and 29 deletions

View File

@@ -31,6 +31,7 @@ interface DemandLogState {
logs: Log[];
loadLogs: boolean;
message: string;
total: number;
}
export const demandLogStore = defineStore({
@@ -47,6 +48,7 @@ export const demandLogStore = defineStore({
logs: [],
loadLogs: false,
message: "",
total: 0,
}),
actions: {
setLogCondition(data: Conditions) {
@@ -109,6 +111,7 @@ export const demandLogStore = defineStore({
this.setLogs("", res.data.data.logs.errorReason);
return res.data;
}
this.total = res.data.data.logs.logs.length;
const logs = res.data.data.logs.logs
.map((d: Log) => d.content)
.join("\n");