Skip to content
This repository was archived by the owner on Feb 21, 2025. It is now read-only.

Commit a00cd89

Browse files
committed
Merge branch 'beta'
2 parents a2f2ec3 + cc10239 commit a00cd89

File tree

9 files changed

+29
-25
lines changed

9 files changed

+29
-25
lines changed

lib/models/domain.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ Domain domainFromJson(String str) => Domain.fromJson(json.decode(str));
55
String domainToJson(Domain data) => json.encode(data.toJson());
66

77
class Domain {
8+
int id;
9+
int type;
10+
String domain;
11+
int enabled;
12+
DateTime dateAdded;
13+
DateTime dateModified;
14+
String? comment;
15+
List<int> groups;
16+
817
Domain({
918
required this.id,
1019
required this.type,
@@ -16,15 +25,6 @@ class Domain {
1625
required this.groups,
1726
});
1827

19-
int id;
20-
int type;
21-
String domain;
22-
int enabled;
23-
DateTime dateAdded;
24-
DateTime dateModified;
25-
String comment;
26-
List<int> groups;
27-
2828
factory Domain.fromJson(Map<String, dynamic> json) => Domain(
2929
id: json["id"],
3030
type: json["type"],

lib/models/log.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ class Log {
33
final String type;
44
final String url;
55
final String device;
6-
final String status;
6+
final String? status;
77
final String replyType;
8-
final int replyTime;
8+
final BigInt replyTime;
99
final String? answeredBy;
1010

1111
const Log({
@@ -43,7 +43,7 @@ class Log {
4343
device: data[3],
4444
status: data[4],
4545
replyType: replyTypes[int.parse(data[6])],
46-
replyTime: int.parse(data[7]),
47-
answeredBy: data[4] == '2' ? data[10] : null
46+
replyTime: BigInt.parse(data[7]),
47+
answeredBy: data[4] == '2' ? data.length >= 10 ? data[10] : null : null
4848
);
4949
}

lib/screens/domains/domain_details_screen.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ class DomainDetailsScreen extends StatelessWidget {
9191
Material(
9292
color: Colors.transparent,
9393
child: InkWell(
94-
onTap: domain.comment != ""
94+
onTap: domain.comment != null && domain.comment != ""
9595
? () => {
9696
showModal(
9797
context: context,
9898
builder: (context) => DomainCommentModal(
99-
comment: domain.comment
99+
comment: domain.comment!
100100
)
101101
)
102102
} : null,

lib/screens/home/clients_last_hours.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ class ClientsLastHours extends StatelessWidget {
2525
gridData: FlGridData(
2626
show: true,
2727
drawVerticalLine: false,
28-
horizontalInterval: (data['topPoint']/5).toDouble(),
2928
getDrawingHorizontalLine: (value) => FlLine(
3029
color: selectedTheme == ThemeMode.light
3130
? Colors.black12

lib/screens/logs/log_details_screen.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ class LogDetailsScreen extends StatelessWidget {
116116
label: AppLocalizations.of(context)!.time,
117117
description: formatTimestamp(log.dateTime, 'HH:mm:ss'),
118118
),
119-
item(
119+
if (log.status != null) item(
120120
Icons.shield_outlined,
121121
AppLocalizations.of(context)!.status,
122-
LogStatus(status: log.status, showIcon: false)
122+
LogStatus(status: log.status!, showIcon: false)
123123
),
124124
if (log.status == '2' && log.answeredBy != null) CustomListTile(
125125
leadingIcon: Icons.domain,
@@ -129,7 +129,7 @@ class LogDetailsScreen extends StatelessWidget {
129129
CustomListTile(
130130
leadingIcon: Icons.system_update_alt_outlined,
131131
label: AppLocalizations.of(context)!.reply,
132-
description: "${log.replyType} (${(log.replyTime/10)} ms)",
132+
description: "${log.replyType} (${(log.replyTime/BigInt.from(10))} ms)",
133133
),
134134
],
135135
),

lib/screens/logs/log_tile.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class LogTile extends StatelessWidget {
4646
child: Column(
4747
crossAxisAlignment: CrossAxisAlignment.start,
4848
children: [
49-
LogStatus(status: log.status, showIcon: true),
49+
if (log.status != null) LogStatus(status: log.status!, showIcon: true),
5050
const SizedBox(height: 10),
5151
SizedBox(
5252
child: Text(
@@ -102,7 +102,7 @@ class LogTile extends StatelessWidget {
102102
child: Column(
103103
crossAxisAlignment: CrossAxisAlignment.start,
104104
children: [
105-
LogStatus(status: log.status, showIcon: true),
105+
if (log.status != null) LogStatus(status: log.status!, showIcon: true),
106106
const SizedBox(height: 10),
107107
SizedBox(
108108
child: Text(

lib/screens/logs/logs.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class _LogsState extends State<Logs> {
136136
List<Log> tempLogs = logs != null ? [...logs] : [...logsList];
137137

138138
tempLogs = tempLogs.where((log) {
139-
if (statusSelected.contains(int.parse(log.status))) {
139+
if (log.status != null && statusSelected.contains(int.parse(log.status!))) {
140140
return true;
141141
}
142142
else {

lib/screens/servers/add_server_fullscreen.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,14 @@ class _AddServerFullscreenState extends State<AddServerFullscreen> {
222222
));
223223
}
224224
else {
225-
setState(() {
225+
if (mounted) {
226+
setState(() {
227+
isConnecting = false;
228+
});
229+
}
230+
else {
226231
isConnecting = false;
227-
});
232+
}
228233
if (result['result'] == 'socket') {
229234
showSnackBar(
230235
appConfigProvider: appConfigProvider,

lib/screens/servers/servers_tile_item.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class _ServersTileItemState extends State<ServersTileItem> with SingleTickerProv
115115
if (result['result'] == 'success') {
116116
await connectSuccess(result);
117117
}
118-
else {
118+
else if (mounted) {
119119
showSnackBar(
120120
appConfigProvider: appConfigProvider,
121121
label: AppLocalizations.of(context)!.cannotConnect,

0 commit comments

Comments
 (0)