npm run build fixed
This commit is contained in:
1 parent
76f963d49e
commit
4f50cc297e
8 files changed
+21
-12
No files matched your search
+4
-6
@@ -1,5 +1,5 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import { BrowserRouter as Router, Routes, Route, Navigate, useLocation } from 'react-router-dom';
|
import { BrowserRouter as Router, Routes, Route, Navigate } from 'react-router-dom';
|
||||||
import HomeView from './views/HomeView';
|
import HomeView from './views/HomeView';
|
||||||
import ServiceView from './views/ServiceView';
|
import ServiceView from './views/ServiceView';
|
||||||
import LoginView from './views/LoginView';
|
import LoginView from './views/LoginView';
|
||||||
@@ -14,7 +14,7 @@ function AppContent() {
|
|||||||
const [isSettingsOpen, setIsSettingsOpen] = useState(false);
|
const [isSettingsOpen, setIsSettingsOpen] = useState(false);
|
||||||
const [isChatOpen, setIsChatOpen] = useState(false);
|
const [isChatOpen, setIsChatOpen] = useState(false);
|
||||||
const { user, logout } = useAuth();
|
const { user, logout } = useAuth();
|
||||||
const location = useLocation();
|
|
||||||
|
|
||||||
// Gestion du thème
|
// Gestion du thème
|
||||||
const [theme, setTheme] = useState<'dark' | 'light'>(
|
const [theme, setTheme] = useState<'dark' | 'light'>(
|
||||||
@@ -33,9 +33,7 @@ function AppContent() {
|
|||||||
return () => window.removeEventListener('analyze-log', handleOpenAI);
|
return () => window.removeEventListener('analyze-log', handleOpenAI);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// Détection du service ID dans l'URL pour le contexte IA
|
// Détection du service ID dans l'URL pour le contexte IA (omis car inutilisé)
|
||||||
const serviceIdMatch = location.pathname.match(/\/service\/(\d+)/);
|
|
||||||
const currentServiceId = serviceIdMatch ? parseInt(serviceIdMatch[1]) : null;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`app-container ${theme}`}>
|
<div className={`app-container ${theme}`}>
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ export default function AIChatSidebar({ isOpen, onClose, currentService }: AICha
|
|||||||
if (targetConv.title === "Nouvelle discussion") {
|
if (targetConv.title === "Nouvelle discussion") {
|
||||||
fetchConversations();
|
fetchConversations();
|
||||||
// et on met à jour la reférence locale pour ne pas avoir de glitch visuel
|
// et on met à jour la reférence locale pour ne pas avoir de glitch visuel
|
||||||
setCurrentConv(prev => prev ? {...prev, title: text.substring(0, 30)} : prev);
|
setCurrentConv((prev: Conversation | null) => prev ? {...prev, title: text.substring(0, 30)} : prev);
|
||||||
}
|
}
|
||||||
} else if (data.error) {
|
} else if (data.error) {
|
||||||
setIsTyping(false);
|
setIsTyping(false);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useEffect, useState, useRef } from 'react';
|
import { useEffect, useState, useRef } from 'react';
|
||||||
import { io, Socket } from 'socket.io-client';
|
import { io, Socket } from 'socket.io-client';
|
||||||
import { Download, Sparkles } from 'lucide-react';
|
import { Download, Sparkles } from 'lucide-react';
|
||||||
import type { LogService } from '../types';
|
import type { LogService } from '../types';
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import React from 'react';
|
|
||||||
import { Navigate, Outlet } from 'react-router-dom';
|
import { Navigate, Outlet } from 'react-router-dom';
|
||||||
import { useAuth } from '../context/AuthContext';
|
import { useAuth } from '../context/AuthContext';
|
||||||
|
|
||||||
|
|||||||
@@ -13,3 +13,15 @@ export interface GlobalSettings {
|
|||||||
ollamaModel: string;
|
ollamaModel: string;
|
||||||
searxngUrl: string;
|
searxngUrl: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface Message {
|
||||||
|
role: 'user' | 'assistant' | 'system';
|
||||||
|
content: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Conversation {
|
||||||
|
id: number;
|
||||||
|
title: string;
|
||||||
|
updatedAt: string;
|
||||||
|
messages?: Message[];
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import { PlusCircle, Clock, Server, HardDrive, LayoutGrid } from 'lucide-react';
|
import { PlusCircle, Clock, Server, HardDrive, LayoutGrid } from 'lucide-react';
|
||||||
import AddServiceModal from '../components/AddServiceModal';
|
import AddServiceModal from '../components/AddServiceModal';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { useNavigate, Link } from 'react-router-dom';
|
import { useNavigate, Link } from 'react-router-dom';
|
||||||
import { useAuth } from '../context/AuthContext';
|
import { useAuth } from '../context/AuthContext';
|
||||||
import { LogIn, UserPlus, Mail, Lock, ShieldCheck } from 'lucide-react';
|
import { LogIn, Mail, Lock, ShieldCheck } from 'lucide-react';
|
||||||
|
|
||||||
export default function LoginView() {
|
export default function LoginView() {
|
||||||
const [email, setEmail] = useState('');
|
const [email, setEmail] = useState('');
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import { useNavigate, useParams } from 'react-router-dom';
|
import { useNavigate, useParams } from 'react-router-dom';
|
||||||
import { ArrowLeft, Server, HardDrive, Trash2 } from 'lucide-react';
|
import { ArrowLeft, Server, HardDrive, Trash2 } from 'lucide-react';
|
||||||
import type { LogService } from '../types';
|
import type { LogService } from '../types';
|
||||||
|
|||||||
Reference in new issue
Block a user