Skip to content

Commit

Permalink
opt.: debug page copy logs
Browse files Browse the repository at this point in the history
  • Loading branch information
lollipopkit committed Jul 28, 2024
1 parent c90d0e4 commit 969643d
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 21 deletions.
7 changes: 1 addition & 6 deletions lib/core/route.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:flutter/material.dart';
import 'package:server_box/data/model/server/private_key_info.dart';
import 'package:server_box/data/model/server/server_private_info.dart';
import 'package:server_box/data/res/build_data.dart';
import 'package:server_box/data/res/provider.dart';
import 'package:server_box/data/res/store.dart';
import 'package:server_box/view/page/backup.dart';
import 'package:server_box/view/page/container.dart';
Expand Down Expand Up @@ -157,11 +156,7 @@ class AppRoutes {
return AppRoutes(
DebugPage(
key: key,
args: DebugPageArgs(
notifier: Pros.debug.widgets,
onClear: Pros.debug.clear,
title: 'Logs(${BuildData.build})',
),
args: const DebugPageArgs(title: 'Logs(${BuildData.build})'),
),
'debug',
);
Expand Down
2 changes: 0 additions & 2 deletions lib/data/res/provider.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:fl_lib/fl_lib.dart';
import 'package:server_box/data/provider/app.dart';
import 'package:server_box/data/provider/private_key.dart';
import 'package:server_box/data/provider/server.dart';
Expand All @@ -7,7 +6,6 @@ import 'package:server_box/data/provider/snippet.dart';

abstract final class Pros {
static final app = AppProvider();
static final debug = DebugProvider(maxLines: 177);
static final key = PrivateKeyProvider();
static final server = ServerProvider();
static final sftp = SftpProvider();
Expand Down
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Future<void> _initData() async {
void _setupDebug() {
Logger.root.level = Level.ALL;
Logger.root.onRecord.listen((record) {
Pros.debug.addLog(record);
DebugProvider.addLog(record);
print(record);
if (record.error != null) print(record.error);
if (record.stackTrace != null) print(record.stackTrace);
Expand Down
8 changes: 6 additions & 2 deletions lib/view/page/server/detail/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,19 @@ class _ServerDetailPageState extends State<ServerDetailPage>
}

Widget _buildCpuModelItem(MapEntry<String, int> e) {
final name = e.key
.replaceFirst('Intel(R)', '')
.replaceFirst('AMD', '')
.replaceFirst('with Radeon Graphics', '');
final child = Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SizedBox(
width: _media.size.width * .7,
child: Text(
e.key,
name,
style: UIs.text13,
overflow: TextOverflow.fade,
overflow: TextOverflow.ellipsis,
maxLines: 1,
),
),
Expand Down
3 changes: 1 addition & 2 deletions lib/view/page/ssh/page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,7 @@ class SSHPageState extends State<SSHPage>
_terminal,
key: _termKey,
controller: _terminalController,
keyboardType:
letterCache ? TextInputType.text : TextInputType.visiblePassword,
keyboardType: TextInputType.text,
enableSuggestions: letterCache,
textStyle: _terminalStyle,
theme: _terminalTheme,
Expand Down
7 changes: 2 additions & 5 deletions lib/view/page/ssh/tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ final class _TabBar extends StatelessWidget implements PreferredSizeWidget {
textWidthBasis: TextWidthBasis.parent,
);
child = AnimatedContainer(
width: selected ? 90 : 50,
width: selected ? 90 : 57,
duration: Durations.medium3,
padding: selected ? const EdgeInsets.symmetric(horizontal: 7) : null,
curve: Curves.fastEaseInToSlowEaseOut,
Expand All @@ -290,10 +290,7 @@ final class _TabBar extends StatelessWidget implements PreferredSizeWidget {
SizedBox(width: 50, child: text),
],
),
false => Align(
alignment: Alignment.centerRight,
child: text,
),
false => Center(child: text),
},
);
}
Expand Down
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,8 @@ packages:
dependency: "direct main"
description:
path: "."
ref: "v1.0.96"
resolved-ref: "585ac0566cae83a54c035dc3346a80356e68e528"
ref: "v1.0.99"
resolved-ref: d2b9bb5093528cc014e8ddc0bcb70bf7fec16e99
url: "https://github.com/lppcg/fl_lib"
source: git
version: "0.0.1"
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ dependencies:
fl_lib:
git:
url: https://github.com/lppcg/fl_lib
ref: v1.0.96
ref: v1.0.99

dependency_overrides:
# dartssh2:
Expand Down

0 comments on commit 969643d

Please sign in to comment.