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.

Replace native controls with UI components

Juan Denisb0b2f57b606c
diff --git a/frontend/src/components/CommandPalette.jsx b/frontend/src/components/CommandPalette.jsx
index 8e8d04dc..ad930801 100644
--- a/frontend/src/components/CommandPalette.jsx
+++ b/frontend/src/components/CommandPalette.jsx
@@ -1,6 +1,14 @@
-import React, { useState, useEffect, useRef, useCallback, useMemo } from 'react';
+import React, { useState, useEffect, useCallback, useMemo } from 'react';
import { useNavigate } from 'react-router-dom';
import api from '../services/api';
+import {
+ CommandDialog,
+ CommandInput,
+ CommandList,
+ CommandEmpty,
+ CommandGroup,
+ CommandItem,
+} from '@/components/ui/command';
const STATIC_PAGES = [
{ label: 'Services', path: '/services', category: 'Pages', keywords: 'apps containers' },
@@ -59,16 +67,12 @@ function scoreItem(item, query) {
const CommandPalette = ({ open, onClose }) => {
const [query, setQuery] = useState('');
const [dynamicItems, setDynamicItems] = useState([]);
- const [selectedIndex, setSelectedIndex] = useState(0);
- const inputRef = useRef(null);
- const listRef = useRef(null);
const navigate = useNavigate();
// Fetch dynamic items (services/containers + servers) when opened
useEffect(() => {
if (!open) return;
setQuery('');
- setSelectedIndex(0);
let cancelled = false;
async function fetchDynamic() {
@@ -85,7 +89,7 @@ const CommandPalette = ({ open, onClose }) => {
});
});
}
- } catch {}
+ } catch (_e) {} // eslint-disable-line no-empty
try {
const serverData = await api.getServers();
const servers = serverData?.servers || serverData || [];
@@ -99,20 +103,13 @@ const CommandPalette = ({ open, onClose }) => {
});
});
}
- } catch {}
+ } catch (_e) {} // eslint-disable-line no-empty
if (!cancelled) setDynamicItems(items);
}
fetchDynamic();
return () => { cancelled = true; };
}, [open]);
- // Focus input when opened
- useEffect(() => {
- if (open && inputRef.current) {
- requestAnimationFrame(() => inputRef.current?.focus());
- }
- }, [open]);
-
const allItems = useMemo(() => [...STATIC_PAGES, ...dynamicItems], [dynamicItems]);
const results = useMemo(() => {
@@ -124,99 +121,46 @@ const CommandPalette = ({ open, onClose }) => {
.slice(0, 20);
}, [query, allItems]);
- // Reset selected index when results change
- useEffect(() => {
- setSelectedIndex(0);
- }, [results]);
-
const handleSelect = useCallback((item) => {
navigate(item.path);
onClose();
}, [navigate, onClose]);
- const handleKeyDown = useCallback((e) => {
- if (e.key === 'ArrowDown') {
- e.preventDefault();
- setSelectedIndex(prev => Math.min(prev + 1, results.length - 1));
- } else if (e.key === 'ArrowUp') {
- e.preventDefault();
- setSelectedIndex(prev => Math.max(prev - 1, 0));
- } else if (e.key === 'Enter' && results[selectedIndex]) {
- e.preventDefault();
- handleSelect(results[selectedIndex]);
- } else if (e.key === 'Escape') {
- e.preventDefault();
- onClose();
- }
- }, [results, selectedIndex, handleSelect, onClose]);
-
- // Scroll selected item into view
- useEffect(() => {
- if (!listRef.current) return;
- const selected = listRef.current.children[selectedIndex];
- if (selected) selected.scrollIntoView({ block: 'nearest' });
- }, [selectedIndex]);
-
- if (!open) return null;
-
// Group results by category
- const grouped = {};
- results.forEach(item => {
- if (!grouped[item.category]) grouped[item.category] = [];
- grouped[item.category].push(item);
- });
-
- let flatIndex = -1;
+ const grouped = useMemo(() => {
+ const groups = {};
+ results.forEach(item => {
+ if (!groups[item.category]) groups[item.category] = [];
+ groups[item.category].push(item);
+ });
+ return groups;
+ }, [results]);
return (
- <div className="command-palette-overlay" onClick={onClose}>
- <div className="command-palette" onClick={e => e.stopPropagation()} role="dialog" aria-modal="true" aria-label="Command palette">
- <div className="command-palette__input-wrapper">
- <svg viewBox="0 0 24 24" width="18" height="18" stroke="currentColor" fill="none" strokeWidth="2">
- <circle cx="11" cy="11" r="8"/>
- <line x1="21" y1="21" x2="16.65" y2="16.65"/>
- </svg>
- <input
- ref={inputRef}
- type="text"
- value={query}
- onChange={e => setQuery(e.target.value)}
- onKeyDown={handleKeyDown}
- placeholder="Search pages, services, servers..."
- className="command-palette__input"
- autoComplete="off"
- spellCheck="false"
- />
- <kbd className="command-palette__kbd">ESC</kbd>
- </div>
- <div className="command-palette__results" ref={listRef}>
- {results.length === 0 ? (
- <div className="command-palette__empty">No results found</div>
- ) : (
- Object.entries(grouped).map(([category, items]) => (
- <div key={category} className="command-palette__group">
- <div className="command-palette__group-label">{category}</div>
- {items.map(item => {
- flatIndex++;
- const idx = flatIndex;
- return (
- <button
- key={`${item.category}-${item.path}-${item.label}`}
- className={`command-palette__item ${idx === selectedIndex ? 'command-palette__item--active' : ''}`}
- onClick={() => handleSelect(item)}
- onMouseEnter={() => setSelectedIndex(idx)}
- >
- <span className="command-palette__item-label">{item.label}</span>
- <span className="command-palette__item-path">{item.path}</span>
- </button>
- );
- })}
- </div>
- ))
- )}
- </div>
- </div>
- </div>
+ <CommandDialog open={open} onOpenChange={(isOpen) => { if (!isOpen) onClose(); }}>
+ <CommandInput
+ placeholder="Search pages, services, servers..."
+ value={query}
+ onValueChange={setQuery}
+ />
+ <CommandList>
+ <CommandEmpty>No results found</CommandEmpty>
+ {Object.entries(grouped).map(([category, items]) => (
+ <CommandGroup key={category} heading={category}>
+ {items.map(item => (
+ <CommandItem
+ key={`${item.category}-${item.path}-${item.label}`}
+ value={`${item.label} ${item.path} ${item.keywords || ''}`}
+ onSelect={() => handleSelect(item)}
+ >
+ <span className="command-palette__item-label">{item.label}</span>
+ <span className="command-palette__item-path">{item.path}</span>
+ </CommandItem>
+ ))}
+ </CommandGroup>
+ ))}
+ </CommandList>
+ </CommandDialog>
);
};
diff --git a/frontend/src/components/EnvironmentVariables.jsx b/frontend/src/components/EnvironmentVariables.jsx
index 86a2c4d9..608bcc13 100644
--- a/frontend/src/components/EnvironmentVariables.jsx
+++ b/frontend/src/components/EnvironmentVariables.jsx
@@ -1,6 +1,11 @@
import React, { useState, useEffect, useRef } from 'react';
import api from '../services/api';
import { useToast } from '../contexts/ToastContext';
+import { Button } from '@/components/ui/button';
+import { Input } from '@/components/ui/input';
+import { Textarea } from '@/components/ui/textarea';
+import { Checkbox } from '@/components/ui/checkbox';
+import { Badge } from '@/components/ui/badge';
import Modal from './Modal';
const EnvironmentVariables = ({ appId }) => {
@@ -141,7 +146,6 @@ const EnvironmentVariables = ({ appId }) => {
async function handleExport(includeSecrets = true) {
try {
const data = await api.exportEnvFile(appId, includeSecrets);
- // Download as file
const blob = new Blob([data.content], { type: 'text/plain' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
@@ -234,7 +238,7 @@ const EnvironmentVariables = ({ appId }) => {
<h3>Environment Variables</h3>
<div className="header-actions">
{envVars.length > 0 && (
- <button className="btn btn-secondary btn-sm" onClick={toggleShowAll} title={allVisible ? 'Hide all values' : 'Show all values'}>
+ <Button variant="outline" size="sm" onClick={toggleShowAll} title={allVisible ? 'Hide all values' : 'Show all values'}>
{allVisible ? (
<svg viewBox="0 0 24 24" width="14" height="14" stroke="currentColor" fill="none" strokeWidth="2">
<path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"/>
@@ -247,27 +251,27 @@ const EnvironmentVariables = ({ appId }) => {
</svg>
)}
{allVisible ? 'Hide All' : 'Show All'}
- </button>
+ </Button>
)}
- <button className="btn btn-secondary btn-sm" onClick={() => setShowImportModal(true)}>
+ <Button variant="outline" size="sm" onClick={() => setShowImportModal(true)}>
<svg viewBox="0 0 24 24" width="14" height="14" stroke="currentColor" fill="none" strokeWidth="2">
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12"/>
</svg>
Import
- </button>
- <button className="btn btn-secondary btn-sm" onClick={() => handleExport(true)}>
+ </Button>
+ <Button variant="outline" size="sm" onClick={() => handleExport(true)}>
<svg viewBox="0 0 24 24" width="14" height="14" stroke="currentColor" fill="none" strokeWidth="2">
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"/>
</svg>
Export
- </button>
- <button className="btn btn-secondary btn-sm" onClick={handleShowHistory}>
+ </Button>
+ <Button variant="outline" size="sm" onClick={handleShowHistory}>
<svg viewBox="0 0 24 24" width="14" height="14" stroke="currentColor" fill="none" strokeWidth="2">
<circle cx="12" cy="12" r="10"/>
<polyline points="12 6 12 12 16 14"/>
</svg>
History
- </button>
+ </Button>
</div>
</div>
@@ -278,14 +282,14 @@ const EnvironmentVariables = ({ appId }) => {
{/* Add new variable form */}
<form className="env-add-form" onSubmit={handleAdd}>
<div className="env-form-row">
- <input
+ <Input
type="text"
value={newKey}
onChange={(e) => setNewKey(e.target.value.toUpperCase().replace(/[^A-Z0-9_]/g, ''))}
placeholder="KEY_NAME"
className="env-key-input"
/>
- <input
+ <Input
type={newIsSecret ? 'password' : 'text'}
value={newValue}
onChange={(e) => setNewValue(e.target.value)}
@@ -293,21 +297,20 @@ const EnvironmentVariables = ({ appId }) => {
className="env-value-input"
/>
<label className="env-secret-toggle" title="Mark as secret">
- <input
- type="checkbox"
+ <Checkbox
checked={newIsSecret}
- onChange={(e) => setNewIsSecret(e.target.checked)}
+ onCheckedChange={setNewIsSecret}
/>
<svg viewBox="0 0 24 24" width="16" height="16" stroke="currentColor" fill="none" strokeWidth="2">
<rect x="3" y="11" width="18" height="11" rx="2" ry="2"/>
<path d="M7 11V7a5 5 0 0 1 10 0v4"/>
</svg>
</label>
- <button type="submit" className="btn btn-primary" disabled={saving}>
+ <Button type="submit" disabled={saving}>
Add
- </button>
+ </Button>
</div>
- <input
+ <Input
type="text"
value={newDescription}
onChange={(e) => setNewDescription(e.target.value)}
@@ -319,7 +322,7 @@ const EnvironmentVariables = ({ appId }) => {
{/* Filter */}
{envVars.length > 5 && (
<div className="env-filter">
- <input
+ <Input
type="text"
value={filter}
onChange={(e) => setFilter(e.target.value)}
@@ -422,7 +425,7 @@ const EnvironmentVariables = ({ appId }) => {
{editingId === envVar.id ? (
<div className="env-edit-row">
- <input
+ <Input
type="text"
value={editValue}
onChange={(e) => setEditValue(e.target.value)}
@@ -432,12 +435,12 @@ const EnvironmentVariables = ({ appId }) => {
if (e.key === 'Escape') cancelEditing();
}}
/>
- <button className="btn btn-primary btn-sm" onClick={() => handleUpdate(envVar.key)}>
+ <Button size="sm" onClick={() => handleUpdate(envVar.key)}>
Save
- </button>
- <button className="btn btn-secondary btn-sm" onClick={cancelEditing}>
+ </Button>
+ <Button variant="outline" size="sm" onClick={cancelEditing}>
Cancel
- </button>
+ </Button>
</div>
) : (
<div className="env-value">
@@ -457,91 +460,87 @@ const EnvironmentVariables = ({ appId }) => {
{envVars.length > 0 && (
<div className="env-footer">
<span className="env-count">{envVars.length} variable{envVars.length !== 1 ? 's' : ''}</span>
- <button className="btn btn-danger btn-sm" onClick={handleClearAll}>
+ <Button variant="destructive" size="sm" onClick={handleClearAll}>
Clear All
- </button>
+ </Button>
</div>
)}
{/* Import Modal */}
<Modal open={showImportModal} onClose={() => setShowImportModal(false)} title="Import Environment Variables">
- <p className="hint">Paste your .env file content below or upload a file.</p>
-
- <div className="import-file-upload">
- <input
- type="file"
- ref={fileInputRef}
- accept=".env,.txt"
- onChange={handleFileUpload}
- style={{ display: 'none' }}
- />
- <button
- className="btn btn-secondary"
- onClick={() => fileInputRef.current?.click()}
- >
- Choose File
- </button>
- </div>
+ <p className="hint">Paste your .env file content below or upload a file.</p>
- <textarea
- value={importContent}
- onChange={(e) => setImportContent(e.target.value)}
- placeholder="DATABASE_URL=postgres://...&#10;API_KEY=your-api-key&#10;DEBUG=false"
- rows={10}
- className="import-textarea"
- />
-
- <label className="checkbox-label">
- <input
- type="checkbox"
- checked={importOverwrite}
- onChange={(e) => setImportOverwrite(e.target.checked)}
- />
- <span>Overwrite existing variables with same keys</span>
- </label>
- <div className="modal-footer">
- <button className="btn btn-secondary" onClick={() => setShowImportModal(false)}>
- Cancel
- </button>
- <button className="btn btn-primary" onClick={handleImport} disabled={saving}>
- {saving ? 'Importing...' : 'Import'}
- </button>
- </div>
+ <div className="import-file-upload">
+ <input
+ type="file"
+ ref={fileInputRef}
+ accept=".env,.txt"
+ onChange={handleFileUpload}
+ style={{ display: 'none' }}
+ />
+ <Button variant="outline" onClick={() => fileInputRef.current?.click()}>
+ Choose File
+ </Button>
+ </div>
+
+ <Textarea
+ value={importContent}
+ onChange={(e) => setImportContent(e.target.value)}
+ placeholder={"DATABASE_URL=postgres://...\nAPI_KEY=your-api-key\nDEBUG=false"}
+ rows={10}
+ className="import-textarea"
+ />
+
+ <label className="checkbox-label">
+ <Checkbox
+ checked={importOverwrite}
+ onCheckedChange={setImportOverwrite}
+ />
+ <span>Overwrite existing variables with same keys</span>
+ </label>
+ <div className="modal-footer">
+ <Button variant="outline" onClick={() => setShowImportModal(false)}>
+ Cancel
+ </Button>
+ <Button onClick={handleImport} disabled={saving}>
+ {saving ? 'Importing...' : 'Import'}
+ </Button>
+ </div>
</Modal>
{/* History Modal */}
<Modal open={showHistoryModal} onClose={() => setShowHistoryModal(false)} title="Change History" size="lg">
- {history.length === 0 ? (
- <p className="hint">No changes recorded yet.</p>
- ) : (
- <table className="table">
- <thead>
- <tr>
- <th>Key</th>
- <th>Action</th>
- <th>Changed At</th>
- </tr>
- </thead>
- <tbody>
- {history.map((h, idx) => (
- <tr key={idx}>
- <td className="mono">{h.key}</td>
- <td>
- <span className={`badge badge-${h.action === 'created' ? 'success' : h.action === 'deleted' ? 'danger' : 'warning'}`}>
- {h.action}
- </span>
- </td>
- <td>{new Date(h.changed_at).toLocaleString()}</td>
- </tr>
- ))}
- </tbody>
- </table>
- )}
- <div className="modal-footer">
- <button className="btn btn-secondary" onClick={() => setShowHistoryModal(false)}>
- Close
- </button>
- </div>
+ {history.length === 0 ? (
+ <p className="hint">No changes recorded yet.</p>
+ ) : (
+ <table className="table">
+ <thead>
+ <tr>
+ <th>Key</th>
+ <th>Action</th>
+ <th>Changed At</th>
+ </tr>
+ </thead>
+ <tbody>
+ {history.map((h, idx) => (
+ <tr key={idx}>
+ <td className="mono">{h.key}</td>
+ <td>
+ <Badge variant={h.action === 'created' ? 'success' : h.action === 'deleted' ? 'destructive' : 'warning'}>
+ {h.action}
+ </Badge>
+ </td>
+ <td>{new Date(h.changed_at).toLocaleString()}</td>
+ </tr>
+ ))}
+ </tbody>
+ </table>
+ )}
+ <div className="modal-footer">
+ <Button variant="outline" onClick={() => setShowHistoryModal(false)}>
+ Close
+ </Button>
+ </div>
</Modal>
</div>
);
diff --git a/frontend/src/components/LogsDrawer.jsx b/frontend/src/components/LogsDrawer.jsx
index f07faec5..9ae9f3b6 100644
--- a/frontend/src/components/LogsDrawer.jsx
+++ b/frontend/src/components/LogsDrawer.jsx
@@ -1,5 +1,7 @@
import React, { useState, useEffect, useRef, useCallback } from 'react';
import { useLogsDrawer } from '../contexts/LogsDrawerContext';
+import { Button } from '@/components/ui/button';
+import { Switch } from '@/components/ui/switch';
import socketService from '../services/socket';
import api from '../services/api';
@@ -24,7 +26,6 @@ const LogsDrawer = () => {
setLines([]);
let cancelled = false;
- // Load initial log batch
async function loadInitial() {
try {
let data;
@@ -41,7 +42,6 @@ const LogsDrawer = () => {
}
loadInitial();
- // Subscribe to real-time log_line events
socketService.connect();
if (service.logPath) {
socketService.subscribeLogs(service.logPath);
@@ -111,11 +111,16 @@ const LogsDrawer = () => {
<span className="logs-drawer__service-name">{service.name}</span>
<span className="logs-drawer__last-line">{lastLine}</span>
<div className="logs-drawer__collapsed-actions">
- <button className="btn-icon" onClick={(e) => { e.stopPropagation(); closeDrawer(); }} title="Close">
+ <Button
+ variant="ghost"
+ size="icon"
+ onClick={(e) => { e.stopPropagation(); closeDrawer(); }}
+ title="Close"
+ >
<svg viewBox="0 0 24 24" width="14" height="14" stroke="currentColor" fill="none" strokeWidth="2">
<line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/>
</svg>
- </button>
+ </Button>
</div>
</div>
</div>
@@ -136,25 +141,25 @@ const LogsDrawer = () => {
</div>
<div className="logs-drawer__header-right">
<label className="logs-drawer__toggle">
- <input type="checkbox" checked={autoScroll} onChange={(e) => setAutoScroll(e.target.checked)} />
+ <Switch checked={autoScroll} onCheckedChange={setAutoScroll} />
<span>Auto-scroll</span>
</label>
- <button className="btn-icon" onClick={() => setLines([])} title="Clear">
+ <Button variant="ghost" size="icon" onClick={() => setLines([])} title="Clear">
<svg viewBox="0 0 24 24" width="14" height="14" stroke="currentColor" fill="none" strokeWidth="2">
<polyline points="3 6 5 6 21 6"/>
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/>
</svg>
- </button>
- <button className="btn-icon" onClick={collapseDrawer} title="Collapse">
+ </Button>
+ <Button variant="ghost" size="icon" onClick={collapseDrawer} title="Collapse">
<svg viewBox="0 0 24 24" width="14" height="14" stroke="currentColor" fill="none" strokeWidth="2">
<polyline points="6 9 12 15 18 9"/>
</svg>
- </button>
- <button className="btn-icon" onClick={closeDrawer} title="Close">
+ </Button>
+ <Button variant="ghost" size="icon" onClick={closeDrawer} title="Close">
<svg viewBox="0 0 24 24" width="14" height="14" stroke="currentColor" fill="none" strokeWidth="2">
<line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/>
</svg>
- </button>
+ </Button>
</div>
</div>
diff --git a/frontend/src/components/service-detail/CommandsTab.jsx b/frontend/src/components/service-detail/CommandsTab.jsx
index 7fea60d7..7d92f3ff 100644
--- a/frontend/src/components/service-detail/CommandsTab.jsx
+++ b/frontend/src/components/service-detail/CommandsTab.jsx
@@ -1,4 +1,6 @@
import React, { useState } from 'react';
+import { Button } from '@/components/ui/button';
+import { Input } from '@/components/ui/input';
import api from '../../services/api';
const CommandsTab = ({ appId, appType }) => {
@@ -43,32 +45,32 @@ const CommandsTab = ({ appId, appType }) => {
<div className="quick-commands">
{quickCommands.map(({ label, cmd }) => (
- <button
+ <Button
key={cmd}
- className="btn btn-secondary btn-sm"
+ variant="outline"
+ size="sm"
onClick={() => handleRun(cmd)}
disabled={running}
>
{label}
- </button>
+ </Button>
))}
</div>
<div className="command-input">
- <input
+ <Input
type="text"
value={command}
onChange={(e) => setCommand(e.target.value)}
placeholder="Enter command..."
onKeyDown={(e) => e.key === 'Enter' && handleRun()}
/>
- <button
- className="btn btn-primary"
+ <Button
onClick={() => handleRun()}
disabled={running}
>
{running ? 'Running...' : 'Run'}
- </button>
+ </Button>
</div>
{output && (
diff --git a/frontend/src/components/service-detail/EventsTab.jsx b/frontend/src/components/service-detail/EventsTab.jsx
index b92733d1..770b9cf9 100644
--- a/frontend/src/components/service-detail/EventsTab.jsx
+++ b/frontend/src/components/service-detail/EventsTab.jsx
@@ -1,4 +1,6 @@
import React, { useState } from 'react';
+import { Button } from '@/components/ui/button';
+import { Badge } from '@/components/ui/badge';
import { useDeployments } from '../../hooks/useDeployments';
import { getDeployStatus, formatRelativeTime, formatDuration } from '../../utils/serviceTypes';
@@ -15,7 +17,7 @@ const EventsTab = ({ appId }) => {
<div className="events-tab__empty">
<h3>Failed to load events</h3>
<p>{error}</p>
- <button className="btn btn-secondary" onClick={reload}>Retry</button>
+ <Button variant="outline" onClick={reload}>Retry</Button>
</div>
);
}
@@ -37,7 +39,7 @@ const EventsTab = ({ appId }) => {
<div className="events-tab">
<div className="events-tab__header">
<h3>Deployment Events</h3>
- <button className="btn btn-secondary btn-sm" onClick={reload}>Refresh</button>
+ <Button variant="outline" size="sm" onClick={reload}>Refresh</Button>
</div>
<div className="events-tab__timeline">
diff --git a/frontend/src/components/service-detail/GitConnectModal.jsx b/frontend/src/components/service-detail/GitConnectModal.jsx
index 5baeab5f..64358a1e 100644
--- a/frontend/src/components/service-detail/GitConnectModal.jsx
+++ b/frontend/src/components/service-detail/GitConnectModal.jsx
@@ -1,6 +1,11 @@
-import React, { useState, useEffect } from 'react';
+import React, { useState } from 'react';
import api from '../../services/api';
import { useToast } from '../../contexts/ToastContext';
+import { Button } from '@/components/ui/button';
+import { Input } from '@/components/ui/input';
+import { Label } from '@/components/ui/label';
+import { Textarea } from '@/components/ui/textarea';
+import { Switch } from '@/components/ui/switch';
import Modal from '../Modal';
const GitConnectModal = ({ appId, deployConfig, onClose, onSaved }) => {
@@ -74,86 +79,82 @@ const GitConnectModal = ({ appId, deployConfig, onClose, onSaved }) => {
return (
<Modal open={true} onClose={onClose} title={deployConfig ? 'Edit Repository' : 'Connect Repository'}>
- <form className="git-connect-modal__form" onSubmit={handleSubmit}>
- <div className="git-connect-modal__field">
- <label>Repository URL</label>
- <input
- type="text"
- value={repoUrl}
- onChange={(e) => setRepoUrl(e.target.value)}
- placeholder="https://github.com/user/repo.git"
- required
- />
- {provider && (
- <span className="settings-hint" style={{ marginTop: '4px', display: 'block' }}>
- Detected: {provider}
- </span>
- )}
+ <form className="git-connect-modal__form" onSubmit={handleSubmit}>
+ <div className="git-connect-modal__field">
+ <Label>Repository URL</Label>
+ <Input
+ type="text"
+ value={repoUrl}
+ onChange={(e) => setRepoUrl(e.target.value)}
+ placeholder="https://github.com/user/repo.git"
+ required
+ />
+ {provider && (
+ <span className="settings-hint" style={{ marginTop: '4px', display: 'block' }}>
+ Detected: {provider}
+ </span>
+ )}
+ </div>
+
+ <div className="git-connect-modal__field">
+ <Label>Branch</Label>
+ <Input
+ type="text"
+ value={branch}
+ onChange={(e) => setBranch(e.target.value)}
+ placeholder="main"
+ />
+ </div>
+
+ <div className="git-connect-modal__toggle">
+ <div className="git-connect-modal__toggle-label">
+ Auto-deploy on push
+ <span>Automatically deploy when new commits are pushed to the branch.</span>
</div>
-
- <div className="git-connect-modal__field">
- <label>Branch</label>
- <input
- type="text"
- value={branch}
- onChange={(e) => setBranch(e.target.value)}
- placeholder="main"
- />
- </div>
-
- <div className="git-connect-modal__toggle">
- <div className="git-connect-modal__toggle-label">
- Auto-deploy on push
- <span>Automatically deploy when new commits are pushed to the branch.</span>
- </div>
- <label className="toggle">
- <input
- type="checkbox"
- checked={autoDeploy}
- onChange={(e) => setAutoDeploy(e.target.checked)}
- />
- <span className="toggle-slider"></span>
- </label>
- </div>
-
- <div className="git-connect-modal__field">
- <label>Pre-deploy Script (optional)</label>
- <textarea
- value={preDeployScript}
- onChange={(e) => setPreDeployScript(e.target.value)}
- placeholder="Commands to run before deployment..."
- />
- </div>
-
- <div className="git-connect-modal__field">
- <label>Post-deploy Script (optional)</label>
- <textarea
- value={postDeployScript}
- onChange={(e) => setPostDeployScript(e.target.value)}
- placeholder="Commands to run after deployment..."
- />
- </div>
-
- <div className="git-connect-modal__actions">
- {deployConfig && (
- <button
- type="button"
- className="btn btn-danger"
- onClick={handleDisconnect}
- disabled={saving}
- style={{ marginRight: 'auto' }}
- >
- Disconnect
- </button>
- )}
- <button type="button" className="btn btn-secondary" onClick={onClose}>
- Cancel
- </button>
- <button type="submit" className="btn btn-primary" disabled={saving}>
- {saving ? 'Saving...' : deployConfig ? 'Save Changes' : 'Connect'}
- </button>
- </div>
- </form>
+ <Switch
+ checked={autoDeploy}
+ onCheckedChange={setAutoDeploy}
+ />
+ </div>
+
+ <div className="git-connect-modal__field">
+ <Label>Pre-deploy Script (optional)</Label>
+ <Textarea
+ value={preDeployScript}
+ onChange={(e) => setPreDeployScript(e.target.value)}
+ placeholder="Commands to run before deployment..."
+ />
+ </div>
+
+ <div className="git-connect-modal__field">
+ <Label>Post-deploy Script (optional)</Label>
+ <Textarea
+ value={postDeployScript}
+ onChange={(e) => setPostDeployScript(e.target.value)}
+ placeholder="Commands to run after deployment..."
+ />
+ </div>
+
+ <div className="git-connect-modal__actions">
+ {deployConfig && (
+ <Button
+ type="button"
+ variant="destructive"
+ onClick={handleDisconnect}
+ disabled={saving}
+ style={{ marginRight: 'auto' }}
+ >
+ Disconnect
+ </Button>
+ )}
+ <Button type="button" variant="outline" onClick={onClose}>
+ Cancel
+ </Button>
+ <Button type="submit" disabled={saving}>
+ {saving ? 'Saving...' : deployConfig ? 'Save Changes' : 'Connect'}
+ </Button>
+ </div>
+ </form>
</Modal>
);
};
diff --git a/frontend/src/components/service-detail/GunicornTab.jsx b/frontend/src/components/service-detail/GunicornTab.jsx
index f377270c..a61c18c7 100644
--- a/frontend/src/components/service-detail/GunicornTab.jsx
+++ b/frontend/src/components/service-detail/GunicornTab.jsx
@@ -1,6 +1,8 @@
import React, { useState, useEffect } from 'react';
import api from '../../services/api';
import { useToast } from '../../contexts/ToastContext';
+import { Button } from '@/components/ui/button';
+import { Textarea } from '@/components/ui/textarea';
const GunicornTab = ({ appId }) => {
const toast = useToast();
@@ -43,11 +45,11 @@ const GunicornTab = ({ appId }) => {
<div>
<div className="section-header">
<h3>Gunicorn Configuration</h3>
- <button className="btn btn-primary" onClick={handleSave} disabled={saving}>
+ <Button onClick={handleSave} disabled={saving}>
{saving ? 'Saving...' : 'Save'}
- </button>
+ </Button>
</div>
- <textarea
+ <Textarea
className="code-editor"
value={config}
onChange={(e) => setConfig(e.target.value)}
diff --git a/frontend/src/components/service-detail/LogsTab.jsx b/frontend/src/components/service-detail/LogsTab.jsx
index cc16b007..9e3c5e01 100644
--- a/frontend/src/components/service-detail/LogsTab.jsx
+++ b/frontend/src/components/service-detail/LogsTab.jsx
@@ -1,6 +1,9 @@
import React, { useState, useEffect, useRef, useMemo } from 'react';
import api from '../../services/api';
import { useLogsDrawer } from '../../contexts/LogsDrawerContext';
+import { Button } from '@/components/ui/button';
+import { Input } from '@/components/ui/input';
+import { Switch } from '@/components/ui/switch';
const LOG_LEVELS = ['all', 'error', 'warn', 'info', 'debug'];
@@ -57,7 +60,6 @@ const LogsTab = ({ app }) => {
if (!rawLogs) return [];
let lines = rawLogs.split('\n');
- // Level filter
if (levelFilter !== 'all') {
lines = lines.filter(line => {
const lower = line.toLowerCase();
@@ -69,7 +71,6 @@ const LogsTab = ({ app }) => {
});
}
- // Search filter
if (searchTerm) {
const term = searchTerm.toLowerCase();
lines = lines.filter(line => line.toLowerCase().includes(term));
@@ -112,7 +113,7 @@ const LogsTab = ({ app }) => {
<circle cx="11" cy="11" r="8"/>
<line x1="21" y1="21" x2="16.65" y2="16.65"/>
</svg>
- <input
+ <Input
type="text"
placeholder="Search logs..."
value={searchTerm}
@@ -146,36 +147,37 @@ const LogsTab = ({ app }) => {
</div>
<div className="logs-toolbar__right">
<label className="logs-toolbar__toggle">
- <input type="checkbox" checked={autoScroll} onChange={(e) => setAutoScroll(e.target.checked)} />
+ <Switch checked={autoScroll} onCheckedChange={setAutoScroll} />
<span>Auto-scroll</span>
</label>
<label className="logs-toolbar__toggle">
- <input type="checkbox" checked={autoRefresh} onChange={(e) => setAutoRefresh(e.target.checked)} />
+ <Switch checked={autoRefresh} onCheckedChange={setAutoRefresh} />
<span>Live</span>
</label>
<div className="logs-toolbar__divider" />
- <button className="btn btn-ghost btn-sm" onClick={handleCopy} title="Copy logs">
+ <Button variant="ghost" size="icon" onClick={handleCopy} title="Copy logs">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"/>
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/>
</svg>
- </button>
- <button className="btn btn-ghost btn-sm" onClick={handleDownload} title="Download logs">
+ </Button>
+ <Button variant="ghost" size="icon" onClick={handleDownload} title="Download logs">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<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"/>
</svg>
- </button>
- <button className="btn btn-ghost btn-sm" onClick={loadLogs} title="Refresh">
+ </Button>
+ <Button variant="ghost" size="icon" onClick={loadLogs} title="Refresh">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<polyline points="23 4 23 10 17 10"/>
<path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/>
</svg>
- </button>
+ </Button>
<div className="logs-toolbar__divider" />
- <button
- className="btn btn-ghost btn-sm"
+ <Button
+ variant="ghost"
+ size="icon"
onClick={() => openDrawer({
name: app.name,
containerId: app.id,
@@ -188,7 +190,7 @@ const LogsTab = ({ app }) => {
<line x1="12" y1="17" x2="12" y2="22"/>
<path d="M5 17h14v-1.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V6h1a2 2 0 0 0 0-4H8a2 2 0 0 0 0 4h1v4.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24Z"/>
</svg>
- </button>
+ </Button>
</div>
</div>
diff --git a/frontend/src/components/service-detail/PackagesTab.jsx b/frontend/src/components/service-detail/PackagesTab.jsx
index 79d99db8..bd5e1936 100644
--- a/frontend/src/components/service-detail/PackagesTab.jsx
+++ b/frontend/src/components/service-detail/PackagesTab.jsx
@@ -1,6 +1,8 @@
import React, { useState, useEffect } from 'react';
import api from '../../services/api';
import { useToast } from '../../contexts/ToastContext';
+import { Button } from '@/components/ui/button';
+import { Input } from '@/components/ui/input';
const PackagesTab = ({ appId }) => {
const toast = useToast();
@@ -57,21 +59,21 @@ const PackagesTab = ({ appId }) => {
<div>
<div className="section-header">
<h3>Installed Packages</h3>
- <button className="btn btn-secondary btn-sm" onClick={handleFreeze}>
+ <Button variant="outline" size="sm" onClick={handleFreeze}>
Freeze to requirements.txt
- </button>
+ </Button>
</div>
<form className="install-form" onSubmit={handleInstall}>
- <input
+ <Input
type="text"
value={newPackage}
onChange={(e) => setNewPackage(e.target.value)}
placeholder="Package name (e.g., requests, flask==2.0.0)"
/>
- <button type="submit" className="btn btn-primary" disabled={installing}>
+ <Button type="submit" disabled={installing}>
{installing ? 'Installing...' : 'Install'}
- </button>
+ </Button>
</form>
<div className="packages-list">
diff --git a/frontend/src/components/service-detail/SettingsTab.jsx b/frontend/src/components/service-detail/SettingsTab.jsx
index 554680ec..b4dd6f0b 100644
--- a/frontend/src/components/service-detail/SettingsTab.jsx
+++ b/frontend/src/components/service-detail/SettingsTab.jsx
@@ -2,6 +2,8 @@ import React, { useState } from 'react';
import { useNavigate } from 'react-router-dom';
import api from '../../services/api';
import { useToast } from '../../contexts/ToastContext';
+import { Button } from '@/components/ui/button';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
const SettingsTab = ({ app, deployConfig, onUpdate, onOpenGitModal }) => {
const navigate = useNavigate();
@@ -78,9 +80,9 @@ const SettingsTab = ({ app, deployConfig, onUpdate, onOpenGitModal }) => {
</span>
</div>
<div className="settings-control">
- <button className="btn btn-secondary" onClick={onOpenGitModal}>
+ <Button variant="outline" onClick={onOpenGitModal}>
{deployConfig ? 'Edit' : 'Connect'}
- </button>
+ </Button>
</div>
</div>
</div>
@@ -105,17 +107,21 @@ const SettingsTab = ({ app, deployConfig, onUpdate, onOpenGitModal }) => {
{envLabels[app.environment_type] || app.environment_type}
</span>
) : (
- <select
+ <Select
value={environmentType}
- onChange={(e) => handleEnvironmentChange(e.target.value)}
+ onValueChange={handleEnvironmentChange}
disabled={savingEnvironment}
- className="settings-select"
>
- <option value="standalone">Standalone</option>
- <option value="development">Development</option>
- <option value="staging">Staging</option>
- <option value="production">Production</option>
- </select>
+ <SelectTrigger className="settings-select">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="standalone">Standalone</SelectItem>
+ <SelectItem value="development">Development</SelectItem>
+ <SelectItem value="staging">Staging</SelectItem>
+ <SelectItem value="production">Production</SelectItem>
+ </SelectContent>
+ </Select>
)}
{savingEnvironment && <span className="settings-saving">Saving...</span>}
</div>
@@ -130,13 +136,13 @@ const SettingsTab = ({ app, deployConfig, onUpdate, onOpenGitModal }) => {
</span>
</div>
<div className="settings-control">
- <button
- className="btn btn-secondary"
+ <Button
+ variant="outline"
onClick={handleUnlink}
disabled={unlinking}
>
{unlinking ? 'Unlinking...' : 'Unlink'}
- </button>
+ </Button>
</div>
</div>
)}
@@ -148,13 +154,13 @@ const SettingsTab = ({ app, deployConfig, onUpdate, onOpenGitModal }) => {
<h3 className="svc-settings__section-title">Danger Zone</h3>
<div className="card danger-zone">
<p>Once you delete a service, there is no going back. All data will be permanently removed.</p>
- <button
- className="btn btn-danger"
+ <Button
+ variant="destructive"
onClick={handleDelete}
disabled={deleting}
>
{deleting ? 'Deleting...' : 'Delete Service'}
- </button>
+ </Button>
</div>
</div>
</div>
diff --git a/frontend/src/components/service-detail/ShellTab.jsx b/frontend/src/components/service-detail/ShellTab.jsx
index 69d95bc0..e41a6c5d 100644
--- a/frontend/src/components/service-detail/ShellTab.jsx
+++ b/frontend/src/components/service-detail/ShellTab.jsx
@@ -1,5 +1,7 @@
import React, { useState, useEffect, useRef } from 'react';
import api from '../../services/api';
+import { Input } from '@/components/ui/input';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
const ShellTab = ({ appId, appName }) => {
const [containers, setContainers] = useState([]);
@@ -81,17 +83,21 @@ const ShellTab = ({ appId, appName }) => {
<div className="shell-tab__header">
<span style={{ fontSize: '13px', color: 'var(--text-secondary)' }}>Container Shell</span>
{containers.length > 1 && (
- <select
+ <Select
value={selectedContainer || ''}
- onChange={(e) => setSelectedContainer(e.target.value)}
- style={{ fontSize: '12px' }}
+ onValueChange={setSelectedContainer}
>
- {containers.map(c => (
- <option key={c.Id} value={c.Id}>
- {c.Names?.[0]?.replace(/^\//, '') || c.Id.substring(0, 12)}
- </option>
- ))}
- </select>
+ <SelectTrigger style={{ fontSize: '12px' }}>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {containers.map(c => (
+ <SelectItem key={c.Id} value={c.Id}>
+ {c.Names?.[0]?.replace(/^\//, '') || c.Id.substring(0, 12)}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
)}
</div>
@@ -112,7 +118,7 @@ const ShellTab = ({ appId, appName }) => {
<form className="shell-tab__input-row" onSubmit={handleExec}>
<span className="shell-tab__prompt">$</span>
- <input
+ <Input
className="shell-tab__input"
type="text"
value={command}
diff --git a/frontend/src/components/setup/SetupStepAccount.jsx b/frontend/src/components/setup/SetupStepAccount.jsx
index b34c4706..df5945db 100644
--- a/frontend/src/components/setup/SetupStepAccount.jsx
+++ b/frontend/src/components/setup/SetupStepAccount.jsx
@@ -1,6 +1,9 @@
import React, { useState } from 'react';
import { useAuth } from '../../contexts/AuthContext';
import { Info } from 'lucide-react';
+import { Button } from '@/components/ui/button';
+import { Input } from '@/components/ui/input';
+import { Label } from '@/components/ui/label';
const SetupStepAccount = ({ onComplete }) => {
const [email, setEmail] = useState('');
@@ -77,8 +80,8 @@ const SetupStepAccount = ({ onComplete }) => {
<form onSubmit={handleLogin}>
<div className="form-group">
- <label htmlFor="email">Email</label>
- <input
+ <Label htmlFor="email">Email</Label>
+ <Input
type="email"
id="email"
value={email}
@@ -90,8 +93,8 @@ const SetupStepAccount = ({ onComplete }) => {
</div>
<div className="form-group">
- <label htmlFor="password">Password</label>
- <input
+ <Label htmlFor="password">Password</Label>
+ <Input
type="password"
id="password"
value={password}
@@ -136,8 +139,8 @@ const SetupStepAccount = ({ onComplete }) => {
<form onSubmit={handleRegister}>
<div className="form-group">
- <label htmlFor="email">Admin Email</label>
- <input
+ <Label htmlFor="email">Admin Email</Label>
+ <Input
type="email"
id="email"
value={email}
@@ -149,8 +152,8 @@ const SetupStepAccount = ({ onComplete }) => {
</div>
<div className="form-group">
- <label htmlFor="username">Username</label>
- <input
+ <Label htmlFor="username">Username</Label>
+ <Input
type="text"
id="username"
value={username}
@@ -161,8 +164,8 @@ const SetupStepAccount = ({ onComplete }) => {
</div>
<div className="form-group">
- <label htmlFor="password">Password</label>
- <input
+ <Label htmlFor="password">Password</Label>
+ <Input
type="password"
id="password"
value={password}
@@ -173,8 +176,8 @@ const SetupStepAccount = ({ onComplete }) => {
</div>
<div className="form-group">
- <label htmlFor="confirmPassword">Confirm Password</label>
- <input
+ <Label htmlFor="confirmPassword">Confirm Password</Label>
+ <Input
type="password"
id="confirmPassword"
value={confirmPassword}
diff --git a/frontend/src/components/setup/SetupStepIntent.jsx b/frontend/src/components/setup/SetupStepIntent.jsx
index 8533730c..55300fe2 100644
--- a/frontend/src/components/setup/SetupStepIntent.jsx
+++ b/frontend/src/components/setup/SetupStepIntent.jsx
@@ -1,5 +1,6 @@
import React, { useState } from 'react';
import { Globe, Code, Server, GitBranch, Check } from 'lucide-react';
+import { Button } from '@/components/ui/button';
const USE_CASE_OPTIONS = [
{
diff --git a/frontend/src/components/setup/SetupStepSummary.jsx b/frontend/src/components/setup/SetupStepSummary.jsx
index 5b94b033..7676d3d1 100644
--- a/frontend/src/components/setup/SetupStepSummary.jsx
+++ b/frontend/src/components/setup/SetupStepSummary.jsx
@@ -1,6 +1,7 @@
import React from 'react';
import { useResourceTier } from '../../contexts/ResourceTierContext';
import { Sparkles } from 'lucide-react';
+import { Badge } from '@/components/ui/badge';
const USE_CASE_LABELS = {
wordpress: 'WordPress Sites',
@@ -78,9 +79,9 @@ const SetupStepSummary = ({ accountInfo, useCases, onFinish }) => {
{useCases && useCases.length > 0 ? (
<div className="summary-tags">
{useCases.map((uc) => (
- <span key={uc} className="summary-tag">
+ <Badge key={uc} variant="secondary">
{USE_CASE_LABELS[uc] || uc}
- </span>
+ </Badge>
))}
</div>
) : (
diff --git a/frontend/src/components/wordpress/ActivityFeed.jsx b/frontend/src/components/wordpress/ActivityFeed.jsx
index 0a41a740..6665af9d 100644
--- a/frontend/src/components/wordpress/ActivityFeed.jsx
+++ b/frontend/src/components/wordpress/ActivityFeed.jsx
@@ -1,6 +1,9 @@
import React, { useState, useEffect } from 'react';
import { ArrowUpRight, ArrowDownLeft, Database, GitBranch, Lock, Unlock, Trash2, Play, Square, RefreshCw, Camera, AlertCircle } from 'lucide-react';
import wordpressApi from '../../services/wordpress';
+import { Button } from '@/components/ui/button';
+import { Badge } from '@/components/ui/badge';
+import { Skeleton } from '@/components/ui/skeleton';
const ACTION_ICONS = {
create: Play,
@@ -17,18 +20,18 @@ const ACTION_ICONS = {
restarted: RefreshCw
};
-const ACTION_COLORS = {
+const ACTION_BADGE_VARIANTS = {
create: 'success',
deploy: 'info',
- promote: 'primary',
+ promote: 'default',
sync: 'info',
lock: 'warning',
- unlock: 'default',
- destroy: 'danger',
+ unlock: 'secondary',
+ destroy: 'destructive',
snapshot_created: 'info',
snapshot_restored: 'warning',
started: 'success',
- stopped: 'default',
+ stopped: 'secondary',
restarted: 'info'
};
@@ -77,10 +80,10 @@ const ActivityFeed = ({ projectId, envId, limit = 20, compact = false }) => {
<div className="activity-feed">
{[1, 2, 3].map(i => (
<div key={i} className="activity-item-skeleton">
- <div className="skeleton" style={{ width: 32, height: 32, borderRadius: '50%' }} />
+ <Skeleton className="h-8 w-8 rounded-full" />
<div style={{ flex: 1 }}>
- <div className="skeleton" style={{ width: '60%', height: 14, marginBottom: 6 }} />
- <div className="skeleton" style={{ width: '40%', height: 12 }} />
+ <Skeleton className="h-3.5 w-3/5 mb-1.5" />
+ <Skeleton className="h-3 w-2/5" />
</div>
</div>
))}
@@ -100,7 +103,7 @@ const ActivityFeed = ({ projectId, envId, limit = 20, compact = false }) => {
<div className={`activity-feed ${compact ? 'compact' : ''}`}>
{activities.map(activity => {
const Icon = ACTION_ICONS[activity.action] || AlertCircle;
- const colorClass = ACTION_COLORS[activity.action] || 'default';
+ const colorClass = ACTION_BADGE_VARIANTS[activity.action] || 'secondary';
return (
<div key={activity.id} className="activity-item">
@@ -118,19 +121,19 @@ const ActivityFeed = ({ projectId, envId, limit = 20, compact = false }) => {
<div className="activity-meta">
<span className="activity-time">{formatRelativeTime(activity.created_at)}</span>
{activity.status === 'failed' && (
- <span className="activity-status-badge failed">Failed</span>
+ <Badge variant="destructive">Failed</Badge>
)}
{activity.status === 'running' && (
- <span className="activity-status-badge running">Running</span>
+ <Badge variant="info">Running</Badge>
)}
</div>
</div>
);
})}
{total > activities.length && !compact && (
- <button className="btn btn-ghost btn-sm activity-load-more" onClick={loadActivities}>
+ <Button variant="ghost" size="sm" className="activity-load-more" onClick={loadActivities}>
Load more
- </button>
+ </Button>
)}
</div>
);
diff --git a/frontend/src/components/wordpress/AutoSyncScheduleModal.jsx b/frontend/src/components/wordpress/AutoSyncScheduleModal.jsx
index d084d8bd..8d3a2022 100644
--- a/frontend/src/components/wordpress/AutoSyncScheduleModal.jsx
+++ b/frontend/src/components/wordpress/AutoSyncScheduleModal.jsx
@@ -1,7 +1,11 @@
import React, { useState, useEffect } from 'react';
-import { Clock, RefreshCw } from 'lucide-react';
+import { RefreshCw } from 'lucide-react';
import Spinner from '../Spinner';
import Modal from '../Modal';
+import { Button } from '@/components/ui/button';
+import { Input } from '@/components/ui/input';
+import { Label } from '@/components/ui/label';
+import { Switch } from '@/components/ui/switch';
const SCHEDULE_PRESETS = [
{ label: 'Daily at 3 AM', value: '0 3 * * *' },
@@ -85,96 +89,91 @@ const AutoSyncScheduleModal = ({ environment, prodId, onClose, api }) => {
return (
<Modal open={true} onClose={onClose} title="Auto-Sync Schedule" className="auto-sync-modal">
- {loading ? (
- <div className="auto-sync-loading">
- <Spinner size="sm" />
- <span>Loading schedule...</span>
+ {loading ? (
+ <div className="auto-sync-loading">
+ <Spinner size="sm" />
+ <span>Loading schedule...</span>
+ </div>
+ ) : (
+ <div className="auto-sync-body">
+ <div className="auto-sync-env-name">{envName}</div>
+
+ <div className="auto-sync-toggle">
+ <label className="auto-sync-toggle-label">
+ <span>Enable Auto-Sync from Production</span>
+ <Switch checked={enabled} onCheckedChange={setEnabled} />
+ </label>
+ <p className="auto-sync-description">
+ Automatically sync this environment from production on a schedule.
+ </p>
</div>
- ) : (
- <div className="auto-sync-body">
- <div className="auto-sync-env-name">{envName}</div>
-
- <div className="auto-sync-toggle">
- <label className="auto-sync-toggle-label">
- <span>Enable Auto-Sync from Production</span>
- <button
- className={`toggle-switch ${enabled ? 'active' : ''}`}
- onClick={() => setEnabled(!enabled)}
- >
- <span className="toggle-switch-slider" />
- </button>
- </label>
- <p className="auto-sync-description">
- Automatically sync this environment from production on a schedule.
- </p>
- </div>
-
- {enabled && (
- <>
+
+ {enabled && (
+ <>
+ <div className="form-group">
+ <Label>Schedule</Label>
+ <div className="auto-sync-presets">
+ {SCHEDULE_PRESETS.map(preset => (
+ <label key={preset.value} className="radio-label">
+ <input
+ type="radio"
+ name="schedule-preset"
+ checked={selectedPreset === preset.value}
+ onChange={() => handlePresetChange(preset.value)}
+ />
+ <span className="radio-content">
+ <strong>{preset.label}</strong>
+ {preset.value !== 'custom' && (
+ <span className="auto-sync-cron-display">{preset.value}</span>
+ )}
+ </span>
+ </label>
+ ))}
+ </div>
+ </div>
+
+ {selectedPreset === 'custom' && (
<div className="form-group">
- <label>Schedule</label>
- <div className="auto-sync-presets">
- {SCHEDULE_PRESETS.map(preset => (
- <label key={preset.value} className="radio-label">
- <input
- type="radio"
- name="schedule-preset"
- checked={selectedPreset === preset.value}
- onChange={() => handlePresetChange(preset.value)}
- />
- <span className="radio-content">
- <strong>{preset.label}</strong>
- {preset.value !== 'custom' && (
- <span className="auto-sync-cron-display">{preset.value}</span>
- )}
- </span>
- </label>
+ <Label>Custom Cron Expression</Label>
+ <Input
+ type="text"
+ value={customCron}
+ onChange={e => handleCustomCronChange(e.target.value)}
+ placeholder="0 3 * * *"
+ className="auto-sync-cron-input"
+ />
+ <span className="form-hint">
+ Format: minute hour day-of-month month day-of-week
+ </span>
+ </div>
+ )}
+
+ {nextRuns.length > 0 && (
+ <div className="auto-sync-next-runs">
+ <h5>Next Scheduled Runs</h5>
+ <ul>
+ {nextRuns.map((run, i) => (
+ <li key={i}>
+ <RefreshCw size={10} />
+ <span>{formatDateTime(run)}</span>
+ </li>
))}
- </div>
+ </ul>
</div>
-
- {selectedPreset === 'custom' && (
- <div className="form-group">
- <label>Custom Cron Expression</label>
- <input
- type="text"
- value={customCron}
- onChange={e => handleCustomCronChange(e.target.value)}
- placeholder="0 3 * * *"
- className="auto-sync-cron-input"
- />
- <span className="form-hint">
- Format: minute hour day-of-month month day-of-week
- </span>
- </div>
- )}
-
- {nextRuns.length > 0 && (
- <div className="auto-sync-next-runs">
- <h5>Next Scheduled Runs</h5>
- <ul>
- {nextRuns.map((run, i) => (
- <li key={i}>
- <RefreshCw size={10} />
- <span>{formatDateTime(run)}</span>
- </li>
- ))}
- </ul>
- </div>
- )}
- </>
- )}
- </div>
- )}
-
- <div className="modal-actions">
- <button className="btn btn-secondary" onClick={onClose} disabled={saving}>
- Cancel
- </button>
- <button className="btn btn-primary" onClick={handleSave} disabled={saving || loading}>
- {saving ? <><Spinner size="sm" /> Saving...</> : 'Save Schedule'}
- </button>
+ )}
+ </>
+ )}
</div>
+ )}
+
+ <div className="modal-actions">
+ <Button variant="outline" onClick={onClose} disabled={saving}>
+ Cancel
+ </Button>
+ <Button onClick={handleSave} disabled={saving || loading}>
+ {saving ? <><Spinner size="sm" /> Saving...</> : 'Save Schedule'}
+ </Button>
+ </div>
</Modal>
);
};
diff --git a/frontend/src/components/wordpress/BasicAuthModal.jsx b/frontend/src/components/wordpress/BasicAuthModal.jsx
index 4fa47c98..61e34af0 100644
--- a/frontend/src/components/wordpress/BasicAuthModal.jsx
+++ b/frontend/src/components/wordpress/BasicAuthModal.jsx
@@ -2,6 +2,8 @@ import React, { useState, useEffect } from 'react';
import { Shield, Copy, Check, AlertTriangle } from 'lucide-react';
import Spinner from '../Spinner';
import Modal from '../Modal';
+import { Button } from '@/components/ui/button';
+import { Switch } from '@/components/ui/switch';
const BasicAuthModal = ({ environment, prodId, onClose, api }) => {
const [loading, setLoading] = useState(true);
@@ -66,87 +68,87 @@ const BasicAuthModal = ({ environment, prodId, onClose, api }) => {
return (
<Modal open={true} onClose={onClose} title="Basic Auth" className="basic-auth-modal">
- <div className="basic-auth-body">
- <div className="basic-auth-env-name">{envName}</div>
+ <div className="basic-auth-body">
+ <div className="basic-auth-env-name">{envName}</div>
- {loading ? (
- <div className="basic-auth-loading">
- <Spinner size="sm" />
- <span>Loading status...</span>
+ {loading ? (
+ <div className="basic-auth-loading">
+ <Spinner size="sm" />
+ <span>Loading status...</span>
+ </div>
+ ) : (
+ <>
+ <div className="basic-auth-toggle">
+ <label className="basic-auth-toggle-label">
+ <span>HTTP Basic Authentication</span>
+ <Switch
+ checked={status.enabled}
+ onCheckedChange={status.enabled ? handleDisable : handleEnable}
+ disabled={toggling}
+ />
+ </label>
+ <p className="basic-auth-description">
+ Adds password protection to the site. Visitors must enter credentials to access any page.
+ </p>
</div>
- ) : (
- <>
- <div className="basic-auth-toggle">
- <label className="basic-auth-toggle-label">
- <span>HTTP Basic Authentication</span>
- <button
- className={`toggle-switch ${status.enabled ? 'active' : ''}`}
- onClick={status.enabled ? handleDisable : handleEnable}
- disabled={toggling}
- >
- <span className="toggle-switch-slider" />
- </button>
- </label>
- <p className="basic-auth-description">
- Adds password protection to the site. Visitors must enter credentials to access any page.
- </p>
- </div>
- {status.enabled && status.username && !credentials && (
- <div className="basic-auth-current">
- <div className="basic-auth-field">
- <label>Username</label>
- <div className="basic-auth-value">
- <code>{status.username}</code>
- </div>
+ {status.enabled && status.username && !credentials && (
+ <div className="basic-auth-current">
+ <div className="basic-auth-field">
+ <label>Username</label>
+ <div className="basic-auth-value">
+ <code>{status.username}</code>
</div>
- <p className="basic-auth-hint">
- Password was shown when Basic Auth was first enabled. Disable and re-enable to generate new credentials.
- </p>
</div>
- )}
+ <p className="basic-auth-hint">
+ Password was shown when Basic Auth was first enabled. Disable and re-enable to generate new credentials.
+ </p>
+ </div>
+ )}
- {credentials && (
- <div className="basic-auth-credentials">
- <div className="basic-auth-credential-warning">
- <AlertTriangle size={14} />
- <span>Save these credentials now. The password will not be shown again.</span>
- </div>
- <div className="basic-auth-field">
- <label>Username</label>
- <div className="basic-auth-value">
- <code>{credentials.username}</code>
- <button
- className="btn btn-ghost btn-sm"
- onClick={() => copyToClipboard(credentials.username, 'user')}
- >
- {copied === 'user' ? <Check size={12} /> : <Copy size={12} />}
- </button>
- </div>
+ {credentials && (
+ <div className="basic-auth-credentials">
+ <div className="basic-auth-credential-warning">
+ <AlertTriangle size={14} />
+ <span>Save these credentials now. The password will not be shown again.</span>
+ </div>
+ <div className="basic-auth-field">
+ <label>Username</label>
+ <div className="basic-auth-value">
+ <code>{credentials.username}</code>
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={() => copyToClipboard(credentials.username, 'user')}
+ >
+ {copied === 'user' ? <Check size={12} /> : <Copy size={12} />}
+ </Button>
</div>
- <div className="basic-auth-field">
- <label>Password</label>
- <div className="basic-auth-value">
- <code>{credentials.password}</code>
- <button
- className="btn btn-ghost btn-sm"
- onClick={() => copyToClipboard(credentials.password, 'pass')}
- >
- {copied === 'pass' ? <Check size={12} /> : <Copy size={12} />}
- </button>
- </div>
+ </div>
+ <div className="basic-auth-field">
+ <label>Password</label>
+ <div className="basic-auth-value">
+ <code>{credentials.password}</code>
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={() => copyToClipboard(credentials.password, 'pass')}
+ >
+ {copied === 'pass' ? <Check size={12} /> : <Copy size={12} />}
+ </Button>
</div>
</div>
- )}
- </>
- )}
- </div>
+ </div>
+ )}
+ </>
+ )}
+ </div>
- <div className="modal-actions">
- <button className="btn btn-secondary" onClick={onClose}>
- Close
- </button>
- </div>
+ <div className="modal-actions">
+ <Button variant="outline" onClick={onClose}>
+ Close
+ </Button>
+ </div>
</Modal>
);
};
diff --git a/frontend/src/components/wordpress/BulkActionsBar.jsx b/frontend/src/components/wordpress/BulkActionsBar.jsx
index 9491be8c..bc64f86f 100644
--- a/frontend/src/components/wordpress/BulkActionsBar.jsx
+++ b/frontend/src/components/wordpress/BulkActionsBar.jsx
@@ -1,6 +1,7 @@
import React, { useState } from 'react';
import { Square, Play, RefreshCw, ArrowDownLeft, X } from 'lucide-react';
import Spinner from '../Spinner';
+import { Button } from '@/components/ui/button';
const BulkActionsBar = ({ selectedIds, environments, prodId, onClear, onExecute, api }) => {
const [executing, setExecuting] = useState(false);
@@ -39,20 +40,21 @@ const BulkActionsBar = ({ selectedIds, environments, prodId, onClear, onExecute,
{confirmAction === 'stop' && `Stop ${selectedIds.length} environment(s)?`}
{confirmAction === 'sync' && `Sync ${selectedIds.length} environment(s) from production?`}
</span>
- <button
- className="btn btn-primary btn-sm"
+ <Button
+ size="sm"
onClick={() => executeAction(confirmAction)}
disabled={executing}
>
{executing ? <Spinner size="sm" /> : 'Confirm'}
- </button>
- <button
- className="btn btn-ghost btn-sm"
+ </Button>
+ <Button
+ variant="ghost"
+ size="sm"
onClick={() => setConfirmAction(null)}
disabled={executing}
>
Cancel
- </button>
+ </Button>
</div>
) : (
<>
@@ -62,50 +64,56 @@ const BulkActionsBar = ({ selectedIds, environments, prodId, onClear, onExecute,
</div>
<div className="bulk-actions-buttons">
- <button
- className="btn btn-ghost btn-sm"
+ <Button
+ variant="ghost"
+ size="sm"
onClick={() => handleAction('start')}
disabled={executing}
title="Start Selected"
>
<Play size={12} />
Start
- </button>
- <button
- className="btn btn-ghost btn-sm"
+ </Button>
+ <Button
+ variant="ghost"
+ size="sm"
onClick={() => handleAction('stop')}
disabled={executing}
title="Stop Selected"
>
<Square size={12} />
Stop
- </button>
- <button
- className="btn btn-ghost btn-sm"
+ </Button>
+ <Button
+ variant="ghost"
+ size="sm"
onClick={() => handleAction('restart')}
disabled={executing}
title="Restart Selected"
>
<RefreshCw size={12} />
Restart
- </button>
- <button
- className="btn btn-ghost btn-sm"
+ </Button>
+ <Button
+ variant="ghost"
+ size="sm"
onClick={() => handleAction('sync')}
disabled={executing}
title="Sync from Production"
>
<ArrowDownLeft size={12} />
Sync from Prod
- </button>
+ </Button>
</div>
- <button
- className="btn btn-ghost btn-sm bulk-actions-clear"
+ <Button
+ variant="ghost"
+ size="icon"
+ className="bulk-actions-clear"
onClick={onClear}
>
<X size={12} />
- </button>
+ </Button>
</>
)}
</div>
diff --git a/frontend/src/components/wordpress/CommitList.jsx b/frontend/src/components/wordpress/CommitList.jsx
index 350ef7c3..d7a5f4b8 100644
--- a/frontend/src/components/wordpress/CommitList.jsx
+++ b/frontend/src/components/wordpress/CommitList.jsx
@@ -1,6 +1,9 @@
import React, { useState } from 'react';
import { GitCommit, Rocket, Copy, CheckCircle } from 'lucide-react';
import Modal from '../Modal';
+import { Button } from '@/components/ui/button';
+import { Input } from '@/components/ui/input';
+import { Label } from '@/components/ui/label';
const CommitList = ({ commits, currentCommit, onDeploy, onCreateDev, loading = false }) => {
const [actionLoading, setActionLoading] = useState({});
@@ -89,25 +92,26 @@ const CommitList = ({ commits, currentCommit, onDeploy, onCreateDev, loading = f
<div className="commit-actions">
{!isCurrent && (
- <button
- className="btn btn-primary btn-sm"
+ <Button
+ size="sm"
onClick={() => handleDeploy(commit)}
disabled={isDeploying}
title="Deploy this commit"
>
<Rocket size={12} />
{isDeploying ? 'Deploying...' : 'Deploy'}
- </button>
+ </Button>
)}
- <button
- className="btn btn-secondary btn-sm"
+ <Button
+ variant="outline"
+ size="sm"
onClick={() => setShowDevModal(commit)}
disabled={isCreatingDev}
title="Create dev environment from this commit"
>
<Copy size={12} />
{isCreatingDev ? 'Creating...' : 'Create Dev'}
- </button>
+ </Button>
</div>
</div>
);
@@ -143,45 +147,45 @@ const CreateDevModal = ({ commit, onClose, onCreate, loading }) => {
return (
<Modal open={true} onClose={onClose} title="Create Dev Environment">
- <p className="hint">
- Create a development environment with code from commit{' '}
- <code>{commit.sha.substring(0, 7)}</code>
- </p>
- <p className="commit-message-preview">"{commit.message}"</p>
-
- <form onSubmit={handleSubmit}>
- <div className="form-group">
- <label>Environment Name</label>
- <input
- type="text"
- name="name"
- value={formData.name}
- onChange={handleChange}
- placeholder="dev-abc1234"
- />
- </div>
-
- <div className="form-group">
- <label>Domain (optional)</label>
- <input
- type="text"
- name="domain"
- value={formData.domain}
- onChange={handleChange}
- placeholder="dev.example.com"
- />
- <span className="form-hint">Leave empty to auto-generate</span>
- </div>
-
- <div className="modal-actions">
- <button type="button" className="btn btn-secondary" onClick={onClose}>
- Cancel
- </button>
- <button type="submit" className="btn btn-primary" disabled={loading}>
- {loading ? 'Creating...' : 'Create Environment'}
- </button>
- </div>
- </form>
+ <p className="hint">
+ Create a development environment with code from commit{' '}
+ <code>{commit.sha.substring(0, 7)}</code>
+ </p>
+ <p className="commit-message-preview">"{commit.message}"</p>
+
+ <form onSubmit={handleSubmit}>
+ <div className="form-group">
+ <Label>Environment Name</Label>
+ <Input
+ type="text"
+ name="name"
+ value={formData.name}
+ onChange={handleChange}
+ placeholder="dev-abc1234"
+ />
+ </div>
+
+ <div className="form-group">
+ <Label>Domain (optional)</Label>
+ <Input
+ type="text"
+ name="domain"
+ value={formData.domain}
+ onChange={handleChange}
+ placeholder="dev.example.com"
+ />
+ <span className="form-hint">Leave empty to auto-generate</span>
+ </div>
+
+ <div className="modal-actions">
+ <Button type="button" variant="outline" onClick={onClose}>
+ Cancel
+ </Button>
+ <Button type="submit" disabled={loading}>
+ {loading ? 'Creating...' : 'Create Environment'}
+ </Button>
+ </div>
+ </form>
</Modal>
);
};
diff --git a/frontend/src/components/wordpress/CompareView.jsx b/frontend/src/components/wordpress/CompareView.jsx
index 59b3da8d..e6afec4c 100644
--- a/frontend/src/components/wordpress/CompareView.jsx
+++ b/frontend/src/components/wordpress/CompareView.jsx
@@ -3,6 +3,7 @@ import { GitCompare, Check, X, Minus, RefreshCw } from 'lucide-react';
import wordpressApi from '../../services/wordpress';
import Spinner from '../Spinner';
import Modal from '../Modal';
+import { Button } from '@/components/ui/button';
const CompareView = ({ projectId, envA, envB, onClose }) => {
const [comparison, setComparison] = useState(null);
@@ -33,107 +34,107 @@ const CompareView = ({ projectId, envA, envB, onClose }) => {
return (
<Modal open={true} onClose={onClose} title="Compare Environments" size="xl">
- <div className="compare-header">
- <div className={`compare-env-pill ${envAType}`}>
- <span className="compare-env-type">{envAType}</span>
- <span className="compare-env-name">{envA?.name || 'Environment A'}</span>
- </div>
- <GitCompare size={16} className="compare-vs-icon" />
- <div className={`compare-env-pill ${envBType}`}>
- <span className="compare-env-type">{envBType}</span>
- <span className="compare-env-name">{envB?.name || 'Environment B'}</span>
- </div>
- <button className="btn btn-ghost btn-sm" onClick={loadComparison} disabled={loading}>
- <RefreshCw size={14} />
- </button>
+ <div className="compare-header">
+ <div className={`compare-env-pill ${envAType}`}>
+ <span className="compare-env-type">{envAType}</span>
+ <span className="compare-env-name">{envA?.name || 'Environment A'}</span>
+ </div>
+ <GitCompare size={16} className="compare-vs-icon" />
+ <div className={`compare-env-pill ${envBType}`}>
+ <span className="compare-env-type">{envBType}</span>
+ <span className="compare-env-name">{envB?.name || 'Environment B'}</span>
</div>
+ <Button variant="ghost" size="sm" onClick={loadComparison} disabled={loading}>
+ <RefreshCw size={14} />
+ </Button>
+ </div>
- <div className="compare-body">
- {loading && (
- <div className="compare-loading">
- <Spinner size="md" />
- <span>Comparing environments...</span>
- </div>
- )}
-
- {error && (
- <div className="compare-error">
- <p>{error}</p>
- <button className="btn btn-primary btn-sm" onClick={loadComparison}>
- Retry
- </button>
- </div>
- )}
-
- {!loading && !error && comparison && (
- <>
- {/* Version Comparison */}
- <CompareSection title="Versions">
- <CompareRow
- label="WordPress"
- valueA={comparison.env_a?.wp_version}
- valueB={comparison.env_b?.wp_version}
- />
- <CompareRow
- label="PHP"
- valueA={comparison.env_a?.php_version}
- valueB={comparison.env_b?.php_version}
- />
- <CompareRow
- label="Active Theme"
- valueA={comparison.env_a?.active_theme}
- valueB={comparison.env_b?.active_theme}
- />
+ <div className="compare-body">
+ {loading && (
+ <div className="compare-loading">
+ <Spinner size="md" />
+ <span>Comparing environments...</span>
+ </div>
+ )}
+
+ {error && (
+ <div className="compare-error">
+ <p>{error}</p>
+ <Button size="sm" onClick={loadComparison}>
+ Retry
+ </Button>
+ </div>
+ )}
+
+ {!loading && !error && comparison && (
+ <>
+ {/* Version Comparison */}
+ <CompareSection title="Versions">
+ <CompareRow
+ label="WordPress"
+ valueA={comparison.env_a?.wp_version}
+ valueB={comparison.env_b?.wp_version}
+ />
+ <CompareRow
+ label="PHP"
+ valueA={comparison.env_a?.php_version}
+ valueB={comparison.env_b?.php_version}
+ />
+ <CompareRow
+ label="Active Theme"
+ valueA={comparison.env_a?.active_theme}
+ valueB={comparison.env_b?.active_theme}
+ />
+ </CompareSection>
+
+ {/* Plugins Comparison */}
+ {comparison.plugins && (
+ <CompareSection
+ title="Plugins"
+ summary={getPluginSummary(comparison.plugins)}
+ >
+ {comparison.plugins.map(plugin => (
+ <CompareRow
+ key={plugin.name}
+ label={plugin.name}
+ valueA={plugin.version_a || (plugin.in_a ? 'Installed' : null)}
+ valueB={plugin.version_b || (plugin.in_b ? 'Installed' : null)}
+ status={plugin.status}
+ />
+ ))}
+ {comparison.plugins.length === 0 && (
+ <div className="compare-empty-row">No plugin data available</div>
+ )}
</CompareSection>
+ )}
+
+ {/* Themes Comparison */}
+ {comparison.themes && (
+ <CompareSection
+ title="Themes"
+ summary={getThemeSummary(comparison.themes)}
+ >
+ {comparison.themes.map(theme => (
+ <CompareRow
+ key={theme.name}
+ label={theme.name}
+ valueA={theme.version_a || (theme.in_a ? 'Installed' : null)}
+ valueB={theme.version_b || (theme.in_b ? 'Installed' : null)}
+ status={theme.status}
+ />
+ ))}
+ {comparison.themes.length === 0 && (
+ <div className="compare-empty-row">No theme data available</div>
+ )}
+ </CompareSection>
+ )}
+ </>
+ )}
+ </div>
- {/* Plugins Comparison */}
- {comparison.plugins && (
- <CompareSection
- title="Plugins"
- summary={getPluginSummary(comparison.plugins)}
- >
- {comparison.plugins.map(plugin => (
- <CompareRow
- key={plugin.name}
- label={plugin.name}
- valueA={plugin.version_a || (plugin.in_a ? 'Installed' : null)}
- valueB={plugin.version_b || (plugin.in_b ? 'Installed' : null)}
- status={plugin.status}
- />
- ))}
- {comparison.plugins.length === 0 && (
- <div className="compare-empty-row">No plugin data available</div>
- )}
- </CompareSection>
- )}
-
- {/* Themes Comparison */}
- {comparison.themes && (
- <CompareSection
- title="Themes"
- summary={getThemeSummary(comparison.themes)}
- >
- {comparison.themes.map(theme => (
- <CompareRow
- key={theme.name}
- label={theme.name}
- valueA={theme.version_a || (theme.in_a ? 'Installed' : null)}
- valueB={theme.version_b || (theme.in_b ? 'Installed' : null)}
- status={theme.status}
- />
- ))}
- {comparison.themes.length === 0 && (
- <div className="compare-empty-row">No theme data available</div>
- )}
- </CompareSection>
- )}
- </>
- )}
- </div>
-
- <div className="modal-actions">
- <button className="btn btn-secondary" onClick={onClose}>Close</button>
- </div>
+ <div className="modal-actions">
+ <Button variant="outline" onClick={onClose}>Close</Button>
+ </div>
</Modal>
);
};
diff --git a/frontend/src/components/wordpress/ContainerLogs.jsx b/frontend/src/components/wordpress/ContainerLogs.jsx
index e4bebba2..7554b464 100644
--- a/frontend/src/components/wordpress/ContainerLogs.jsx
+++ b/frontend/src/components/wordpress/ContainerLogs.jsx
@@ -1,6 +1,8 @@
import React, { useState, useEffect, useRef } from 'react';
import { Terminal, X, Download } from 'lucide-react';
import wordpressApi from '../../services/wordpress';
+import { Button } from '@/components/ui/button';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
const ContainerLogs = ({ projectId, envId, onClose }) => {
const [logs, setLogs] = useState([]);
@@ -59,33 +61,35 @@ const ContainerLogs = ({ projectId, envId, onClose }) => {
<span>Container Logs</span>
</div>
<div className="container-logs-controls">
- <select
- value={service}
- onChange={e => setService(e.target.value)}
- className="logs-service-select"
- >
- <option value="wordpress">WordPress</option>
- <option value="db">MySQL</option>
- </select>
- <select
- value={lines}
- onChange={e => setLines(Number(e.target.value))}
- className="logs-lines-select"
- >
- <option value={50}>50 lines</option>
- <option value={100}>100 lines</option>
- <option value={500}>500 lines</option>
- </select>
- <button className="btn btn-ghost btn-sm" onClick={loadLogs} title="Refresh">
+ <Select value={service} onValueChange={setService}>
+ <SelectTrigger className="logs-service-select">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="wordpress">WordPress</SelectItem>
+ <SelectItem value="db">MySQL</SelectItem>
+ </SelectContent>
+ </Select>
+ <Select value={String(lines)} onValueChange={(v) => setLines(Number(v))}>
+ <SelectTrigger className="logs-lines-select">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="50">50 lines</SelectItem>
+ <SelectItem value="100">100 lines</SelectItem>
+ <SelectItem value="500">500 lines</SelectItem>
+ </SelectContent>
+ </Select>
+ <Button variant="ghost" size="sm" onClick={loadLogs} title="Refresh">
<RefreshIcon />
- </button>
- <button className="btn btn-ghost btn-sm" onClick={handleDownload} title="Download">
+ </Button>
+ <Button variant="ghost" size="sm" onClick={handleDownload} title="Download">
<Download size={14} />
- </button>
+ </Button>
{onClose && (
- <button className="btn btn-ghost btn-sm" onClick={onClose}>
+ <Button variant="ghost" size="sm" onClick={onClose}>
<X size={14} />
- </button>
+ </Button>
)}
</div>
</div>
diff --git a/frontend/src/components/wordpress/CreateSiteModal.jsx b/frontend/src/components/wordpress/CreateSiteModal.jsx
index eb17ec76..c5f45093 100644
--- a/frontend/src/components/wordpress/CreateSiteModal.jsx
+++ b/frontend/src/components/wordpress/CreateSiteModal.jsx
@@ -1,6 +1,9 @@
import React, { useState } from 'react';
-import { X } from 'lucide-react';
import Modal from '../Modal';
+import { Button } from '@/components/ui/button';
+import { Input } from '@/components/ui/input';
+import { Label } from '@/components/ui/label';
+import { Checkbox } from '@/components/ui/checkbox';
const CreateSiteModal = ({ onClose, onCreate }) => {
const [formData, setFormData] = useState({
@@ -59,91 +62,92 @@ const CreateSiteModal = ({ onClose, onCreate }) => {
return (
<Modal open={true} onClose={onClose} title="Create WordPress Site">
- {error && <div className="error-message">{error}</div>}
+ {error && <div className="error-message">{error}</div>}
- <form onSubmit={handleSubmit}>
+ <form onSubmit={handleSubmit}>
+ <div className="form-group">
+ <Label>Site Name *</Label>
+ <Input
+ type="text"
+ name="name"
+ value={formData.name}
+ onChange={handleNameChange}
+ placeholder="My WordPress Site"
+ required
+ />
+ </div>
+
+ <div className="form-group">
+ <Label>Domain</Label>
+ <Input
+ type="text"
+ name="domain"
+ value={formData.domain}
+ onChange={handleChange}
+ placeholder="example.com"
+ />
+ <span className="form-hint">Leave empty to use a local development URL</span>
+ </div>
+
+ <div className="form-row">
<div className="form-group">
- <label>Site Name *</label>
- <input
+ <Label>Admin Username *</Label>
+ <Input
type="text"
- name="name"
- value={formData.name}
- onChange={handleNameChange}
- placeholder="My WordPress Site"
+ name="adminUser"
+ value={formData.adminUser}
+ onChange={handleChange}
+ placeholder="admin"
required
/>
</div>
<div className="form-group">
- <label>Domain</label>
- <input
- type="text"
- name="domain"
- value={formData.domain}
+ <Label>Admin Email *</Label>
+ <Input
+ type="email"
+ name="adminEmail"
+ value={formData.adminEmail}
onChange={handleChange}
- placeholder="example.com"
+ placeholder="[email protected]"
+ required
/>
- <span className="form-hint">Leave empty to use a local development URL</span>
</div>
+ </div>
- <div className="form-row">
- <div className="form-group">
- <label>Admin Username *</label>
- <input
- type="text"
- name="adminUser"
- value={formData.adminUser}
- onChange={handleChange}
- placeholder="admin"
- required
- />
- </div>
-
- <div className="form-group">
- <label>Admin Email *</label>
- <input
- type="email"
- name="adminEmail"
- value={formData.adminEmail}
- onChange={handleChange}
- placeholder="[email protected]"
- required
- />
- </div>
- </div>
+ <div className="form-group">
+ <Label>Database Name</Label>
+ <Input
+ type="text"
+ name="dbName"
+ value={formData.dbName}
+ onChange={handleChange}
+ placeholder="wp_mysite"
+ />
+ </div>
- <div className="form-group">
- <label>Database Name</label>
- <input
- type="text"
- name="dbName"
- value={formData.dbName}
- onChange={handleChange}
- placeholder="wp_mysite"
+ <div className="form-group">
+ <label className="checkbox-label">
+ <Checkbox
+ name="createDatabase"
+ checked={formData.createDatabase}
+ onCheckedChange={(checked) =>
+ setFormData(prev => ({ ...prev, createDatabase: checked }))
+ }
/>
- </div>
+ <span>Create database automatically</span>
+ </label>
+ </div>
- <div className="form-group">
- <label className="checkbox-label">
- <input
- type="checkbox"
- name="createDatabase"
- checked={formData.createDatabase}
- onChange={handleChange}
- />
- <span>Create database automatically</span>
- </label>
- </div>
-
- <div className="modal-actions">
- <button type="button" className="btn btn-secondary" onClick={onClose}>
- Cancel
- </button>
- <button type="submit" className="btn btn-primary" disabled={loading}>
- {loading ? 'Creating...' : 'Create Site'}
- </button>
- </div>
- </form>
+ <div className="modal-actions">
+ <Button type="button" variant="outline" onClick={onClose}>
+ Cancel
+ </Button>
+ <Button type="submit" disabled={loading}>
+ {loading ? 'Creating...' : 'Create Site'}
+ </Button>
+ </div>
+ </form>
</Modal>
);
};
diff --git a/frontend/src/components/wordpress/GitConnectForm.jsx b/frontend/src/components/wordpress/GitConnectForm.jsx
index 109fd8ec..489b2a20 100644
--- a/frontend/src/components/wordpress/GitConnectForm.jsx
+++ b/frontend/src/components/wordpress/GitConnectForm.jsx
@@ -1,5 +1,10 @@
import React, { useState } from 'react';
import { GitBranch, Link, Unlink } from 'lucide-react';
+import { Button } from '@/components/ui/button';
+import { Input } from '@/components/ui/input';
+import { Label } from '@/components/ui/label';
+import { Textarea } from '@/components/ui/textarea';
+import { Checkbox } from '@/components/ui/checkbox';
const GitConnectForm = ({ gitStatus, onConnect, onDisconnect }) => {
const [formData, setFormData] = useState({
@@ -103,14 +108,14 @@ const GitConnectForm = ({ gitStatus, onConnect, onDisconnect }) => {
</div>
<div className="git-connected-actions">
- <button
- className="btn btn-danger-outline"
+ <Button
+ variant="destructive"
onClick={handleDisconnect}
disabled={loading}
>
<Unlink size={14} />
{loading ? 'Disconnecting...' : 'Disconnect'}
- </button>
+ </Button>
</div>
</div>
);
@@ -127,8 +132,8 @@ const GitConnectForm = ({ gitStatus, onConnect, onDisconnect }) => {
<form onSubmit={handleConnect}>
<div className="form-group">
- <label>Repository URL *</label>
- <input
+ <Label>Repository URL *</Label>
+ <Input
type="text"
name="repoUrl"
value={formData.repoUrl}
@@ -139,8 +144,8 @@ const GitConnectForm = ({ gitStatus, onConnect, onDisconnect }) => {
</div>
<div className="form-group">
- <label>Branch</label>
- <input
+ <Label>Branch</Label>
+ <Input
type="text"
name="branch"
value={formData.branch}
@@ -150,11 +155,11 @@ const GitConnectForm = ({ gitStatus, onConnect, onDisconnect }) => {
</div>
<div className="form-group">
- <label>Tracked Paths (one per line)</label>
- <textarea
+ <Label>Tracked Paths (one per line)</Label>
+ <Textarea
value={formData.paths.join('\n')}
onChange={handlePathsChange}
- placeholder="wp-content/themes&#10;wp-content/plugins"
+ placeholder={"wp-content/themes\nwp-content/plugins"}
rows={3}
/>
<span className="form-hint">
@@ -164,21 +169,22 @@ const GitConnectForm = ({ gitStatus, onConnect, onDisconnect }) => {
<div className="form-group">
<label className="checkbox-label">
- <input
- type="checkbox"
+ <Checkbox
name="autoDeploy"
checked={formData.autoDeploy}
- onChange={handleChange}
+ onCheckedChange={(checked) =>
+ setFormData(prev => ({ ...prev, autoDeploy: checked }))
+ }
/>
<span>Enable auto-deploy on push</span>
</label>
</div>
<div className="form-actions">
- <button type="submit" className="btn btn-primary" disabled={loading}>
+ <Button type="submit" disabled={loading}>
<Link size={14} />
{loading ? 'Connecting...' : 'Connect Repository'}
- </button>
+ </Button>
</div>
</form>
</div>
diff --git a/frontend/src/components/wordpress/HealthStatusPanel.jsx b/frontend/src/components/wordpress/HealthStatusPanel.jsx
index fa9e70b6..081ab0d4 100644
--- a/frontend/src/components/wordpress/HealthStatusPanel.jsx
+++ b/frontend/src/components/wordpress/HealthStatusPanel.jsx
@@ -1,6 +1,7 @@
import React, { useState, useEffect, useRef } from 'react';
import { Activity, RefreshCw, CheckCircle, AlertTriangle, XCircle, HelpCircle } from 'lucide-react';
import Spinner from '../Spinner';
+import { Button } from '@/components/ui/button';
const STATUS_CONFIG = {
healthy: { icon: CheckCircle, color: 'green', label: 'Healthy' },
@@ -62,7 +63,6 @@ const HealthStatusPanel = ({ projectId, environments, api, compact = false }) =>
}
if (compact) {
- // Return just dots for pipeline cards
return null; // Dots are rendered directly via HealthDot export
}
@@ -84,10 +84,10 @@ const HealthStatusPanel = ({ projectId, environments, api, compact = false }) =>
<Activity size={16} />
Environment Health
</h4>
- <button className="btn btn-ghost btn-sm" onClick={loadHealth}>
+ <Button variant="ghost" size="sm" onClick={loadHealth}>
<RefreshCw size={12} />
Refresh
- </button>
+ </Button>
</div>
<div className="health-panel-grid">
diff --git a/frontend/src/components/wordpress/PipelineView.jsx b/frontend/src/components/wordpress/PipelineView.jsx
index 69146e42..48f62ba5 100644
--- a/frontend/src/components/wordpress/PipelineView.jsx
+++ b/frontend/src/components/wordpress/PipelineView.jsx
@@ -8,6 +8,8 @@ import {
import EnvironmentStatusBadge from './EnvironmentStatusBadge';
import { HealthDot } from './HealthStatusPanel';
import DiskUsageBar from './DiskUsageBar';
+import { Button } from '@/components/ui/button';
+import { Checkbox } from '@/components/ui/checkbox';
const PipelineView = ({
pipeline,
@@ -40,9 +42,6 @@ const PipelineView = ({
const stagingEnv = environments.find(e => e.environment_type === 'staging');
const multidevEnvs = environments.filter(e => e.environment_type === 'multidev');
- // Pipeline order: Dev -> Staging -> Production
- const pipelineEnvs = [devEnv, stagingEnv].filter(Boolean);
-
return (
<div className="pipeline-view">
<div className="pipeline-row">
@@ -140,26 +139,28 @@ const PipelineView = ({
<div className="pipeline-sync-row">
{devEnv && (
<div className="pipeline-sync-action">
- <button
- className="btn btn-ghost btn-sm"
+ <Button
+ variant="ghost"
+ size="sm"
onClick={() => onSync?.(devEnv)}
title="Pull production data into development"
>
<ArrowDownLeft size={14} />
Pull from Prod
- </button>
+ </Button>
</div>
)}
{stagingEnv && (
<div className="pipeline-sync-action">
- <button
- className="btn btn-ghost btn-sm"
+ <Button
+ variant="ghost"
+ size="sm"
onClick={() => onSync?.(stagingEnv)}
title="Pull production data into staging"
>
<ArrowDownLeft size={14} />
Pull from Prod
- </button>
+ </Button>
</div>
)}
</div>
@@ -168,34 +169,40 @@ const PipelineView = ({
{onCompare && (devEnv || stagingEnv) && production && (
<div className="pipeline-compare-row">
{devEnv && (
- <button
- className="btn btn-ghost btn-sm pipeline-compare-btn"
+ <Button
+ variant="ghost"
+ size="sm"
+ className="pipeline-compare-btn"
onClick={() => onCompare(devEnv, production)}
title="Compare development vs production"
>
<GitCompare size={14} />
Compare vs Prod
- </button>
+ </Button>
)}
{stagingEnv && (
- <button
- className="btn btn-ghost btn-sm pipeline-compare-btn"
+ <Button
+ variant="ghost"
+ size="sm"
+ className="pipeline-compare-btn"
onClick={() => onCompare(stagingEnv, production)}
title="Compare staging vs production"
>
<GitCompare size={14} />
Compare vs Prod
- </button>
+ </Button>
)}
{devEnv && stagingEnv && (
- <button
- className="btn btn-ghost btn-sm pipeline-compare-btn"
+ <Button
+ variant="ghost"
+ size="sm"
+ className="pipeline-compare-btn"
onClick={() => onCompare(devEnv, stagingEnv)}
title="Compare development vs staging"
>
<GitCompare size={14} />
Dev vs Staging
- </button>
+ </Button>
)}
</div>
)}
@@ -210,13 +217,14 @@ const PipelineView = ({
<span className="pipeline-section-count">{multidevEnvs.length}</span>
)}
</h4>
- <button
- className="btn btn-ghost btn-sm"
+ <Button
+ variant="ghost"
+ size="sm"
onClick={onCreateMultidev}
>
<Plus size={14} />
New Multidev
- </button>
+ </Button>
</div>
{multidevEnvs.length > 0 ? (
<div className="pipeline-multidev-grid">
@@ -244,10 +252,10 @@ const PipelineView = ({
<GitBranch size={24} />
<p>No multidev environments yet</p>
<span>Create branch-based environments for feature development and testing</span>
- <button className="btn btn-primary btn-sm" onClick={onCreateMultidev}>
+ <Button size="sm" onClick={onCreateMultidev}>
<Plus size={14} />
Create Multidev
- </button>
+ </Button>
</div>
)}
</div>
@@ -299,11 +307,10 @@ const PipelineCard = ({
<div className={`pipeline-card ${isProduction ? 'production' : ''} ${env.is_locked ? 'locked' : ''}`}>
<div className="pipeline-card-header">
{onBulkToggle && !isProduction && (
- <input
- type="checkbox"
+ <Checkbox
className="pipeline-card-checkbox"
checked={bulkSelected || false}
- onChange={() => onBulkToggle(env.id)}
+ onCheckedChange={() => onBulkToggle(env.id)}
/>
)}
<EnvironmentStatusBadge
@@ -315,12 +322,14 @@ const PipelineCard = ({
<HealthDot status={healthStatus} size={8} />
)}
<div className="pipeline-card-menu-wrapper">
- <button
- className="btn btn-ghost btn-sm pipeline-card-menu-btn"
+ <Button
+ variant="ghost"
+ size="sm"
+ className="pipeline-card-menu-btn"
onClick={() => setShowMenu(!showMenu)}
>
<MoreVertical size={14} />
- </button>
+ </Button>
{showMenu && (
<div className="pipeline-card-menu" onMouseLeave={() => setShowMenu(false)}>
{isRunning ? (
@@ -413,12 +422,9 @@ const PipelineCard = ({
<ExternalLink size={12} /> Visit
</a>
)}
- <button
- className="btn btn-ghost btn-sm"
- onClick={() => onViewLogs?.(env)}
- >
+ <Button variant="ghost" size="sm" onClick={() => onViewLogs?.(env)}>
<FileText size={12} /> Logs
- </button>
+ </Button>
</div>
{env.is_locked && env.locked_reason && (
@@ -482,7 +488,6 @@ const MultidevCard = ({
return date.toLocaleDateString();
}
- // Determine best promote target
const promoteTarget = devEnv || stagingEnv || production;
return (
@@ -499,12 +504,13 @@ const MultidevCard = ({
)}
</div>
<div className="multidev-card-menu-wrapper">
- <button
- className="btn btn-ghost btn-sm"
+ <Button
+ variant="ghost"
+ size="sm"
onClick={() => setShowMenu(!showMenu)}
>
<MoreVertical size={14} />
- </button>
+ </Button>
{showMenu && (
<div className="pipeline-card-menu" onMouseLeave={() => setShowMenu(false)}>
{isRunning ? (
@@ -580,20 +586,21 @@ const MultidevCard = ({
<ExternalLink size={12} /> Visit
</a>
)}
- <button
- className="btn btn-ghost btn-sm"
+ <Button
+ variant="ghost"
+ size="sm"
onClick={() => promoteTarget && onPromote?.(env, promoteTarget)}
disabled={!promoteTarget}
title={promoteTarget ? `Promote to ${promoteTarget.environment_type || 'production'}` : 'No target environment'}
>
<ArrowRight size={12} /> Promote
- </button>
- <button className="btn btn-ghost btn-sm" onClick={() => onViewLogs?.(env)}>
+ </Button>
+ <Button variant="ghost" size="icon" onClick={() => onViewLogs?.(env)}>
<FileText size={12} />
- </button>
- <button className="btn btn-ghost btn-sm btn-danger" onClick={() => onDelete?.(env)}>
+ </Button>
+ <Button variant="destructive" size="icon" onClick={() => onDelete?.(env)}>
<Trash2 size={12} />
- </button>
+ </Button>
</div>
{env.is_locked && env.locked_reason && (
<div className="pipeline-card-lock-banner">
diff --git a/frontend/src/components/wordpress/PromoteModal.jsx b/frontend/src/components/wordpress/PromoteModal.jsx
index f0b58f6d..92dae20a 100644
--- a/frontend/src/components/wordpress/PromoteModal.jsx
+++ b/frontend/src/components/wordpress/PromoteModal.jsx
@@ -3,6 +3,10 @@ import { ArrowRight, Shield } from 'lucide-react';
import wordpressApi from '../../services/wordpress';
import Spinner from '../Spinner';
import Modal from '../Modal';
+import { Button } from '@/components/ui/button';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
+import { Checkbox } from '@/components/ui/checkbox';
+import { Label } from '@/components/ui/label';
const PromoteModal = ({ sourceEnv, targetEnv, onClose, onPromote }) => {
const [promotionType, setPromotionType] = useState('code');
@@ -65,176 +69,175 @@ const PromoteModal = ({ sourceEnv, targetEnv, onClose, onPromote }) => {
return (
<Modal open={true} onClose={onClose} title="Promote Environment" size="lg">
- <form onSubmit={handleSubmit}>
- <div className="promote-direction">
- <div className={`promote-env-pill ${sourceType}`}>
- <span className="promote-env-type">{sourceType}</span>
- <span className="promote-env-name">{sourceEnv.name}</span>
- </div>
- <ArrowRight size={20} className="promote-arrow" />
- <div className={`promote-env-pill ${targetType}`}>
- <span className="promote-env-type">{targetType}</span>
- <span className="promote-env-name">{targetEnv.name}</span>
- </div>
+ <form onSubmit={handleSubmit}>
+ <div className="promote-direction">
+ <div className={`promote-env-pill ${sourceType}`}>
+ <span className="promote-env-type">{sourceType}</span>
+ <span className="promote-env-name">{sourceEnv.name}</span>
+ </div>
+ <ArrowRight size={20} className="promote-arrow" />
+ <div className={`promote-env-pill ${targetType}`}>
+ <span className="promote-env-type">{targetType}</span>
+ <span className="promote-env-name">{targetEnv.name}</span>
+ </div>
+ </div>
+
+ <div className="form-group">
+ <Label>Promotion Type</Label>
+ <div className="radio-group">
+ <label className="radio-label">
+ <input
+ type="radio"
+ name="promotionType"
+ value="code"
+ checked={promotionType === 'code'}
+ onChange={e => setPromotionType(e.target.value)}
+ />
+ <div className="radio-content">
+ <strong>Code Only</strong>
+ <span>Sync themes, plugins, and mu-plugins via rsync</span>
+ </div>
+ </label>
+ <label className="radio-label">
+ <input
+ type="radio"
+ name="promotionType"
+ value="database"
+ checked={promotionType === 'database'}
+ onChange={e => setPromotionType(e.target.value)}
+ />
+ <div className="radio-content">
+ <strong>Database Only</strong>
+ <span>Export, transform, and import database</span>
+ </div>
+ </label>
+ <label className="radio-label">
+ <input
+ type="radio"
+ name="promotionType"
+ value="full"
+ checked={promotionType === 'full'}
+ onChange={e => setPromotionType(e.target.value)}
+ />
+ <div className="radio-content">
+ <strong>Full (Code + Database)</strong>
+ <span>Complete environment promotion</span>
+ </div>
+ </label>
</div>
+ </div>
+ {(promotionType === 'code' || promotionType === 'full') && (
<div className="form-group">
- <label>Promotion Type</label>
- <div className="radio-group">
- <label className="radio-label">
- <input
- type="radio"
- name="promotionType"
- value="code"
- checked={promotionType === 'code'}
- onChange={e => setPromotionType(e.target.value)}
+ <Label>Code Options</Label>
+ <div className="checkbox-group">
+ <label className="checkbox-label">
+ <Checkbox
+ checked={config.include_plugins}
+ onCheckedChange={v => handleConfigChange('include_plugins', v)}
/>
- <div className="radio-content">
- <strong>Code Only</strong>
- <span>Sync themes, plugins, and mu-plugins via rsync</span>
- </div>
+ <span>Include plugins</span>
</label>
- <label className="radio-label">
- <input
- type="radio"
- name="promotionType"
- value="database"
- checked={promotionType === 'database'}
- onChange={e => setPromotionType(e.target.value)}
+ <label className="checkbox-label">
+ <Checkbox
+ checked={config.include_themes}
+ onCheckedChange={v => handleConfigChange('include_themes', v)}
/>
- <div className="radio-content">
- <strong>Database Only</strong>
- <span>Export, transform, and import database</span>
- </div>
+ <span>Include themes</span>
</label>
- <label className="radio-label">
- <input
- type="radio"
- name="promotionType"
- value="full"
- checked={promotionType === 'full'}
- onChange={e => setPromotionType(e.target.value)}
+ <label className="checkbox-label">
+ <Checkbox
+ checked={config.include_mu_plugins}
+ onCheckedChange={v => handleConfigChange('include_mu_plugins', v)}
/>
- <div className="radio-content">
- <strong>Full (Code + Database)</strong>
- <span>Complete environment promotion</span>
- </div>
+ <span>Include mu-plugins</span>
+ </label>
+ <label className="checkbox-label">
+ <Checkbox
+ checked={config.include_uploads}
+ onCheckedChange={v => handleConfigChange('include_uploads', v)}
+ />
+ <span>Include uploads (media files)</span>
</label>
</div>
</div>
+ )}
- {(promotionType === 'code' || promotionType === 'full') && (
+ {(promotionType === 'database' || promotionType === 'full') && (
+ <>
<div className="form-group">
- <label>Code Options</label>
- <div className="checkbox-group">
- <label className="checkbox-label">
- <input
- type="checkbox"
- checked={config.include_plugins}
- onChange={e => handleConfigChange('include_plugins', e.target.checked)}
- />
- <span>Include plugins</span>
- </label>
- <label className="checkbox-label">
- <input
- type="checkbox"
- checked={config.include_themes}
- onChange={e => handleConfigChange('include_themes', e.target.checked)}
- />
- <span>Include themes</span>
- </label>
- <label className="checkbox-label">
- <input
- type="checkbox"
- checked={config.include_mu_plugins}
- onChange={e => handleConfigChange('include_mu_plugins', e.target.checked)}
- />
- <span>Include mu-plugins</span>
- </label>
- <label className="checkbox-label">
- <input
- type="checkbox"
- checked={config.include_uploads}
- onChange={e => handleConfigChange('include_uploads', e.target.checked)}
- />
- <span>Include uploads (media files)</span>
- </label>
- </div>
+ <label className="checkbox-label">
+ <Checkbox
+ checked={config.sanitize}
+ onCheckedChange={v => handleConfigChange('sanitize', v)}
+ />
+ <span>Sanitize database during promotion</span>
+ </label>
</div>
- )}
- {(promotionType === 'database' || promotionType === 'full') && (
- <>
+ {config.sanitize && profiles.length > 0 && (
<div className="form-group">
- <label className="checkbox-label">
- <input
- type="checkbox"
- checked={config.sanitize}
- onChange={e => handleConfigChange('sanitize', e.target.checked)}
- />
- <span>Sanitize database during promotion</span>
- </label>
- </div>
-
- {config.sanitize && profiles.length > 0 && (
- <div className="form-group">
- <label>
- <Shield size={14} style={{ marginRight: 4, verticalAlign: -2 }} />
- Sanitization Profile
- </label>
- <select
- value={config.sanitization_profile_id}
- onChange={e => handleConfigChange('sanitization_profile_id', e.target.value)}
- >
- <option value="">Manual configuration</option>
+ <Label>
+ <Shield size={14} style={{ marginRight: 4, verticalAlign: -2 }} />
+ Sanitization Profile
+ </Label>
+ <Select
+ value={config.sanitization_profile_id}
+ onValueChange={v => handleConfigChange('sanitization_profile_id', v)}
+ >
+ <SelectTrigger>
+ <SelectValue placeholder="Manual configuration" />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="">Manual configuration</SelectItem>
{profiles.map(p => (
- <option key={p.id} value={p.id}>
+ <SelectItem key={p.id} value={String(p.id)}>
{p.name}{p.is_default ? ' (default)' : ''}{p.is_builtin ? '' : ' (custom)'}
- </option>
+ </SelectItem>
))}
- </select>
- {config.sanitization_profile_id && (
- <span className="form-hint">
- {profiles.find(p => String(p.id) === config.sanitization_profile_id)?.description || ''}
- </span>
- )}
- </div>
- )}
- </>
- )}
-
- <div className="form-group">
- <label className="checkbox-label">
- <input
- type="checkbox"
- checked={config.backup_target_first}
- onChange={e => handleConfigChange('backup_target_first', e.target.checked)}
- />
- <span>Create snapshot of target before promoting</span>
- </label>
- <span className="form-hint">Recommended. Allows rollback if something goes wrong.</span>
- </div>
+ </SelectContent>
+ </Select>
+ {config.sanitization_profile_id && (
+ <span className="form-hint">
+ {profiles.find(p => String(p.id) === config.sanitization_profile_id)?.description || ''}
+ </span>
+ )}
+ </div>
+ )}
+ </>
+ )}
- {targetType === 'production' && (
- <div className="promote-warning">
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
- <path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" />
- <line x1="12" y1="9" x2="12" y2="13" />
- <line x1="12" y1="17" x2="12.01" y2="17" />
- </svg>
- <span>You are promoting to <strong>production</strong>. This will affect the live site.</span>
- </div>
- )}
+ <div className="form-group">
+ <label className="checkbox-label">
+ <Checkbox
+ checked={config.backup_target_first}
+ onCheckedChange={v => handleConfigChange('backup_target_first', v)}
+ />
+ <span>Create snapshot of target before promoting</span>
+ </label>
+ <span className="form-hint">Recommended. Allows rollback if something goes wrong.</span>
+ </div>
- <div className="modal-actions">
- <button type="button" className="btn btn-secondary" onClick={onClose} disabled={loading}>
- Cancel
- </button>
- <button type="submit" className="btn btn-primary" disabled={loading}>
- {loading ? <><Spinner size="sm" /> Promoting...</> : 'Promote'}
- </button>
+ {targetType === 'production' && (
+ <div className="promote-warning">
+ <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
+ <path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" />
+ <line x1="12" y1="9" x2="12" y2="13" />
+ <line x1="12" y1="17" x2="12.01" y2="17" />
+ </svg>
+ <span>You are promoting to <strong>production</strong>. This will affect the live site.</span>
</div>
- </form>
+ )}
+
+ <div className="modal-actions">
+ <Button type="button" variant="outline" onClick={onClose} disabled={loading}>
+ Cancel
+ </Button>
+ <Button type="submit" disabled={loading}>
+ {loading ? <><Spinner size="sm" /> Promoting...</> : 'Promote'}
+ </Button>
+ </div>
+ </form>
</Modal>
);
};
diff --git a/frontend/src/components/wordpress/ResourceLimitsModal.jsx b/frontend/src/components/wordpress/ResourceLimitsModal.jsx
index c5eed852..80dbeed3 100644
--- a/frontend/src/components/wordpress/ResourceLimitsModal.jsx
+++ b/frontend/src/components/wordpress/ResourceLimitsModal.jsx
@@ -1,7 +1,10 @@
import React, { useState } from 'react';
-import { Cpu, HardDrive, AlertTriangle } from 'lucide-react';
+import { HardDrive, AlertTriangle } from 'lucide-react';
import Spinner from '../Spinner';
import Modal from '../Modal';
+import { Button } from '@/components/ui/button';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
+import { Label } from '@/components/ui/label';
const PRESETS = {
low: { memory: '256M', cpus: '0.25', db_memory: '256M', db_cpus: '0.25' },
@@ -43,95 +46,105 @@ const ResourceLimitsModal = ({ environment, currentLimits, onClose, onApply }) =
return (
<Modal open={true} onClose={onClose} title="Resource Limits" className="resource-limits-modal">
- <form onSubmit={handleSubmit}>
- <div className="resource-limits-env-name">{envName}</div>
+ <form onSubmit={handleSubmit}>
+ <div className="resource-limits-env-name">{envName}</div>
- <div className="resource-limits-presets">
- <span className="resource-limits-presets-label">Presets:</span>
- {Object.entries(PRESETS).map(([key]) => (
- <button
- key={key}
- type="button"
- className="btn btn-ghost btn-sm resource-preset-btn"
- onClick={() => applyPreset(key)}
- >
- {key.charAt(0).toUpperCase() + key.slice(1)}
- </button>
- ))}
- </div>
+ <div className="resource-limits-presets">
+ <span className="resource-limits-presets-label">Presets:</span>
+ {Object.entries(PRESETS).map(([key]) => (
+ <Button
+ key={key}
+ type="button"
+ variant="ghost"
+ size="sm"
+ className="resource-preset-btn"
+ onClick={() => applyPreset(key)}
+ >
+ {key.charAt(0).toUpperCase() + key.slice(1)}
+ </Button>
+ ))}
+ </div>
- <div className="resource-limits-section">
- <h4>
- <HardDrive size={14} />
- WordPress Container
- </h4>
- <div className="resource-limits-row">
- <label>Memory</label>
- <select
- value={limits.memory}
- onChange={e => handleChange('memory', e.target.value)}
- >
+ <div className="resource-limits-section">
+ <h4>
+ <HardDrive size={14} />
+ WordPress Container
+ </h4>
+ <div className="resource-limits-row">
+ <Label>Memory</Label>
+ <Select value={limits.memory} onValueChange={v => handleChange('memory', v)}>
+ <SelectTrigger>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
{MEMORY_OPTIONS.map(opt => (
- <option key={opt} value={opt}>{opt}</option>
+ <SelectItem key={opt} value={opt}>{opt}</SelectItem>
))}
- </select>
- </div>
- <div className="resource-limits-row">
- <label>CPU Cores</label>
- <select
- value={limits.cpus}
- onChange={e => handleChange('cpus', e.target.value)}
- >
+ </SelectContent>
+ </Select>
+ </div>
+ <div className="resource-limits-row">
+ <Label>CPU Cores</Label>
+ <Select value={limits.cpus} onValueChange={v => handleChange('cpus', v)}>
+ <SelectTrigger>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
{CPU_OPTIONS.map(opt => (
- <option key={opt} value={opt}>{opt}</option>
+ <SelectItem key={opt} value={opt}>{opt}</SelectItem>
))}
- </select>
- </div>
+ </SelectContent>
+ </Select>
</div>
+ </div>
- <div className="resource-limits-section">
- <h4>
- <HardDrive size={14} />
- Database Container
- </h4>
- <div className="resource-limits-row">
- <label>Memory</label>
- <select
- value={limits.db_memory}
- onChange={e => handleChange('db_memory', e.target.value)}
- >
+ <div className="resource-limits-section">
+ <h4>
+ <HardDrive size={14} />
+ Database Container
+ </h4>
+ <div className="resource-limits-row">
+ <Label>Memory</Label>
+ <Select value={limits.db_memory} onValueChange={v => handleChange('db_memory', v)}>
+ <SelectTrigger>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
{MEMORY_OPTIONS.filter((_, i) => i < 5).map(opt => (
- <option key={opt} value={opt}>{opt}</option>
+ <SelectItem key={opt} value={opt}>{opt}</SelectItem>
))}
- </select>
- </div>
- <div className="resource-limits-row">
- <label>CPU Cores</label>
- <select
- value={limits.db_cpus}
- onChange={e => handleChange('db_cpus', e.target.value)}
- >
+ </SelectContent>
+ </Select>
+ </div>
+ <div className="resource-limits-row">
+ <Label>CPU Cores</Label>
+ <Select value={limits.db_cpus} onValueChange={v => handleChange('db_cpus', v)}>
+ <SelectTrigger>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
{CPU_OPTIONS.filter((_, i) => i < 4).map(opt => (
- <option key={opt} value={opt}>{opt}</option>
+ <SelectItem key={opt} value={opt}>{opt}</SelectItem>
))}
- </select>
- </div>
+ </SelectContent>
+ </Select>
</div>
+ </div>
- <div className="resource-limits-warning">
- <AlertTriangle size={14} />
- <span>Applying resource limits will restart the environment containers.</span>
- </div>
+ <div className="resource-limits-warning">
+ <AlertTriangle size={14} />
+ <span>Applying resource limits will restart the environment containers.</span>
+ </div>
- <div className="modal-actions">
- <button type="button" className="btn btn-secondary" onClick={onClose} disabled={loading}>
- Cancel
- </button>
- <button type="submit" className="btn btn-primary" disabled={loading}>
- {loading ? <><Spinner size="sm" /> Applying...</> : 'Apply Limits'}
- </button>
- </div>
- </form>
+ <div className="modal-actions">
+ <Button type="button" variant="outline" onClick={onClose} disabled={loading}>
+ Cancel
+ </Button>
+ <Button type="submit" disabled={loading}>
+ {loading ? <><Spinner size="sm" /> Applying...</> : 'Apply Limits'}
+ </Button>
+ </div>
+ </form>
</Modal>
);
};
diff --git a/frontend/src/components/wordpress/SanitizationProfileForm.jsx b/frontend/src/components/wordpress/SanitizationProfileForm.jsx
index 92f8731c..e1b1b84e 100644
--- a/frontend/src/components/wordpress/SanitizationProfileForm.jsx
+++ b/frontend/src/components/wordpress/SanitizationProfileForm.jsx
@@ -3,6 +3,10 @@ import { Shield, Plus, Trash2, Star, Edit3, Save } from 'lucide-react';
import wordpressApi from '../../services/wordpress';
import Spinner from '../Spinner';
import Modal from '../Modal';
+import { Button } from '@/components/ui/button';
+import { Input } from '@/components/ui/input';
+import { Label } from '@/components/ui/label';
+import { Checkbox } from '@/components/ui/checkbox';
const SanitizationProfileForm = ({ onClose, onProfilesChange }) => {
const [profiles, setProfiles] = useState([]);
@@ -73,49 +77,50 @@ const SanitizationProfileForm = ({ onClose, onProfilesChange }) => {
return (
<Modal open={true} onClose={onClose} title="Sanitization Profiles" size="lg">
- <div className="sanitization-profiles-body">
- {loading ? (
- <div className="sanitization-loading">
- <Spinner size="md" />
+ <div className="sanitization-profiles-body">
+ {loading ? (
+ <div className="sanitization-loading">
+ <Spinner size="md" />
+ </div>
+ ) : (
+ <>
+ <div className="sanitization-profile-list">
+ {profiles.map(profile => (
+ <ProfileCard
+ key={profile.id}
+ profile={profile}
+ onEdit={() => { setEditingProfile(profile); setShowCreateForm(false); }}
+ onDelete={() => handleDelete(profile.id)}
+ onSetDefault={() => handleSetDefault(profile.id)}
+ />
+ ))}
</div>
- ) : (
- <>
- <div className="sanitization-profile-list">
- {profiles.map(profile => (
- <ProfileCard
- key={profile.id}
- profile={profile}
- onEdit={() => { setEditingProfile(profile); setShowCreateForm(false); }}
- onDelete={() => handleDelete(profile.id)}
- onSetDefault={() => handleSetDefault(profile.id)}
- />
- ))}
- </div>
- {!showCreateForm && !editingProfile && (
- <button
- className="btn btn-primary btn-sm sanitization-add-btn"
- onClick={() => setShowCreateForm(true)}
- >
- <Plus size={14} />
- Create Custom Profile
- </button>
- )}
+ {!showCreateForm && !editingProfile && (
+ <Button
+ size="sm"
+ className="sanitization-add-btn"
+ onClick={() => setShowCreateForm(true)}
+ >
+ <Plus size={14} />
+ Create Custom Profile
+ </Button>
+ )}
- {(showCreateForm || editingProfile) && (
- <ProfileEditor
- profile={editingProfile}
- onSave={handleSaveProfile}
- onCancel={() => { setEditingProfile(null); setShowCreateForm(false); }}
- />
- )}
- </>
- )}
- </div>
+ {(showCreateForm || editingProfile) && (
+ <ProfileEditor
+ profile={editingProfile}
+ onSave={handleSaveProfile}
+ onCancel={() => { setEditingProfile(null); setShowCreateForm(false); }}
+ />
+ )}
+ </>
+ )}
+ </div>
- <div className="modal-actions">
- <button className="btn btn-secondary" onClick={onClose}>Close</button>
- </div>
+ <div className="modal-actions">
+ <Button variant="outline" onClick={onClose}>Close</Button>
+ </div>
</Modal>
);
};
@@ -130,17 +135,17 @@ const ProfileCard = ({ profile, onEdit, onDelete, onSetDefault }) => (
</div>
<div className="sanitization-profile-card-actions">
{!profile.is_default && (
- <button className="btn btn-ghost btn-sm" onClick={onSetDefault} title="Set as default">
+ <Button variant="ghost" size="sm" onClick={onSetDefault} title="Set as default">
<Star size={12} />
- </button>
+ </Button>
)}
- <button className="btn btn-ghost btn-sm" onClick={onEdit} title="Edit">
+ <Button variant="ghost" size="sm" onClick={onEdit} title="Edit">
<Edit3 size={12} />
- </button>
+ </Button>
{!profile.is_builtin && (
- <button className="btn btn-ghost btn-sm btn-danger" onClick={onDelete} title="Delete">
+ <Button variant="ghost" size="sm" onClick={onDelete} title="Delete">
<Trash2 size={12} />
- </button>
+ </Button>
)}
</div>
</div>
@@ -223,8 +228,8 @@ const ProfileEditor = ({ profile, onSave, onCancel }) => {
<h4>{profile ? 'Edit Profile' : 'Create Profile'}</h4>
<div className="form-group">
- <label>Profile Name *</label>
- <input
+ <Label>Profile Name *</Label>
+ <Input
type="text"
value={name}
onChange={e => setName(e.target.value)}
@@ -235,8 +240,8 @@ const ProfileEditor = ({ profile, onSave, onCancel }) => {
</div>
<div className="form-group">
- <label>Description</label>
- <input
+ <Label>Description</Label>
+ <Input
type="text"
value={description}
onChange={e => setDescription(e.target.value)}
@@ -245,45 +250,40 @@ const ProfileEditor = ({ profile, onSave, onCancel }) => {
</div>
<div className="form-group">
- <label>Data Sanitization</label>
+ <Label>Data Sanitization</Label>
<div className="checkbox-group">
<label className="checkbox-label">
- <input
- type="checkbox"
+ <Checkbox
checked={config.anonymize_emails || false}
- onChange={() => handleConfigToggle('anonymize_emails')}
+ onCheckedChange={() => handleConfigToggle('anonymize_emails')}
/>
<span>Anonymize email addresses</span>
</label>
<label className="checkbox-label">
- <input
- type="checkbox"
+ <Checkbox
checked={config.anonymize_names || false}
- onChange={() => handleConfigToggle('anonymize_names')}
+ onCheckedChange={() => handleConfigToggle('anonymize_names')}
/>
<span>Anonymize user names</span>
</label>
<label className="checkbox-label">
- <input
- type="checkbox"
+ <Checkbox
checked={config.reset_passwords || false}
- onChange={() => handleConfigToggle('reset_passwords')}
+ onCheckedChange={() => handleConfigToggle('reset_passwords')}
/>
<span>Reset all passwords</span>
</label>
<label className="checkbox-label">
- <input
- type="checkbox"
+ <Checkbox
checked={config.strip_payment_data || false}
- onChange={() => handleConfigToggle('strip_payment_data')}
+ onCheckedChange={() => handleConfigToggle('strip_payment_data')}
/>
<span>Strip WooCommerce payment data</span>
</label>
<label className="checkbox-label">
- <input
- type="checkbox"
+ <Checkbox
checked={config.remove_transients || false}
- onChange={() => handleConfigToggle('remove_transients')}
+ onCheckedChange={() => handleConfigToggle('remove_transients')}
/>
<span>Remove transients</span>
</label>
@@ -291,8 +291,8 @@ const ProfileEditor = ({ profile, onSave, onCancel }) => {
</div>
<div className="form-group">
- <label>Truncate Tables (comma-separated)</label>
- <input
+ <Label>Truncate Tables (comma-separated)</Label>
+ <Input
type="text"
value={truncateInput}
onChange={e => setTruncateInput(e.target.value)}
@@ -302,8 +302,8 @@ const ProfileEditor = ({ profile, onSave, onCancel }) => {
</div>
<div className="form-group">
- <label>Exclude Tables (comma-separated)</label>
- <input
+ <Label>Exclude Tables (comma-separated)</Label>
+ <Input
type="text"
value={excludeInput}
onChange={e => setExcludeInput(e.target.value)}
@@ -313,12 +313,12 @@ const ProfileEditor = ({ profile, onSave, onCancel }) => {
</div>
<div className="sanitization-editor-actions">
- <button type="button" className="btn btn-secondary btn-sm" onClick={onCancel}>
+ <Button type="button" variant="outline" size="sm" onClick={onCancel}>
Cancel
- </button>
- <button type="submit" className="btn btn-primary btn-sm" disabled={saving || !name.trim()}>
+ </Button>
+ <Button type="submit" size="sm" disabled={saving || !name.trim()}>
{saving ? <><Spinner size="sm" /> Saving...</> : <><Save size={14} /> Save Profile</>}
- </button>
+ </Button>
</div>
</form>
);
diff --git a/frontend/src/components/wordpress/SyncModal.jsx b/frontend/src/components/wordpress/SyncModal.jsx
index 4e40f054..4a8b677e 100644
--- a/frontend/src/components/wordpress/SyncModal.jsx
+++ b/frontend/src/components/wordpress/SyncModal.jsx
@@ -3,6 +3,11 @@ import { ArrowDownLeft, Shield } from 'lucide-react';
import wordpressApi from '../../services/wordpress';
import Spinner from '../Spinner';
import Modal from '../Modal';
+import { Button } from '@/components/ui/button';
+import { Input } from '@/components/ui/input';
+import { Label } from '@/components/ui/label';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
+import { Checkbox } from '@/components/ui/checkbox';
const SyncModal = ({ environment, productionName, onClose, onSync }) => {
const [syncType, setSyncType] = useState('database');
@@ -23,7 +28,6 @@ const SyncModal = ({ environment, productionName, onClose, onSync }) => {
try {
const data = await wordpressApi.getSanitizationProfiles();
setProfiles(data.profiles || []);
- // Auto-select default profile
const defaultProfile = (data.profiles || []).find(p => p.is_default);
if (defaultProfile) {
setConfig(prev => ({
@@ -66,146 +70,150 @@ const SyncModal = ({ environment, productionName, onClose, onSync }) => {
return (
<Modal open={true} onClose={onClose} title="Sync from Production">
- <form onSubmit={handleSubmit}>
- <div className="sync-direction">
- <div className="promote-env-pill production">
- <span className="promote-env-type">Production</span>
- <span className="promote-env-name">{productionName}</span>
- </div>
- <ArrowDownLeft size={20} className="promote-arrow" />
- <div className={`promote-env-pill ${envType}`}>
- <span className="promote-env-type">{envType}</span>
- <span className="promote-env-name">{environment.name}</span>
- </div>
+ <form onSubmit={handleSubmit}>
+ <div className="sync-direction">
+ <div className="promote-env-pill production">
+ <span className="promote-env-type">Production</span>
+ <span className="promote-env-name">{productionName}</span>
+ </div>
+ <ArrowDownLeft size={20} className="promote-arrow" />
+ <div className={`promote-env-pill ${envType}`}>
+ <span className="promote-env-type">{envType}</span>
+ <span className="promote-env-name">{environment.name}</span>
</div>
+ </div>
- <div className="form-group">
- <label>Sync Type</label>
- <div className="radio-group">
- <label className="radio-label">
- <input
- type="radio"
- name="syncType"
- value="database"
- checked={syncType === 'database'}
- onChange={e => setSyncType(e.target.value)}
- />
- <div className="radio-content">
- <strong>Database Only</strong>
- <span>Pull production database into this environment</span>
- </div>
- </label>
- <label className="radio-label">
- <input
- type="radio"
- name="syncType"
- value="files"
- checked={syncType === 'files'}
- onChange={e => setSyncType(e.target.value)}
- />
- <div className="radio-content">
- <strong>Files Only</strong>
- <span>Pull production files (wp-content) into this environment</span>
- </div>
- </label>
- <label className="radio-label">
- <input
- type="radio"
- name="syncType"
- value="full"
- checked={syncType === 'full'}
- onChange={e => setSyncType(e.target.value)}
+ <div className="form-group">
+ <Label>Sync Type</Label>
+ <div className="radio-group">
+ <label className="radio-label">
+ <input
+ type="radio"
+ name="syncType"
+ value="database"
+ checked={syncType === 'database'}
+ onChange={e => setSyncType(e.target.value)}
+ />
+ <div className="radio-content">
+ <strong>Database Only</strong>
+ <span>Pull production database into this environment</span>
+ </div>
+ </label>
+ <label className="radio-label">
+ <input
+ type="radio"
+ name="syncType"
+ value="files"
+ checked={syncType === 'files'}
+ onChange={e => setSyncType(e.target.value)}
+ />
+ <div className="radio-content">
+ <strong>Files Only</strong>
+ <span>Pull production files (wp-content) into this environment</span>
+ </div>
+ </label>
+ <label className="radio-label">
+ <input
+ type="radio"
+ name="syncType"
+ value="full"
+ checked={syncType === 'full'}
+ onChange={e => setSyncType(e.target.value)}
+ />
+ <div className="radio-content">
+ <strong>Full Sync</strong>
+ <span>Pull both database and files from production</span>
+ </div>
+ </label>
+ </div>
+ </div>
+
+ {(syncType === 'database' || syncType === 'full') && (
+ <>
+ <div className="form-group">
+ <label className="checkbox-label">
+ <Checkbox
+ checked={config.sanitize}
+ onCheckedChange={v => handleConfigChange('sanitize', v)}
/>
- <div className="radio-content">
- <strong>Full Sync</strong>
- <span>Pull both database and files from production</span>
- </div>
+ <span>Sanitize data (anonymize emails, reset passwords)</span>
</label>
</div>
- </div>
- {(syncType === 'database' || syncType === 'full') && (
- <>
+ {config.sanitize && profiles.length > 0 && (
<div className="form-group">
- <label className="checkbox-label">
- <input
- type="checkbox"
- checked={config.sanitize}
- onChange={e => handleConfigChange('sanitize', e.target.checked)}
- />
- <span>Sanitize data (anonymize emails, reset passwords)</span>
- </label>
- </div>
-
- {config.sanitize && profiles.length > 0 && (
- <div className="form-group">
- <label>
- <Shield size={14} style={{ marginRight: 4, verticalAlign: -2 }} />
- Sanitization Profile
- </label>
- <select
- value={config.sanitization_profile_id}
- onChange={e => handleConfigChange('sanitization_profile_id', e.target.value)}
- >
- <option value="">Manual configuration</option>
+ <Label>
+ <Shield size={14} style={{ marginRight: 4, verticalAlign: -2 }} />
+ Sanitization Profile
+ </Label>
+ <Select
+ value={config.sanitization_profile_id}
+ onValueChange={v => handleConfigChange('sanitization_profile_id', v)}
+ >
+ <SelectTrigger>
+ <SelectValue placeholder="Manual configuration" />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="">Manual configuration</SelectItem>
{profiles.map(p => (
- <option key={p.id} value={p.id}>
+ <SelectItem key={p.id} value={String(p.id)}>
{p.name}{p.is_default ? ' (default)' : ''}{p.is_builtin ? '' : ' (custom)'}
- </option>
+ </SelectItem>
))}
- </select>
- {config.sanitization_profile_id && (
- <span className="form-hint">
- {profiles.find(p => String(p.id) === config.sanitization_profile_id)?.description || ''}
- </span>
- )}
- </div>
- )}
-
- <div className="form-group">
- <label>Exclude Tables (comma-separated, optional)</label>
- <input
- type="text"
- value={config.exclude_tables}
- onChange={e => handleConfigChange('exclude_tables', e.target.value)}
- placeholder="wp_users, wp_usermeta"
- />
- <span className="form-hint">Tables to skip during sync</span>
+ </SelectContent>
+ </Select>
+ {config.sanitization_profile_id && (
+ <span className="form-hint">
+ {profiles.find(p => String(p.id) === config.sanitization_profile_id)?.description || ''}
+ </span>
+ )}
</div>
+ )}
- <div className="form-group">
- <label>Truncate Tables (comma-separated, optional)</label>
- <input
- type="text"
- value={config.truncate_tables}
- onChange={e => handleConfigChange('truncate_tables', e.target.value)}
- placeholder="wp_actionscheduler_actions, wp_actionscheduler_logs"
- />
- <span className="form-hint">Tables to empty (structure kept, data removed)</span>
- </div>
- </>
- )}
+ <div className="form-group">
+ <Label>Exclude Tables (comma-separated, optional)</Label>
+ <Input
+ type="text"
+ value={config.exclude_tables}
+ onChange={e => handleConfigChange('exclude_tables', e.target.value)}
+ placeholder="wp_users, wp_usermeta"
+ />
+ <span className="form-hint">Tables to skip during sync</span>
+ </div>
- <div className="sync-warning">
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
- <circle cx="12" cy="12" r="10" />
- <path d="M12 8v4M12 16h.01" />
- </svg>
- <div>
- <strong>This will overwrite data</strong>
- <p>The current {syncType === 'files' ? 'files' : syncType === 'database' ? 'database' : 'database and files'} in this environment will be replaced with production data. A snapshot will be created before syncing.</p>
+ <div className="form-group">
+ <Label>Truncate Tables (comma-separated, optional)</Label>
+ <Input
+ type="text"
+ value={config.truncate_tables}
+ onChange={e => handleConfigChange('truncate_tables', e.target.value)}
+ placeholder="wp_actionscheduler_actions, wp_actionscheduler_logs"
+ />
+ <span className="form-hint">Tables to empty (structure kept, data removed)</span>
</div>
- </div>
+ </>
+ )}
- <div className="modal-actions">
- <button type="button" className="btn btn-secondary" onClick={onClose} disabled={loading}>
- Cancel
- </button>
- <button type="submit" className="btn btn-primary" disabled={loading}>
- {loading ? <><Spinner size="sm" /> Syncing...</> : 'Sync Now'}
- </button>
+ <div className="sync-warning">
+ <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
+ <circle cx="12" cy="12" r="10" />
+ <path d="M12 8v4M12 16h.01" />
+ </svg>
+ <div>
+ <strong>This will overwrite data</strong>
+ <p>The current {syncType === 'files' ? 'files' : syncType === 'database' ? 'database' : 'database and files'} in this environment will be replaced with production data. A snapshot will be created before syncing.</p>
</div>
- </form>
+ </div>
+
+ <div className="modal-actions">
+ <Button type="button" variant="outline" onClick={onClose} disabled={loading}>
+ Cancel
+ </Button>
+ <Button type="submit" disabled={loading}>
+ {loading ? <><Spinner size="sm" /> Syncing...</> : 'Sync Now'}
+ </Button>
+ </div>
+ </form>
</Modal>
);
};
diff --git a/frontend/src/components/wordpress/WordPressSiteCard.jsx b/frontend/src/components/wordpress/WordPressSiteCard.jsx
index 9711113c..3dfc9697 100644
--- a/frontend/src/components/wordpress/WordPressSiteCard.jsx
+++ b/frontend/src/components/wordpress/WordPressSiteCard.jsx
@@ -2,6 +2,7 @@ import React, { useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { ExternalLink, Settings, Copy, Trash2 } from 'lucide-react';
import { ConfirmDialog } from '../ConfirmDialog';
+import { Button } from '@/components/ui/button';
const WordPressSiteCard = ({ site, onDelete }) => {
const navigate = useNavigate();
@@ -87,39 +88,44 @@ const WordPressSiteCard = ({ site, onDelete }) => {
</div>
<div className="wp-site-card-footer">
- <button
- className="btn btn-ghost btn-sm"
+ <Button
+ variant="ghost"
+ size="sm"
onClick={handleVisitSite}
disabled={!site.url}
title="Visit Site"
>
<ExternalLink size={14} />
Visit
- </button>
- <button
- className="btn btn-ghost btn-sm"
+ </Button>
+ <Button
+ variant="ghost"
+ size="sm"
onClick={handleOpenDashboard}
disabled={!site.url}
title="Open Dashboard"
>
<Settings size={14} />
Dashboard
- </button>
- <button
- className="btn btn-ghost btn-sm"
+ </Button>
+ <Button
+ variant="ghost"
+ size="sm"
onClick={handleManage}
title="Manage Site"
>
<Copy size={14} />
Manage
- </button>
- <button
- className="btn btn-ghost btn-sm btn-danger"
+ </Button>
+ <Button
+ variant="ghost"
+ size="sm"
onClick={handleDelete}
title="Delete Site"
+ className="text-destructive hover:text-destructive"
>
<Trash2 size={14} />
- </button>
+ </Button>
</div>
<ConfirmDialog
diff --git a/frontend/src/components/wordpress/WpCliTerminal.jsx b/frontend/src/components/wordpress/WpCliTerminal.jsx
index d52df74f..7d3ecab6 100644
--- a/frontend/src/components/wordpress/WpCliTerminal.jsx
+++ b/frontend/src/components/wordpress/WpCliTerminal.jsx
@@ -1,7 +1,9 @@
import React, { useState, useRef, useEffect } from 'react';
-import { Terminal, Play, Clock, X } from 'lucide-react';
+import { Play, Clock } from 'lucide-react';
import Spinner from '../Spinner';
import Modal from '../Modal';
+import { Button } from '@/components/ui/button';
+import { Input } from '@/components/ui/input';
const QUICK_COMMANDS = [
{ label: 'Plugin List', command: 'wp plugin list --format=table' },
@@ -93,94 +95,96 @@ const WpCliTerminal = ({ environment, prodId, onClose, api }) => {
return (
<Modal open={true} onClose={onClose} title={`WP-CLI - ${envName}`} className="wpcli-terminal-modal">
- <div className="wpcli-quick-actions">
- {QUICK_COMMANDS.map(qc => (
+ <div className="wpcli-quick-actions">
+ {QUICK_COMMANDS.map(qc => (
+ <Button
+ key={qc.command}
+ variant="ghost"
+ size="sm"
+ onClick={() => executeCommand(qc.command)}
+ disabled={executing}
+ >
+ {qc.label}
+ </Button>
+ ))}
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={() => setShowHistory(!showHistory)}
+ title="Command history"
+ >
+ <Clock size={12} />
+ </Button>
+ </div>
+
+ {showHistory && history.length > 0 && (
+ <div className="wpcli-history">
+ {history.slice(0, 10).map((cmd, i) => (
<button
- key={qc.command}
- className="btn btn-ghost btn-sm"
- onClick={() => executeCommand(qc.command)}
- disabled={executing}
+ key={i}
+ className="wpcli-history-item"
+ onClick={() => {
+ setCommand(cmd);
+ setShowHistory(false);
+ inputRef.current?.focus();
+ }}
>
- {qc.label}
+ <code>{cmd}</code>
</button>
))}
- <button
- className="btn btn-ghost btn-sm"
- onClick={() => setShowHistory(!showHistory)}
- title="Command history"
- >
- <Clock size={12} />
- </button>
</div>
+ )}
- {showHistory && history.length > 0 && (
- <div className="wpcli-history">
- {history.slice(0, 10).map((cmd, i) => (
- <button
- key={i}
- className="wpcli-history-item"
- onClick={() => {
- setCommand(cmd);
- setShowHistory(false);
- inputRef.current?.focus();
- }}
- >
- <code>{cmd}</code>
- </button>
- ))}
+ <div className="wpcli-output" ref={outputRef}>
+ {output.length === 0 && (
+ <div className="wpcli-output-empty">
+ Enter a WP-CLI command below or use the quick actions above.
</div>
)}
-
- <div className="wpcli-output" ref={outputRef}>
- {output.length === 0 && (
- <div className="wpcli-output-empty">
- Enter a WP-CLI command below or use the quick actions above.
- </div>
- )}
- {output.map((entry, i) => (
- <div key={i} className={`wpcli-output-entry ${entry.type}`}>
- {entry.type === 'command' && (
- <div className="wpcli-output-command">
- <span className="wpcli-prompt">$</span>
- <code>{entry.text}</code>
- </div>
- )}
- {entry.type === 'output' && (
- <pre className="wpcli-output-text">{entry.text}</pre>
- )}
- {entry.type === 'error' && (
- <pre className="wpcli-output-error">{entry.text}</pre>
- )}
- </div>
- ))}
- {executing && (
- <div className="wpcli-executing">
- <Spinner size="sm" />
- <span>Executing...</span>
- </div>
- )}
- </div>
-
- <div className="wpcli-input-row">
- <span className="wpcli-prompt">$</span>
- <input
- ref={inputRef}
- type="text"
- value={command}
- onChange={e => setCommand(e.target.value)}
- onKeyDown={handleKeyDown}
- placeholder="wp plugin list --format=table"
- disabled={executing}
- className="wpcli-input"
- />
- <button
- className="btn btn-primary btn-sm"
- onClick={() => executeCommand(command)}
- disabled={executing || !command.trim()}
- >
- <Play size={12} />
- </button>
- </div>
+ {output.map((entry, i) => (
+ <div key={i} className={`wpcli-output-entry ${entry.type}`}>
+ {entry.type === 'command' && (
+ <div className="wpcli-output-command">
+ <span className="wpcli-prompt">$</span>
+ <code>{entry.text}</code>
+ </div>
+ )}
+ {entry.type === 'output' && (
+ <pre className="wpcli-output-text">{entry.text}</pre>
+ )}
+ {entry.type === 'error' && (
+ <pre className="wpcli-output-error">{entry.text}</pre>
+ )}
+ </div>
+ ))}
+ {executing && (
+ <div className="wpcli-executing">
+ <Spinner size="sm" />
+ <span>Executing...</span>
+ </div>
+ )}
+ </div>
+
+ <div className="wpcli-input-row">
+ <span className="wpcli-prompt">$</span>
+ <Input
+ ref={inputRef}
+ type="text"
+ value={command}
+ onChange={e => setCommand(e.target.value)}
+ onKeyDown={handleKeyDown}
+ placeholder="wp plugin list --format=table"
+ disabled={executing}
+ className="wpcli-input"
+ />
+ <Button
+ size="sm"
+ onClick={() => executeCommand(command)}
+ disabled={executing || !command.trim()}
+ >
+ <Play size={12} />
+ </Button>
+ </div>
</Modal>
);
};
diff --git a/frontend/src/components/workflow/DeploymentProgressModal.jsx b/frontend/src/components/workflow/DeploymentProgressModal.jsx
index bef290fa..ea088247 100644
--- a/frontend/src/components/workflow/DeploymentProgressModal.jsx
+++ b/frontend/src/components/workflow/DeploymentProgressModal.jsx
@@ -1,6 +1,7 @@
import React from 'react';
-import { X, Loader, CheckCircle, XCircle, Server, Database, Globe, Box, ExternalLink } from 'lucide-react';
+import { Loader, CheckCircle, XCircle, Server, Database, Globe, Box, ExternalLink } from 'lucide-react';
import Modal from '../Modal';
+import { Button } from '@/components/ui/button';
const nodeTypeConfig = {
dockerApp: { icon: Server, label: 'Docker App', color: '#2496ed' },
@@ -115,9 +116,9 @@ const DeploymentProgressModal = ({ isDeploying, results, nodes, onClose }) => {
<div className="deployment-modal-footer">
{isComplete && (
- <button className="btn btn-primary" onClick={onClose}>
+ <Button variant="default" onClick={onClose}>
{hasErrors ? 'Close' : 'Done'}
- </button>
+ </Button>
)}
</div>
</Modal>
diff --git a/frontend/src/components/workflow/panels/DatabaseConfigPanel.jsx b/frontend/src/components/workflow/panels/DatabaseConfigPanel.jsx
index e4697658..e174dc69 100644
--- a/frontend/src/components/workflow/panels/DatabaseConfigPanel.jsx
+++ b/frontend/src/components/workflow/panels/DatabaseConfigPanel.jsx
@@ -1,6 +1,9 @@
import React from 'react';
import { Database } from 'lucide-react';
import ConfigPanel from '../ConfigPanel';
+import { Input } from '@/components/ui/input';
+import { Label } from '@/components/ui/label';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
const dbTypeConfig = {
mysql: { color: '#00758f', defaultPort: 3306 },
@@ -34,8 +37,8 @@ const DatabaseConfigPanel = ({ node, onChange, onClose }) => {
onClose={onClose}
>
<div className="form-group">
- <label>Name</label>
- <input
+ <Label>Name</Label>
+ <Input
type="text"
value={data.name || ''}
onChange={(e) => handleChange('name', e.target.value)}
@@ -44,34 +47,44 @@ const DatabaseConfigPanel = ({ node, onChange, onClose }) => {
</div>
<div className="form-group">
- <label>Type</label>
- <select
+ <Label>Type</Label>
+ <Select
value={data.type || 'mysql'}
- onChange={(e) => handleChange('type', e.target.value)}
+ onValueChange={(value) => handleChange('type', value)}
>
- <option value="mysql">MySQL</option>
- <option value="postgresql">PostgreSQL</option>
- <option value="mongodb">MongoDB</option>
- <option value="redis">Redis</option>
- </select>
+ <SelectTrigger>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="mysql">MySQL</SelectItem>
+ <SelectItem value="postgresql">PostgreSQL</SelectItem>
+ <SelectItem value="mongodb">MongoDB</SelectItem>
+ <SelectItem value="redis">Redis</SelectItem>
+ </SelectContent>
+ </Select>
</div>
<div className="form-group">
- <label>Status</label>
- <select
+ <Label>Status</Label>
+ <Select
value={data.status || 'stopped'}
- onChange={(e) => handleChange('status', e.target.value)}
+ onValueChange={(value) => handleChange('status', value)}
>
- <option value="stopped">Stopped</option>
- <option value="running">Running</option>
- <option value="error">Error</option>
- </select>
+ <SelectTrigger>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="stopped">Stopped</SelectItem>
+ <SelectItem value="running">Running</SelectItem>
+ <SelectItem value="error">Error</SelectItem>
+ </SelectContent>
+ </Select>
</div>
<div className="form-row">
<div className="form-group">
- <label>Host</label>
- <input
+ <Label>Host</Label>
+ <Input
type="text"
value={data.host || ''}
onChange={(e) => handleChange('host', e.target.value)}
@@ -80,8 +93,8 @@ const DatabaseConfigPanel = ({ node, onChange, onClose }) => {
</div>
<div className="form-group">
- <label>Port</label>
- <input
+ <Label>Port</Label>
+ <Input
type="number"
value={data.port || dbTypeConfig[dbType]?.defaultPort || 3306}
onChange={(e) => handleChange('port', parseInt(e.target.value) || '')}
@@ -91,8 +104,8 @@ const DatabaseConfigPanel = ({ node, onChange, onClose }) => {
{data.size && (
<div className="form-group">
- <label>Size</label>
- <input
+ <Label>Size</Label>
+ <Input
type="text"
value={data.size}
disabled
diff --git a/frontend/src/components/workflow/panels/DockerAppConfigPanel.jsx b/frontend/src/components/workflow/panels/DockerAppConfigPanel.jsx
index 0c99841c..ca4cffca 100644
--- a/frontend/src/components/workflow/panels/DockerAppConfigPanel.jsx
+++ b/frontend/src/components/workflow/panels/DockerAppConfigPanel.jsx
@@ -2,6 +2,10 @@ import React, { useState } from 'react';
import { Server, Globe, Link, ExternalLink, Play, Square, RotateCw } from 'lucide-react';
import ConfigPanel from '../ConfigPanel';
import api from '../../../services/api';
+import { Button } from '@/components/ui/button';
+import { Input } from '@/components/ui/input';
+import { Label } from '@/components/ui/label';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
const DockerAppConfigPanel = ({ node, onChange, onClose }) => {
const data = node?.data || {};
@@ -9,6 +13,7 @@ const DockerAppConfigPanel = ({ node, onChange, onClose }) => {
const [isActioning, setIsActioning] = useState(false);
const [actionMessage, setActionMessage] = useState(null);
+ const [ports, setPorts] = useState(data.ports || []);
const handleChange = (field, value) => {
onChange({ ...data, [field]: value });
@@ -22,18 +27,17 @@ const DockerAppConfigPanel = ({ node, onChange, onClose }) => {
setActionMessage(null);
try {
- let result;
switch (action) {
case 'start':
- result = await api.startApp(data.appId);
+ await api.startApp(data.appId);
handleChange('status', 'running');
break;
case 'stop':
- result = await api.stopApp(data.appId);
+ await api.stopApp(data.appId);
handleChange('status', 'stopped');
break;
case 'restart':
- result = await api.restartApp(data.appId);
+ await api.restartApp(data.appId);
handleChange('status', 'running');
break;
default:
@@ -60,6 +64,25 @@ const DockerAppConfigPanel = ({ node, onChange, onClose }) => {
}
};
+ const handleAddPort = () => {
+ const newPorts = [...ports, ''];
+ setPorts(newPorts);
+ handleChange('ports', newPorts);
+ };
+
+ const handlePortChange = (index, value) => {
+ const newPorts = [...ports];
+ newPorts[index] = value;
+ setPorts(newPorts);
+ handleChange('ports', newPorts);
+ };
+
+ const handleRemovePort = (index) => {
+ const newPorts = ports.filter((_, i) => i !== index);
+ setPorts(newPorts);
+ handleChange('ports', newPorts);
+ };
+
// Real app panel - shows info and actions
if (isReal) {
return (
@@ -71,12 +94,12 @@ const DockerAppConfigPanel = ({ node, onChange, onClose }) => {
onClose={onClose}
>
<div className="form-group">
- <label>Name</label>
+ <Label>Name</Label>
<div className="form-value">{data.name || 'Unknown'}</div>
</div>
<div className="form-group">
- <label>Status</label>
+ <Label>Status</Label>
<div className={`form-value status-badge status-${data.status}`}>
{data.status || 'unknown'}
</div>
@@ -84,21 +107,21 @@ const DockerAppConfigPanel = ({ node, onChange, onClose }) => {
{data.template && (
<div className="form-group">
- <label>Template</label>
+ <Label>Template</Label>
<div className="form-value">{data.template}</div>
</div>
)}
{data.port && (
<div className="form-group">
- <label>Port</label>
+ <Label>Port</Label>
<div className="form-value">{data.port}</div>
</div>
)}
{data.privateUrl && (
<div className="form-group">
- <label>Private URL</label>
+ <Label>Private URL</Label>
<div className="form-value form-value-link" onClick={openPrivateUrl}>
<Link size={14} />
{data.privateUrl}
@@ -109,7 +132,7 @@ const DockerAppConfigPanel = ({ node, onChange, onClose }) => {
{data.domains && data.domains.length > 0 && (
<div className="form-group">
- <label>Connected Domains</label>
+ <Label>Connected Domains</Label>
<div className="form-domains">
{data.domains.map((domain, idx) => (
<div key={idx} className="form-domain-item">
@@ -125,32 +148,35 @@ const DockerAppConfigPanel = ({ node, onChange, onClose }) => {
)}
<div className="form-group">
- <label>Actions</label>
+ <Label>Actions</Label>
<div className="action-buttons">
- <button
- className="btn btn-sm btn-success"
+ <Button
+ variant="default"
+ size="sm"
onClick={() => handleAction('start')}
disabled={isActioning || data.status === 'running'}
>
<Play size={14} />
Start
- </button>
- <button
- className="btn btn-sm btn-warning"
+ </Button>
+ <Button
+ variant="outline"
+ size="sm"
onClick={() => handleAction('stop')}
disabled={isActioning || data.status === 'stopped'}
>
<Square size={14} />
Stop
- </button>
- <button
- className="btn btn-sm btn-secondary"
+ </Button>
+ <Button
+ variant="secondary"
+ size="sm"
onClick={() => handleAction('restart')}
disabled={isActioning}
>
<RotateCw size={14} />
Restart
- </button>
+ </Button>
</div>
{actionMessage && (
<div className="action-message">{actionMessage}</div>
@@ -158,40 +184,20 @@ const DockerAppConfigPanel = ({ node, onChange, onClose }) => {
</div>
<div className="form-group">
- <button
- className="btn btn-primary btn-block"
+ <Button
+ variant="default"
+ className="btn-block"
onClick={openAppDetails}
>
<ExternalLink size={14} />
Open App Details
- </button>
+ </Button>
</div>
</ConfigPanel>
);
}
// Legacy panel for non-real apps (manual creation)
- const [ports, setPorts] = useState(data.ports || []);
-
- const handleAddPort = () => {
- const newPorts = [...ports, ''];
- setPorts(newPorts);
- handleChange('ports', newPorts);
- };
-
- const handlePortChange = (index, value) => {
- const newPorts = [...ports];
- newPorts[index] = value;
- setPorts(newPorts);
- handleChange('ports', newPorts);
- };
-
- const handleRemovePort = (index) => {
- const newPorts = ports.filter((_, i) => i !== index);
- setPorts(newPorts);
- handleChange('ports', newPorts);
- };
-
return (
<ConfigPanel
isOpen={!!node}
@@ -201,8 +207,8 @@ const DockerAppConfigPanel = ({ node, onChange, onClose }) => {
onClose={onClose}
>
<div className="form-group">
- <label>Name</label>
- <input
+ <Label>Name</Label>
+ <Input
type="text"
value={data.name || ''}
onChange={(e) => handleChange('name', e.target.value)}
@@ -211,8 +217,8 @@ const DockerAppConfigPanel = ({ node, onChange, onClose }) => {
</div>
<div className="form-group">
- <label>Image</label>
- <input
+ <Label>Image</Label>
+ <Input
type="text"
value={data.image || ''}
onChange={(e) => handleChange('image', e.target.value)}
@@ -222,51 +228,58 @@ const DockerAppConfigPanel = ({ node, onChange, onClose }) => {
</div>
<div className="form-group">
- <label>Status</label>
- <select
+ <Label>Status</Label>
+ <Select
value={data.status || 'stopped'}
- onChange={(e) => handleChange('status', e.target.value)}
+ onValueChange={(value) => handleChange('status', value)}
>
- <option value="stopped">Stopped</option>
- <option value="running">Running</option>
- <option value="error">Error</option>
- </select>
+ <SelectTrigger>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="stopped">Stopped</SelectItem>
+ <SelectItem value="running">Running</SelectItem>
+ <SelectItem value="error">Error</SelectItem>
+ </SelectContent>
+ </Select>
</div>
<div className="form-group">
- <label>Port Mappings</label>
+ <Label>Port Mappings</Label>
<div className="port-list">
{ports.map((port, index) => (
<div key={index} className="port-item">
- <input
+ <Input
type="text"
value={port}
onChange={(e) => handlePortChange(index, e.target.value)}
placeholder="8080:80"
/>
- <button
+ <Button
type="button"
- className="btn btn-icon btn-danger-ghost"
+ variant="ghost"
+ size="icon"
onClick={() => handleRemovePort(index)}
>
×
- </button>
+ </Button>
</div>
))}
- <button
+ <Button
type="button"
- className="btn btn-secondary btn-sm"
+ variant="outline"
+ size="sm"
onClick={handleAddPort}
>
+ Add Port
- </button>
+ </Button>
</div>
<span className="form-hint">Format: host_port:container_port</span>
</div>
<div className="form-group">
- <label>Memory Limit</label>
- <input
+ <Label>Memory Limit</Label>
+ <Input
type="text"
value={data.memory || ''}
onChange={(e) => handleChange('memory', e.target.value)}
diff --git a/frontend/src/components/workflow/panels/DomainConfigPanel.jsx b/frontend/src/components/workflow/panels/DomainConfigPanel.jsx
index 94233f3f..499d02c2 100644
--- a/frontend/src/components/workflow/panels/DomainConfigPanel.jsx
+++ b/frontend/src/components/workflow/panels/DomainConfigPanel.jsx
@@ -1,6 +1,9 @@
import React from 'react';
import { Globe } from 'lucide-react';
import ConfigPanel from '../ConfigPanel';
+import { Input } from '@/components/ui/input';
+import { Label } from '@/components/ui/label';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
const DomainConfigPanel = ({ node, onChange, onClose }) => {
const data = node?.data || {};
@@ -25,8 +28,8 @@ const DomainConfigPanel = ({ node, onChange, onClose }) => {
onClose={onClose}
>
<div className="form-group">
- <label>Domain Name</label>
- <input
+ <Label>Domain Name</Label>
+ <Input
type="text"
value={data.name || ''}
onChange={(e) => handleChange('name', e.target.value)}
@@ -36,21 +39,26 @@ const DomainConfigPanel = ({ node, onChange, onClose }) => {
</div>
<div className="form-group">
- <label>SSL Status</label>
- <select
+ <Label>SSL Status</Label>
+ <Select
value={data.ssl || 'none'}
- onChange={(e) => handleChange('ssl', e.target.value)}
+ onValueChange={(value) => handleChange('ssl', value)}
>
- <option value="none">No SSL</option>
- <option value="valid">Valid Certificate</option>
- <option value="expired">Expired Certificate</option>
- </select>
+ <SelectTrigger>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="none">No SSL</SelectItem>
+ <SelectItem value="valid">Valid Certificate</SelectItem>
+ <SelectItem value="expired">Expired Certificate</SelectItem>
+ </SelectContent>
+ </Select>
</div>
{data.ssl === 'valid' && (
<div className="form-group">
- <label>SSL Expiry Date</label>
- <input
+ <Label>SSL Expiry Date</Label>
+ <Input
type="date"
value={data.sslExpiry || ''}
onChange={(e) => handleChange('sslExpiry', e.target.value)}
@@ -60,14 +68,19 @@ const DomainConfigPanel = ({ node, onChange, onClose }) => {
)}
<div className="form-group">
- <label>DNS Status</label>
- <select
+ <Label>DNS Status</Label>
+ <Select
value={data.dnsStatus || 'pending'}
- onChange={(e) => handleChange('dnsStatus', e.target.value)}
+ onValueChange={(value) => handleChange('dnsStatus', value)}
>
- <option value="pending">Pending Propagation</option>
- <option value="propagated">Propagated</option>
- </select>
+ <SelectTrigger>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="pending">Pending Propagation</SelectItem>
+ <SelectItem value="propagated">Propagated</SelectItem>
+ </SelectContent>
+ </Select>
<span className="form-hint">DNS record propagation status</span>
</div>
</ConfigPanel>
diff --git a/frontend/src/components/workflow/panels/LogicIfConfigPanel.jsx b/frontend/src/components/workflow/panels/LogicIfConfigPanel.jsx
index 42820efe..2eaadf58 100644
--- a/frontend/src/components/workflow/panels/LogicIfConfigPanel.jsx
+++ b/frontend/src/components/workflow/panels/LogicIfConfigPanel.jsx
@@ -1,6 +1,9 @@
import React from 'react';
import ConfigPanel from '../ConfigPanel';
import { GitBranch } from 'lucide-react';
+import { Button } from '@/components/ui/button';
+import { Input } from '@/components/ui/input';
+import { Label } from '@/components/ui/label';
const LogicIfConfigPanel = ({ node, onChange, onClose, onDelete }) => {
const { data } = node;
@@ -13,14 +16,14 @@ const LogicIfConfigPanel = ({ node, onChange, onClose, onDelete }) => {
color="#f97316"
onClose={onClose}
footer={onDelete && (
- <button className="btn-delete-node" onClick={onDelete}>
+ <Button variant="destructive" size="sm" className="btn-delete-node" onClick={onDelete}>
Remove Node
- </button>
+ </Button>
)}
>
<div className="form-group">
- <label>Label</label>
- <input
+ <Label>Label</Label>
+ <Input
type="text"
value={label}
onChange={(e) => onChange({ ...data, label: e.target.value })}
@@ -28,8 +31,8 @@ const LogicIfConfigPanel = ({ node, onChange, onClose, onDelete }) => {
</div>
<div className="form-group">
- <label>Condition (Python expression)</label>
- <input
+ <Label>Condition (Python expression)</Label>
+ <Input
type="text"
className="font-mono"
value={condition}
diff --git a/frontend/src/components/workflow/panels/NotificationConfigPanel.jsx b/frontend/src/components/workflow/panels/NotificationConfigPanel.jsx
index f983fb70..59f52989 100644
--- a/frontend/src/components/workflow/panels/NotificationConfigPanel.jsx
+++ b/frontend/src/components/workflow/panels/NotificationConfigPanel.jsx
@@ -1,6 +1,10 @@
import React from 'react';
import ConfigPanel from '../ConfigPanel';
import { Bell, MessageSquare, Mail, Slack, Send, Globe } from 'lucide-react';
+import { Button } from '@/components/ui/button';
+import { Input } from '@/components/ui/input';
+import { Label } from '@/components/ui/label';
+import { Textarea } from '@/components/ui/textarea';
const NotificationConfigPanel = ({ node, onChange, onClose, onDelete }) => {
const { data } = node;
@@ -22,14 +26,14 @@ const NotificationConfigPanel = ({ node, onChange, onClose, onDelete }) => {
color="#818cf8"
onClose={onClose}
footer={onDelete && (
- <button className="btn-delete-node" onClick={onDelete}>
+ <Button variant="destructive" size="sm" className="btn-delete-node" onClick={onDelete}>
Remove Node
- </button>
+ </Button>
)}
>
<div className="form-group">
- <label>Label</label>
- <input
+ <Label>Label</Label>
+ <Input
type="text"
value={label}
onChange={(e) => onChange({ ...data, label: e.target.value })}
@@ -37,7 +41,7 @@ const NotificationConfigPanel = ({ node, onChange, onClose, onDelete }) => {
</div>
<div className="form-group">
- <label>Channel</label>
+ <Label>Channel</Label>
<div className="channel-grid">
{channels.map(({ id, icon: Icon, label: chLabel }) => (
<button
@@ -53,8 +57,8 @@ const NotificationConfigPanel = ({ node, onChange, onClose, onDelete }) => {
</div>
<div className="form-group">
- <label>Message Template</label>
- <textarea
+ <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}'}
diff --git a/frontend/src/components/workflow/panels/ScriptConfigPanel.jsx b/frontend/src/components/workflow/panels/ScriptConfigPanel.jsx
index 9d07bd07..e50a50fd 100644
--- a/frontend/src/components/workflow/panels/ScriptConfigPanel.jsx
+++ b/frontend/src/components/workflow/panels/ScriptConfigPanel.jsx
@@ -1,6 +1,10 @@
import React from 'react';
import ConfigPanel from '../ConfigPanel';
import { Terminal, Code } from 'lucide-react';
+import { Button } from '@/components/ui/button';
+import { Input } from '@/components/ui/input';
+import { Label } from '@/components/ui/label';
+import { Textarea } from '@/components/ui/textarea';
const ScriptConfigPanel = ({ node, onChange, onClose, onDelete }) => {
const { data } = node;
@@ -20,14 +24,14 @@ const ScriptConfigPanel = ({ node, onChange, onClose, onDelete }) => {
color="#71717a"
onClose={onClose}
footer={onDelete && (
- <button className="btn-delete-node" onClick={onDelete}>
+ <Button variant="destructive" size="sm" className="btn-delete-node" onClick={onDelete}>
Remove Node
- </button>
+ </Button>
)}
>
<div className="form-group">
- <label>Label</label>
- <input
+ <Label>Label</Label>
+ <Input
type="text"
value={label}
onChange={(e) => onChange({ ...data, label: e.target.value })}
@@ -35,7 +39,7 @@ const ScriptConfigPanel = ({ node, onChange, onClose, onDelete }) => {
</div>
<div className="form-group">
- <label>Language</label>
+ <Label>Language</Label>
<div className="lang-toggle">
<button
className={`lang-btn ${language === 'bash' ? 'active' : ''}`}
@@ -55,8 +59,8 @@ const ScriptConfigPanel = ({ node, onChange, onClose, onDelete }) => {
</div>
<div className="form-group">
- <label>Script Content</label>
- <textarea
+ <Label>Script Content</Label>
+ <Textarea
className="script-editor font-mono"
value={content}
onChange={(e) => onChange({ ...data, content: e.target.value })}
@@ -70,8 +74,8 @@ const ScriptConfigPanel = ({ node, onChange, onClose, onDelete }) => {
<div className="form-row form-row-3">
<div className="form-group">
- <label>Timeout (s)</label>
- <input
+ <Label>Timeout (s)</Label>
+ <Input
type="number"
min="1"
max="3600"
@@ -80,8 +84,8 @@ const ScriptConfigPanel = ({ node, onChange, onClose, onDelete }) => {
/>
</div>
<div className="form-group">
- <label>Retries</label>
- <input
+ <Label>Retries</Label>
+ <Input
type="number"
min="0"
max="5"
@@ -90,8 +94,8 @@ const ScriptConfigPanel = ({ node, onChange, onClose, onDelete }) => {
/>
</div>
<div className="form-group">
- <label>Delay (s)</label>
- <input
+ <Label>Delay (s)</Label>
+ <Input
type="number"
min="1"
max="300"
diff --git a/frontend/src/components/workflow/panels/ServiceConfigPanel.jsx b/frontend/src/components/workflow/panels/ServiceConfigPanel.jsx
index 087a071c..893b7cf0 100644
--- a/frontend/src/components/workflow/panels/ServiceConfigPanel.jsx
+++ b/frontend/src/components/workflow/panels/ServiceConfigPanel.jsx
@@ -1,6 +1,10 @@
import React from 'react';
import { Box } from 'lucide-react';
import ConfigPanel from '../ConfigPanel';
+import { Input } from '@/components/ui/input';
+import { Label } from '@/components/ui/label';
+import { Textarea } from '@/components/ui/textarea';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
const serviceTypeConfig = {
redis: { color: '#dc382d', defaultPort: 6379 },
@@ -34,8 +38,8 @@ const ServiceConfigPanel = ({ node, onChange, onClose }) => {
onClose={onClose}
>
<div className="form-group">
- <label>Name</label>
- <input
+ <Label>Name</Label>
+ <Input
type="text"
value={data.name || ''}
onChange={(e) => handleChange('name', e.target.value)}
@@ -44,33 +48,43 @@ const ServiceConfigPanel = ({ node, onChange, onClose }) => {
</div>
<div className="form-group">
- <label>Service Type</label>
- <select
+ <Label>Service Type</Label>
+ <Select
value={data.serviceType || 'redis'}
- onChange={(e) => handleChange('serviceType', e.target.value)}
+ onValueChange={(value) => handleChange('serviceType', value)}
>
- <option value="redis">Redis</option>
- <option value="memcached">Memcached</option>
- <option value="rabbitmq">RabbitMQ</option>
- <option value="queue">Queue</option>
- </select>
+ <SelectTrigger>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="redis">Redis</SelectItem>
+ <SelectItem value="memcached">Memcached</SelectItem>
+ <SelectItem value="rabbitmq">RabbitMQ</SelectItem>
+ <SelectItem value="queue">Queue</SelectItem>
+ </SelectContent>
+ </Select>
</div>
<div className="form-group">
- <label>Status</label>
- <select
+ <Label>Status</Label>
+ <Select
value={data.status || 'stopped'}
- onChange={(e) => handleChange('status', e.target.value)}
+ onValueChange={(value) => handleChange('status', value)}
>
- <option value="stopped">Stopped</option>
- <option value="running">Running</option>
- <option value="error">Error</option>
- </select>
+ <SelectTrigger>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="stopped">Stopped</SelectItem>
+ <SelectItem value="running">Running</SelectItem>
+ <SelectItem value="error">Error</SelectItem>
+ </SelectContent>
+ </Select>
</div>
<div className="form-group">
- <label>Port</label>
- <input
+ <Label>Port</Label>
+ <Input
type="number"
value={data.port || serviceTypeConfig[serviceType]?.defaultPort || 6379}
onChange={(e) => handleChange('port', parseInt(e.target.value) || '')}
@@ -78,8 +92,8 @@ const ServiceConfigPanel = ({ node, onChange, onClose }) => {
</div>
<div className="form-group">
- <label>Description</label>
- <textarea
+ <Label>Description</Label>
+ <Textarea
value={data.description || ''}
onChange={(e) => handleChange('description', e.target.value)}
placeholder="Service description..."
diff --git a/frontend/src/components/workflow/panels/TriggerConfigPanel.jsx b/frontend/src/components/workflow/panels/TriggerConfigPanel.jsx
index d1b2b54e..e211cf30 100644
--- a/frontend/src/components/workflow/panels/TriggerConfigPanel.jsx
+++ b/frontend/src/components/workflow/panels/TriggerConfigPanel.jsx
@@ -1,6 +1,11 @@
import React, { useState } from 'react';
import ConfigPanel from '../ConfigPanel';
import { Play, Clock, Webhook, Zap, Copy, Check } from 'lucide-react';
+import { Button } from '@/components/ui/button';
+import { Input } from '@/components/ui/input';
+import { Label } from '@/components/ui/label';
+import { Switch } from '@/components/ui/switch';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
const TriggerConfigPanel = ({ node, onChange, onClose, onDelete }) => {
const { data } = node;
@@ -58,14 +63,14 @@ const TriggerConfigPanel = ({ node, onChange, onClose, onDelete }) => {
color="#3b82f6"
onClose={onClose}
footer={onDelete && (
- <button className="btn-delete-node" onClick={onDelete}>
+ <Button variant="destructive" size="sm" className="btn-delete-node" onClick={onDelete}>
Remove Node
- </button>
+ </Button>
)}
>
<div className="form-group">
- <label>Label</label>
- <input
+ <Label>Label</Label>
+ <Input
type="text"
value={label}
onChange={(e) => onChange({ ...data, label: e.target.value })}
@@ -73,7 +78,7 @@ const TriggerConfigPanel = ({ node, onChange, onClose, onDelete }) => {
</div>
<div className="form-group">
- <label>Trigger Type</label>
+ <Label>Trigger Type</Label>
<div className="trigger-type-grid">
{triggerTypes.map(({ id, icon: Icon, label: typeLabel, desc }) => (
<button
@@ -92,19 +97,14 @@ const TriggerConfigPanel = ({ node, onChange, onClose, onDelete }) => {
<div className="form-group">
<label className="toggle-label">
<span>Enabled</span>
- <button
- className={`toggle-switch ${isActive ? 'active' : ''}`}
- onClick={toggleActive}
- >
- <span className="toggle-knob" />
- </button>
+ <Switch checked={isActive} onCheckedChange={toggleActive} />
</label>
</div>
{triggerType === 'cron' && (
<div className="form-group">
- <label>Cron Expression</label>
- <input
+ <Label>Cron Expression</Label>
+ <Input
type="text"
className="font-mono"
value={triggerConfig.cron || '0 * * * *'}
@@ -119,19 +119,19 @@ const TriggerConfigPanel = ({ node, onChange, onClose, onDelete }) => {
{triggerType === 'webhook' && (
<div className="form-group">
- <label>Webhook URL</label>
+ <Label>Webhook URL</Label>
{webhookUrl ? (
<>
<div className="input-with-action">
- <input
+ <Input
type="text"
value={webhookUrl}
readOnly
className="input-readonly font-mono"
/>
- <button className="input-action-btn" onClick={copyWebhookUrl} title="Copy URL">
+ <Button variant="ghost" size="icon" className="input-action-btn" onClick={copyWebhookUrl} title="Copy URL">
{copied ? <Check size={14} /> : <Copy size={14} />}
- </button>
+ </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>.
@@ -147,17 +147,22 @@ const TriggerConfigPanel = ({ node, onChange, onClose, onDelete }) => {
{triggerType === 'event' && (
<div className="form-group">
- <label>System Event</label>
- <select
+ <Label>System Event</Label>
+ <Select
value={triggerConfig.eventType || 'health_check_failed'}
- onChange={(e) => handleConfigChange('eventType', e.target.value)}
+ onValueChange={(value) => handleConfigChange('eventType', 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>
+ <SelectTrigger>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="health_check_failed">Health Check Failed</SelectItem>
+ <SelectItem value="high_cpu">High CPU Usage (&gt;80%)</SelectItem>
+ <SelectItem value="high_memory">High Memory Usage (&gt;80%)</SelectItem>
+ <SelectItem value="git_push">Git Push Received</SelectItem>
+ <SelectItem value="app_stopped">Application Stopped</SelectItem>
+ </SelectContent>
+ </Select>
<span className="form-hint">
Event data is available as <code>context.event_data</code> in scripts and conditions.
</span>