-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Listener for airside logs + Widget to display airside logs (#22)
* commiting to new branch * experimenting * works, but has test data hardcoded in * modified but not finalized * made changes * fixed changes * adding into main dart * changes * new changes with refactor * functional changes made * widget commit * fixed changes * trying to rebase main * changes from main refactor * formatted files * Fixed merge conflicts in .metadata * Fixed merge conflict pubspec.lock * fixed changes, made some modifications * pushing changes * fixing build issue * trying to fix build issue * fixing requested changes * fixing build, forgot to format * fixing new requested changes * adding tests * fixing nitpicks * tests completed * restored main * adding test_logs * fixed file change --------- Co-authored-by: Balaji <[email protected]>
- Loading branch information
1 parent
5c858c5
commit 1b3ce62
Showing
12 changed files
with
586 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import 'dart:io'; | ||
|
||
class GetAirsideLogs { | ||
final String pathToDirectory; | ||
|
||
GetAirsideLogs({required this.pathToDirectory}); | ||
|
||
List<File> getFiles() { | ||
return Directory(pathToDirectory) | ||
.listSync(recursive: true, followLinks: true) | ||
.whereType<File>() | ||
.toList(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class LogDisplayerScreen extends StatelessWidget { | ||
final String fileContext; | ||
final String fileName; | ||
const LogDisplayerScreen( | ||
{Key? key, required this.fileContext, required this.fileName}) | ||
: super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: Text(fileName), | ||
), | ||
body: SingleChildScrollView( | ||
child: Padding( | ||
padding: const EdgeInsets.all(8.0), | ||
child: Text(fileContext), | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:imacs/modules/get_airside_logs.dart'; | ||
import 'package:imacs/screens/log_displayer_screen.dart'; | ||
|
||
class LogsList extends StatelessWidget { | ||
const LogsList({ | ||
super.key, | ||
required this.getAirsideLogs, | ||
}); | ||
|
||
final GetAirsideLogs getAirsideLogs; | ||
|
||
static Route _logDisplayerRoute(BuildContext context, Object? arguments) { | ||
final args = arguments as Map<String, String>; | ||
return MaterialPageRoute( | ||
builder: (context) => LogDisplayerScreen( | ||
fileContext: args['fileContent']!, fileName: args['fileName']!), | ||
); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return SingleChildScrollView( | ||
child: SizedBox( | ||
width: 600, | ||
child: AspectRatio( | ||
aspectRatio: 4 / 3, | ||
child: ListView.builder( | ||
itemCount: getAirsideLogs.getFiles().length, | ||
itemBuilder: (context, index) { | ||
List<String> filePath = | ||
getAirsideLogs.getFiles()[index].uri.pathSegments; | ||
String fileName = filePath.length == 1 | ||
? filePath.last | ||
: filePath | ||
.sublist(filePath.length - 2, filePath.length) | ||
.join('/'); | ||
return Padding( | ||
padding: const EdgeInsets.all(8.0), | ||
child: Card( | ||
child: ListTile( | ||
title: Text(fileName), | ||
onTap: () { | ||
String fileContent = | ||
getAirsideLogs.getFiles()[index].readAsStringSync(); | ||
Navigator.of(context).restorablePush( | ||
_logDisplayerRoute, // restorable push wouldn't function without static method | ||
arguments: { | ||
'fileContent': fileContent, | ||
'fileName': fileName, | ||
}, | ||
); | ||
}, | ||
), | ||
), | ||
); | ||
}, | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
07:46:57: [INFO] [test_functions.py | main | 20] main logger initialized | ||
07:46:57: [DEBUG] [test_functions.py | main | 26] Test Debug | ||
07:46:57: [INFO] [test_functions.py | main | 28] Test Info | ||
07:46:57: [WARNING] [test_functions.py | main | 30] Test Warning | ||
07:46:57: [WARNING] [test_functions.py | main | 30] Test Warning | ||
07:46:57: [CRITICAL] [test_functions.py | main | 34] Test Critical | ||
07:46:57: [CRITICAL] [test_functions.py | main | 34] Test Critical | ||
07:46:57: [DEBUG] [test_functions.py | main | 26] Test Debug | ||
07:46:57: [INFO] [test_functions.py | main | 28] Test Info | ||
07:46:57: [CRITICAL] [test_functions.py | main | 34] Test Critical | ||
07:46:57: [WARNING] [test_functions.py | main | 30] Test Warning | ||
07:46:57: [WARNING] [test_functions.py | main | 30] Test Warning | ||
07:46:57: [INFO] [test_functions.py | main | 28] Test Info | ||
07:46:57: [ERROR] [test_functions.py | main | 32] Test Error | ||
07:46:57: [INFO] [test_functions.py | main | 28] Test Info | ||
07:46:57: [ERROR] [test_functions.py | main | 32] Test Error | ||
07:46:57: [WARNING] [test_functions.py | main | 30] Test Warning | ||
07:46:57: [WARNING] [test_functions.py | main | 30] Test Warning | ||
07:46:57: [ERROR] [test_functions.py | main | 32] Test Error | ||
07:46:57: [ERROR] [test_functions.py | main | 32] Test Error | ||
07:46:57: [CRITICAL] [test_functions.py | main | 34] Test Critical | ||
07:46:57: [ERROR] [test_functions.py | main | 32] Test Error | ||
07:46:57: [INFO] [test_functions.py | main | 28] Test Info | ||
07:46:57: [WARNING] [test_functions.py | main | 30] Test Warning | ||
07:46:57: [DEBUG] [test_functions.py | main | 26] Test Debug | ||
07:46:57: [WARNING] [test_functions.py | main | 30] Test Warning | ||
07:46:57: [WARNING] [test_functions.py | main | 30] Test Warning | ||
07:46:57: [WARNING] [test_functions.py | main | 30] Test Warning | ||
07:46:57: [WARNING] [test_functions.py | main | 30] Test Warning | ||
07:46:57: [CRITICAL] [test_functions.py | main | 34] Test Critical | ||
07:46:57: [DEBUG] [test_functions.py | main | 26] Test Debug | ||
07:46:57: [DEBUG] [test_functions.py | main | 26] Test Debug | ||
07:46:57: [INFO] [test_functions.py | main | 28] Test Info | ||
07:46:57: [WARNING] [test_functions.py | main | 30] Test Warning | ||
07:46:57: [INFO] [test_functions.py | main | 28] Test Info | ||
07:46:57: [WARNING] [test_functions.py | main | 30] Test Warning | ||
07:46:57: [INFO] [test_functions.py | main | 28] Test Info | ||
07:46:57: [WARNING] [test_functions.py | main | 30] Test Warning | ||
07:46:57: [ERROR] [test_functions.py | main | 32] Test Error | ||
07:46:57: [DEBUG] [test_functions.py | main | 26] Test Debug | ||
07:46:57: [DEBUG] [test_functions.py | main | 26] Test Debug | ||
07:46:57: [WARNING] [test_functions.py | main | 30] Test Warning | ||
07:46:57: [CRITICAL] [test_functions.py | main | 34] Test Critical | ||
07:46:57: [DEBUG] [test_functions.py | main | 26] Test Debug | ||
07:46:57: [CRITICAL] [test_functions.py | main | 34] Test Critical | ||
07:46:57: [DEBUG] [test_functions.py | main | 26] Test Debug | ||
07:46:57: [CRITICAL] [test_functions.py | main | 34] Test Critical | ||
07:46:57: [WARNING] [test_functions.py | main | 30] Test Warning | ||
07:46:57: [INFO] [test_functions.py | main | 28] Test Info | ||
07:46:57: [ERROR] [test_functions.py | main | 32] Test Error | ||
07:46:57: [DEBUG] [test_functions.py | main | 26] Test Debug | ||
07:46:57: [INFO] [test_functions.py | main | 28] Test Info | ||
07:46:57: [WARNING] [test_functions.py | main | 30] Test Warning | ||
07:46:57: [DEBUG] [test_functions.py | main | 26] Test Debug | ||
07:46:57: [DEBUG] [test_functions.py | main | 26] Test Debug | ||
07:46:57: [WARNING] [test_functions.py | main | 30] Test Warning | ||
07:46:57: [DEBUG] [test_functions.py | main | 26] Test Debug | ||
07:46:57: [CRITICAL] [test_functions.py | main | 34] Test Critical | ||
07:46:57: [ERROR] [test_functions.py | main | 32] Test Error | ||
07:46:57: [ERROR] [test_functions.py | main | 32] Test Error | ||
07:46:57: [DEBUG] [test_functions.py | main | 26] Test Debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
07:47:01: [INFO] [test_functions.py | main | 20] main logger initialized | ||
07:47:01: [DEBUG] [test_functions.py | main | 26] Test Debug | ||
07:47:01: [CRITICAL] [test_functions.py | main | 34] Test Critical | ||
07:47:01: [WARNING] [test_functions.py | main | 30] Test Warning | ||
07:47:01: [CRITICAL] [test_functions.py | main | 34] Test Critical | ||
07:47:01: [CRITICAL] [test_functions.py | main | 34] Test Critical | ||
07:47:01: [CRITICAL] [test_functions.py | main | 34] Test Critical | ||
07:47:01: [WARNING] [test_functions.py | main | 30] Test Warning | ||
07:47:01: [ERROR] [test_functions.py | main | 32] Test Error | ||
07:47:01: [INFO] [test_functions.py | main | 28] Test Info | ||
07:47:01: [ERROR] [test_functions.py | main | 32] Test Error | ||
07:47:01: [DEBUG] [test_functions.py | main | 26] Test Debug | ||
07:47:01: [INFO] [test_functions.py | main | 28] Test Info | ||
07:47:01: [ERROR] [test_functions.py | main | 32] Test Error | ||
07:47:01: [DEBUG] [test_functions.py | main | 26] Test Debug | ||
07:47:01: [CRITICAL] [test_functions.py | main | 34] Test Critical | ||
07:47:01: [INFO] [test_functions.py | main | 28] Test Info | ||
07:47:01: [ERROR] [test_functions.py | main | 32] Test Error | ||
07:47:01: [CRITICAL] [test_functions.py | main | 34] Test Critical | ||
07:47:01: [INFO] [test_functions.py | main | 28] Test Info | ||
07:47:01: [DEBUG] [test_functions.py | main | 26] Test Debug | ||
07:47:01: [CRITICAL] [test_functions.py | main | 34] Test Critical | ||
07:47:01: [WARNING] [test_functions.py | main | 30] Test Warning | ||
07:47:01: [CRITICAL] [test_functions.py | main | 34] Test Critical | ||
07:47:01: [CRITICAL] [test_functions.py | main | 34] Test Critical | ||
07:47:01: [CRITICAL] [test_functions.py | main | 34] Test Critical | ||
07:47:01: [ERROR] [test_functions.py | main | 32] Test Error | ||
07:47:01: [ERROR] [test_functions.py | main | 32] Test Error | ||
07:47:01: [DEBUG] [test_functions.py | main | 26] Test Debug | ||
07:47:01: [DEBUG] [test_functions.py | main | 26] Test Debug | ||
07:47:01: [CRITICAL] [test_functions.py | main | 34] Test Critical | ||
07:47:01: [DEBUG] [test_functions.py | main | 26] Test Debug | ||
07:47:01: [INFO] [test_functions.py | main | 28] Test Info | ||
07:47:01: [INFO] [test_functions.py | main | 28] Test Info | ||
07:47:01: [ERROR] [test_functions.py | main | 32] Test Error | ||
07:47:01: [DEBUG] [test_functions.py | main | 26] Test Debug | ||
07:47:01: [CRITICAL] [test_functions.py | main | 34] Test Critical | ||
07:47:01: [DEBUG] [test_functions.py | main | 26] Test Debug | ||
07:47:01: [WARNING] [test_functions.py | main | 30] Test Warning | ||
07:47:01: [WARNING] [test_functions.py | main | 30] Test Warning | ||
07:47:01: [WARNING] [test_functions.py | main | 30] Test Warning | ||
07:47:01: [CRITICAL] [test_functions.py | main | 34] Test Critical | ||
07:47:01: [INFO] [test_functions.py | main | 28] Test Info | ||
07:47:01: [INFO] [test_functions.py | main | 28] Test Info | ||
07:47:01: [DEBUG] [test_functions.py | main | 26] Test Debug | ||
07:47:01: [WARNING] [test_functions.py | main | 30] Test Warning | ||
07:47:01: [ERROR] [test_functions.py | main | 32] Test Error | ||
07:47:01: [CRITICAL] [test_functions.py | main | 34] Test Critical | ||
07:47:01: [WARNING] [test_functions.py | main | 30] Test Warning | ||
07:47:01: [INFO] [test_functions.py | main | 28] Test Info | ||
07:47:01: [INFO] [test_functions.py | main | 28] Test Info | ||
07:47:01: [DEBUG] [test_functions.py | main | 26] Test Debug | ||
07:47:01: [CRITICAL] [test_functions.py | main | 34] Test Critical | ||
07:47:01: [CRITICAL] [test_functions.py | main | 34] Test Critical | ||
07:47:01: [WARNING] [test_functions.py | main | 30] Test Warning | ||
07:47:01: [WARNING] [test_functions.py | main | 30] Test Warning | ||
07:47:01: [INFO] [test_functions.py | main | 28] Test Info | ||
07:47:01: [CRITICAL] [test_functions.py | main | 34] Test Critical | ||
07:47:01: [INFO] [test_functions.py | main | 28] Test Info | ||
07:47:01: [WARNING] [test_functions.py | main | 30] Test Warning | ||
07:47:01: [WARNING] [test_functions.py | main | 30] Test Warning |
Oops, something went wrong.