Features: - Health check endpoint for Portainer monitoring - Local search filtering in DataGrid - Container status badges reflect health (green/orange/blue) Improvements: - Standardized 56px header heights across panels - Container grid parses Docker API format correctly - Search bar styling improvements - Status badges have consistent width Fixes: - Quick links persistence (link type, form refresh) - Iframe switching closes existing content first - ContainerState type conflict resolved Branding: - Updated favicon and icons with Tatlock bucket logo 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
0d15d3dbb5
commit
bdced8739c
@@ -1,6 +1,7 @@
|
||||
import 'dart:developer' as developer;
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:tatlock_ui/core/auth/auth_provider.dart';
|
||||
import 'package:tatlock_ui/core/config/app_config.dart';
|
||||
@@ -49,33 +50,59 @@ class AuthInterceptor extends Interceptor {
|
||||
}
|
||||
}
|
||||
|
||||
/// Logs requests and responses in debug mode.
|
||||
/// Logs API requests and responses to the console.
|
||||
///
|
||||
/// All requests are logged with method, URL, query params, and body.
|
||||
/// Responses include status code. Errors include full details.
|
||||
class LoggingInterceptor extends Interceptor {
|
||||
@override
|
||||
void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
|
||||
developer.log(
|
||||
'→ ${options.method} ${options.uri}',
|
||||
name: 'api',
|
||||
);
|
||||
final buffer = StringBuffer()
|
||||
..writeln('┌── API Request ──────────────────────────────────────')
|
||||
..writeln('│ ${options.method} ${options.path}');
|
||||
|
||||
if (options.queryParameters.isNotEmpty) {
|
||||
buffer.writeln('│ Query: ${options.queryParameters}');
|
||||
}
|
||||
|
||||
if (options.data != null) {
|
||||
buffer.writeln('│ Body: ${options.data}');
|
||||
}
|
||||
|
||||
buffer.writeln('└─────────────────────────────────────────────────────');
|
||||
|
||||
final message = buffer.toString();
|
||||
developer.log(message, name: 'API');
|
||||
debugPrint(message);
|
||||
handler.next(options);
|
||||
}
|
||||
|
||||
@override
|
||||
void onResponse(Response response, ResponseInterceptorHandler handler) {
|
||||
developer.log(
|
||||
'← ${response.statusCode} ${response.requestOptions.uri}',
|
||||
name: 'api',
|
||||
);
|
||||
final message =
|
||||
'✓ ${response.statusCode} ${response.requestOptions.method} ${response.requestOptions.path}';
|
||||
developer.log(message, name: 'API');
|
||||
debugPrint(message);
|
||||
handler.next(response);
|
||||
}
|
||||
|
||||
@override
|
||||
void onError(DioException err, ErrorInterceptorHandler handler) {
|
||||
developer.log(
|
||||
'✗ ${err.response?.statusCode ?? 'NETWORK'} ${err.requestOptions.uri}: ${err.message}',
|
||||
name: 'api',
|
||||
error: err,
|
||||
);
|
||||
final buffer = StringBuffer()
|
||||
..writeln('┌── API Error ────────────────────────────────────────')
|
||||
..writeln('│ ${err.requestOptions.method} ${err.requestOptions.path}')
|
||||
..writeln('│ Status: ${err.response?.statusCode ?? 'NETWORK ERROR'}')
|
||||
..writeln('│ Message: ${err.message}');
|
||||
|
||||
if (err.response?.data != null) {
|
||||
buffer.writeln('│ Response: ${err.response?.data}');
|
||||
}
|
||||
|
||||
buffer.writeln('└─────────────────────────────────────────────────────');
|
||||
|
||||
final message = buffer.toString();
|
||||
developer.log(message, name: 'API', error: err);
|
||||
debugPrint(message);
|
||||
handler.next(err);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user