mirror of
https://github.com/TwiN/gatus.git
synced 2026-02-04 09:31:45 +00:00
fix(ui): Persist show average response time setting (#1438)
* feat(ui): Persist show average response time * chore(ui): Regenerate static assets --------- Co-authored-by: TwiN <twin@linux.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
@@ -66,7 +66,7 @@
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
@click="showAverageResponseTime = !showAverageResponseTime"
|
||||
@click="toggleShowAverageResponseTime"
|
||||
:title="showAverageResponseTime ? 'Show min-max response time' : 'Show average response time'"
|
||||
>
|
||||
<Activity v-if="showAverageResponseTime" class="h-5 w-5" />
|
||||
@@ -224,7 +224,7 @@ const events = ref([])
|
||||
const currentPage = ref(1)
|
||||
const resultPageSize = 50
|
||||
const showResponseTimeChartAndBadges = ref(false)
|
||||
const showAverageResponseTime = ref(false)
|
||||
const showAverageResponseTime = ref(localStorage.getItem('gatus:show-average-response-time') !== 'false')
|
||||
const selectedChartDuration = ref('24h')
|
||||
const isRefreshing = ref(false)
|
||||
|
||||
@@ -245,6 +245,11 @@ const hostname = computed(() => {
|
||||
return latestResult.value?.hostname || null
|
||||
})
|
||||
|
||||
const toggleShowAverageResponseTime = () => {
|
||||
showAverageResponseTime.value = !showAverageResponseTime.value
|
||||
localStorage.setItem('gatus:show-average-response-time', showAverageResponseTime.value ? 'true' : 'false')
|
||||
}
|
||||
|
||||
const pageAverageResponseTime = computed(() => {
|
||||
// Use endpointStatus for current page's average response time
|
||||
if (!endpointStatus.value || !endpointStatus.value.results || endpointStatus.value.results.length === 0) {
|
||||
|
||||
@@ -219,7 +219,7 @@ const itemsPerPage = 96
|
||||
const searchQuery = ref('')
|
||||
const showOnlyFailing = ref(false)
|
||||
const showRecentFailures = ref(false)
|
||||
const showAverageResponseTime = ref(true)
|
||||
const showAverageResponseTime = ref(localStorage.getItem('gatus:show-average-response-time') !== 'false')
|
||||
const groupByGroup = ref(false)
|
||||
const sortBy = ref(localStorage.getItem('gatus:sort-by') || 'name')
|
||||
const uncollapsedGroups = ref(new Set())
|
||||
@@ -483,6 +483,7 @@ const goToPage = (page) => {
|
||||
|
||||
const toggleShowAverageResponseTime = () => {
|
||||
showAverageResponseTime.value = !showAverageResponseTime.value
|
||||
localStorage.setItem('gatus:show-average-response-time', showAverageResponseTime.value ? 'true' : 'false')
|
||||
}
|
||||
|
||||
const showTooltip = (result, event, action = 'hover') => {
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user