Files
tatlock-ui/lib/features/control_room/stacks/domain/entities/stack.dart
T
Jeroen SchweitzerandClaude Opus 4.5 5c09bac3d2 feat: add stack detail view with YAML and env vars editor
When a stack is selected, the right pane now shows a split view:
- Top: Stack editor with tabs for Compose YAML and Environment Variables
- Bottom: Docked compact container list for the selected stack

Includes Deploy button to redeploy stack with updated configuration.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 02:18:07 +01:00

73 lines
1.6 KiB
Dart

import 'package:freezed_annotation/freezed_annotation.dart';
part 'stack.freezed.dart';
/// Container orchestration stack (Docker Compose stack).
@freezed
class Stack with _$Stack {
const factory Stack({
/// Unique stack identifier.
required String id,
/// Stack name.
required String name,
/// Stack type (compose, swarm, kubernetes).
@Default(StackType.compose) StackType type,
/// Current stack status.
@Default(StackStatus.unknown) StackStatus status,
/// Number of containers in the stack.
@Default(0) int containerCount,
/// Number of running containers.
@Default(0) int runningCount,
/// Path to the compose file (if applicable).
String? composeFile,
/// Compose YAML content.
String? yaml,
/// Environment variables for the stack.
@Default({}) Map<String, String> envVars,
/// Environment name (e.g., production, staging).
String? environment,
/// When the stack was created.
DateTime? createdAt,
/// When the stack was last updated.
DateTime? updatedAt,
}) = _Stack;
const Stack._();
/// Whether all containers in the stack are running.
bool get isHealthy => runningCount == containerCount && containerCount > 0;
/// Whether the stack has any running containers.
bool get hasRunningContainers => runningCount > 0;
/// Whether the stack is partially running.
bool get isPartial =>
runningCount > 0 && runningCount < containerCount;
}
/// Stack orchestration type.
enum StackType {
compose,
swarm,
kubernetes,
}
/// Stack status.
enum StackStatus {
active,
inactive,
error,
unknown,
}