Initial commit: Accessible SSH Terminal
This commit is contained in:
37
lib/models/saved_connection.dart
Normal file
37
lib/models/saved_connection.dart
Normal file
@@ -0,0 +1,37 @@
|
||||
class SavedConnection {
|
||||
final String id;
|
||||
final String host;
|
||||
final int port;
|
||||
final String username;
|
||||
final String? privateKey; // Stores the content of the private key file
|
||||
|
||||
SavedConnection({
|
||||
required this.id,
|
||||
required this.host,
|
||||
required this.port,
|
||||
required this.username,
|
||||
this.privateKey,
|
||||
});
|
||||
|
||||
String get label => '$username@$host:$port';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'id': id,
|
||||
'host': host,
|
||||
'port': port,
|
||||
'username': username,
|
||||
'privateKey': privateKey,
|
||||
};
|
||||
}
|
||||
|
||||
factory SavedConnection.fromJson(Map<String, dynamic> json) {
|
||||
return SavedConnection(
|
||||
id: json['id'] as String,
|
||||
host: json['host'] as String,
|
||||
port: json['port'] as int,
|
||||
username: json['username'] as String,
|
||||
privateKey: json['privateKey'] as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
8
lib/models/terminal_line.dart
Normal file
8
lib/models/terminal_line.dart
Normal file
@@ -0,0 +1,8 @@
|
||||
// lib/models/terminal_line.dart
|
||||
// This file will define the data model for a single line of terminal output.
|
||||
class TerminalLine {
|
||||
final String text;
|
||||
// TODO: Add properties for ANSI styling, e.g., color, bold, etc.
|
||||
|
||||
TerminalLine({required this.text});
|
||||
}
|
||||
Reference in New Issue
Block a user