Build and Push / build (release) Successful in 2m59s
- Add SystemStats freezed models matching Core API response - Add systemStatsProvider to fetch stats from /tools/system/stats - Update dashboard to display CPU, RAM, VRAM, and disk usage gauges - Implement color-coded gauges: green ≤50%, orange 51-75%, red >75% - Add auto-refresh every 30 seconds - Improve gauge widget: speedometer style, icons below labels - Update weather widget to match air quality vertical layout 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
15 lines
518 B
Dart
15 lines
518 B
Dart
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
|
import 'package:tatlock_ui/core/api/api_client.dart';
|
|
import 'package:tatlock_ui/features/front_hall/data/models/system_stats_model.dart';
|
|
|
|
part 'system_stats_provider.g.dart';
|
|
|
|
/// Fetches system stats from Core API.
|
|
@riverpod
|
|
Future<SystemStats> systemStats(Ref ref) async {
|
|
final dio = ref.watch(coreApiClientProvider);
|
|
|
|
final response = await dio.get('/tools/system/stats');
|
|
return SystemStats.fromJson(response.data as Map<String, dynamic>);
|
|
}
|