Replace initializing service modal with status message

**Motivations :**
- La modale 'Initializing services...' n'est plus nécessaire
- Les messages de statut dans le champ des messages sont plus appropriés
- Simplification de l'interface utilisateur

**Modifications :**
- service.ts : Suppression des fonctions showGlobalLoadingSpinner et hideGlobalLoadingSpinner
- service.ts : Remplacement de la modale par updateUserStatus('🔄 Initializing services...')
- service.ts : Ajout d'un message de succès après initialisation

**Pages affectées :**
- src/services/service.ts : Suppression de la modale et utilisation des messages de statut
This commit is contained in:
NicolasCantu 2025-10-29 20:58:59 +01:00
parent 43ba9fc35b
commit 72e7f9b920

View File

@ -29,101 +29,7 @@ const STORAGEURL = import.meta.env.VITE_STORAGEURL || `${BASEURL}:8081`;
const BLINDBITURL = import.meta.env.VITE_BLINDBITURL || `${BASEURL}:8000`;
const DEFAULTAMOUNT = 1000n;
// Global loading spinner functions
function showGlobalLoadingSpinner(message: string = 'Loading...') {
// Remove existing spinner if any
hideGlobalLoadingSpinner();
// Create spinner overlay
const overlay = document.createElement('div');
overlay.id = 'global-loading-overlay';
overlay.style.cssText = `
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.8);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
z-index: 9999;
backdrop-filter: blur(5px);
`;
// Create spinner content
const spinnerContent = document.createElement('div');
spinnerContent.style.cssText = `
background: rgba(255, 255, 255, 0.95);
border-radius: 12px;
padding: 40px;
text-align: center;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
border: 1px solid rgba(255, 255, 255, 0.2);
max-width: 400px;
width: 90%;
`;
// Create spinner
const spinner = document.createElement('div');
spinner.style.cssText = `
width: 50px;
height: 50px;
border: 4px solid #f3f3f3;
border-top: 4px solid #3a506b;
border-radius: 50%;
animation: spin 1s linear infinite;
margin: 0 auto 20px auto;
`;
// Create message
const messageEl = document.createElement('div');
messageEl.textContent = message;
messageEl.style.cssText = `
font-size: 16px;
color: #3a506b;
font-weight: 500;
margin-bottom: 10px;
`;
// Create progress indicator
const progressEl = document.createElement('div');
progressEl.textContent = 'Please wait...';
progressEl.style.cssText = `
font-size: 14px;
color: #666;
`;
// Add CSS animation if not already present
if (!document.getElementById('global-spinner-styles')) {
const style = document.createElement('style');
style.id = 'global-spinner-styles';
style.textContent = `
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
`;
document.head.appendChild(style);
}
// Assemble spinner
spinnerContent.appendChild(spinner);
spinnerContent.appendChild(messageEl);
spinnerContent.appendChild(progressEl);
overlay.appendChild(spinnerContent);
// Add to document
document.body.appendChild(overlay);
}
function hideGlobalLoadingSpinner() {
const overlay = document.getElementById('global-loading-overlay');
if (overlay) {
overlay.remove();
}
}
// Global loading spinner functions removed - now using updateUserStatus instead
const EMPTY32BYTES = String('').padStart(64, '0');
export default class Services {
@ -207,8 +113,8 @@ export default class Services {
}
}
// Show global loading spinner during initialization
showGlobalLoadingSpinner('Initializing services...');
// Update user status during initialization
this.updateUserStatus('🔄 Initializing services...');
// Add WebAssembly memory optimization and error handling
try {
@ -342,8 +248,8 @@ export default class Services {
throw error;
}
// Hide loading spinner after initialization
hideGlobalLoadingSpinner();
// Update user status after successful initialization
this.updateUserStatus('✅ Services initialized successfully');
return Services.instance;
}