Compare commits

..

5 commits

Author SHA1 Message Date
a16a48a1c8
Bump version to v2.0.1 2025-06-23 21:10:21 +00:00
17f4e66d87
Merge pull request #13 from BluemediaDev/fix/filter-overall-status
Only consider statuses in the summary that are not hidden
2025-06-23 23:08:08 +02:00
fb94e1bcab
Merge pull request #12 from BluemediaDev/fix/width
Fix horizontal scrollbar under certain circumstances
2025-06-23 23:07:25 +02:00
2ee020297e
Only consider statuses in the summary that are not hidden 2025-06-23 21:05:45 +00:00
bf7fad4f4e
Fix horizontal scrollbar in some cases 2025-06-23 19:16:33 +00:00
5 changed files with 41 additions and 38 deletions

View file

@ -27,7 +27,7 @@ jobs:
id: release
uses: mikepenz/release-changelog-builder-action@v5
with:
configuration: ".github/changelog-configuration.json"
configuration: '.github/changelog-configuration.json'
failOnError: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "fancy-gatus",
"version": "2.0.0",
"version": "2.0.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "fancy-gatus",
"version": "2.0.0",
"version": "2.0.1",
"dependencies": {
"@tailwindcss/vite": "^4.1.8",
"axios": "^1.9.0",

View file

@ -1,7 +1,7 @@
{
"name": "fancy-gatus",
"private": true,
"version": "2.0.0",
"version": "2.0.1",
"type": "module",
"scripts": {
"dev": "vite dev",

View file

@ -5,10 +5,10 @@
</script>
<div
class="w-screen h-fit min-h-screen flex flex-col items-center bg-base-200"
class="h-fit min-h-screen flex flex-col items-center bg-base-200"
data-theme={$persistentSettings.darkmode ? 'darkgray' : 'emerald'}
>
<div class="w-full md:w-5/6 xl:w-3/5 max-w-5xl h-full pl-4 md:pl-0 pr-4 md:pr-0 pt-5 pb-5">
<div class="md:w-5/6 xl:w-3/5 max-w-5xl h-full pl-4 md:pl-0 pr-4 md:pr-0 pt-5 pb-5">
{@render children()}
</div>
</div>

View file

@ -1,5 +1,6 @@
<script lang="ts">
import axios from 'axios'
import type { AxiosError } from 'axios'
import { onMount } from 'svelte'
import type { Config } from '$lib/types/config'
import type { Status } from '$lib/types/api'
@ -15,41 +16,42 @@
let config: Config = $state({})
let apiData: Status[] = $state([])
function getConfig() {
axios
.get('config.json', { baseURL: '/' })
.then((response) => {
async function getConfig() {
try {
const response = await axios.get('config.json', { baseURL: '/' })
config = response.data
// Set title if defined in config
if (config.title) {
document.title = config.title
}
getApiData()
})
.catch((error) => {
if (error.response.status === 404) {
} catch (err) {
const error = err as AxiosError
if (error.response && error.response.status === 404) {
console.warn('No config.json file found. Using default values.')
getApiData()
} else {
}
console.log('Error getting config: ' + error)
}
})
}
function getApiData() {
async function getApiData() {
// Set base URL for API calls if defined in config
if (config.gatusBaseUrl && axios.defaults.baseURL !== config.gatusBaseUrl) {
axios.defaults.baseURL = config.gatusBaseUrl
}
axios
.get('/api/v1/endpoints/statuses')
.then((response) => {
try {
const response = await axios.get('/api/v1/endpoints/statuses')
apiData = response.data
loading = false
})
.catch((error) => {
} catch (error) {
console.log(error)
})
}
}
async function refresh() {
await getConfig()
await getApiData()
}
// Group statuses by their group name
@ -93,13 +95,14 @@
// Array of statuses where the last result has success = false
let failedStatuses = $derived.by(() => {
return apiData.filter((status) => {
const filteredStatuses = groups.flatMap((item) => item.statuses)
return filteredStatuses.filter((status) => {
return !status.results[status.results.length - 1].success
})
})
onMount(() => {
getConfig()
refresh()
})
</script>
@ -118,6 +121,6 @@
expandByDefault={config.defaultExpandGroups}
/>
{/each}
<RefreshSettings defaultRefreshInterval={config.defaultRefreshInterval} onRefresh={getConfig} />
<RefreshSettings defaultRefreshInterval={config.defaultRefreshInterval} onRefresh={refresh} />
<Footer />
{/if}