diff --git a/frontend/public/images/workflows/pulse.svg b/frontend/public/images/workflows/pulse.svg new file mode 100644 index 00000000..18c03f98 --- /dev/null +++ b/frontend/public/images/workflows/pulse.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index f1667aec..17bcab31 100755 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -51,6 +51,7 @@ import 'react-toastify/dist/ReactToastify.css'; import Drift from "react-driftjs"; import { AppContext } from './context/ContextApi.jsx'; +import Workflows2 from "./views/Workflows2.jsx"; // Production - backend proxy forwarding in nginx var globalUrl = window.location.origin; @@ -474,6 +475,23 @@ const App = (message, props) => { {...props} /> } + /> + + } /> { + return ( + + setMouseHoverIndex(index)} + onMouseOut={() => setMouseHoverIndex(-1)} + > + + + + {data.name} + + + {data.tags?.map((tag, index) => ( + {tag} + ))} + + + + ⚡ + {data.actions || 0} + + + 🔄 + {data.triggers || 0} + + + + + + + ); +}; + +const Workflows2 = () => { + const location = useLocation(); + const navigate = useNavigate(); + const [currTab, setCurrTab] = useState(0); + const [searchQuery, setSearchQuery] = useState(""); + const [selectedCategory, setSelectedCategory] = useState([]); + const [selectedLabel, setSelectedLabel] = useState([]); + const [mouseHoverIndex, setMouseHoverIndex] = useState(-1); + const [isLoading, setIsLoading] = useState(false); + const [view, setView] = useState("grid"); + + // Mock data - replace with actual API calls + const mockWorkflows = [ + { id: 1, name: "Workflow 1", tags: ["webhook", "alert"], actions: 2, triggers: 2 }, + { id: 2, name: "Workflow 2", tags: ["tag1", "tag2"], actions: 0, triggers: 5 }, + // Add more mock workflows as needed + ]; + + const handleTabChange = (event, newValue) => { + setCurrTab(newValue); + }; + + const handleCreateWorkflow = () => { + console.log("Create workflow clicked"); + }; + + return ( + + + Workflows + + + + + + + + + + + + setSearchQuery(e.target.value)} + style={{ flex: 0.7, borderRadius: 8 }} + InputProps={{ + style: { borderRadius: 8 }, + endAdornment: ( + + {searchQuery.length === 0 ? : + setSearchQuery('')} + /> + } + + ), + }} + /> + + setSelectedCategory(e.target.value)} + displayEmpty + multiple + style={{ flex: 0.7, maxWidth: 300 }} + renderValue={(selected) => selected.length ? selected.join(', ') : 'All Categories'} + > + All Categories + {/* Add category items here */} + + + + + navigate("/workflows/debug")} + > + + + + + { + if (view === "grid") { + setView("list"); + } else { + setView("grid"); + } + }} + > + { + view === "list" ? : + } + + + + {/* Add upload handling */ }} + > + + + + + {/* Add export handling */ }} + > + + + + + + + + Create Workflow + + + + + {isLoading ? ( + + + + ) : ( + + {mockWorkflows.map((workflow, index) => ( + + ))} + + )} + + + ); +}; + +export default Workflows2; \ No newline at end of file