mirror of
https://github.com/reconurge/flowsint.git
synced 2026-03-11 17:34:31 -05:00
feat: open console on scan launch
This commit is contained in:
BIN
flowsint-app/public/icon.ico
Normal file
BIN
flowsint-app/public/icon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 109 KiB |
BIN
flowsint-app/public/icon.png
Normal file
BIN
flowsint-app/public/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 109 KiB |
@@ -9,11 +9,9 @@ import { type CosmosInputNode } from '@cosmograph/cosmos'
|
||||
import { ResizablePanel, ResizablePanelGroup } from '../ui/resizable'
|
||||
import EmptyState from './empty-state'
|
||||
|
||||
// Lazy loading du timeline
|
||||
const CosmographTimeline = lazy(() =>
|
||||
import('@cosmograph/react').then((module) => ({ default: module.CosmographTimeline }))
|
||||
)
|
||||
// Hook pour tracker l'état de chargement de Cosmograph
|
||||
const useCosmographLoader = (nodes: any[], edges: any[]) => {
|
||||
const [isCosmographReady, setIsCosmographReady] = useState(true)
|
||||
const [loadingStage, setLoadingStage] = useState<'importing' | 'rendering' | 'ready'>('ready')
|
||||
@@ -21,7 +19,6 @@ const useCosmographLoader = (nodes: any[], edges: any[]) => {
|
||||
const dataVersionRef = useRef(0)
|
||||
|
||||
useEffect(() => {
|
||||
// Reset l'état quand les données changent
|
||||
dataVersionRef.current += 1
|
||||
setIsCosmographReady(false)
|
||||
setLoadingStage('importing')
|
||||
@@ -30,7 +27,6 @@ const useCosmographLoader = (nodes: any[], edges: any[]) => {
|
||||
setLoadingStage('ready')
|
||||
return
|
||||
}
|
||||
// Skip simulation if no edges
|
||||
if (edges.length === 0) {
|
||||
setIsCosmographReady(true)
|
||||
setLoadingStage('ready')
|
||||
@@ -149,7 +145,6 @@ const GraphContent = memo(() => {
|
||||
}
|
||||
}, [cosmograph?.cosmograph, isCosmographReady])
|
||||
|
||||
// Configuration des actions une seule fois
|
||||
useEffect(() => {
|
||||
if (cosmograph?.cosmograph && !actionsSetRef.current) {
|
||||
const actions = {
|
||||
@@ -217,7 +212,6 @@ const GraphContent = memo(() => {
|
||||
})
|
||||
GraphContent.displayName = 'GraphContent'
|
||||
|
||||
// Timeline avec ses propres optimisations
|
||||
const TimelinePanel = memo(() => {
|
||||
const handleAnimationPlay = useCallback(() => {}, [])
|
||||
|
||||
@@ -244,7 +238,6 @@ const TimelinePanel = memo(() => {
|
||||
})
|
||||
TimelinePanel.displayName = 'TimelinePanel'
|
||||
|
||||
// Provider wrapper mémorisé pour éviter les re-créations
|
||||
const GraphProvider = memo(
|
||||
({ nodes, edges, children }: { nodes: any[]; edges: any[]; children: React.ReactNode }) => {
|
||||
return (
|
||||
@@ -256,7 +249,6 @@ const GraphProvider = memo(
|
||||
)
|
||||
GraphProvider.displayName = 'GraphProvider'
|
||||
|
||||
// Composant principal avec optimisations maximales
|
||||
const Graph = memo(() => {
|
||||
const nodes = useGraphStore((s) => s.filteredNodes)
|
||||
const edges = useGraphStore((s) => s.filteredEdges)
|
||||
|
||||
@@ -3,16 +3,19 @@ import { useConfirm } from '@/components/use-confirm-dialog'
|
||||
import { flowService } from '@/api/flow-service'
|
||||
import { useMutation, useQueryClient } from '@tanstack/react-query'
|
||||
import { queryKeys } from '@/api/query-keys'
|
||||
import { useLayoutStore } from '@/stores/layout-store'
|
||||
|
||||
export function useLaunchFlow(askUser: boolean = false) {
|
||||
const { confirm } = useConfirm()
|
||||
const queryClient = useQueryClient()
|
||||
const openClonsole = useLayoutStore(s => s.openConsole)
|
||||
|
||||
// Launch flow mutation
|
||||
const launchFlowMutation = useMutation({
|
||||
mutationFn: ({ flowId, body }: { flowId: string; body: BodyInit }) =>
|
||||
flowService.launch(flowId, body),
|
||||
onSuccess: (data, variables) => {
|
||||
onSuccess: (_, variables) => {
|
||||
openClonsole()
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: queryKeys.flows.detail(variables.flowId)
|
||||
})
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import { toast } from 'sonner'
|
||||
import { useConfirm } from '@/components/use-confirm-dialog'
|
||||
import { transformService } from '@/api/transform-service'
|
||||
import { useLayoutStore } from '@/stores/layout-store'
|
||||
|
||||
export function useLaunchTransform(askUser: boolean = false) {
|
||||
const { confirm } = useConfirm()
|
||||
const openClonsole = useLayoutStore(s => s.openConsole)
|
||||
|
||||
const launchTransform = async (
|
||||
values: string[],
|
||||
transformName: string,
|
||||
@@ -26,6 +29,7 @@ export function useLaunchTransform(askUser: boolean = false) {
|
||||
`Transform ${transformName} has been launched on ${sliced.join(', ')}${left > 0 ? ` and ${left} others` : ''}.`,
|
||||
error: () => `An error occurred launching transform.`
|
||||
})
|
||||
openClonsole()
|
||||
return
|
||||
}
|
||||
return {
|
||||
|
||||
@@ -9,6 +9,7 @@ interface LayoutStore {
|
||||
isOpenAnalysis: boolean
|
||||
chatWidth: number
|
||||
chatHeight: number
|
||||
openConsole: () => void
|
||||
toggleConsole: () => void
|
||||
togglePanel: () => void
|
||||
toggleChat: () => void
|
||||
@@ -39,6 +40,7 @@ export const useLayoutStore = create<LayoutStore>()(
|
||||
chatHeight: 600,
|
||||
activeTab: 'entities',
|
||||
activeTransformTab: 'transforms',
|
||||
openConsole: () => set(() => ({ isOpenConsole: true })),
|
||||
toggleConsole: () => set((state) => ({ isOpenConsole: !state.isOpenConsole })),
|
||||
togglePanel: () => set((state) => ({ isOpenPanel: !state.isOpenPanel })),
|
||||
toggleDetails: () => set((state) => ({ isOpenDetails: !state.isOpenDetails })),
|
||||
|
||||
@@ -13,7 +13,6 @@ from cryptography.hazmat.primitives.ciphers.aead import AESGCM
|
||||
|
||||
from dotenv import load_dotenv
|
||||
|
||||
# Charger les variables d'environnement
|
||||
load_dotenv()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user