forked from baron/baron-sso
chore: Flutter 코드 포맷팅 적용 및 미사용 코드(Dead Code) 정리
This commit is contained in:
@@ -1079,45 +1079,6 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
||||
return tr('ui.userfront.dashboard.sessions.unknown_device');
|
||||
}
|
||||
|
||||
String _sessionPrimaryLabel(UserSessionSummary session) {
|
||||
final appLabel = _sessionAppLabel(session);
|
||||
if (appLabel.isNotEmpty) {
|
||||
return appLabel;
|
||||
}
|
||||
if (session.isCurrent) {
|
||||
return 'UserFront';
|
||||
}
|
||||
return tr('ui.userfront.dashboard.sessions.unknown_session');
|
||||
}
|
||||
|
||||
String _sessionClientLabel(UserSessionSummary session) {
|
||||
return '';
|
||||
}
|
||||
|
||||
String _sessionAppLabel(UserSessionSummary session) {
|
||||
final appName = session.appName.trim();
|
||||
if (appName.isNotEmpty) {
|
||||
return appName;
|
||||
}
|
||||
final clientId = session.clientId.trim().toLowerCase();
|
||||
if (clientId.isEmpty) {
|
||||
return session.isCurrent ? 'UserFront' : '';
|
||||
}
|
||||
if (clientId.contains('adminfront')) {
|
||||
return 'AdminFront';
|
||||
}
|
||||
if (clientId.contains('devfront')) {
|
||||
return 'DevFront';
|
||||
}
|
||||
if (clientId.contains('userfront')) {
|
||||
return 'UserFront';
|
||||
}
|
||||
if (clientId.contains('baron')) {
|
||||
return tr('ui.userfront.app_label.baron');
|
||||
}
|
||||
return session.clientId.trim();
|
||||
}
|
||||
|
||||
String _sessionUserAgentLabel(String userAgent) {
|
||||
final lower = userAgent.toLowerCase();
|
||||
if (lower.isEmpty) {
|
||||
@@ -1173,29 +1134,6 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
||||
return '';
|
||||
}
|
||||
|
||||
String _sessionOsLabel(String userAgent) {
|
||||
final lower = userAgent.toLowerCase();
|
||||
if (lower.isEmpty || _looksLikeInternalUserAgent(lower)) {
|
||||
return '';
|
||||
}
|
||||
if (lower.contains('iphone') || lower.contains('ios')) {
|
||||
return 'iOS';
|
||||
}
|
||||
if (lower.contains('android')) {
|
||||
return 'Android';
|
||||
}
|
||||
if (lower.contains('windows')) {
|
||||
return 'Windows';
|
||||
}
|
||||
if (lower.contains('mac os') || lower.contains('macintosh')) {
|
||||
return 'macOS';
|
||||
}
|
||||
if (lower.contains('linux')) {
|
||||
return 'Linux';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
bool _looksLikeInternalUserAgent(String userAgent) {
|
||||
return userAgent.startsWith('go-http-client/') ||
|
||||
userAgent.startsWith('fasthttp') ||
|
||||
|
||||
Reference in New Issue
Block a user