reorganized web-app
This commit is contained in:
parent
5c87f068d6
commit
b67fe48f72
31 changed files with 1781 additions and 431 deletions
|
|
@ -5,7 +5,6 @@ import {
|
|||
CloudArrowDownIcon,
|
||||
ExclamationTriangleIcon,
|
||||
CheckCircleIcon,
|
||||
ClockIcon,
|
||||
} from '@heroicons/react/24/outline';
|
||||
import { usePipeline } from './hooks/usePipeline';
|
||||
import type { PipelineOperation } from './types';
|
||||
|
|
@ -145,11 +144,11 @@ export function PipelinePage() {
|
|||
const getCategoryIcon = (category: string) => {
|
||||
switch (category) {
|
||||
case 'sync':
|
||||
return <CloudArrowDownIcon className="h-5 w-5" />;
|
||||
return <CloudArrowDownIcon className="h-4 w-4" />;
|
||||
case 'maintenance':
|
||||
return <ExclamationTriangleIcon className="h-5 w-5" />;
|
||||
return <ExclamationTriangleIcon className="h-4 w-4" />;
|
||||
default:
|
||||
return <CircleStackIcon className="h-5 w-5" />;
|
||||
return <CircleStackIcon className="h-4 w-4" />;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -165,21 +164,21 @@ export function PipelinePage() {
|
|||
};
|
||||
|
||||
return (
|
||||
<div className="p-6 max-w-7xl mx-auto">
|
||||
<div className="mb-8">
|
||||
<h1 className="text-2xl font-bold text-text-primary mb-2">Data Pipeline Management</h1>
|
||||
<p className="text-text-secondary">
|
||||
<div className="flex flex-col h-full space-y-4">
|
||||
<div className="flex-shrink-0">
|
||||
<h1 className="text-lg font-bold text-text-primary mb-2">Data Pipeline Management</h1>
|
||||
<p className="text-text-secondary text-sm">
|
||||
Manage data synchronization and maintenance operations
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* Stats Overview */}
|
||||
{(stats.exchanges || stats.providerMappings) && (
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4 mb-8">
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-3 flex-shrink-0">
|
||||
{stats.exchanges && (
|
||||
<div className="bg-surface-secondary p-4 rounded-lg border border-border">
|
||||
<h3 className="text-lg font-semibold text-text-primary mb-3">Exchange Statistics</h3>
|
||||
<div className="space-y-2 text-sm">
|
||||
<div className="bg-surface-secondary p-3 rounded-lg border border-border">
|
||||
<h3 className="text-base font-semibold text-text-primary mb-2">Exchange Statistics</h3>
|
||||
<div className="space-y-1.5 text-xs">
|
||||
<div className="flex justify-between">
|
||||
<span className="text-text-secondary">Total Exchanges:</span>
|
||||
<span className="text-text-primary font-medium">{stats.exchanges.totalExchanges}</span>
|
||||
|
|
@ -201,9 +200,9 @@ export function PipelinePage() {
|
|||
)}
|
||||
|
||||
{stats.providerMappings && (
|
||||
<div className="bg-surface-secondary p-4 rounded-lg border border-border">
|
||||
<h3 className="text-lg font-semibold text-text-primary mb-3">Provider Mapping Statistics</h3>
|
||||
<div className="space-y-2 text-sm">
|
||||
<div className="bg-surface-secondary p-3 rounded-lg border border-border">
|
||||
<h3 className="text-base font-semibold text-text-primary mb-2">Provider Mapping Statistics</h3>
|
||||
<div className="space-y-1.5 text-xs">
|
||||
<div className="flex justify-between">
|
||||
<span className="text-text-secondary">Coverage:</span>
|
||||
<span className="text-primary-400 font-medium">
|
||||
|
|
@ -224,7 +223,7 @@ export function PipelinePage() {
|
|||
<div className="mt-1 flex flex-wrap gap-2">
|
||||
{Object.entries(stats.providerMappings.mappingsByProvider).map(([provider, count]) => (
|
||||
<span key={provider} className="text-xs bg-surface px-2 py-1 rounded">
|
||||
{provider}: {count}
|
||||
{provider}: {String(count)}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
|
|
@ -238,27 +237,27 @@ export function PipelinePage() {
|
|||
|
||||
{/* Status Messages */}
|
||||
{error && (
|
||||
<div className="mb-6 p-4 bg-danger/10 border border-danger/20 rounded-lg">
|
||||
<div className="p-3 bg-danger/10 border border-danger/20 rounded-lg flex-shrink-0">
|
||||
<div className="flex items-center gap-2">
|
||||
<ExclamationTriangleIcon className="h-5 w-5 text-danger" />
|
||||
<span className="text-danger">{error}</span>
|
||||
<ExclamationTriangleIcon className="h-4 w-4 text-danger" />
|
||||
<span className="text-danger text-sm">{error}</span>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{lastJobResult && (
|
||||
<div className={`mb-6 p-4 rounded-lg border ${
|
||||
<div className={`p-3 rounded-lg border flex-shrink-0 ${
|
||||
lastJobResult.success
|
||||
? 'bg-success/10 border-success/20'
|
||||
: 'bg-danger/10 border-danger/20'
|
||||
}`}>
|
||||
<div className="flex items-center gap-2">
|
||||
{lastJobResult.success ? (
|
||||
<CheckCircleIcon className="h-5 w-5 text-success" />
|
||||
<CheckCircleIcon className="h-4 w-4 text-success" />
|
||||
) : (
|
||||
<ExclamationTriangleIcon className="h-5 w-5 text-danger" />
|
||||
<ExclamationTriangleIcon className="h-4 w-4 text-danger" />
|
||||
)}
|
||||
<span className={lastJobResult.success ? 'text-success' : 'text-danger'}>
|
||||
<span className={`text-sm ${lastJobResult.success ? 'text-success' : 'text-danger'}`}>
|
||||
{lastJobResult.message || lastJobResult.error}
|
||||
</span>
|
||||
{lastJobResult.jobId && (
|
||||
|
|
@ -271,35 +270,35 @@ export function PipelinePage() {
|
|||
)}
|
||||
|
||||
{/* Operations Grid */}
|
||||
<div className="space-y-6">
|
||||
<div className="flex-1 min-h-0 space-y-4 overflow-y-auto">
|
||||
{/* Sync Operations */}
|
||||
<div>
|
||||
<h2 className="text-lg font-semibold text-text-primary mb-4 flex items-center gap-2">
|
||||
<CloudArrowDownIcon className="h-5 w-5 text-primary-400" />
|
||||
<h2 className="text-base font-semibold text-text-primary mb-3 flex items-center gap-2">
|
||||
<CloudArrowDownIcon className="h-4 w-4 text-primary-400" />
|
||||
Sync Operations
|
||||
</h2>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3">
|
||||
{operations.filter(op => op.category === 'sync').map(op => (
|
||||
<div
|
||||
key={op.id}
|
||||
className="bg-surface-secondary p-4 rounded-lg border border-border hover:border-primary-500/50 transition-colors"
|
||||
className="bg-surface-secondary p-3 rounded-lg border border-border hover:border-primary-500/50 transition-colors"
|
||||
>
|
||||
<div className="flex items-start justify-between mb-2">
|
||||
<h3 className="font-medium text-text-primary">{op.name}</h3>
|
||||
<h3 className="font-medium text-sm text-text-primary">{op.name}</h3>
|
||||
<div className={getCategoryColor(op.category)}>
|
||||
{getCategoryIcon(op.category)}
|
||||
</div>
|
||||
</div>
|
||||
<p className="text-sm text-text-secondary mb-3">{op.description}</p>
|
||||
<p className="text-xs text-text-secondary mb-2">{op.description}</p>
|
||||
|
||||
{/* Special inputs for specific operations */}
|
||||
{op.id === 'sync-provider-symbols' && (
|
||||
<div className="mb-3">
|
||||
<div className="mb-2">
|
||||
<label className="block text-xs text-text-muted mb-1">Provider</label>
|
||||
<select
|
||||
value={selectedProvider}
|
||||
onChange={e => setSelectedProvider(e.target.value)}
|
||||
className="w-full px-2 py-1 text-sm bg-surface border border-border rounded focus:ring-1 focus:ring-primary-500 focus:border-primary-500"
|
||||
className="w-full px-2 py-1 text-xs bg-surface border border-border rounded focus:ring-1 focus:ring-primary-500 focus:border-primary-500"
|
||||
>
|
||||
<option value="yahoo">Yahoo</option>
|
||||
<option value="qm">QuestionsAndMethods</option>
|
||||
|
|
@ -309,8 +308,8 @@ export function PipelinePage() {
|
|||
)}
|
||||
|
||||
{op.id === 'sync-all-exchanges' && (
|
||||
<div className="mb-3">
|
||||
<label className="flex items-center gap-2 text-sm">
|
||||
<div className="mb-2">
|
||||
<label className="flex items-center gap-2 text-xs">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={clearFirst}
|
||||
|
|
@ -325,16 +324,16 @@ export function PipelinePage() {
|
|||
<button
|
||||
onClick={() => handleOperation(op)}
|
||||
disabled={loading}
|
||||
className="w-full px-3 py-2 bg-primary-500/20 text-primary-400 rounded text-sm font-medium hover:bg-primary-500/30 disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex items-center justify-center gap-2"
|
||||
className="w-full px-2.5 py-1.5 bg-primary-500/20 text-primary-400 rounded text-xs font-medium hover:bg-primary-500/30 disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex items-center justify-center gap-2"
|
||||
>
|
||||
{loading ? (
|
||||
<>
|
||||
<ArrowPathIcon className="h-4 w-4 animate-spin" />
|
||||
<ArrowPathIcon className="h-3 w-3 animate-spin" />
|
||||
Processing...
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<CloudArrowDownIcon className="h-4 w-4" />
|
||||
<CloudArrowDownIcon className="h-3 w-3" />
|
||||
Execute
|
||||
</>
|
||||
)}
|
||||
|
|
@ -346,31 +345,31 @@ export function PipelinePage() {
|
|||
|
||||
{/* Maintenance Operations */}
|
||||
<div>
|
||||
<h2 className="text-lg font-semibold text-text-primary mb-4 flex items-center gap-2">
|
||||
<ExclamationTriangleIcon className="h-5 w-5 text-warning" />
|
||||
<h2 className="text-base font-semibold text-text-primary mb-3 flex items-center gap-2">
|
||||
<ExclamationTriangleIcon className="h-4 w-4 text-warning" />
|
||||
Maintenance Operations
|
||||
</h2>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3">
|
||||
{operations.filter(op => op.category === 'maintenance').map(op => (
|
||||
<div
|
||||
key={op.id}
|
||||
className="bg-surface-secondary p-4 rounded-lg border border-warning/20 hover:border-warning/50 transition-colors"
|
||||
>
|
||||
<div className="flex items-start justify-between mb-2">
|
||||
<h3 className="font-medium text-text-primary">{op.name}</h3>
|
||||
<h3 className="font-medium text-sm text-text-primary">{op.name}</h3>
|
||||
<div className={getCategoryColor(op.category)}>
|
||||
{getCategoryIcon(op.category)}
|
||||
</div>
|
||||
</div>
|
||||
<p className="text-sm text-text-secondary mb-3">{op.description}</p>
|
||||
<p className="text-xs text-text-secondary mb-2">{op.description}</p>
|
||||
|
||||
{op.id === 'clear-postgresql' && (
|
||||
<div className="mb-3">
|
||||
<div className="mb-2">
|
||||
<label className="block text-xs text-text-muted mb-1">Data Type</label>
|
||||
<select
|
||||
value={clearDataType}
|
||||
onChange={e => setClearDataType(e.target.value as any)}
|
||||
className="w-full px-2 py-1 text-sm bg-surface border border-border rounded focus:ring-1 focus:ring-warning focus:border-warning"
|
||||
className="w-full px-2 py-1 text-xs bg-surface border border-border rounded focus:ring-1 focus:ring-warning focus:border-warning"
|
||||
>
|
||||
<option value="all">All Data</option>
|
||||
<option value="exchanges">Exchanges Only</option>
|
||||
|
|
@ -382,16 +381,16 @@ export function PipelinePage() {
|
|||
<button
|
||||
onClick={() => handleOperation(op)}
|
||||
disabled={loading}
|
||||
className="w-full px-3 py-2 bg-warning/20 text-warning rounded text-sm font-medium hover:bg-warning/30 disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex items-center justify-center gap-2"
|
||||
className="w-full px-2.5 py-1.5 bg-warning/20 text-warning rounded text-xs font-medium hover:bg-warning/30 disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex items-center justify-center gap-2"
|
||||
>
|
||||
{loading ? (
|
||||
<>
|
||||
<ArrowPathIcon className="h-4 w-4 animate-spin" />
|
||||
<ArrowPathIcon className="h-3 w-3 animate-spin" />
|
||||
Processing...
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<ExclamationTriangleIcon className="h-4 w-4" />
|
||||
<ExclamationTriangleIcon className="h-3 w-3" />
|
||||
Execute
|
||||
</>
|
||||
)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue