Skip to content

Commit 68f183e

Browse files
committed
reinstate refresh control
1 parent 1486ffa commit 68f183e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/Frontend/src/components/audit/AuditList.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { dotNetTimespanToMilliseconds, formatDotNetTimespan } from "@/composable
1010
import "@vuepic/vue-datepicker/dist/main.css";
1111
import FiltersPanel from "@/components/audit/FiltersPanel.vue";
1212
import { onBeforeMount, watch } from "vue";
13+
import RefreshConfig from "../RefreshConfig.vue";
1314
1415
const store = useAuditStore();
1516
const { messages, totalCount, sortBy, messageFilterString, selectedEndpointName, itemsPerPage, dateRange } = storeToRefs(store);
@@ -166,6 +167,7 @@ const watchHandle = watch([() => route.query, itemsPerPage, sortBy, messageFilte
166167

167168
<template>
168169
<div>
170+
<RefreshConfig id="auditListRefresh" @change="store.updateRefreshTimer" @manual-refresh="store.refresh" />
169171
<div class="row">
170172
<FiltersPanel />
171173
</div>

src/Frontend/src/stores/AuditStore.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ref } from "vue";
44
import type { SortInfo } from "@/components/SortInfo";
55
import Message from "@/resources/Message";
66
import { EndpointsView } from "@/resources/EndpointView.ts";
7+
import useAutoRefresh from "@/composables/autoRefresh";
78

89
export const useAuditStore = defineStore("AuditStore", () => {
910
const sortByInstances = ref<SortInfo>({
@@ -29,7 +30,7 @@ export const useAuditStore = defineStore("AuditStore", () => {
2930
}
3031
}
3132

32-
async function refresh() {
33+
const dataRetriever = useAutoRefresh(async () => {
3334
try {
3435
let from = "",
3536
to = "";
@@ -46,10 +47,11 @@ export const useAuditStore = defineStore("AuditStore", () => {
4647
messages.value = [];
4748
throw e;
4849
}
49-
}
50+
}, null);
5051

5152
return {
52-
refresh,
53+
refresh: dataRetriever.executeAndResetTimer,
54+
updateRefreshTimer: dataRetriever.updateTimeout,
5355
loadEndpoints,
5456
sortBy: sortByInstances,
5557
messages,

0 commit comments

Comments
 (0)