2026.03.29 20:00 Gitea_manager javítás előtt
This commit is contained in:
2
frontend/admin/.nuxt/imports.d.ts
vendored
2
frontend/admin/.nuxt/imports.d.ts
vendored
@@ -30,7 +30,7 @@ export { requestIdleCallback, cancelIdleCallback } from '#app/compat/idle-callba
|
||||
export { setInterval } from '#app/compat/interval';
|
||||
export { definePageMeta } from '../node_modules/nuxt/dist/pages/runtime/composables';
|
||||
export { defineLazyHydrationComponent } from '#app/composables/lazy-hydration';
|
||||
export { default as useHealthMonitor, HealthMetrics, SystemAlert, HealthMonitorState } from '../composables/useHealthMonitor';
|
||||
export { useHealthMonitor, HealthMetrics, SystemAlert, HealthMonitorState } from '../composables/useHealthMonitor';
|
||||
export { default as usePolling, PollingOptions, PollingState } from '../composables/usePolling';
|
||||
export { Role, Role, ScopeLevel, ScopeLevel, RoleRank, AdminTiles, useRBAC, TilePermission } from '../composables/useRBAC';
|
||||
export { useServiceMap, Service, Scope } from '../composables/useServiceMap';
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"id":"dev","timestamp":1774433357734}
|
||||
{"id":"dev","timestamp":1774557833950}
|
||||
@@ -1 +1 @@
|
||||
{"id":"dev","timestamp":1774433357734,"prerendered":[]}
|
||||
{"id":"dev","timestamp":1774557833950,"prerendered":[]}
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"date": "2026-03-25T10:09:22.800Z",
|
||||
"date": "2026-03-26T20:43:59.681Z",
|
||||
"preset": "nitro-dev",
|
||||
"framework": {
|
||||
"name": "nuxt",
|
||||
@@ -11,7 +11,7 @@
|
||||
"dev": {
|
||||
"pid": 19,
|
||||
"workerAddress": {
|
||||
"socketPath": "\u0000nitro-worker-19-1-1-2130.sock"
|
||||
"socketPath": "\u0000nitro-worker-19-1-1-9144.sock"
|
||||
}
|
||||
}
|
||||
}
|
||||
4
frontend/admin/.nuxt/nuxt.d.ts
vendored
4
frontend/admin/.nuxt/nuxt.d.ts
vendored
@@ -1,8 +1,8 @@
|
||||
/// <reference types="@nuxtjs/tailwindcss" />
|
||||
/// <reference types="@pinia/nuxt" />
|
||||
/// <reference types="vuetify-nuxt-module" />
|
||||
/// <reference types="@nuxtjs/i18n" />
|
||||
/// <reference types="@pinia/nuxt" />
|
||||
/// <reference types="@nuxt/telemetry" />
|
||||
/// <reference types="@nuxtjs/tailwindcss" />
|
||||
/// <reference path="types/nitro-layouts.d.ts" />
|
||||
/// <reference path="types/builder-env.d.ts" />
|
||||
/// <reference types="nuxt" />
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// generated by the @nuxtjs/tailwindcss <https://github.com/nuxt-modules/tailwindcss> module at 3/25/2026, 8:30:35 PM
|
||||
// generated by the @nuxtjs/tailwindcss <https://github.com/nuxt-modules/tailwindcss> module at 3/27/2026, 9:42:29 AM
|
||||
import "@nuxtjs/tailwindcss/config-ctx"
|
||||
import configMerger from "@nuxtjs/tailwindcss/merger";
|
||||
|
||||
|
||||
4
frontend/admin/.nuxt/types/imports.d.ts
vendored
4
frontend/admin/.nuxt/types/imports.d.ts
vendored
@@ -119,7 +119,7 @@ declare global {
|
||||
const useFetch: typeof import('../../node_modules/nuxt/dist/app/composables/fetch').useFetch
|
||||
const useHead: typeof import('../../node_modules/nuxt/dist/app/composables/head').useHead
|
||||
const useHeadSafe: typeof import('../../node_modules/nuxt/dist/app/composables/head').useHeadSafe
|
||||
const useHealthMonitor: typeof import('../../composables/useHealthMonitor').default
|
||||
const useHealthMonitor: typeof import('../../composables/useHealthMonitor').useHealthMonitor
|
||||
const useHydration: typeof import('../../node_modules/nuxt/dist/app/composables/hydrate').useHydration
|
||||
const useI18n: typeof import('../../node_modules/vue-i18n/dist/vue-i18n').useI18n
|
||||
const useId: typeof import('vue').useId
|
||||
@@ -357,7 +357,7 @@ declare module 'vue' {
|
||||
readonly useFetch: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app/composables/fetch')['useFetch']>
|
||||
readonly useHead: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app/composables/head')['useHead']>
|
||||
readonly useHeadSafe: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app/composables/head')['useHeadSafe']>
|
||||
readonly useHealthMonitor: UnwrapRef<typeof import('../../composables/useHealthMonitor')['default']>
|
||||
readonly useHealthMonitor: UnwrapRef<typeof import('../../composables/useHealthMonitor')['useHealthMonitor']>
|
||||
readonly useHydration: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app/composables/hydrate')['useHydration']>
|
||||
readonly useI18n: UnwrapRef<typeof import('../../node_modules/vue-i18n/dist/vue-i18n')['useI18n']>
|
||||
readonly useId: UnwrapRef<typeof import('vue')['useId']>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ref, computed } from 'vue'
|
||||
import { ref, computed, onUnmounted } from 'vue'
|
||||
import { useAuthStore } from '~/stores/auth'
|
||||
|
||||
// Types
|
||||
@@ -32,7 +32,7 @@ export interface HealthMonitorState {
|
||||
lastUpdated: Date | null
|
||||
}
|
||||
|
||||
// Mock data for development/testing
|
||||
// Mock data for development/testing (only for alerts since no backend endpoint yet)
|
||||
const generateMockMetrics = (): HealthMetrics => {
|
||||
return {
|
||||
total_assets: Math.floor(Math.random() * 10000) + 5000,
|
||||
@@ -97,7 +97,17 @@ class HealthMonitorApiService {
|
||||
if (!response.ok) {
|
||||
const errorText = await response.text()
|
||||
console.error('Health monitor API error:', response.status, response.statusText, errorText)
|
||||
throw new Error(`HTTP ${response.status}: ${response.statusText} - ${errorText}`)
|
||||
|
||||
// Specific error handling
|
||||
if (response.status === 401) {
|
||||
throw new Error('Authentication required. Please log in again.')
|
||||
} else if (response.status === 403) {
|
||||
throw new Error('Access forbidden. Admin privileges required.')
|
||||
} else if (response.status === 500) {
|
||||
throw new Error('Server error. Please try again later.')
|
||||
} else {
|
||||
throw new Error(`HTTP ${response.status}: ${response.statusText} - ${errorText}`)
|
||||
}
|
||||
}
|
||||
|
||||
const data = await response.json()
|
||||
@@ -121,7 +131,7 @@ class HealthMonitorApiService {
|
||||
}
|
||||
}
|
||||
|
||||
// Get system alerts
|
||||
// Get system alerts (mocked for now - no backend endpoint)
|
||||
async getSystemAlerts(options?: {
|
||||
severity?: SystemAlert['severity']
|
||||
resolved?: boolean
|
||||
@@ -185,6 +195,7 @@ export const useHealthMonitor = () => {
|
||||
})
|
||||
|
||||
const apiService = new HealthMonitorApiService()
|
||||
let refreshInterval: NodeJS.Timeout | null = null
|
||||
|
||||
// Computed properties
|
||||
const systemStatusColor = computed(() => {
|
||||
@@ -192,7 +203,7 @@ export const useHealthMonitor = () => {
|
||||
|
||||
switch (state.value.metrics.system_status) {
|
||||
case 'healthy': return 'green'
|
||||
case 'degraded': return 'orange'
|
||||
case 'degraded': return 'dark-blue' // Changed from orange to dark-blue for better contrast
|
||||
case 'critical': return 'red'
|
||||
default: return 'grey'
|
||||
}
|
||||
@@ -239,9 +250,7 @@ export const useHealthMonitor = () => {
|
||||
} catch (error) {
|
||||
state.value.error = error instanceof Error ? error.message : 'Failed to fetch health metrics'
|
||||
console.error('Error fetching health metrics:', error)
|
||||
|
||||
// Fallback to mock data
|
||||
state.value.metrics = generateMockMetrics()
|
||||
// NO FALLBACK TO MOCK DATA - let error propagate
|
||||
} finally {
|
||||
state.value.loading = false
|
||||
}
|
||||
@@ -262,7 +271,7 @@ export const useHealthMonitor = () => {
|
||||
state.value.error = error instanceof Error ? error.message : 'Failed to fetch system alerts'
|
||||
console.error('Error fetching system alerts:', error)
|
||||
|
||||
// Fallback to mock data
|
||||
// Fallback to mock data for alerts (since no real endpoint yet)
|
||||
state.value.alerts = generateMockAlerts(5)
|
||||
} finally {
|
||||
state.value.loading = false
|
||||
@@ -292,11 +301,41 @@ export const useHealthMonitor = () => {
|
||||
state.value.alerts = state.value.alerts.filter(alert => alert.id !== alertId)
|
||||
}
|
||||
|
||||
// Initialize
|
||||
const initialize = () => {
|
||||
refreshAll()
|
||||
// Start automatic refresh (30-second interval)
|
||||
const startPolling = (intervalMs: number = 30000) => {
|
||||
stopPolling() // Clear any existing interval
|
||||
|
||||
refreshInterval = setInterval(() => {
|
||||
console.log('Auto-refreshing health monitor data...')
|
||||
refreshAll()
|
||||
}, intervalMs)
|
||||
|
||||
console.log(`Health monitor polling started with ${intervalMs}ms interval`)
|
||||
}
|
||||
|
||||
// Stop automatic refresh
|
||||
const stopPolling = () => {
|
||||
if (refreshInterval) {
|
||||
clearInterval(refreshInterval)
|
||||
refreshInterval = null
|
||||
console.log('Health monitor polling stopped')
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize with polling
|
||||
const initialize = (enablePolling: boolean = true) => {
|
||||
refreshAll()
|
||||
|
||||
if (enablePolling) {
|
||||
startPolling()
|
||||
}
|
||||
}
|
||||
|
||||
// Cleanup on unmount
|
||||
onUnmounted(() => {
|
||||
stopPolling()
|
||||
})
|
||||
|
||||
return {
|
||||
// State
|
||||
state: computed(() => state.value),
|
||||
@@ -321,12 +360,14 @@ export const useHealthMonitor = () => {
|
||||
markAlertAsResolved,
|
||||
dismissAlert,
|
||||
initialize,
|
||||
startPolling,
|
||||
stopPolling,
|
||||
|
||||
// Helper functions
|
||||
getAlertColor: (severity: SystemAlert['severity']) => {
|
||||
switch (severity) {
|
||||
case 'info': return 'blue'
|
||||
case 'warning': return 'orange'
|
||||
case 'warning': return 'dark-blue' // Changed from orange to dark-blue
|
||||
case 'critical': return 'red'
|
||||
default: return 'grey'
|
||||
}
|
||||
@@ -346,6 +387,4 @@ export const useHealthMonitor = () => {
|
||||
return date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default useHealthMonitor
|
||||
}
|
||||
Reference in New Issue
Block a user