53 lines
1.6 KiB
Dart
53 lines
1.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../proto/messages.pb.dart';
|
|
import 'app_scope.dart';
|
|
import 'log_list_view.dart';
|
|
|
|
/// Compact log panel on the Dashboard tab. Filters by severity using the
|
|
/// set configured in Settings (default ERROR + FATAL).
|
|
class MiniLogPanel extends StatelessWidget {
|
|
const MiniLogPanel({super.key, required this.severities});
|
|
|
|
final Set<int> severities;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final scope = AppScope.of(context);
|
|
return Container(
|
|
decoration: BoxDecoration(
|
|
border: Border.all(
|
|
color: Theme.of(context).colorScheme.outlineVariant,
|
|
),
|
|
borderRadius: BorderRadius.circular(6),
|
|
),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
children: [
|
|
Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
|
|
child: Row(
|
|
children: const [
|
|
Text('Errors & fatals',
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w500, fontSize: 12)),
|
|
SizedBox(width: 6),
|
|
Text('· filtered view',
|
|
style: TextStyle(fontSize: 11, color: Colors.grey)),
|
|
],
|
|
),
|
|
),
|
|
const Divider(height: 1),
|
|
Expanded(
|
|
child: LogListView(
|
|
session: scope.session,
|
|
filter: (e) => severities.contains(
|
|
e.hasSeverity() ? e.severity.value : 0,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
} |