feat: enhance vacation approval process by adding notification system for employees, including email alerts and in-app notifications; improve error handling and user feedback during vacation management
This commit is contained in:
@@ -1,7 +1,25 @@
|
||||
<script lang="ts">
|
||||
import { resolve } from '$app/paths';
|
||||
import SystemMonitorCardLocal from '$lib/components/ti/SystemMonitorCardLocal.svelte';
|
||||
import AlertDiagnosticsCard from '$lib/components/ti/AlertDiagnosticsCard.svelte';
|
||||
import { Monitor, ArrowLeft } from 'lucide-svelte';
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
let error = $state<Error | null>(null);
|
||||
let hasError = $derived(!!error);
|
||||
|
||||
onMount(() => {
|
||||
// Capturar erros não tratados
|
||||
window.addEventListener('error', (event) => {
|
||||
console.error('Erro capturado na página de monitoramento:', event.error);
|
||||
error = event.error;
|
||||
});
|
||||
|
||||
window.addEventListener('unhandledrejection', (event) => {
|
||||
console.error('Promise rejeitada na página de monitoramento:', event.reason);
|
||||
error = event.reason instanceof Error ? event.reason : new Error(String(event.reason));
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="container mx-auto max-w-7xl px-4 py-6">
|
||||
@@ -26,6 +44,38 @@
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{#if hasError}
|
||||
<div class="alert alert-error mb-6">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
class="h-6 w-6 shrink-0 stroke-current"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"
|
||||
/>
|
||||
</svg>
|
||||
<div>
|
||||
<h3 class="font-bold">Erro ao carregar página</h3>
|
||||
<div class="text-sm">{error?.message || 'Erro desconhecido'}</div>
|
||||
</div>
|
||||
<button class="btn btn-sm" onclick={() => (error = null)}>Fechar</button>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<!-- Diagnóstico de Configuração -->
|
||||
<div class="mb-6">
|
||||
{#if !hasError}
|
||||
<AlertDiagnosticsCard />
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<!-- Card de Monitoramento -->
|
||||
<SystemMonitorCardLocal />
|
||||
{#if !hasError}
|
||||
<SystemMonitorCardLocal />
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user