- Upgrade flutter_riverpod to 3.1.0, riverpod_annotation to 4.0.0 - Upgrade freezed to 3.2.3, freezed_annotation to 3.1.0 - Migrate freezed classes to use sealed keyword (freezed 3.x) - Update provider naming (*NotifierProvider → *Provider) - Add legacy.dart import for StateNotifierProvider compatibility - Fix valueOrNull → value for AsyncValue - Remove unused imports and fields - Add sync from Authentik button to users/groups pages - Suppress invalid_annotation_target warning in analysis_options 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
73 lines
1.6 KiB
Dart
73 lines
1.6 KiB
Dart
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
|
|
part 'stack.freezed.dart';
|
|
|
|
/// Container orchestration stack (Docker Compose stack).
|
|
@freezed
|
|
sealed 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,
|
|
}
|