forked from baron/baron-sso
consent 변화 내부 머지 완료
This commit is contained in:
@@ -21,6 +21,10 @@ class AuditLogEntry {
|
||||
final String userAgent;
|
||||
final String sessionId;
|
||||
final String details;
|
||||
final String source;
|
||||
final String clientId;
|
||||
final String appName;
|
||||
final String parentSessionId;
|
||||
|
||||
AuditLogEntry({
|
||||
required this.eventId,
|
||||
@@ -33,6 +37,10 @@ class AuditLogEntry {
|
||||
required this.userAgent,
|
||||
required this.sessionId,
|
||||
required this.details,
|
||||
required this.source,
|
||||
required this.clientId,
|
||||
required this.appName,
|
||||
required this.parentSessionId,
|
||||
});
|
||||
|
||||
factory AuditLogEntry.fromJson(Map<String, dynamic> json) {
|
||||
@@ -55,6 +63,10 @@ class AuditLogEntry {
|
||||
userAgent: json['user_agent'] ?? '',
|
||||
sessionId: json['session_id'] ?? '',
|
||||
details: json['details'] ?? '',
|
||||
source: json['source'] ?? '',
|
||||
clientId: json['client_id'] ?? '',
|
||||
appName: json['app_name'] ?? '',
|
||||
parentSessionId: json['parent_session_id'] ?? '',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -542,6 +554,34 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
||||
);
|
||||
}
|
||||
|
||||
String _appLabelForLog(AuditLogEntry log) {
|
||||
if (log.appName.isNotEmpty) {
|
||||
return log.appName;
|
||||
}
|
||||
return _appLabelForPath(log.path);
|
||||
}
|
||||
|
||||
Widget _buildAppCell(AuditLogEntry log, {TextStyle? style}) {
|
||||
final label = _appLabelForLog(log);
|
||||
if (label == 'Baron 통합로그인') {
|
||||
return _selectableText(label, style: style);
|
||||
}
|
||||
final tooltip = log.parentSessionId.isEmpty
|
||||
? '부모 세션 ID 없음'
|
||||
: '부모 세션 ID: ${log.parentSessionId}';
|
||||
final baseStyle = style ?? const TextStyle();
|
||||
final emphasisStyle = log.parentSessionId.isEmpty
|
||||
? baseStyle
|
||||
: baseStyle.copyWith(
|
||||
color: Colors.blueAccent,
|
||||
decoration: TextDecoration.underline,
|
||||
);
|
||||
return Tooltip(
|
||||
message: tooltip,
|
||||
child: _selectableText(label, style: emphasisStyle),
|
||||
);
|
||||
}
|
||||
|
||||
String _appLabelForPath(String path) {
|
||||
if (path.startsWith('/api/v1/auth')) {
|
||||
return 'Baron 통합로그인';
|
||||
@@ -992,13 +1032,12 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
||||
rows: logs.map((log) {
|
||||
final statusLabel = log.status == 'success' ? '성공' : '실패';
|
||||
final statusColor = log.status == 'success' ? Colors.green : Colors.redAccent;
|
||||
final appLabel = _appLabelForPath(log.path);
|
||||
final authMethod = log.authMethod.isNotEmpty ? log.authMethod : _authMethodLabel();
|
||||
final deviceLabel = _deviceLabelFromUserAgent(log.userAgent);
|
||||
return DataRow(cells: [
|
||||
DataCell(_selectableText(log.sessionId.isEmpty ? '-' : log.sessionId)),
|
||||
DataCell(_selectableText(_formatDateTime(log.timestamp))),
|
||||
DataCell(_selectableText(appLabel)),
|
||||
DataCell(_buildAppCell(log)),
|
||||
DataCell(_selectableText(log.ipAddress.isEmpty ? '-' : log.ipAddress)),
|
||||
DataCell(_selectableText(deviceLabel)),
|
||||
DataCell(_buildAuthMethodCell(log, authMethod)),
|
||||
@@ -1036,8 +1075,8 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: _selectableText(
|
||||
_appLabelForPath(log.path),
|
||||
child: _buildAppCell(
|
||||
log,
|
||||
style: const TextStyle(fontWeight: FontWeight.w600, color: _ink),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user