feat: implement Phase 2 - Process Groups Management
All checks were successful
Build and Push Docker Image to Gitea / build-and-push (push) Successful in 58s
All checks were successful
Build and Push Docker Image to Gitea / build-and-push (push) Successful in 58s
Features added:
- Group-based process organization with collapsible cards
- Batch operations for groups (Start All, Stop All, Restart All)
- Group statistics display (running, stopped, fatal counts)
- Dedicated /groups page for group-centric management
- View toggle in /processes page (Flat view | Grouped view)
Implementation details:
- Created group API routes: /api/supervisor/groups/[name]/{start,stop,restart}
- Added React Query hooks: useStartProcessGroup, useStopProcessGroup, useRestartProcessGroup
- Created components: GroupCard, GroupView, GroupSelector
- Updated Navbar with Groups navigation link
- Integrated grouped view in processes page with toggle
Phase 2 complete (6-8 hours estimated)
This commit is contained in:
37
components/groups/GroupSelector.tsx
Normal file
37
components/groups/GroupSelector.tsx
Normal file
@@ -0,0 +1,37 @@
|
||||
'use client';
|
||||
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { LayoutGrid, List } from 'lucide-react';
|
||||
|
||||
interface GroupSelectorProps {
|
||||
viewMode: 'flat' | 'grouped';
|
||||
onViewModeChange: (mode: 'flat' | 'grouped') => void;
|
||||
}
|
||||
|
||||
export function GroupSelector({ viewMode, onViewModeChange }: GroupSelectorProps) {
|
||||
return (
|
||||
<div className="flex gap-2 items-center">
|
||||
<span className="text-sm font-medium text-muted-foreground">View:</span>
|
||||
<div className="flex gap-1 border rounded-md p-1">
|
||||
<Button
|
||||
variant={viewMode === 'flat' ? 'default' : 'ghost'}
|
||||
size="sm"
|
||||
onClick={() => onViewModeChange('flat')}
|
||||
className="gap-2"
|
||||
>
|
||||
<LayoutGrid className="h-4 w-4" />
|
||||
Flat
|
||||
</Button>
|
||||
<Button
|
||||
variant={viewMode === 'grouped' ? 'default' : 'ghost'}
|
||||
size="sm"
|
||||
onClick={() => onViewModeChange('grouped')}
|
||||
className="gap-2"
|
||||
>
|
||||
<List className="h-4 w-4" />
|
||||
Grouped
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user