forked from baron/baron-sso
e2e 구조변경
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:math' as math;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
@@ -31,6 +32,9 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
||||
static const _surface = Colors.white;
|
||||
static const _border = Color(0xFFE5E7EB);
|
||||
static const _subtle = Color(0xFFF7F8FA);
|
||||
static const double _historySessionMinWidth = 92;
|
||||
static const double _historyOtherColumnsBaselineWidth = 780;
|
||||
static const int _historySessionMinVisibleChars = 8;
|
||||
|
||||
final ScrollController _pageScrollController = ScrollController();
|
||||
final ScrollController _rpScrollController = ScrollController();
|
||||
@@ -1370,6 +1374,9 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
||||
children: [
|
||||
LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
final sessionColumnWidth = _historySessionColumnWidth(
|
||||
constraints.maxWidth,
|
||||
);
|
||||
return SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: ConstrainedBox(
|
||||
@@ -1379,10 +1386,13 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
||||
horizontalMargin: 12,
|
||||
columns: [
|
||||
DataColumn(
|
||||
label: Text(
|
||||
tr(
|
||||
'ui.userfront.audit.table.session_id',
|
||||
fallback: 'Session ID',
|
||||
label: SizedBox(
|
||||
width: sessionColumnWidth,
|
||||
child: Text(
|
||||
tr(
|
||||
'ui.userfront.audit.table.session_id',
|
||||
fallback: 'Session ID',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -1426,10 +1436,14 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
||||
return DataRow(
|
||||
cells: [
|
||||
DataCell(
|
||||
_selectableText(
|
||||
log.sessionId.isEmpty
|
||||
? tr('ui.common.hyphen', fallback: '-')
|
||||
: log.sessionId,
|
||||
SizedBox(
|
||||
width: sessionColumnWidth,
|
||||
child: _buildHistorySessionIdCell(
|
||||
log.sessionId.isEmpty
|
||||
? tr('ui.common.hyphen', fallback: '-')
|
||||
: log.sessionId,
|
||||
sessionColumnWidth,
|
||||
),
|
||||
),
|
||||
),
|
||||
DataCell(
|
||||
@@ -1474,6 +1488,36 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
||||
);
|
||||
}
|
||||
|
||||
double _historySessionColumnWidth(double maxWidth) {
|
||||
return math.max(
|
||||
_historySessionMinWidth,
|
||||
maxWidth - _historyOtherColumnsBaselineWidth,
|
||||
);
|
||||
}
|
||||
|
||||
String _compactSessionId(String sessionId) {
|
||||
if (sessionId.length <= _historySessionMinVisibleChars) {
|
||||
return sessionId;
|
||||
}
|
||||
return '${sessionId.substring(0, _historySessionMinVisibleChars)}...';
|
||||
}
|
||||
|
||||
Widget _buildHistorySessionIdCell(String sessionId, double columnWidth) {
|
||||
final compactMode = columnWidth <= _historySessionMinWidth + 0.5;
|
||||
final displayText = compactMode ? _compactSessionId(sessionId) : sessionId;
|
||||
final textWidget = Text(
|
||||
displayText,
|
||||
maxLines: 1,
|
||||
softWrap: false,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
);
|
||||
|
||||
if (displayText == sessionId) {
|
||||
return textWidget;
|
||||
}
|
||||
return Tooltip(message: sessionId, child: textWidget);
|
||||
}
|
||||
|
||||
Widget _buildHistoryList(AuthTimelineState state) {
|
||||
return _buildHistoryContainer(
|
||||
child: Column(
|
||||
|
||||
Reference in New Issue
Block a user