Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

Refactor routes, sidebar and workflow panels

Juan Denis19f17ccbf223
diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx
index 01bfb566..45fba18e 100644
--- a/frontend/src/App.jsx
+++ b/frontend/src/App.jsx
@@ -1,54 +1,54 @@
-import React, { useEffect, Suspense, lazy } from 'react';
+import React, { useEffect } from 'react';
import { BrowserRouter as Router, Routes, Route, Navigate, useLocation } from 'react-router-dom';
import { AuthProvider, useAuth } from './contexts/AuthContext';
import { ToastProvider } from './contexts/ToastContext';
import { ThemeProvider } from './contexts/ThemeContext';
import { ResourceTierProvider } from './contexts/ResourceTierContext';
import { ToastContainer } from './components/Toast';
-import { LoadingState } from './components/Spinner';
import DashboardLayout from './layouts/DashboardLayout';
import Dashboard from './pages/Dashboard';
import Login from './pages/Login';
import Register from './pages/Register';
import Setup from './pages/Setup';
+import Applications from './pages/Applications';
+import ApplicationDetail from './pages/ApplicationDetail';
+import Docker from './pages/Docker';
+import Databases from './pages/Databases';
+import Domains from './pages/Domains';
+import Monitoring from './pages/Monitoring';
+import Backups from './pages/Backups';
+import Terminal from './pages/Terminal';
+import Settings from './pages/Settings';
+import FileManager from './pages/FileManager';
+import FTPServer from './pages/FTPServer';
+// Firewall is now part of Security page
+import Git from './pages/Git';
+import CronJobs from './pages/CronJobs';
+import Security from './pages/Security';
import Services from './pages/Services';
import ServiceDetail from './pages/ServiceDetail';
-
-// Lazy-loaded pages
-const Applications = lazy(() => import('./pages/Applications'));
-const ApplicationDetail = lazy(() => import('./pages/ApplicationDetail'));
-const Docker = lazy(() => import('./pages/Docker'));
-const Databases = lazy(() => import('./pages/Databases'));
-const Domains = lazy(() => import('./pages/Domains'));
-const Monitoring = lazy(() => import('./pages/Monitoring'));
-const Backups = lazy(() => import('./pages/Backups'));
-const Terminal = lazy(() => import('./pages/Terminal'));
-const Settings = lazy(() => import('./pages/Settings'));
-const FileManager = lazy(() => import('./pages/FileManager'));
-// FTPServer — absorbed into FileManager page as tab
-// Firewall is now part of Security page
-const Git = lazy(() => import('./pages/Git'));
-const CronJobs = lazy(() => import('./pages/CronJobs'));
-const Security = lazy(() => import('./pages/Security'));
-const Templates = lazy(() => import('./pages/Templates'));
-const WorkflowBuilder = lazy(() => import('./pages/WorkflowBuilder'));
-const Servers = lazy(() => import('./pages/Servers'));
-const ServerDetail = lazy(() => import('./pages/ServerDetail'));
-// Downloads — absorbed into Marketplace page as tab
-const WordPress = lazy(() => import('./pages/WordPress'));
-const WordPressDetail = lazy(() => import('./pages/WordPressDetail'));
-const WordPressProjects = lazy(() => import('./pages/WordPressProjects'));
-const WordPressProject = lazy(() => import('./pages/WordPressProject'));
-// SSLCertificates — absorbed into Domains page as tab
-const Email = lazy(() => import('./pages/Email'));
-const SSOCallback = lazy(() => import('./pages/SSOCallback'));
-const DatabaseMigration = lazy(() => import('./pages/DatabaseMigration'));
-// AgentPlugins, ServerTemplates — absorbed into Servers page as tabs
-const Workspaces = lazy(() => import('./pages/Workspaces'));
-// DNSZones, SSLCertificates — absorbed into Domains page as tabs
-// StatusPages — absorbed into Monitoring page as a tab
-// CloudProvision, AgentFleet, FleetMonitor — absorbed into Servers page as tabs
-const Marketplace = lazy(() => import('./pages/Marketplace'));
+import Templates from './pages/Templates';
+import WorkflowBuilder from './pages/WorkflowBuilder';
+import Servers from './pages/Servers';
+import ServerDetail from './pages/ServerDetail';
+import AgentFleet from './pages/AgentFleet';
+import FleetMonitor from './pages/FleetMonitor';
+import Downloads from './pages/Downloads';
+import WordPress from './pages/WordPress';
+import WordPressDetail from './pages/WordPressDetail';
+import WordPressProjects from './pages/WordPressProjects';
+import WordPressProject from './pages/WordPressProject';
+import SSLCertificates from './pages/SSLCertificates';
+import Email from './pages/Email';
+import SSOCallback from './pages/SSOCallback';
+import DatabaseMigration from './pages/DatabaseMigration';
+import AgentPlugins from './pages/AgentPlugins';
+import ServerTemplates from './pages/ServerTemplates';
+import Workspaces from './pages/Workspaces';
+import DNSZones from './pages/DNSZones';
+import StatusPages from './pages/StatusPages';
+import CloudProvision from './pages/CloudProvision';
+import Marketplace from './pages/Marketplace';
// Page title mapping
const PAGE_TITLES = {
@@ -64,13 +64,13 @@ const PAGE_TITLES = {
'/workflow': 'Workflow Builder',
'/domains': 'Domains',
'/databases': 'Databases',
- // SSL absorbed into Domains
+ '/ssl': 'SSL Certificates',
'/docker': 'Docker',
'/servers': 'Servers',
- // Downloads absorbed into Marketplace
+ '/downloads': 'Downloads',
'/git': 'Git Repositories',
'/files': 'File Manager',
- // FTP absorbed into File Manager
+ '/ftp': 'FTP Server',
'/monitoring': 'Monitoring',
'/backups': 'Backups',
'/cron': 'Cron Jobs',
@@ -79,9 +79,14 @@ const PAGE_TITLES = {
'/terminal': 'Terminal',
'/settings': 'Settings',
'/migrate': 'Database Migration',
- // Fleet, Fleet Monitor, Agent Plugins, Server Templates, Cloud — absorbed into Servers
+ '/fleet': 'Agent Fleet',
+ '/fleet-monitor': 'Fleet Monitor',
+ '/agent-plugins': 'Agent Plugins',
+ '/server-templates': 'Server Templates',
'/workspaces': 'Workspaces',
- // DNS absorbed into Domains, Status Pages absorbed into Monitoring, Cloud absorbed into Servers
+ '/dns': 'DNS Zones',
+ '/status-pages': 'Status Pages',
+ '/cloud': 'Cloud Provisioning',
'/marketplace': 'Marketplace',
};
@@ -116,7 +121,7 @@ function PrivateRoute({ children }) {
const { isAuthenticated, loading, needsSetup, needsMigration } = useAuth();
if (loading) {
- return <LoadingState />;
+ return <div className="loading">Loading...</div>;
}
// Priority: migrations > setup > auth
@@ -135,7 +140,7 @@ function PublicRoute({ children }) {
const { isAuthenticated, loading, needsSetup, needsMigration } = useAuth();
if (loading) {
- return <LoadingState />;
+ return <div className="loading">Loading...</div>;
}
// Priority: migrations > setup > auth
@@ -154,7 +159,7 @@ function SetupRoute({ children }) {
const { loading, needsSetup, isAuthenticated } = useAuth();
if (loading) {
- return <LoadingState />;
+ return <div className="loading">Loading...</div>;
}
// If setup is not needed, redirect appropriately
@@ -167,7 +172,6 @@ function SetupRoute({ children }) {
function AppRoutes() {
return (
- <Suspense fallback={<LoadingState />}>
<Routes>
<Route path="/migrate" element={<DatabaseMigration />} />
<Route path="/setup" element={
@@ -210,37 +214,30 @@ function AppRoutes() {
<Route path="templates" element={<Templates />} />
<Route path="workflow" element={<WorkflowBuilder />} />
<Route path="domains" element={<Domains />} />
- <Route path="domains/:tab" element={<Domains />} />
<Route path="databases" element={<Databases />} />
<Route path="databases/:tab" element={<Databases />} />
- <Route path="ssl" element={<Navigate to="/domains/ssl" replace />} />
+ <Route path="ssl" element={<SSLCertificates />} />
<Route path="docker" element={<Docker />} />
<Route path="docker/:tab" element={<Docker />} />
<Route path="servers" element={<Servers />} />
- <Route path="servers/fleet" element={<Servers />} />
- <Route path="servers/monitor" element={<Servers />} />
- <Route path="servers/cloud" element={<Servers />} />
- <Route path="servers/plugins" element={<Servers />} />
- <Route path="servers/config" element={<Servers />} />
<Route path="servers/:id" element={<ServerDetail />} />
<Route path="servers/:id/:tab" element={<ServerDetail />} />
- <Route path="fleet" element={<Navigate to="/servers/fleet" replace />} />
- <Route path="fleet-monitor" element={<Navigate to="/servers/monitor" replace />} />
- <Route path="agent-plugins" element={<Navigate to="/servers/plugins" replace />} />
- <Route path="server-templates" element={<Navigate to="/servers/config" replace />} />
- <Route path="cloud" element={<Navigate to="/servers/cloud" replace />} />
+ <Route path="fleet" element={<AgentFleet />} />
+ <Route path="fleet-monitor" element={<FleetMonitor />} />
+ <Route path="agent-plugins" element={<AgentPlugins />} />
+ <Route path="server-templates" element={<ServerTemplates />} />
<Route path="workspaces" element={<Workspaces />} />
- <Route path="dns" element={<Navigate to="/domains/dns" replace />} />
- <Route path="status-pages" element={<Navigate to="/monitoring/status-pages" replace />} />
+ <Route path="dns" element={<DNSZones />} />
+ <Route path="status-pages" element={<StatusPages />} />
+ <Route path="cloud" element={<CloudProvision />} />
<Route path="marketplace" element={<Marketplace />} />
- <Route path="marketplace/:tab" element={<Marketplace />} />
- <Route path="downloads" element={<Navigate to="/marketplace/downloads" replace />} />
+ <Route path="downloads" element={<Downloads />} />
<Route path="firewall" element={<Navigate to="/security/firewall" replace />} />
<Route path="git" element={<Git />} />
<Route path="git/:tab" element={<Git />} />
<Route path="files" element={<FileManager />} />
- <Route path="files/:tab" element={<FileManager />} />
- <Route path="ftp" element={<Navigate to="/files/ftp" replace />} />
+ <Route path="ftp" element={<FTPServer />} />
+ <Route path="ftp/:tab" element={<FTPServer />} />
<Route path="monitoring" element={<Monitoring />} />
<Route path="monitoring/:tab" element={<Monitoring />} />
<Route path="backups" element={<Backups />} />
@@ -256,7 +253,6 @@ function AppRoutes() {
<Route path="settings/:tab" element={<Settings />} />
</Route>
</Routes>
- </Suspense>
);
}
diff --git a/frontend/src/components/Sidebar.jsx b/frontend/src/components/Sidebar.jsx
index 1b6a5757..e33b5d74 100644
--- a/frontend/src/components/Sidebar.jsx
+++ b/frontend/src/components/Sidebar.jsx
@@ -1,8 +1,8 @@
import React, { useState, useEffect, useRef, useMemo } from 'react';
-import { NavLink, useNavigate } from 'react-router-dom';
+import { NavLink, useNavigate, useLocation } from 'react-router-dom';
import { useAuth } from '../contexts/AuthContext';
import { useTheme } from '../contexts/ThemeContext';
-import { Star, Settings, LogOut, Sun, Moon, Monitor, ChevronRight, ChevronUp, Layers, Palette, PanelLeft, Check } from 'lucide-react';
+import { Star, Settings, LogOut, Sun, Moon, Monitor, ChevronRight, ChevronDown, ChevronUp, Layers, Palette, PanelLeft, Check } from 'lucide-react';
import { api } from '../services/api';
import ServerKitLogo from './ServerKitLogo';
import { SIDEBAR_CATEGORIES, CATEGORY_LABELS, SIDEBAR_PRESETS, getVisibleItems } from './sidebarItems';
@@ -72,6 +72,12 @@ const Sidebar = () => {
const conditions = { wpInstalled };
const currentPreset = user?.sidebar_config?.preset || 'full';
+ const [expandedItems, setExpandedItems] = useState({});
+ const location = useLocation();
+
+ const toggleExpand = (itemId) => {
+ setExpandedItems(prev => ({ ...prev, [itemId]: !prev[itemId] }));
+ };
const handlePresetSwitch = async (presetKey) => {
if (presetKey === currentPreset) return;
@@ -99,21 +105,46 @@ const Sidebar = () => {
return groups;
}, [visibleItems]);
- const renderNavItem = (item) => (
- <React.Fragment key={item.id}>
- <NavLink
- to={item.route}
- className={({ isActive }) => `nav-item ${isActive ? 'active' : ''}`}
- end={item.end || false}
- >
- <svg className="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor"
- dangerouslySetInnerHTML={{ __html: item.icon }}
- />
- {item.label}
- </NavLink>
- {item.subItems?.map(sub => {
- if (sub.requiresCondition && !conditions[sub.requiresCondition]) return null;
- return (
+ // Auto-expand parent when a sub-item route is active
+ useEffect(() => {
+ const path = location.pathname;
+ for (const item of visibleItems) {
+ if (item.subItems?.some(sub => path === sub.route || path.startsWith(sub.route + '/'))) {
+ setExpandedItems(prev => prev[item.id] ? prev : { ...prev, [item.id]: true });
+ }
+ }
+ }, [location.pathname, visibleItems]);
+
+ const renderNavItem = (item) => {
+ const hasChildren = item.subItems && item.subItems.length > 0;
+ const isExpanded = expandedItems[item.id];
+ const visibleSubs = hasChildren
+ ? item.subItems.filter(sub => !sub.requiresCondition || conditions[sub.requiresCondition])
+ : [];
+
+ return (
+ <React.Fragment key={item.id}>
+ <div className={`nav-item-row ${hasChildren ? 'has-children' : ''}`}>
+ <NavLink
+ to={item.route}
+ className={({ isActive }) => `nav-item ${isActive ? 'active' : ''}`}
+ end={item.end || hasChildren}
+ >
+ <svg className="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor"
+ dangerouslySetInnerHTML={{ __html: item.icon }}
+ />
+ {item.label}
+ </NavLink>
+ {visibleSubs.length > 0 && (
+ <button
+ className={`nav-expand-btn ${isExpanded ? 'expanded' : ''}`}
+ onClick={(e) => { e.stopPropagation(); toggleExpand(item.id); }}
+ >
+ <ChevronRight size={14} />
+ </button>
+ )}
+ </div>
+ {isExpanded && visibleSubs.map(sub => (
<NavLink
key={sub.id}
to={sub.route}
@@ -124,10 +155,10 @@ const Sidebar = () => {
/>
{sub.label}
</NavLink>
- );
- })}
- </React.Fragment>
- );
+ ))}
+ </React.Fragment>
+ );
+ };
return (
<aside className="sidebar">
diff --git a/frontend/src/components/sidebarItems.js b/frontend/src/components/sidebarItems.js
index b3334176..19b48485 100644
--- a/frontend/src/components/sidebarItems.js
+++ b/frontend/src/components/sidebarItems.js
@@ -1,5 +1,5 @@
// Sidebar navigation items definition
-// Each item has: id, label, route, category, icon (SVG paths), and optional sub-items
+// Items with subItems render as collapsible groups (collapsed by default)
// The 'dashboard' item is always visible and cannot be hidden
export const SIDEBAR_CATEGORIES = ['overview', 'infrastructure', 'operations', 'system'];
@@ -26,21 +26,35 @@ export const SIDEBAR_ITEMS = [
label: 'Servers',
route: '/servers',
category: 'infrastructure',
- icon: '<rect x="2" y="2" width="20" height="8" rx="2" ry="2"/><rect x="2" y="14" width="20" height="8" rx="2" ry="2"/><line x1="6" y1="6" x2="6.01" y2="6"/><line x1="6" y1="18" x2="6.01" y2="18"/>'
+ icon: '<rect x="2" y="2" width="20" height="8" rx="2" ry="2"/><rect x="2" y="14" width="20" height="8" rx="2" ry="2"/><line x1="6" y1="6" x2="6.01" y2="6"/><line x1="6" y1="18" x2="6.01" y2="18"/>',
+ subItems: [
+ { id: 'fleet', label: 'Agent Fleet', route: '/fleet', icon: '<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/>' },
+ { id: 'fleet-monitor', label: 'Fleet Monitor', route: '/fleet-monitor', icon: '<path d="M22 12h-4l-3 9L9 3l-3 9H2"/>' },
+ { id: 'cloud', label: 'Cloud Servers', route: '/cloud', icon: '<path d="M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z"/>' },
+ { id: 'agent-plugins', label: 'Plugins', route: '/agent-plugins', icon: '<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/>' },
+ { id: 'server-templates', label: 'Config Templates', route: '/server-templates', icon: '<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/><polyline points="10 9 9 9 8 9"/>' }
+ ]
},
{
id: 'domains',
- label: 'Domains & Sites',
+ label: 'Domains',
route: '/domains',
category: 'infrastructure',
- icon: '<circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>'
+ icon: '<circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>',
+ subItems: [
+ { id: 'dns', label: 'DNS Zones', route: '/dns', icon: '<path d="M12 2L2 7l10 5 10-5-10-5z"/><path d="M2 17l10 5 10-5"/><path d="M2 12l10 5 10-5"/>' },
+ { id: 'ssl', label: 'SSL Certificates', route: '/ssl', icon: '<rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/>' }
+ ]
},
{
id: 'services',
label: 'Services',
route: '/services',
category: 'infrastructure',
- icon: '<path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/><polyline points="3.27 6.96 12 12.01 20.73 6.96"/><line x1="12" y1="22.08" x2="12" y2="12"/>'
+ icon: '<path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/><polyline points="3.27 6.96 12 12.01 20.73 6.96"/><line x1="12" y1="22.08" x2="12" y2="12"/>',
+ subItems: [
+ { id: 'templates', label: 'Templates', route: '/templates', icon: '<rect x="3" y="3" width="7" height="9"/><rect x="14" y="3" width="7" height="5"/><rect x="14" y="12" width="7" height="9"/><rect x="3" y="16" width="7" height="5"/>' }
+ ]
},
{
id: 'wordpress',
@@ -49,13 +63,7 @@ export const SIDEBAR_ITEMS = [
category: 'infrastructure',
icon: '<circle cx="12" cy="12" r="10"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/><path d="M3.5 9h17M3.5 15h17"/>',
subItems: [
- {
- id: 'wp-pipeline',
- label: 'Pipeline',
- route: '/wordpress/projects',
- requiresCondition: 'wpInstalled',
- icon: '<path d="M22 12h-4l-3 9L9 3l-3 9H2"/>'
- }
+ { id: 'wp-pipeline', label: 'Pipeline', route: '/wordpress/projects', requiresCondition: 'wpInstalled', icon: '<path d="M22 12h-4l-3 9L9 3l-3 9H2"/>' }
]
},
{
@@ -88,17 +96,23 @@ export const SIDEBAR_ITEMS = [
},
{
id: 'files',
- label: 'File Manager',
+ label: 'Files',
route: '/files',
category: 'operations',
- icon: '<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/>'
+ icon: '<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/>',
+ subItems: [
+ { id: 'ftp', label: 'FTP Server', route: '/ftp', icon: '<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="17 8 12 3 7 8"/><line x1="12" y1="3" x2="12" y2="15"/>' }
+ ]
},
{
id: 'monitoring',
label: 'Monitoring',
route: '/monitoring',
category: 'operations',
- icon: '<path d="M22 12h-4l-3 9L9 3l-3 9H2"/>'
+ icon: '<path d="M22 12h-4l-3 9L9 3l-3 9H2"/>',
+ subItems: [
+ { id: 'status-pages', label: 'Status Pages', route: '/status-pages', icon: '<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><polyline points="22 4 12 14.01 9 11.01"/>' }
+ ]
},
{
id: 'backups',
@@ -147,11 +161,14 @@ export const SIDEBAR_ITEMS = [
label: 'Marketplace',
route: '/marketplace',
category: 'system',
- icon: '<circle cx="9" cy="21" r="1"/><circle cx="20" cy="21" r="1"/><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"/>'
+ icon: '<circle cx="9" cy="21" r="1"/><circle cx="20" cy="21" r="1"/><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"/>',
+ subItems: [
+ { id: 'downloads', label: 'Downloads', route: '/downloads', icon: '<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/>' }
+ ]
}
];
-// Preset profiles define which items are hidden
+// Preset profiles define which items are hidden (top-level only)
export const SIDEBAR_PRESETS = {
full: {
label: 'Full',
@@ -184,8 +201,6 @@ export const SIDEBAR_PRESETS = {
export function getVisibleItems(sidebarConfig) {
const { preset = 'full', hiddenItems = [] } = sidebarConfig || {};
- // For custom preset, use hiddenItems directly
- // For named presets, use the preset's hiddenItems
const hidden = preset === 'custom'
? hiddenItems
: (SIDEBAR_PRESETS[preset]?.hiddenItems || []);
diff --git a/frontend/src/components/workflow/ConfigPanel.jsx b/frontend/src/components/workflow/ConfigPanel.jsx
index 01ec3b7d..be050b36 100644
--- a/frontend/src/components/workflow/ConfigPanel.jsx
+++ b/frontend/src/components/workflow/ConfigPanel.jsx
@@ -4,30 +4,36 @@ import { X } from 'lucide-react';
const ConfigPanel = ({
isOpen,
title,
- icon: Icon,
- headerColor = '#6366f1',
+ icon,
+ color,
+ headerColor,
onClose,
children,
footer
}) => {
+ const borderColor = color || headerColor || '#6366f1';
+
const handleKeyDown = useCallback((e) => {
- if (e.key === 'Escape' && isOpen) {
+ if (e.key === 'Escape') {
onClose();
}
- }, [isOpen, onClose]);
+ }, [onClose]);
useEffect(() => {
document.addEventListener('keydown', handleKeyDown);
return () => document.removeEventListener('keydown', handleKeyDown);
}, [handleKeyDown]);
+ // Always show when rendered (panels are conditionally rendered by parent)
+ const panelOpen = isOpen !== undefined ? isOpen : true;
+
return (
- <div className={`config-panel ${isOpen ? 'open' : ''}`}>
- <div className="config-panel-header" style={{ borderColor: headerColor }}>
+ <div className={`config-panel ${panelOpen ? 'open' : ''}`}>
+ <div className="config-panel-header" style={{ borderColor }}>
<div className="config-panel-title">
- {Icon && (
- <div className="config-panel-icon" style={{ backgroundColor: headerColor }}>
- <Icon size={18} />
+ {icon && (
+ <div className="config-panel-icon" style={{ backgroundColor: borderColor }}>
+ {typeof icon === 'function' ? React.createElement(icon, { size: 18 }) : icon}
</div>
)}
<h3>{title}</h3>
diff --git a/frontend/src/components/workflow/nodes/LogicIfNode.jsx b/frontend/src/components/workflow/nodes/LogicIfNode.jsx
index 27a5354f..0df9303d 100644
--- a/frontend/src/components/workflow/nodes/LogicIfNode.jsx
+++ b/frontend/src/components/workflow/nodes/LogicIfNode.jsx
@@ -1,10 +1,10 @@
import React, { memo } from 'react';
import { Handle, Position } from '@xyflow/react';
-import { GitBranch, Check, X } from 'lucide-react';
+import { GitBranch } from 'lucide-react';
const LogicIfNode = ({ data, selected }) => {
- const {
- condition = '',
+ const {
+ condition = '',
label = 'If/Else'
} = data;
@@ -16,9 +16,9 @@ const LogicIfNode = ({ data, selected }) => {
id="input"
className="handle-input"
/>
-
- <div className="node-icon bg-gray-800">
- <GitBranch size={16} className="text-orange-400" />
+
+ <div className="node-icon node-icon-logic">
+ <GitBranch size={16} />
</div>
<div className="node-content">
<div className="node-label">{label}</div>
@@ -26,24 +26,26 @@ const LogicIfNode = ({ data, selected }) => {
{condition || 'No condition'}
</div>
</div>
-
- <div className="node-outputs flex justify-around w-full mt-2 border-t border-gray-700 pt-2">
- <div className="flex flex-col items-center">
- <span className="text-[10px] text-green-400 font-bold mb-1">TRUE</span>
+
+ <div className="node-outputs">
+ <div className="node-output-branch">
+ <span className="node-branch-label node-branch-true">TRUE</span>
<Handle
type="source"
position={Position.Bottom}
id="true"
- className="handle-output handle-true !left-[25%]"
+ className="handle-output handle-true"
+ style={{ left: '25%' }}
/>
</div>
- <div className="flex flex-col items-center">
- <span className="text-[10px] text-red-400 font-bold mb-1">FALSE</span>
+ <div className="node-output-branch">
+ <span className="node-branch-label node-branch-false">FALSE</span>
<Handle
type="source"
position={Position.Bottom}
id="false"
- className="handle-output handle-false !left-[75%]"
+ className="handle-output handle-false"
+ style={{ left: '75%' }}
/>
</div>
</div>
diff --git a/frontend/src/components/workflow/nodes/NotificationNode.jsx b/frontend/src/components/workflow/nodes/NotificationNode.jsx
index 452ac96c..b697267d 100644
--- a/frontend/src/components/workflow/nodes/NotificationNode.jsx
+++ b/frontend/src/components/workflow/nodes/NotificationNode.jsx
@@ -3,18 +3,18 @@ import { Handle, Position } from '@xyflow/react';
import { Bell, MessageSquare, Mail, Slack } from 'lucide-react';
const NotificationNode = ({ data, selected }) => {
- const {
- channel = 'discord',
+ const {
+ channel = 'discord',
label = 'Notify',
message = ''
} = data;
const getIcon = () => {
switch (channel) {
- case 'discord': return <MessageSquare size={16} className="text-indigo-400" />;
- case 'slack': return <Slack size={16} className="text-pink-400" />;
- case 'email': return <Mail size={16} className="text-blue-400" />;
- default: return <Bell size={16} className="text-gray-400" />;
+ case 'discord': return <MessageSquare size={16} />;
+ case 'slack': return <Slack size={16} />;
+ case 'email': return <Mail size={16} />;
+ default: return <Bell size={16} />;
}
};
@@ -26,8 +26,8 @@ const NotificationNode = ({ data, selected }) => {
id="input"
className="handle-input"
/>
-
- <div className="node-icon bg-gray-800">
+
+ <div className={`node-icon node-icon-${channel}`}>
{getIcon()}
</div>
<div className="node-content">
@@ -36,7 +36,7 @@ const NotificationNode = ({ data, selected }) => {
{channel.charAt(0).toUpperCase() + channel.slice(1)}
</div>
</div>
-
+
<Handle
type="source"
position={Position.Bottom}
diff --git a/frontend/src/components/workflow/nodes/ScriptNode.jsx b/frontend/src/components/workflow/nodes/ScriptNode.jsx
index 896b4357..bbfb3d2a 100644
--- a/frontend/src/components/workflow/nodes/ScriptNode.jsx
+++ b/frontend/src/components/workflow/nodes/ScriptNode.jsx
@@ -3,17 +3,17 @@ import { Handle, Position } from '@xyflow/react';
import { Terminal, Code, Cpu } from 'lucide-react';
const ScriptNode = ({ data, selected }) => {
- const {
- language = 'bash',
+ const {
+ language = 'bash',
label = 'Run Script',
content = ''
} = data;
const getIcon = () => {
switch (language) {
- case 'bash': return <Terminal size={16} className="text-gray-400" />;
- case 'python': return <Code size={16} className="text-blue-300" />;
- default: return <Cpu size={16} className="text-gray-400" />;
+ case 'bash': return <Terminal size={16} />;
+ case 'python': return <Code size={16} />;
+ default: return <Cpu size={16} />;
}
};
@@ -25,8 +25,8 @@ const ScriptNode = ({ data, selected }) => {
id="input"
className="handle-input"
/>
-
- <div className="node-icon bg-gray-800">
+
+ <div className={`node-icon node-icon-${language}`}>
{getIcon()}
</div>
<div className="node-content">
@@ -35,7 +35,7 @@ const ScriptNode = ({ data, selected }) => {
{language.charAt(0).toUpperCase() + language.slice(1)}
</div>
</div>
-
+
<Handle
type="source"
position={Position.Bottom}
diff --git a/frontend/src/components/workflow/nodes/TriggerNode.jsx b/frontend/src/components/workflow/nodes/TriggerNode.jsx
index 462ddd8b..fd50fbf8 100644
--- a/frontend/src/components/workflow/nodes/TriggerNode.jsx
+++ b/frontend/src/components/workflow/nodes/TriggerNode.jsx
@@ -13,20 +13,18 @@ const TriggerNode = ({ data, selected }) => {
const getIcon = () => {
switch (triggerType) {
- case 'manual': return <Play size={16} className="text-blue-400" />;
- case 'cron': return <Clock size={16} className="text-purple-400" />;
- case 'webhook': return <Webhook size={16} className="text-green-400" />;
- case 'event': return <Zap size={16} className="text-yellow-400" />;
- default: return <Activity size={16} className="text-gray-400" />;
+ case 'manual': return <Play size={16} />;
+ case 'cron': return <Clock size={16} />;
+ case 'webhook': return <Webhook size={16} />;
+ case 'event': return <Zap size={16} />;
+ default: return <Activity size={16} />;
}
};
- const getStatusColor = () => {
- if (!isActive) return 'border-gray-600';
- if (lastStatus === 'success') return 'border-green-500 shadow-[0_0_10px_rgba(34,197,94,0.3)]';
- if (lastStatus === 'failed') return 'border-red-500 shadow-[0_0_10px_rgba(239,68,68,0.3)]';
- return 'border-blue-500 shadow-[0_0_10px_rgba(59,130,246,0.3)]';
- };
+ const statusClass = !isActive ? 'inactive'
+ : lastStatus === 'success' ? 'success'
+ : lastStatus === 'failed' ? 'error'
+ : 'active';
const getSublabel = () => {
const typeName = triggerType.charAt(0).toUpperCase() + triggerType.slice(1);
@@ -53,8 +51,8 @@ const TriggerNode = ({ data, selected }) => {
};
return (
- <div className={`workflow-node node-trigger ${selected ? 'node-selected' : ''} ${getStatusColor()}`}>
- <div className="node-icon bg-gray-800">
+ <div className={`workflow-node node-trigger node-status-${statusClass} ${selected ? 'node-selected' : ''}`}>
+ <div className={`node-icon node-icon-${triggerType}`}>
{getIcon()}
</div>
<div className="node-content">
diff --git a/frontend/src/components/workflow/panels/LogicIfConfigPanel.jsx b/frontend/src/components/workflow/panels/LogicIfConfigPanel.jsx
index 1c1e3de5..42820efe 100644
--- a/frontend/src/components/workflow/panels/LogicIfConfigPanel.jsx
+++ b/frontend/src/components/workflow/panels/LogicIfConfigPanel.jsx
@@ -1,61 +1,64 @@
-import { X } from 'lucide-react';
+import React from 'react';
+import ConfigPanel from '../ConfigPanel';
+import { GitBranch } from 'lucide-react';
-const LogicIfConfigPanel = ({ node, onChange, onClose }) => {
+const LogicIfConfigPanel = ({ node, onChange, onClose, onDelete }) => {
const { data } = node;
const { condition = '', label = 'If/Else' } = data;
return (
- <div className="config-panel">
- <div className="panel-header">
- <h3>Logic Configuration</h3>
- <button onClick={onClose}><X size={18} /></button>
+ <ConfigPanel
+ title="Logic (If/Else)"
+ icon={<GitBranch size={16} />}
+ color="#f97316"
+ onClose={onClose}
+ footer={onDelete && (
+ <button className="btn-delete-node" onClick={onDelete}>
+ Remove Node
+ </button>
+ )}
+ >
+ <div className="form-group">
+ <label>Label</label>
+ <input
+ type="text"
+ value={label}
+ onChange={(e) => onChange({ ...data, label: e.target.value })}
+ />
</div>
- <div className="panel-body">
- <div className="form-group">
- <label>Node Label</label>
- <input
- type="text"
- value={label}
- onChange={(e) => onChange({ ...data, label: e.target.value })}
- />
- </div>
+ <div className="form-group">
+ <label>Condition (Python expression)</label>
+ <input
+ type="text"
+ className="font-mono"
+ value={condition}
+ onChange={(e) => onChange({ ...data, condition: e.target.value })}
+ placeholder="e.g. results['node_1']['returncode'] == 0"
+ />
+ <span className="form-hint">Must evaluate to truthy or falsy. Errors follow the false branch.</span>
+ </div>
- <div className="form-group">
- <label>Condition (Python expression)</label>
- <input
- type="text"
- className="font-mono text-xs bg-gray-900 border-gray-700 rounded p-2 focus:border-blue-500 focus:outline-none"
- value={condition}
- onChange={(e) => onChange({ ...data, condition: e.target.value })}
- placeholder="e.g. results['node_1']['returncode'] == 0"
- />
- </div>
+ <div className="panel-info-box">
+ <strong>Available Variables</strong><br />
+ <code>results</code> — dict of previous node outputs, keyed by node ID<br />
+ <code>context</code> — trigger execution context<br /><br />
+ <strong>Examples</strong><br />
+ <code>{"results['abc123']['returncode'] == 0"}</code><br />
+ <code>{"context.get('event_type') == 'high_cpu'"}</code>
+ </div>
- <div className="mt-4 p-3 bg-gray-800 rounded border border-gray-700">
- <p className="text-[10px] text-gray-400">
- <strong>Available Variables:</strong><br />
- <code>results</code> — dict of previous node outputs, keyed by node ID<br />
- <code>context</code> — trigger execution context<br /><br />
- <strong>Examples:</strong><br />
- <code className="text-gray-300">{"results['abc123']['returncode'] == 0"}</code><br />
- <code className="text-gray-300">{"context.get('event_type') == 'high_cpu'"}</code><br />
- <code className="text-gray-300">len(results) &gt; 0</code>
- </p>
+ <div className="branch-legend">
+ <div className="branch-legend-item">
+ <span className="branch-dot branch-dot-true" />
+ <span>True branch — condition is truthy</span>
</div>
-
- <div className="mt-4 space-y-2">
- <div className="flex items-center gap-2 text-xs">
- <div className="w-2 h-2 rounded-full bg-green-500"></div>
- <span className="text-gray-300">True branch — condition evaluates to truthy</span>
- </div>
- <div className="flex items-center gap-2 text-xs">
- <div className="w-2 h-2 rounded-full bg-red-500"></div>
- <span className="text-gray-300">False branch — condition evaluates to falsy or errors</span>
- </div>
+ <div className="branch-legend-item">
+ <span className="branch-dot branch-dot-false" />
+ <span>False branch — condition is falsy or errors</span>
</div>
</div>
- </div>
+ </ConfigPanel>
);
};
diff --git a/frontend/src/components/workflow/panels/NotificationConfigPanel.jsx b/frontend/src/components/workflow/panels/NotificationConfigPanel.jsx
index b325f8a7..f983fb70 100644
--- a/frontend/src/components/workflow/panels/NotificationConfigPanel.jsx
+++ b/frontend/src/components/workflow/panels/NotificationConfigPanel.jsx
@@ -1,82 +1,78 @@
import React from 'react';
-import { X, MessageSquare, Mail, Slack, Bell } from 'lucide-react';
+import ConfigPanel from '../ConfigPanel';
+import { Bell, MessageSquare, Mail, Slack, Send, Globe } from 'lucide-react';
-const NotificationConfigPanel = ({ node, onChange, onClose }) => {
+const NotificationConfigPanel = ({ node, onChange, onClose, onDelete }) => {
const { data } = node;
const { channel = 'discord', label = 'Notify', message = '' } = data;
+ const channels = [
+ { id: 'discord', icon: MessageSquare, label: 'Discord' },
+ { id: 'slack', icon: Slack, label: 'Slack' },
+ { id: 'email', icon: Mail, label: 'Email' },
+ { id: 'telegram', icon: Send, label: 'Telegram' },
+ { id: 'webhook', icon: Globe, label: 'Webhook' },
+ { id: 'system', icon: Bell, label: 'All Channels' },
+ ];
+
return (
- <div className="config-panel">
- <div className="panel-header">
- <h3>Notification Configuration</h3>
- <button onClick={onClose}><X size={18} /></button>
+ <ConfigPanel
+ title="Notification"
+ icon={<Bell size={16} />}
+ color="#818cf8"
+ onClose={onClose}
+ footer={onDelete && (
+ <button className="btn-delete-node" onClick={onDelete}>
+ Remove Node
+ </button>
+ )}
+ >
+ <div className="form-group">
+ <label>Label</label>
+ <input
+ type="text"
+ value={label}
+ onChange={(e) => onChange({ ...data, label: e.target.value })}
+ />
</div>
- <div className="panel-body">
- <div className="form-group">
- <label>Node Label</label>
- <input
- type="text"
- value={label}
- onChange={(e) => onChange({ ...data, label: e.target.value })}
- />
- </div>
-
- <div className="form-group">
- <label>Channel</label>
- <div className="grid grid-cols-2 gap-2">
- <button
- className={`p-2 rounded border flex items-center justify-center gap-2 transition-colors ${channel === 'discord' ? 'bg-indigo-900/30 border-indigo-500 text-indigo-400' : 'bg-gray-800 border-gray-700 text-gray-400'}`}
- onClick={() => onChange({ ...data, channel: 'discord' })}
- >
- <MessageSquare size={14} />
- <span className="text-xs">Discord</span>
- </button>
- <button
- className={`p-2 rounded border flex items-center justify-center gap-2 transition-colors ${channel === 'slack' ? 'bg-pink-900/30 border-pink-500 text-pink-400' : 'bg-gray-800 border-gray-700 text-gray-400'}`}
- onClick={() => onChange({ ...data, channel: 'slack' })}
- >
- <Slack size={14} />
- <span className="text-xs">Slack</span>
- </button>
+ <div className="form-group">
+ <label>Channel</label>
+ <div className="channel-grid">
+ {channels.map(({ id, icon: Icon, label: chLabel }) => (
<button
- className={`p-2 rounded border flex items-center justify-center gap-2 transition-colors ${channel === 'email' ? 'bg-blue-900/30 border-blue-500 text-blue-400' : 'bg-gray-800 border-gray-700 text-gray-400'}`}
- onClick={() => onChange({ ...data, channel: 'email' })}
+ key={id}
+ className={`channel-btn ${channel === id ? 'active' : ''}`}
+ onClick={() => onChange({ ...data, channel: id })}
>
- <Mail size={14} />
- <span className="text-xs">Email</span>
+ <Icon size={14} />
+ <span>{chLabel}</span>
</button>
- <button
- className={`p-2 rounded border flex items-center justify-center gap-2 transition-colors ${channel === 'system' ? 'bg-gray-700 border-gray-500 text-gray-200' : 'bg-gray-800 border-gray-700 text-gray-400'}`}
- onClick={() => onChange({ ...data, channel: 'system' })}
- >
- <Bell size={14} />
- <span className="text-xs">All</span>
- </button>
- </div>
+ ))}
</div>
+ </div>
- <div className="form-group">
- <label>Message Template</label>
- <textarea
- className="text-xs bg-gray-900 border-gray-700 rounded p-2 h-48 focus:border-blue-500 focus:outline-none"
- value={message}
- onChange={(e) => onChange({ ...data, message: e.target.value })}
- placeholder="e.g. Build finished for {{workflow_name}} — exit code: ${build_node.returncode}"
- />
- </div>
+ <div className="form-group">
+ <label>Message Template</label>
+ <textarea
+ value={message}
+ onChange={(e) => onChange({ ...data, message: e.target.value })}
+ placeholder={'Build finished for {{workflow_name}}\\nExit code: ${build.returncode}'}
+ rows={8}
+ />
+ </div>
- <div className="mt-4 p-3 bg-gray-800 rounded border border-gray-700">
- <p className="text-[10px] text-gray-400">
- <strong>Variables:</strong><br />
- <code>{'{{workflow_name}}'}</code>, <code>{'{{execution_id}}'}</code>, <code>{'{{started_at}}'}</code><br />
- <code>{'${node_id.stdout}'}</code> — output from a specific node<br />
- <code>{'${node_id.returncode}'}</code> — exit code from a script node<br />
- <code>{'{{context.field}}'}</code> — value from trigger context
- </p>
- </div>
+ <div className="panel-info-box">
+ <strong>Variables</strong><br />
+ <code>{'{{workflow_name}}'}</code>, <code>{'{{execution_id}}'}</code>, <code>{'{{started_at}}'}</code><br />
+ <code>{'${node_id.stdout}'}</code> — output from a node<br />
+ <code>{'{{context.field}}'}</code> — trigger context value
+ </div>
+
+ <div className="panel-info-box panel-info-warning">
+ Channels must be configured in <strong>Settings &rarr; Notifications</strong> before they can send messages.
</div>
- </div>
+ </ConfigPanel>
);
};
diff --git a/frontend/src/components/workflow/panels/ScriptConfigPanel.jsx b/frontend/src/components/workflow/panels/ScriptConfigPanel.jsx
index 7d1fa9c6..9d07bd07 100644
--- a/frontend/src/components/workflow/panels/ScriptConfigPanel.jsx
+++ b/frontend/src/components/workflow/panels/ScriptConfigPanel.jsx
@@ -1,7 +1,8 @@
import React from 'react';
-import { X, Terminal, Code } from 'lucide-react';
+import ConfigPanel from '../ConfigPanel';
+import { Terminal, Code } from 'lucide-react';
-const ScriptConfigPanel = ({ node, onChange, onClose }) => {
+const ScriptConfigPanel = ({ node, onChange, onClose, onDelete }) => {
const { data } = node;
const {
language = 'bash',
@@ -13,95 +14,100 @@ const ScriptConfigPanel = ({ node, onChange, onClose }) => {
} = data;
return (
- <div className="config-panel">
- <div className="panel-header">
- <h3>Script Configuration</h3>
- <button onClick={onClose}><X size={18} /></button>
+ <ConfigPanel
+ title="Script"
+ icon={<Terminal size={16} />}
+ color="#71717a"
+ onClose={onClose}
+ footer={onDelete && (
+ <button className="btn-delete-node" onClick={onDelete}>
+ Remove Node
+ </button>
+ )}
+ >
+ <div className="form-group">
+ <label>Label</label>
+ <input
+ type="text"
+ value={label}
+ onChange={(e) => onChange({ ...data, label: e.target.value })}
+ />
</div>
- <div className="panel-body">
+ <div className="form-group">
+ <label>Language</label>
+ <div className="lang-toggle">
+ <button
+ className={`lang-btn ${language === 'bash' ? 'active' : ''}`}
+ onClick={() => onChange({ ...data, language: 'bash' })}
+ >
+ <Terminal size={14} />
+ Bash
+ </button>
+ <button
+ className={`lang-btn ${language === 'python' ? 'active' : ''}`}
+ onClick={() => onChange({ ...data, language: 'python' })}
+ >
+ <Code size={14} />
+ Python
+ </button>
+ </div>
+ </div>
+
+ <div className="form-group">
+ <label>Script Content</label>
+ <textarea
+ className="script-editor font-mono"
+ value={content}
+ onChange={(e) => onChange({ ...data, content: e.target.value })}
+ placeholder={language === 'bash'
+ ? "#!/bin/bash\necho 'Hello World'"
+ : "print('Hello World')"
+ }
+ rows={12}
+ />
+ </div>
+
+ <div className="form-row form-row-3">
<div className="form-group">
- <label>Node Label</label>
+ <label>Timeout (s)</label>
<input
- type="text"
- value={label}
- onChange={(e) => onChange({ ...data, label: e.target.value })}
+ type="number"
+ min="1"
+ max="3600"
+ value={timeout}
+ onChange={(e) => onChange({ ...data, timeout: parseInt(e.target.value) || 300 })}
/>
</div>
-
<div className="form-group">
- <label>Language</label>
- <div className="flex gap-2">
- <button
- className={`flex-1 p-2 rounded border flex items-center justify-center gap-2 ${language === 'bash' ? 'bg-gray-700 border-blue-500 text-blue-400' : 'bg-gray-800 border-gray-700 text-gray-400'}`}
- onClick={() => onChange({ ...data, language: 'bash' })}
- >
- <Terminal size={14} />
- <span>Bash</span>
- </button>
- <button
- className={`flex-1 p-2 rounded border flex items-center justify-center gap-2 ${language === 'python' ? 'bg-gray-700 border-blue-500 text-blue-400' : 'bg-gray-800 border-gray-700 text-gray-400'}`}
- onClick={() => onChange({ ...data, language: 'python' })}
- >
- <Code size={14} />
- <span>Python</span>
- </button>
- </div>
+ <label>Retries</label>
+ <input
+ type="number"
+ min="0"
+ max="5"
+ value={retryCount}
+ onChange={(e) => onChange({ ...data, retryCount: parseInt(e.target.value) || 0 })}
+ />
</div>
-
<div className="form-group">
- <label>Script Content</label>
- <textarea
- className="font-mono text-xs bg-gray-900 border-gray-700 rounded p-2 h-64 focus:border-blue-500 focus:outline-none"
- value={content}
- onChange={(e) => onChange({ ...data, content: e.target.value })}
- placeholder={language === 'bash' ? "#!/bin/bash\necho 'Hello World'" : "print('Hello World')"}
+ <label>Delay (s)</label>
+ <input
+ type="number"
+ min="1"
+ max="300"
+ value={retryDelay}
+ onChange={(e) => onChange({ ...data, retryDelay: parseInt(e.target.value) || 5 })}
/>
</div>
+ </div>
- <div className="grid grid-cols-3 gap-2">
- <div className="form-group">
- <label>Timeout (s)</label>
- <input
- type="number"
- min="1"
- max="3600"
- value={timeout}
- onChange={(e) => onChange({ ...data, timeout: parseInt(e.target.value) || 300 })}
- />
- </div>
- <div className="form-group">
- <label>Retries</label>
- <input
- type="number"
- min="0"
- max="5"
- value={retryCount}
- onChange={(e) => onChange({ ...data, retryCount: parseInt(e.target.value) || 0 })}
- />
- </div>
- <div className="form-group">
- <label>Delay (s)</label>
- <input
- type="number"
- min="1"
- max="300"
- value={retryDelay}
- onChange={(e) => onChange({ ...data, retryDelay: parseInt(e.target.value) || 5 })}
- />
- </div>
- </div>
-
- <div className="mt-4 p-3 bg-blue-900/20 rounded border border-blue-500/30">
- <p className="text-[10px] text-blue-300">
- <strong>Variables:</strong><br />
- <code className="text-blue-200">{'${node_id.stdout}'}</code> — output from a previous node<br />
- <code className="text-blue-200">$NODE_ID_OUTPUT</code> — same, as env var<br />
- <code className="text-blue-200">$WORKFLOW_ID</code>, <code className="text-blue-200">$EXECUTION_ID</code> — workflow metadata
- </p>
- </div>
+ <div className="panel-info-box">
+ <strong>Variables</strong><br />
+ <code>{'${node_id.stdout}'}</code> — output from a previous node<br />
+ <code>$WORKFLOW_ID</code>, <code>$EXECUTION_ID</code> — workflow metadata<br />
+ <code>$NODE_ID_OUTPUT</code> — node output as env var
</div>
- </div>
+ </ConfigPanel>
);
};
diff --git a/frontend/src/components/workflow/panels/TriggerConfigPanel.jsx b/frontend/src/components/workflow/panels/TriggerConfigPanel.jsx
index 9d956231..d1b2b54e 100644
--- a/frontend/src/components/workflow/panels/TriggerConfigPanel.jsx
+++ b/frontend/src/components/workflow/panels/TriggerConfigPanel.jsx
@@ -1,29 +1,37 @@
import React, { useState } from 'react';
-import { X, Play, Clock, Webhook, Zap, Copy, Check } from 'lucide-react';
+import ConfigPanel from '../ConfigPanel';
+import { Play, Clock, Webhook, Zap, Copy, Check } from 'lucide-react';
-const TriggerConfigPanel = ({ node, onChange, onClose }) => {
+const TriggerConfigPanel = ({ node, onChange, onClose, onDelete }) => {
const { data } = node;
- const { triggerType = 'manual', label = 'Trigger', triggerConfig = {} } = data;
+ const { triggerType = 'manual', label = 'Trigger', isActive = true, triggerConfig = {} } = data;
const [copied, setCopied] = useState(false);
const handleTypeChange = (type) => {
+ const typeLabels = {
+ manual: 'Manual Trigger',
+ cron: 'Scheduled Task',
+ webhook: 'Webhook Trigger',
+ event: 'Event Listener'
+ };
onChange({
...data,
triggerType: type,
- label: `${type.charAt(0).toUpperCase() + type.slice(1)} Trigger`
+ label: typeLabels[type] || `${type} Trigger`
});
};
const handleConfigChange = (key, value) => {
onChange({
...data,
- triggerConfig: {
- ...triggerConfig,
- [key]: value
- }
+ triggerConfig: { ...triggerConfig, [key]: value }
});
};
+ const toggleActive = () => {
+ onChange({ ...data, isActive: !isActive });
+ };
+
const webhookUrl = triggerConfig.webhook_id
? `${window.location.origin}/api/v1/workflows/hooks/${triggerConfig.webhook_id}`
: null;
@@ -36,130 +44,132 @@ const TriggerConfigPanel = ({ node, onChange, onClose }) => {
}
};
+ const triggerTypes = [
+ { id: 'manual', icon: Play, label: 'Manual', desc: 'Run on demand via button or API' },
+ { id: 'cron', icon: Clock, label: 'Schedule', desc: 'Run on a cron schedule' },
+ { id: 'webhook', icon: Webhook, label: 'Webhook', desc: 'Triggered by HTTP POST' },
+ { id: 'event', icon: Zap, label: 'Event', desc: 'React to system events' },
+ ];
+
return (
- <div className="config-panel">
- <div className="panel-header">
- <h3>Trigger Configuration</h3>
- <button onClick={onClose}><X size={18} /></button>
+ <ConfigPanel
+ title="Trigger"
+ icon={<Play size={16} />}
+ color="#3b82f6"
+ onClose={onClose}
+ footer={onDelete && (
+ <button className="btn-delete-node" onClick={onDelete}>
+ Remove Node
+ </button>
+ )}
+ >
+ <div className="form-group">
+ <label>Label</label>
+ <input
+ type="text"
+ value={label}
+ onChange={(e) => onChange({ ...data, label: e.target.value })}
+ />
+ </div>
+
+ <div className="form-group">
+ <label>Trigger Type</label>
+ <div className="trigger-type-grid">
+ {triggerTypes.map(({ id, icon: Icon, label: typeLabel, desc }) => (
+ <button
+ key={id}
+ className={`trigger-type-btn ${triggerType === id ? 'active' : ''}`}
+ onClick={() => handleTypeChange(id)}
+ >
+ <Icon size={18} />
+ <span className="trigger-type-name">{typeLabel}</span>
+ <span className="trigger-type-desc">{desc}</span>
+ </button>
+ ))}
+ </div>
+ </div>
+
+ <div className="form-group">
+ <label className="toggle-label">
+ <span>Enabled</span>
+ <button
+ className={`toggle-switch ${isActive ? 'active' : ''}`}
+ onClick={toggleActive}
+ >
+ <span className="toggle-knob" />
+ </button>
+ </label>
</div>
- <div className="panel-body">
+ {triggerType === 'cron' && (
<div className="form-group">
- <label>Node Label</label>
+ <label>Cron Expression</label>
<input
type="text"
- value={label}
- onChange={(e) => onChange({ ...data, label: e.target.value })}
+ className="font-mono"
+ value={triggerConfig.cron || '0 * * * *'}
+ onChange={(e) => handleConfigChange('cron', e.target.value)}
+ placeholder="e.g. 0 0 * * *"
/>
+ <span className="form-hint">
+ Format: minute hour day month weekday. Examples: <code>*/5 * * * *</code> (every 5 min), <code>0 0 * * *</code> (daily midnight)
+ </span>
</div>
+ )}
+ {triggerType === 'webhook' && (
<div className="form-group">
- <label>Trigger Type</label>
- <div className="trigger-type-grid grid grid-cols-2 gap-2 mt-2">
- <button
- className={`p-3 rounded-lg border flex flex-col items-center gap-2 transition-colors ${triggerType === 'manual' ? 'bg-blue-900/30 border-blue-500' : 'bg-gray-800 border-gray-700 hover:border-gray-500'}`}
- onClick={() => handleTypeChange('manual')}
- >
- <Play size={20} className={triggerType === 'manual' ? 'text-blue-400' : 'text-gray-400'} />
- <span className="text-xs">Manual</span>
- </button>
- <button
- className={`p-3 rounded-lg border flex flex-col items-center gap-2 transition-colors ${triggerType === 'cron' ? 'bg-purple-900/30 border-purple-500' : 'bg-gray-800 border-gray-700 hover:border-gray-500'}`}
- onClick={() => handleTypeChange('cron')}
- >
- <Clock size={20} className={triggerType === 'cron' ? 'text-purple-400' : 'text-gray-400'} />
- <span className="text-xs">Schedule</span>
- </button>
- <button
- className={`p-3 rounded-lg border flex flex-col items-center gap-2 transition-colors ${triggerType === 'webhook' ? 'bg-green-900/30 border-green-500' : 'bg-gray-800 border-gray-700 hover:border-gray-500'}`}
- onClick={() => handleTypeChange('webhook')}
- >
- <Webhook size={20} className={triggerType === 'webhook' ? 'text-green-400' : 'text-gray-400'} />
- <span className="text-xs">Webhook</span>
- </button>
- <button
- className={`p-3 rounded-lg border flex flex-col items-center gap-2 transition-colors ${triggerType === 'event' ? 'bg-yellow-900/30 border-yellow-500' : 'bg-gray-800 border-gray-700 hover:border-gray-500'}`}
- onClick={() => handleTypeChange('event')}
- >
- <Zap size={20} className={triggerType === 'event' ? 'text-yellow-400' : 'text-gray-400'} />
- <span className="text-xs">System Event</span>
- </button>
- </div>
+ <label>Webhook URL</label>
+ {webhookUrl ? (
+ <>
+ <div className="input-with-action">
+ <input
+ type="text"
+ value={webhookUrl}
+ readOnly
+ className="input-readonly font-mono"
+ />
+ <button className="input-action-btn" onClick={copyWebhookUrl} title="Copy URL">
+ {copied ? <Check size={14} /> : <Copy size={14} />}
+ </button>
+ </div>
+ <span className="form-hint">
+ Send a POST request to this URL to trigger the workflow. Request body is available as <code>context.body</code>.
+ </span>
+ </>
+ ) : (
+ <div className="panel-info-box panel-info-warning">
+ Save the workflow first to generate the webhook URL.
+ </div>
+ )}
</div>
+ )}
- {triggerType === 'cron' && (
- <div className="form-group animate-in fade-in slide-in-from-top-1">
- <label>Cron Expression</label>
- <input
- type="text"
- value={triggerConfig.cron || '0 * * * *'}
- onChange={(e) => handleConfigChange('cron', e.target.value)}
- placeholder="e.g. 0 0 * * *"
- />
- <p className="text-[10px] text-gray-500 mt-1">
- (Min Hour Day Month Week)
- </p>
- </div>
- )}
-
- {triggerType === 'webhook' && (
- <div className="form-group animate-in fade-in slide-in-from-top-1">
- <label>Webhook URL</label>
- {webhookUrl ? (
- <>
- <div className="flex gap-2">
- <input
- type="text"
- value={webhookUrl}
- readOnly
- className="bg-gray-900 text-gray-300 cursor-default font-mono text-xs flex-1"
- />
- <button
- onClick={copyWebhookUrl}
- className="px-3 py-1 rounded border border-gray-600 bg-gray-800 hover:bg-gray-700 transition-colors"
- title="Copy URL"
- >
- {copied ? <Check size={14} className="text-green-400" /> : <Copy size={14} className="text-gray-400" />}
- </button>
- </div>
- <p className="text-[10px] text-gray-500 mt-1">
- Send POST requests to this URL to trigger the workflow.
- </p>
- </>
- ) : (
- <p className="text-[10px] text-yellow-400 mt-1">
- Save the workflow to generate the webhook URL.
- </p>
- )}
- <div className="mt-3 p-3 bg-gray-800 rounded border border-gray-700">
- <p className="text-[10px] text-gray-400">
- <strong>Request body</strong> is available in your workflow as <code>context.body</code>.
- Query parameters are in <code>context.query</code>.
- </p>
- </div>
- </div>
- )}
+ {triggerType === 'event' && (
+ <div className="form-group">
+ <label>System Event</label>
+ <select
+ value={triggerConfig.eventType || 'health_check_failed'}
+ onChange={(e) => handleConfigChange('eventType', e.target.value)}
+ >
+ <option value="health_check_failed">Health Check Failed</option>
+ <option value="high_cpu">High CPU Usage (&gt;80%)</option>
+ <option value="high_memory">High Memory Usage (&gt;80%)</option>
+ <option value="git_push">Git Push Received</option>
+ <option value="app_stopped">Application Stopped</option>
+ </select>
+ <span className="form-hint">
+ Event data is available as <code>context.event_data</code> in scripts and conditions.
+ </span>
+ </div>
+ )}
- {triggerType === 'event' && (
- <div className="form-group animate-in fade-in slide-in-from-top-1">
- <label>System Event</label>
- <select
- value={triggerConfig.eventType || 'health_check_failed'}
- onChange={(e) => handleConfigChange('eventType', e.target.value)}
- >
- <option value="health_check_failed">Health Check Failed</option>
- <option value="high_cpu">High CPU Usage (&gt;80%)</option>
- <option value="high_memory">High Memory Usage (&gt;80%)</option>
- <option value="git_push">Git Push Received</option>
- <option value="app_stopped">Application Stopped</option>
- </select>
- <p className="text-[10px] text-gray-500 mt-1">
- Event data is available as <code>context.event_data</code>.
- </p>
- </div>
- )}
- </div>
- </div>
+ {triggerType === 'manual' && (
+ <div className="panel-info-box">
+ Click <strong>Execute</strong> in the toolbar or call the workflow API to run manually.
+ </div>
+ )}
+ </ConfigPanel>
);
};
diff --git a/frontend/src/pages/Domains.jsx b/frontend/src/pages/Domains.jsx
index 922a9ee6..b671ec12 100644
--- a/frontend/src/pages/Domains.jsx
+++ b/frontend/src/pages/Domains.jsx
@@ -1,4 +1,4 @@
-import React, { useState, useEffect, lazy, Suspense } from 'react';
+import React, { useState, useEffect } from 'react';
import {
Globe, Plus, Shield, ShieldCheck, ShieldOff, RefreshCw,
Trash2, ExternalLink, CheckCircle, XCircle, AlertTriangle,
@@ -6,21 +6,9 @@ import {
} from 'lucide-react';
import api from '../services/api';
import { useToast } from '../contexts/ToastContext';
-import { useConfirm } from '../hooks/useConfirm';
-import { ConfirmDialog } from '../components/ConfirmDialog';
-import useTabParam from '../hooks/useTabParam';
-import { LoadingState } from '../components/Spinner';
-
-const DNSZones = lazy(() => import('./DNSZones'));
-const SSLCertificates = lazy(() => import('./SSLCertificates'));
-
-const VALID_TABS = ['domains', 'dns', 'ssl'];
-const TAB_LABELS = { domains: 'Domains', dns: 'DNS Zones', ssl: 'SSL Certificates' };
const Domains = () => {
- const [activeTab, setActiveTab] = useTabParam('/domains', VALID_TABS);
const toast = useToast();
- const { confirm, confirmState, handleConfirm, handleCancel } = useConfirm();
const [domains, setDomains] = useState([]);
const [apps, setApps] = useState([]);
const [sslStatus, setSslStatus] = useState(null);
@@ -46,10 +34,14 @@ const Domains = () => {
async function loadData() {
try {
setLoading(true);
+ const timeout = (promise, ms) => Promise.race([
+ promise,
+ new Promise((_, reject) => setTimeout(() => reject(new Error('Request timeout')), ms))
+ ]);
const [domainsData, appsData, sslData] = await Promise.all([
- api.getDomains(),
- api.getApps(),
- api.getDomainsSslStatus().catch(() => null)
+ timeout(api.getDomains(), 10000).catch(() => ({ domains: [] })),
+ timeout(api.getApps(), 10000).catch(() => ({ apps: [] })),
+ timeout(api.getDomainsSslStatus(), 10000).catch(() => null)
]);
setDomains(domainsData.domains || []);
setApps(appsData.apps || []);
@@ -86,8 +78,7 @@ const Domains = () => {
}
async function handleDeleteDomain(domain) {
- const confirmed = await confirm({ title: 'Delete Domain', message: `Are you sure you want to delete ${domain.name}?` });
- if (!confirmed) return;
+ if (!confirm(`Are you sure you want to delete ${domain.name}?`)) return;
try {
await api.deleteDomain(domain.id);
@@ -116,8 +107,7 @@ const Domains = () => {
}
async function handleDisableSsl(domain) {
- const confirmed = await confirm({ title: 'Disable SSL', message: `Disable SSL for ${domain.name}?`, variant: 'warning' });
- if (!confirmed) return;
+ if (!confirm(`Disable SSL for ${domain.name}?`)) return;
try {
await api.disableSsl(domain.id);
@@ -157,56 +147,29 @@ const Domains = () => {
return app ? app.name : 'Unknown';
}
- if (loading && activeTab === 'domains') {
- return <div className="loading">Loading domains...</div>;
- }
-
return (
<div>
<header className="top-bar">
<div>
- <h1>Domains & Sites</h1>
- <p className="subtitle">Manage your domains, DNS zones, and SSL certificates</p>
+ <h1>Domains & SSL</h1>
+ <p className="subtitle">Manage your domains and SSL certificates</p>
</div>
- {activeTab === 'domains' && (
- <div className="top-bar-actions">
- <button className="btn btn-secondary" onClick={loadData}>
- <RefreshCw size={16} />
- Refresh
- </button>
- <button className="btn btn-primary" onClick={() => setShowAddModal(true)}>
- <Plus size={16} />
- Add Domain
- </button>
- </div>
- )}
- </header>
-
- <div className="tabs-nav tabs-nav-scrollable">
- {VALID_TABS.map(tab => (
- <button
- key={tab}
- className={`tab-btn ${activeTab === tab ? 'active' : ''}`}
- onClick={() => setActiveTab(tab)}
- >
- {TAB_LABELS[tab]}
+ <div className="top-bar-actions">
+ <button className="btn btn-secondary" onClick={loadData}>
+ <RefreshCw size={16} />
+ Refresh
</button>
- ))}
- </div>
-
- {activeTab !== 'domains' && (
- <Suspense fallback={<LoadingState />}>
- {activeTab === 'dns' && <DNSZones />}
- {activeTab === 'ssl' && <SSLCertificates />}
- </Suspense>
- )}
-
- {activeTab === 'domains' && <>
+ <button className="btn btn-primary" onClick={() => setShowAddModal(true)}>
+ <Plus size={16} />
+ Add Domain
+ </button>
+ </div>
+ </header>
{error && (
<div className="error-banner">
{error}
- <button className="btn-dismiss" onClick={() => setError('')}>×</button>
+ <button onClick={() => setError('')} style={{ float: 'right', background: 'none', border: 'none', cursor: 'pointer' }}>×</button>
</div>
)}
@@ -237,7 +200,11 @@ const Domains = () => {
{/* Domains List */}
<h2 className="section-title">Domains</h2>
- {domains.length === 0 ? (
+ {loading ? (
+ <div className="empty-state">
+ <p>Loading domains...</p>
+ </div>
+ ) : domains.length === 0 ? (
<div className="empty-state">
<Globe size={48} />
<h3>No domains configured</h3>
@@ -335,7 +302,7 @@ const Domains = () => {
{/* SSL Certificates */}
{sslStatus && sslStatus.certificates && sslStatus.certificates.length > 0 && (
<>
- <h2 className="section-title mt-10">SSL Certificates</h2>
+ <h2 className="section-title" style={{ marginTop: '40px' }}>SSL Certificates</h2>
<div className="cert-list">
{sslStatus.certificates.map((cert, index) => (
<div key={index} className="cert-item">
@@ -472,17 +439,6 @@ const Domains = () => {
</div>
</div>
)}
- <ConfirmDialog
- isOpen={confirmState.isOpen}
- title={confirmState.title}
- message={confirmState.message}
- confirmText={confirmState.confirmText}
- cancelText={confirmState.cancelText}
- variant={confirmState.variant}
- onConfirm={handleConfirm}
- onCancel={handleCancel}
- />
- </>}
</div>
);
};
diff --git a/frontend/src/pages/FileManager.jsx b/frontend/src/pages/FileManager.jsx
index 9c7ec653..ddcc68c7 100644
--- a/frontend/src/pages/FileManager.jsx
+++ b/frontend/src/pages/FileManager.jsx
@@ -1,11 +1,8 @@
-import { useState, useEffect, useRef, lazy, Suspense } from 'react';
+import { useState, useEffect, useRef } from 'react';
import { api } from '../services/api';
import { useToast } from '../contexts/ToastContext';
-import Spinner, { LoadingState } from '../components/Spinner';
+import Spinner from '../components/Spinner';
import ConfirmDialog from '../components/ConfirmDialog';
-import useTabParam from '../hooks/useTabParam';
-
-const FTPServer = lazy(() => import('./FTPServer'));
import {
Folder, File, FileCode, FileText, FileImage, FileVideo, FileAudio,
FileArchive, Database, Terminal, Upload, FolderPlus, FilePlus,
@@ -19,11 +16,7 @@ import { PieChart as RechartsPie, Pie, Cell, ResponsiveContainer, Tooltip, Legen
const SIDEBAR_VISIBLE_KEY = 'serverkit-fm-sidebar';
const DISK_COLLAPSED_KEY = 'serverkit-fm-disk-collapsed';
-const FILE_TABS = ['files', 'ftp'];
-const FILE_TAB_LABELS = { files: 'File Manager', ftp: 'FTP Server' };
-
function FileManager() {
- const [activeTab, setActiveTab] = useTabParam('/files', FILE_TABS);
const [currentPath, setCurrentPath] = useState('/home');
const [entries, setEntries] = useState([]);
const [parentPath, setParentPath] = useState(null);
@@ -333,29 +326,6 @@ function FileManager() {
const displayedEntries = searchResults || entries;
- if (activeTab === 'ftp') {
- return (
- <div className="file-manager">
- <div className="page-header">
- <div className="page-header-content">
- <h1>File Manager</h1>
- <p className="page-description">Browse, edit, and manage your server files</p>
- </div>
- </div>
- <div className="tabs-nav">
- {FILE_TABS.map(tab => (
- <button key={tab} className={`tab-btn ${activeTab === tab ? 'active' : ''}`} onClick={() => setActiveTab(tab)}>
- {FILE_TAB_LABELS[tab]}
- </button>
- ))}
- </div>
- <Suspense fallback={<LoadingState />}>
- <FTPServer />
- </Suspense>
- </div>
- );
- }
-
return (
<div className={`file-manager ${sidebarVisible ? 'sidebar-open' : ''}`}>
<div className="page-header">
@@ -379,20 +349,12 @@ function FileManager() {
<input
type="file"
ref={fileInputRef}
- className="hidden"
+ style={{ display: 'none' }}
onChange={handleUpload}
/>
</div>
</div>
- <div className="tabs-nav">
- {FILE_TABS.map(tab => (
- <button key={tab} className={`tab-btn ${activeTab === tab ? 'active' : ''}`} onClick={() => setActiveTab(tab)}>
- {FILE_TAB_LABELS[tab]}
- </button>
- ))}
- </div>
-
{uploadProgress !== null && (
<div className="upload-progress">
<div className="progress-bar">
diff --git a/frontend/src/pages/Marketplace.jsx b/frontend/src/pages/Marketplace.jsx
index f5fa4f2e..9ab69659 100644
--- a/frontend/src/pages/Marketplace.jsx
+++ b/frontend/src/pages/Marketplace.jsx
@@ -1,13 +1,8 @@
-import React, { useState, useEffect, useCallback, lazy, Suspense } from 'react';
+import React, { useState, useEffect, useCallback } from 'react';
import api from '../services/api';
import { useToast } from '../contexts/ToastContext';
import { useAuth } from '../contexts/AuthContext';
-import Spinner, { LoadingState } from '../components/Spinner';
-import useTabParam from '../hooks/useTabParam';
-
-const Downloads = lazy(() => import('./Downloads'));
-
-const VALID_TABS = ['browse', 'installed', 'downloads'];
+import Spinner from '../components/Spinner';
const Marketplace = () => {
const toast = useToast();
@@ -17,7 +12,7 @@ const Marketplace = () => {
const [loading, setLoading] = useState(true);
const [search, setSearch] = useState('');
const [category, setCategory] = useState('');
- const [tab, setTab] = useTabParam('/marketplace', VALID_TABS);
+ const [tab, setTab] = useState('browse');
const [showSubmit, setShowSubmit] = useState(false);
const [form, setForm] = useState({ name: '', display_name: '', description: '', category: 'utility', version: '1.0.0', author: '' });
@@ -89,7 +84,6 @@ const Marketplace = () => {
<div className="tabs">
<button className={`tab ${tab === 'browse' ? 'active' : ''}`} onClick={() => setTab('browse')}>Browse</button>
<button className={`tab ${tab === 'installed' ? 'active' : ''}`} onClick={() => setTab('installed')}>Installed ({myExtensions.length})</button>
- <button className={`tab ${tab === 'downloads' ? 'active' : ''}`} onClick={() => setTab('downloads')}>Downloads</button>
</div>
{tab === 'browse' && (
@@ -148,12 +142,6 @@ const Marketplace = () => {
</div>
)}
- {tab === 'downloads' && (
- <Suspense fallback={<LoadingState />}>
- <Downloads />
- </Suspense>
- )}
-
{showSubmit && (
<div className="modal-overlay" onClick={() => setShowSubmit(false)}>
<div className="modal" onClick={e => e.stopPropagation()}>
diff --git a/frontend/src/pages/Monitoring.jsx b/frontend/src/pages/Monitoring.jsx
index cf342682..48cb30a3 100644
--- a/frontend/src/pages/Monitoring.jsx
+++ b/frontend/src/pages/Monitoring.jsx
@@ -1,12 +1,9 @@
-import React, { useState, useEffect, lazy, Suspense } from 'react';
+import React, { useState, useEffect } from 'react';
import useTabParam from '../hooks/useTabParam';
import api from '../services/api';
import { useToast } from '../contexts/ToastContext';
-import { LoadingState } from '../components/Spinner';
-const StatusPages = lazy(() => import('./StatusPages'));
-
-const VALID_TABS = ['overview', 'alerts', 'config', 'thresholds', 'status-pages'];
+const VALID_TABS = ['overview', 'alerts', 'config', 'thresholds'];
const Monitoring = () => {
const toast = useToast();
@@ -207,12 +204,6 @@ const Monitoring = () => {
>
Thresholds
</button>
- <button
- className={`tab ${activeTab === 'status-pages' ? 'active' : ''}`}
- onClick={() => setActiveTab('status-pages')}
- >
- Status Pages
- </button>
</div>
{activeTab === 'overview' && (
@@ -520,12 +511,6 @@ const Monitoring = () => {
</div>
</div>
)}
-
- {activeTab === 'status-pages' && (
- <Suspense fallback={<LoadingState />}>
- <StatusPages />
- </Suspense>
- )}
</div>
);
};
diff --git a/frontend/src/pages/Servers.jsx b/frontend/src/pages/Servers.jsx
index 77ca4e40..685baee5 100644
--- a/frontend/src/pages/Servers.jsx
+++ b/frontend/src/pages/Servers.jsx
@@ -1,34 +1,9 @@
-import React, { useState, useEffect, lazy, Suspense } from 'react';
-import { Link, useLocation, useNavigate } from 'react-router-dom';
+import React, { useState, useEffect } from 'react';
+import { Link } from 'react-router-dom';
import api from '../services/api';
import { useToast } from '../contexts/ToastContext';
-import { useConfirm } from '../hooks/useConfirm';
-import { ConfirmDialog } from '../components/ConfirmDialog';
-import { LoadingState } from '../components/Spinner';
-
-const AgentFleet = lazy(() => import('./AgentFleet'));
-const FleetMonitor = lazy(() => import('./FleetMonitor'));
-const CloudProvision = lazy(() => import('./CloudProvision'));
-const AgentPlugins = lazy(() => import('./AgentPlugins'));
-const ServerTemplates = lazy(() => import('./ServerTemplates'));
-
-const SERVER_TABS = ['overview', 'fleet', 'monitor', 'cloud', 'plugins', 'config'];
-const TAB_LABELS = {
- overview: 'Servers',
- fleet: 'Fleet',
- monitor: 'Monitor',
- cloud: 'Cloud',
- plugins: 'Plugins',
- config: 'Config'
-};
const Servers = () => {
- const location = useLocation();
- const navigate = useNavigate();
- const segment = location.pathname.split('/')[2];
- const activeTab = SERVER_TABS.includes(segment) ? segment : 'overview';
- const setActiveTab = (tab) => navigate(tab === 'overview' ? '/servers' : `/servers/${tab}`, { replace: true });
-
const [servers, setServers] = useState([]);
const [groups, setGroups] = useState([]);
const [loading, setLoading] = useState(true);
@@ -89,7 +64,7 @@ const Servers = () => {
connecting: servers.filter(s => s.status === 'connecting').length
};
- if (loading && activeTab === 'overview') {
+ if (loading) {
return <div className="loading">Loading servers...</div>;
}
@@ -100,43 +75,18 @@ const Servers = () => {
<h1>Servers</h1>
<p className="page-description">Manage your connected servers and agents</p>
</div>
- {activeTab === 'overview' && (
- <div className="page-header-actions">
- <button className="btn btn-secondary" onClick={() => setShowGroupModal(true)}>
- <FolderIcon />
- Manage Groups
- </button>
- <button className="btn btn-primary" onClick={() => setShowAddModal(true)}>
- <PlusIcon />
- Add Server
- </button>
- </div>
- )}
- </div>
-
- <div className="tabs-nav tabs-nav-scrollable">
- {SERVER_TABS.map(tab => (
- <button
- key={tab}
- className={`tab-btn ${activeTab === tab ? 'active' : ''}`}
- onClick={() => setActiveTab(tab)}
- >
- {TAB_LABELS[tab]}
+ <div className="page-header-actions">
+ <button className="btn btn-secondary" onClick={() => setShowGroupModal(true)}>
+ <FolderIcon />
+ Manage Groups
+ </button>
+ <button className="btn btn-primary" onClick={() => setShowAddModal(true)}>
+ <PlusIcon />
+ Add Server
</button>
- ))}
+ </div>
</div>
- {activeTab !== 'overview' && (
- <Suspense fallback={<LoadingState />}>
- {activeTab === 'fleet' && <AgentFleet />}
- {activeTab === 'monitor' && <FleetMonitor />}
- {activeTab === 'cloud' && <CloudProvision />}
- {activeTab === 'plugins' && <AgentPlugins />}
- {activeTab === 'config' && <ServerTemplates />}
- </Suspense>
- )}
-
- {activeTab === 'overview' && <>
<div className="servers-stats">
<div className="stat-card">
<div className="stat-icon total">
@@ -242,7 +192,6 @@ const Servers = () => {
onUpdated={loadData}
/>
)}
- </>}
</div>
);
};
@@ -581,7 +530,6 @@ const ManageGroupsModal = ({ groups, onClose, onUpdated }) => {
const [editingGroup, setEditingGroup] = useState(null);
const [loading, setLoading] = useState(false);
const toast = useToast();
- const { confirm, confirmState, handleConfirm, handleCancel } = useConfirm();
async function handleCreateGroup(e) {
e.preventDefault();
@@ -616,8 +564,7 @@ const ManageGroupsModal = ({ groups, onClose, onUpdated }) => {
}
async function handleDeleteGroup(groupId) {
- const confirmed = await confirm({ title: 'Delete Group', message: 'Delete this group? Servers in this group will become ungrouped.' });
- if (!confirmed) return;
+ if (!confirm('Delete this group? Servers in this group will become ungrouped.')) return;
try {
await api.deleteServerGroup(groupId);
@@ -702,16 +649,6 @@ const ManageGroupsModal = ({ groups, onClose, onUpdated }) => {
<button className="btn btn-primary" onClick={onClose}>Done</button>
</div>
</div>
- <ConfirmDialog
- isOpen={confirmState.isOpen}
- title={confirmState.title}
- message={confirmState.message}
- confirmText={confirmState.confirmText}
- cancelText={confirmState.cancelText}
- variant={confirmState.variant}
- onConfirm={handleConfirm}
- onCancel={handleCancel}
- />
</div>
);
};
diff --git a/frontend/src/pages/WorkflowBuilder.jsx b/frontend/src/pages/WorkflowBuilder.jsx
index 61b7624e..09639080 100644
--- a/frontend/src/pages/WorkflowBuilder.jsx
+++ b/frontend/src/pages/WorkflowBuilder.jsx
@@ -67,119 +67,73 @@ const edgeTypes = {
let nodeId = 0;
const getId = () => `node_${nodeId++}`;
-const NodePalette = ({ onAddNode, templates, onAddFromTemplate, existingApps, onAddExistingApp }) => {
- const [showTemplates, setShowTemplates] = useState(false);
- const [showExistingApps, setShowExistingApps] = useState(false);
-
+const NodePalette = ({ onAddNode }) => {
return (
<div className="workflow-palette">
<div className="palette-section">
- <div className="palette-header">Add Application</div>
+ <div className="palette-header">Triggers</div>
<button
- className="palette-item palette-item-docker"
- onClick={() => setShowTemplates(!showTemplates)}
+ className="palette-item palette-item-trigger"
+ onClick={() => onAddNode('trigger', { label: 'Manual Trigger', triggerType: 'manual', isActive: true })}
>
- <Plus size={16} />
- <span>From Template</span>
+ <Play size={16} />
+ <span>Manual</span>
</button>
- {showTemplates && templates.length > 0 && (
- <div className="palette-submenu">
- {templates.map((template) => (
- <button
- key={template.id}
- className="palette-subitem"
- onClick={() => {
- onAddFromTemplate(template);
- setShowTemplates(false);
- }}
- >
- {template.name}
- </button>
- ))}
- </div>
- )}
- {showTemplates && templates.length === 0 && (
- <div className="palette-empty">No templates available</div>
- )}
-
- {existingApps.length > 0 && (
- <>
- <button
- className="palette-item palette-item-service"
- onClick={() => setShowExistingApps(!showExistingApps)}
- >
- <Server size={16} />
- <span>Existing App</span>
- </button>
- {showExistingApps && (
- <div className="palette-submenu">
- {existingApps.map((app) => (
- <button
- key={app.id}
- className="palette-subitem"
- onClick={() => {
- onAddExistingApp(app);
- setShowExistingApps(false);
- }}
- >
- {app.name}
- <span className={`status-badge status-${app.status}`}>
- {app.status}
- </span>
- </button>
- ))}
- </div>
- )}
- </>
- )}
- </div>
-
- <div className="palette-section">
- <div className="palette-header">Network</div>
<button
- className="palette-item palette-item-domain"
- onClick={() => onAddNode('domain', { name: 'example.com', ssl: 'none', dnsStatus: 'pending' })}
+ className="palette-item palette-item-trigger"
+ onClick={() => onAddNode('trigger', { label: 'Scheduled Task', triggerType: 'cron', isActive: true, triggerConfig: { cron: '0 * * * *' } })}
>
- <Globe size={16} />
- <span>Domain</span>
+ <Activity size={16} />
+ <span>Schedule (Cron)</span>
</button>
- </div>
-
- <div className="palette-section">
- <div className="palette-header">Automation</div>
<button
className="palette-item palette-item-trigger"
- onClick={() => onAddNode('trigger', { label: 'Manual Trigger', triggerType: 'manual', isActive: true })}
+ onClick={() => onAddNode('trigger', { label: 'Webhook Trigger', triggerType: 'webhook', isActive: true, triggerConfig: {} })}
>
- <Play size={16} />
- <span>Trigger</span>
+ <Globe size={16} />
+ <span>Webhook</span>
</button>
<button
- className="palette-item palette-item-logic"
- onClick={() => onAddNode('logic_if', { label: 'If/Else', condition: '' })}
+ className="palette-item palette-item-trigger"
+ onClick={() => onAddNode('trigger', { label: 'Event Listener', triggerType: 'event', isActive: true, triggerConfig: { eventType: 'health_check_failed' } })}
>
- <Layout size={16} />
- <span>Logic (If/Else)</span>
+ <Eye size={16} />
+ <span>System Event</span>
</button>
+ </div>
+
+ <div className="palette-section">
+ <div className="palette-header">Actions</div>
<button
className="palette-item palette-item-script"
onClick={() => onAddNode('script', { label: 'Run Script', language: 'bash', content: '' })}
>
<Terminal size={16} />
- <span>Script</span>
+ <span>Run Script</span>
</button>
<button
className="palette-item palette-item-notification"
- onClick={() => onAddNode('notification', { label: 'Notify', channel: 'discord', message: '' })}
+ onClick={() => onAddNode('notification', { label: 'Send Notification', channel: 'system', message: '' })}
>
<Bell size={16} />
<span>Notification</span>
</button>
</div>
+ <div className="palette-section">
+ <div className="palette-header">Flow Control</div>
+ <button
+ className="palette-item palette-item-logic"
+ onClick={() => onAddNode('logic_if', { label: 'If/Else', condition: '' })}
+ >
+ <Layout size={16} />
+ <span>Condition (If/Else)</span>
+ </button>
+ </div>
+
<div className="palette-section palette-section-info">
<div className="palette-hint">
- Tip: Click "Server Overview" to see all your infrastructure with connections
+ Add a trigger, connect actions, then save and execute. Press Delete to remove selected nodes.
</div>
</div>
</div>
@@ -830,11 +784,25 @@ const WorkflowCanvas = () => {
setSelectedEdge(null);
}, []);
+ const handleDeleteNode = useCallback(() => {
+ if (!selectedNode) return;
+ setNodes((nds) => nds.filter((n) => n.id !== selectedNode.id));
+ setEdges((eds) => eds.filter((e) => e.source !== selectedNode.id && e.target !== selectedNode.id));
+ setSelectedNode(null);
+ }, [selectedNode, setNodes, setEdges]);
+
const handleKeyDown = useCallback((event) => {
- if ((event.key === 'Delete' || event.key === 'Backspace') && selectedEdge) {
- deleteEdge(selectedEdge.id);
+ // Don't delete when typing in an input/textarea
+ if (event.target.tagName === 'INPUT' || event.target.tagName === 'TEXTAREA' || event.target.tagName === 'SELECT') return;
+
+ if (event.key === 'Delete' || event.key === 'Backspace') {
+ if (selectedEdge) {
+ deleteEdge(selectedEdge.id);
+ } else if (selectedNode) {
+ handleDeleteNode();
+ }
}
- }, [selectedEdge, deleteEdge]);
+ }, [selectedEdge, selectedNode, deleteEdge, handleDeleteNode]);
React.useEffect(() => {
document.addEventListener('keydown', handleKeyDown);
@@ -865,7 +833,8 @@ const WorkflowCanvas = () => {
const panelProps = {
node: selectedNode,
onChange: handleNodeDataChange,
- onClose: handlePanelClose
+ onClose: handlePanelClose,
+ onDelete: handleDeleteNode
};
switch (selectedNode.type) {
@@ -906,72 +875,57 @@ const WorkflowCanvas = () => {
)}
</div>
<div className="toolbar-right">
- <button
- className="toolbar-btn toolbar-btn-overview"
- onClick={loadServerOverview}
- disabled={isLoading}
- title="Load full server infrastructure"
- >
- <Eye size={16} />
- <span>{isLoading ? 'Loading...' : 'Server Overview'}</span>
- </button>
<button
className="toolbar-btn"
onClick={newWorkflow}
- title="New custom view"
+ title="New workflow"
>
<Plus size={16} />
- <span>New View</span>
+ <span>New</span>
</button>
<button
className="toolbar-btn"
onClick={() => setShowLoadModal(true)}
- title="Load saved view"
+ title="Load saved workflow"
>
<FolderOpen size={16} />
<span>Load</span>
</button>
- <div className="toolbar-divider h-6 w-[1px] bg-gray-700 mx-1"></div>
+ <div className="toolbar-divider" />
<button
- className={`toolbar-btn ${isExecuting ? 'animate-pulse' : ''}`}
+ className="toolbar-btn toolbar-btn-execute"
onClick={executeWorkflow}
disabled={isExecuting || !currentWorkflow}
- title="Execute workflow manually"
+ title="Execute workflow"
>
- <Play size={16} className="text-green-400" />
- <span>Execute</span>
+ <Play size={16} />
+ <span>{isExecuting ? 'Running...' : 'Execute'}</span>
</button>
<button
className="toolbar-btn"
onClick={() => setShowHistory(true)}
disabled={!currentWorkflow}
- title="View execution history"
+ title="Execution history"
>
<Activity size={16} />
<span>History</span>
</button>
- <div className="toolbar-divider h-6 w-[1px] bg-gray-700 mx-1"></div>
+ <div className="toolbar-divider" />
<button
className="toolbar-btn toolbar-btn-primary"
onClick={saveWorkflow}
disabled={isSaving}
- title="Save current view"
+ title="Save workflow"
>
<Save size={16} />
- <span>{isSaving ? 'Saving...' : 'Save View'}</span>
+ <span>{isSaving ? 'Saving...' : 'Save'}</span>
</button>
</div>
{saveMessage && (
<div className="toolbar-message">{saveMessage}</div>
)}
</div>
- <NodePalette
- onAddNode={addNode}
- templates={templates}
- onAddFromTemplate={addFromTemplate}
- existingApps={existingAppsNotInView}
- onAddExistingApp={addExistingApp}
- />
+ <NodePalette onAddNode={addNode} />
{connectionError && (
<div className="connection-error-toast">
{connectionError}
diff --git a/frontend/src/styles/components/_tabs.scss b/frontend/src/styles/components/_tabs.scss
index a39a8702..1b577c0a 100644
--- a/frontend/src/styles/components/_tabs.scss
+++ b/frontend/src/styles/components/_tabs.scss
@@ -53,3 +53,63 @@
.tab-content {
min-height: 400px;
}
+
+// tabs-nav variant (used by Servers, Domains, etc.)
+.tabs-nav {
+ display: flex;
+ gap: $space-1;
+ border-bottom: 1px solid $border-subtle;
+ margin-bottom: $space-6;
+
+ &.tabs-nav-scrollable {
+ overflow-x: auto;
+ scrollbar-width: none;
+
+ &::-webkit-scrollbar {
+ display: none;
+ }
+ }
+}
+
+.tab-btn {
+ display: inline-flex;
+ align-items: center;
+ gap: $space-2;
+ background: none;
+ border: none;
+ padding: $space-3 $space-5;
+ color: $text-secondary;
+ font-size: $font-size-base;
+ font-weight: $font-weight-medium;
+ cursor: pointer;
+ border-bottom: 2px solid transparent;
+ margin-bottom: -1px;
+ @include transition();
+ white-space: nowrap;
+
+ &:hover {
+ color: $text-primary;
+ }
+
+ &.active {
+ color: $accent-primary;
+ border-bottom-color: $accent-primary;
+ }
+}
+
+// Hide nested page headers when a page component is embedded as a tab
+.tab-embedded {
+ > .page-container > .page-header,
+ > .page-header,
+ > .top-bar,
+ > div > .page-header,
+ > div > .top-bar {
+ display: none;
+ }
+
+ > [class*="-page"] > .page-header,
+ > [class*="-page"] > header.top-bar,
+ > [class*="-page"] > .top-bar {
+ display: none;
+ }
+}
diff --git a/frontend/src/styles/layout/_sidebar.scss b/frontend/src/styles/layout/_sidebar.scss
index 471933bc..192fc8d5 100644
--- a/frontend/src/styles/layout/_sidebar.scss
+++ b/frontend/src/styles/layout/_sidebar.scss
@@ -495,6 +495,50 @@
}
}
+// Nav item row (parent with optional expand button)
+.nav-item-row {
+ display: flex;
+ align-items: center;
+
+ .nav-item {
+ flex: 1;
+ min-width: 0;
+ }
+
+ &.has-children .nav-item {
+ padding-right: 0;
+ }
+}
+
+.nav-expand-btn {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 28px;
+ height: 28px;
+ border: none;
+ background: transparent;
+ color: $text-tertiary;
+ cursor: pointer;
+ border-radius: $radius-sm;
+ flex-shrink: 0;
+ transition: all 0.15s ease;
+ margin-right: 4px;
+
+ &:hover {
+ background: rgba(255, 255, 255, 0.06);
+ color: $text-primary;
+ }
+
+ svg {
+ transition: transform 0.2s ease;
+ }
+
+ &.expanded svg {
+ transform: rotate(90deg);
+ }
+}
+
// Sub Navigation Item (indented under parent)
.nav-sub-item {
padding-left: 2.25rem;
diff --git a/frontend/src/styles/pages/_workflow.scss b/frontend/src/styles/pages/_workflow.scss
index eb823b30..1ebe2ebd 100644
--- a/frontend/src/styles/pages/_workflow.scss
+++ b/frontend/src/styles/pages/_workflow.scss
@@ -184,6 +184,132 @@
}
}
+// ============================================
+// COMPACT NODE VARIANTS (Trigger, Script, Logic, Notification)
+// ============================================
+
+// Shared compact node layout
+.node-trigger,
+.node-script,
+.node-logic,
+.node-notification {
+ display: flex;
+ align-items: center;
+ gap: $space-3;
+ padding: $space-3;
+ min-width: 180px;
+ position: relative;
+
+ &.node-selected {
+ border-color: $accent-primary;
+ box-shadow: 0 0 0 2px $accent-glow;
+ }
+}
+
+.node-icon {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 32px;
+ height: 32px;
+ min-width: 32px;
+ background: $bg-elevated;
+ border-radius: $radius-md;
+ color: $text-secondary;
+}
+
+.node-content {
+ flex: 1;
+ min-width: 0;
+}
+
+.node-label {
+ font-size: $font-size-sm;
+ font-weight: $font-weight-medium;
+ color: $text-primary;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.node-sublabel {
+ font-size: $font-size-xs;
+ color: $text-tertiary;
+ margin-top: 2px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+// Node icon color variants
+.node-icon-manual { color: #3b82f6; }
+.node-icon-cron { color: #a855f7; }
+.node-icon-webhook { color: #10b981; }
+.node-icon-event { color: #f59e0b; }
+.node-icon-bash { color: $text-secondary; }
+.node-icon-python { color: #93c5fd; }
+.node-icon-logic { color: #f97316; }
+.node-icon-discord { color: #818cf8; }
+.node-icon-slack { color: #ec4899; }
+.node-icon-email { color: #3b82f6; }
+
+// Node status glow variants
+.node-status-active { border-color: #3b82f6; box-shadow: 0 0 10px rgba(59, 130, 246, 0.3); }
+.node-status-success { border-color: $success; box-shadow: 0 0 10px rgba(34, 197, 94, 0.3); }
+.node-status-error { border-color: $danger; box-shadow: 0 0 10px rgba(239, 68, 68, 0.3); }
+.node-status-inactive { border-color: $border-subtle; }
+
+// Logic If/Else branching outputs
+.node-outputs {
+ display: flex;
+ justify-content: space-around;
+ width: 100%;
+ margin-top: $space-2;
+ padding-top: $space-2;
+ border-top: 1px solid $border-subtle;
+}
+
+.node-output-branch {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+}
+
+.node-branch-label {
+ font-size: 10px;
+ font-weight: 700;
+ margin-bottom: $space-1;
+
+ &.node-branch-true { color: $success; }
+ &.node-branch-false { color: $danger; }
+}
+
+// Compact handle styles
+.handle-input,
+.handle-output {
+ width: 10px !important;
+ height: 10px !important;
+ background: $bg-card !important;
+ border: 2px solid $border-active !important;
+ transition: all $transition-fast;
+
+ &:hover {
+ background: $accent-primary !important;
+ border-color: $accent-primary !important;
+ transform: scale(1.2);
+ }
+}
+
+.handle-true {
+ border-color: $success !important;
+ &:hover { background: $success !important; }
+}
+
+.handle-false {
+ border-color: $danger !important;
+ &:hover { background: $danger !important; }
+}
+
// ============================================
// HANDLE STYLES
// ============================================
@@ -731,6 +857,265 @@
// PORT LIST (Docker Config Panel)
// ============================================
+// ============================================
+// CONFIG PANEL ELEMENTS
+// ============================================
+
+// Trigger type selector grid
+.trigger-type-grid {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: $space-2;
+}
+
+.trigger-type-btn {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: $space-1;
+ padding: $space-3;
+ background: $bg-body;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-lg;
+ color: $text-tertiary;
+ cursor: pointer;
+ transition: all $transition-fast;
+
+ &:hover {
+ border-color: $border-active;
+ color: $text-secondary;
+ }
+
+ &.active {
+ background: rgba($accent-primary-raw, 0.1);
+ border-color: $accent-primary;
+ color: $accent-primary;
+ }
+
+ .trigger-type-name {
+ font-size: $font-size-sm;
+ font-weight: $font-weight-medium;
+ }
+
+ .trigger-type-desc {
+ font-size: $font-size-xs;
+ color: $text-tertiary;
+ text-align: center;
+ line-height: $line-height-tight;
+ }
+}
+
+// Notification channel selector
+.channel-grid {
+ display: grid;
+ grid-template-columns: 1fr 1fr 1fr;
+ gap: $space-2;
+}
+
+.channel-btn {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: $space-1;
+ padding: $space-2;
+ background: $bg-body;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-md;
+ color: $text-tertiary;
+ font-size: $font-size-xs;
+ cursor: pointer;
+ transition: all $transition-fast;
+
+ &:hover {
+ border-color: $border-active;
+ color: $text-secondary;
+ }
+
+ &.active {
+ background: rgba($accent-primary-raw, 0.1);
+ border-color: $accent-primary;
+ color: $accent-primary;
+ }
+}
+
+// Language toggle
+.lang-toggle {
+ display: flex;
+ gap: $space-2;
+}
+
+.lang-btn {
+ flex: 1;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ gap: $space-2;
+ padding: $space-2;
+ background: $bg-body;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-md;
+ color: $text-tertiary;
+ font-size: $font-size-sm;
+ cursor: pointer;
+ transition: all $transition-fast;
+
+ &:hover { border-color: $border-active; color: $text-secondary; }
+ &.active { background: rgba($accent-primary-raw, 0.1); border-color: $accent-primary; color: $accent-primary; }
+}
+
+// Script editor textarea
+.script-editor {
+ min-height: 240px;
+ font-size: $font-size-xs;
+ line-height: 1.6;
+ tab-size: 4;
+}
+
+// Toggle switch
+.toggle-label {
+ display: flex !important;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.toggle-switch {
+ position: relative;
+ width: 36px;
+ height: 20px;
+ background: $bg-tertiary;
+ border: none;
+ border-radius: $radius-full;
+ cursor: pointer;
+ transition: background $transition-fast;
+
+ &.active { background: $success; }
+
+ .toggle-knob {
+ position: absolute;
+ top: 2px;
+ left: 2px;
+ width: 16px;
+ height: 16px;
+ background: white;
+ border-radius: 50%;
+ transition: transform $transition-fast;
+ }
+
+ &.active .toggle-knob {
+ transform: translateX(16px);
+ }
+}
+
+// Input with action button (e.g. copy)
+.input-with-action {
+ display: flex;
+ gap: $space-2;
+
+ input { flex: 1; }
+}
+
+.input-action-btn {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: $space-2 $space-3;
+ background: $bg-body;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-md;
+ color: $text-secondary;
+ cursor: pointer;
+ transition: all $transition-fast;
+
+ &:hover { background: $bg-hover; color: $text-primary; }
+}
+
+// Info boxes in panels
+.panel-info-box {
+ padding: $space-3;
+ background: rgba($accent-primary-raw, 0.08);
+ border: 1px solid rgba($accent-primary-raw, 0.2);
+ border-radius: $radius-md;
+ font-size: $font-size-xs;
+ color: $text-secondary;
+ line-height: 1.6;
+ margin-top: $space-3;
+
+ code {
+ background: rgba(0, 0, 0, 0.3);
+ padding: 1px 4px;
+ border-radius: 3px;
+ font-size: $font-size-xs;
+ color: $accent-primary;
+ }
+
+ &.panel-info-warning {
+ background: rgba($warning, 0.08);
+ border-color: rgba($warning, 0.2);
+
+ code { color: $warning; }
+ }
+}
+
+// Delete node button
+.btn-delete-node {
+ width: 100%;
+ padding: $space-2 $space-4;
+ background: transparent;
+ border: 1px solid $danger;
+ border-radius: $radius-md;
+ color: $danger;
+ font-size: $font-size-sm;
+ font-weight: $font-weight-medium;
+ cursor: pointer;
+ transition: all $transition-fast;
+
+ &:hover {
+ background: $danger;
+ color: white;
+ }
+}
+
+// Branch legend (If/Else panel)
+.branch-legend {
+ display: flex;
+ flex-direction: column;
+ gap: $space-2;
+ margin-top: $space-4;
+}
+
+.branch-legend-item {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ font-size: $font-size-xs;
+ color: $text-secondary;
+}
+
+.branch-dot {
+ width: 8px;
+ height: 8px;
+ border-radius: 50%;
+
+ &.branch-dot-true { background: $success; }
+ &.branch-dot-false { background: $danger; }
+}
+
+// 3-col form row
+.form-row-3 {
+ display: grid;
+ grid-template-columns: 1fr 1fr 1fr;
+ gap: $space-3;
+}
+
+// Font mono utility
+.font-mono {
+ font-family: $font-mono !important;
+}
+
+// ============================================
+// PORT LIST (Docker Config Panel)
+// ============================================
+
.port-list {
display: flex;
flex-direction: column;
@@ -996,6 +1381,22 @@
}
}
+.toolbar-btn-execute {
+ color: $success;
+
+ &:hover {
+ background: rgba($success, 0.1);
+ border-color: $success;
+ }
+}
+
+.toolbar-divider {
+ width: 1px;
+ height: 24px;
+ background: $border-subtle;
+ margin: 0 $space-1;
+}
+
.toolbar-message {
position: absolute;
top: 100%;