mirror of
https://github.com/TwiN/gatus.git
synced 2026-02-15 13:15:05 +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
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="icon"
|
size="icon"
|
||||||
@click="showAverageResponseTime = !showAverageResponseTime"
|
@click="toggleShowAverageResponseTime"
|
||||||
:title="showAverageResponseTime ? 'Show min-max response time' : 'Show average response time'"
|
:title="showAverageResponseTime ? 'Show min-max response time' : 'Show average response time'"
|
||||||
>
|
>
|
||||||
<Activity v-if="showAverageResponseTime" class="h-5 w-5" />
|
<Activity v-if="showAverageResponseTime" class="h-5 w-5" />
|
||||||
@@ -224,7 +224,7 @@ const events = ref([])
|
|||||||
const currentPage = ref(1)
|
const currentPage = ref(1)
|
||||||
const resultPageSize = 50
|
const resultPageSize = 50
|
||||||
const showResponseTimeChartAndBadges = ref(false)
|
const showResponseTimeChartAndBadges = ref(false)
|
||||||
const showAverageResponseTime = ref(false)
|
const showAverageResponseTime = ref(localStorage.getItem('gatus:show-average-response-time') !== 'false')
|
||||||
const selectedChartDuration = ref('24h')
|
const selectedChartDuration = ref('24h')
|
||||||
const isRefreshing = ref(false)
|
const isRefreshing = ref(false)
|
||||||
|
|
||||||
@@ -245,6 +245,11 @@ const hostname = computed(() => {
|
|||||||
return latestResult.value?.hostname || null
|
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(() => {
|
const pageAverageResponseTime = computed(() => {
|
||||||
// Use endpointStatus for current page's average response time
|
// Use endpointStatus for current page's average response time
|
||||||
if (!endpointStatus.value || !endpointStatus.value.results || endpointStatus.value.results.length === 0) {
|
if (!endpointStatus.value || !endpointStatus.value.results || endpointStatus.value.results.length === 0) {
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ const itemsPerPage = 96
|
|||||||
const searchQuery = ref('')
|
const searchQuery = ref('')
|
||||||
const showOnlyFailing = ref(false)
|
const showOnlyFailing = ref(false)
|
||||||
const showRecentFailures = 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 groupByGroup = ref(false)
|
||||||
const sortBy = ref(localStorage.getItem('gatus:sort-by') || 'name')
|
const sortBy = ref(localStorage.getItem('gatus:sort-by') || 'name')
|
||||||
const uncollapsedGroups = ref(new Set())
|
const uncollapsedGroups = ref(new Set())
|
||||||
@@ -483,6 +483,7 @@ const goToPage = (page) => {
|
|||||||
|
|
||||||
const toggleShowAverageResponseTime = () => {
|
const toggleShowAverageResponseTime = () => {
|
||||||
showAverageResponseTime.value = !showAverageResponseTime.value
|
showAverageResponseTime.value = !showAverageResponseTime.value
|
||||||
|
localStorage.setItem('gatus:show-average-response-time', showAverageResponseTime.value ? 'true' : 'false')
|
||||||
}
|
}
|
||||||
|
|
||||||
const showTooltip = (result, event, action = 'hover') => {
|
const showTooltip = (result, event, action = 'hover') => {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user