opt.: disk size (#252)
This commit is contained in:
@@ -193,8 +193,8 @@ class _PrivateKeyEditPageState extends State<PrivateKeyEditPage> {
|
||||
context.showSnackBar(
|
||||
l10n.fileTooLarge(
|
||||
path,
|
||||
size.convertBytes,
|
||||
Miscs.privateKeyMaxSize.convertBytes,
|
||||
size.bytes2Str,
|
||||
Miscs.privateKeyMaxSize.bytes2Str,
|
||||
),
|
||||
);
|
||||
return;
|
||||
|
||||
@@ -256,7 +256,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
||||
),
|
||||
UIs.width7,
|
||||
Text(
|
||||
'of ${(ss.mem.total * 1024).convertBytes}',
|
||||
'of ${(ss.mem.total * 1024).bytes2Str}',
|
||||
style: UIs.text13Grey,
|
||||
)
|
||||
],
|
||||
@@ -297,7 +297,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
||||
Text('${used.toStringAsFixed(0)}%', style: UIs.text27),
|
||||
UIs.width7,
|
||||
Text(
|
||||
'of ${(ss.swap.total * 1024).convertBytes} ',
|
||||
'of ${(ss.swap.total * 1024).bytes2Str} ',
|
||||
style: UIs.text13Grey,
|
||||
)
|
||||
],
|
||||
@@ -452,7 +452,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
||||
Widget _buildDiskItem(Disk disk, ServerStatus ss) {
|
||||
final (read, write) = ss.diskIO.getSpeed(disk.dev);
|
||||
final text = () {
|
||||
final use = '${disk.used} / ${disk.size}';
|
||||
final use = '${disk.used.kb2Str} / ${disk.size.kb2Str}';
|
||||
if (read == null || write == null) return use;
|
||||
return '$use\n${l10n.read} $read | ${l10n.write} $write';
|
||||
}();
|
||||
|
||||
@@ -182,7 +182,7 @@ class _LocalStoragePageState extends State<LocalStoragePage> {
|
||||
title: Text(fileName),
|
||||
subtitle: isDir
|
||||
? null
|
||||
: Text(stat.size.convertBytes, style: UIs.textGrey),
|
||||
: Text(stat.size.bytes2Str, style: UIs.textGrey),
|
||||
trailing: Text(
|
||||
stat.modified
|
||||
.toString()
|
||||
|
||||
@@ -304,7 +304,7 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
|
||||
subtitle: isDir
|
||||
? null
|
||||
: Text(
|
||||
(file.attr.size ?? 0).convertBytes,
|
||||
(file.attr.size ?? 0).bytes2Str,
|
||||
style: UIs.textGrey,
|
||||
),
|
||||
onTap: () {
|
||||
|
||||
@@ -94,7 +94,7 @@ class _SftpMissionPageState extends State<SftpMissionPage> {
|
||||
);
|
||||
case SftpWorkerStatus.loading:
|
||||
final percentStr = (status.progress ?? 0.0).toStringAsFixed(2);
|
||||
final size = (status.size ?? 0).convertBytes;
|
||||
final size = (status.size ?? 0).bytes2Str;
|
||||
return _wrapInCard(
|
||||
status: status,
|
||||
subtitle: l10n.percentOfSize(percentStr, size),
|
||||
|
||||
Reference in New Issue
Block a user