#64 opt. for process page

This commit is contained in:
lollipopkit
2023-06-27 12:27:16 +08:00
parent 0022294ea4
commit 9ffe5583fd
10 changed files with 35 additions and 27 deletions

View File

@@ -28,7 +28,7 @@ class _ProcessPageState extends State<ProcessPage> {
PsResult _result = PsResult(procs: []);
int? _lastFocusId;
ProcSortMode _procSortMode = ProcSortMode.cpu;
ProcSortMode _procSortMode = ProcSortMode.mem;
final _serverProvider = locator<ServerProvider>();
@@ -121,10 +121,10 @@ class _ProcessPageState extends State<ProcessPage> {
return RoundRectCard(ListTile(
leading: SizedBox(
width: 57,
child: TwoLineText(up: proc.pid.toString(), down: 'pid'),
child: TwoLineText(up: proc.pid.toString(), down: proc.user),
),
title: Text(proc.binary),
subtitle: Text(proc.command, style: grey),
subtitle: Text(proc.command, style: grey, maxLines: 3, overflow: TextOverflow.fade,),
trailing: Row(
mainAxisSize: MainAxisSize.min,
children: [

View File

@@ -80,7 +80,7 @@ class _SSHPageState extends State<SSHPage> {
_terminalTheme = _isDark ? termDarkTheme : termLightTheme;
// Calculate virtkey width / height
_virtKeyWidth = _media.size.width / 7;
_virtKeysHeight = _media.size.height * 0.047 * _virtKeysList.length;
_virtKeysHeight = _media.size.height * 0.043 * _virtKeysList.length;
}
@override

View File

@@ -34,7 +34,11 @@ class _SSHVirtKeySettingPageState extends State<SSHVirtKeySettingPage> {
}
Widget _buildBody() {
final keys = List<VirtKey>.from(_setting.sshVirtKeys.fetch()!);
final keys_ = _setting.sshVirtKeys.fetchRaw()!;
final keys = <VirtKey>[];
for (final key in keys_) {
keys.add(key);
}
final disabled = VirtKey.values.where((e) => !keys.contains(e)).toList();
final allKeys = [...keys, ...disabled];
return ReorderableListView.builder(
@@ -55,9 +59,7 @@ class _SSHVirtKeySettingPageState extends State<SSHVirtKeySettingPage> {
return;
}
keys.moveById(keys[o], keys[n], _setting.sshVirtKeys);
setState(() {
});
setState(() {});
},
);
}