mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-18 07:44:26 +01:00
Center title in SFTP/Apt
This commit is contained in:
@@ -3,4 +3,4 @@ import 'dart:typed_data';
|
|||||||
|
|
||||||
extension Uint8ListX on Future<Uint8List> {
|
extension Uint8ListX on Future<Uint8List> {
|
||||||
Future<String> get string async => utf8.decode(await this);
|
Future<String> get string async => utf8.decode(await this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class DockerPsItem {
|
|||||||
List<String> parts = rawString.split(' ');
|
List<String> parts = rawString.split(' ');
|
||||||
parts.removeWhere((element) => element.isEmpty);
|
parts.removeWhere((element) => element.isEmpty);
|
||||||
parts = parts.map((e) => e.trim()).toList();
|
parts = parts.map((e) => e.trim()).toList();
|
||||||
|
|
||||||
containerId = parts[0];
|
containerId = parts[0];
|
||||||
image = parts[1];
|
image = parts[1];
|
||||||
command = parts[2].trim();
|
command = parts[2].trim();
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
class BuildData {
|
class BuildData {
|
||||||
static const String name = "ServerBox";
|
static const String name = "ServerBox";
|
||||||
static const int build = 102;
|
static const int build = 106;
|
||||||
static const String engine =
|
static const String engine =
|
||||||
"Flutter 2.10.3 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision 7e9793dee1 (5 days ago) • 2022-03-02 11:23:12 -0600\nEngine • revision bd539267b4\nTools • Dart 2.16.1 • DevTools 2.9.2\n";
|
"Flutter 2.10.3 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision 7e9793dee1 (6 days ago) • 2022-03-02 11:23:12 -0600\nEngine • revision bd539267b4\nTools • Dart 2.16.1 • DevTools 2.9.2\n";
|
||||||
static const String buildAt = "2022-03-07 19:19:07.115966";
|
static const String buildAt = "2022-03-08 18:06:40.014600";
|
||||||
static const int modifications = 18;
|
static const int modifications = 8;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ class _AptManagePageState extends State<AptManagePage>
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
centerTitle: true,
|
||||||
title: TwoLineText(up: 'Apt', down: widget.spi.ip),
|
title: TwoLineText(up: 'Apt', down: widget.spi.ip),
|
||||||
actions: [
|
actions: [
|
||||||
IconButton(
|
IconButton(
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ class _DockerManagePageState extends State<DockerManagePage> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
centerTitle: true,
|
||||||
title: TwoLineText(up: 'Docker', down: widget.spi.ip),
|
title: TwoLineText(up: 'Docker', down: widget.spi.ip),
|
||||||
),
|
),
|
||||||
body: _buildMain(),
|
body: _buildMain(),
|
||||||
@@ -125,7 +126,9 @@ class _DockerManagePageState extends State<DockerManagePage> {
|
|||||||
return ListTile(
|
return ListTile(
|
||||||
title: Text(item.image),
|
title: Text(item.image),
|
||||||
subtitle: Text(item.status),
|
subtitle: Text(item.status),
|
||||||
trailing: docker.isBusy ? const CircularProgressIndicator() : _buildMoreBtn(item.running, item.containerId),
|
trailing: docker.isBusy
|
||||||
|
? const CircularProgressIndicator()
|
||||||
|
: _buildMoreBtn(item.running, item.containerId),
|
||||||
);
|
);
|
||||||
}).toList(),
|
}).toList(),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -195,8 +195,8 @@ class _SFTPPageState extends State<SFTPPage> {
|
|||||||
]);
|
]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_status.client!.mkdir(
|
_status.client!
|
||||||
_status.path!.path + '/' + textController.text);
|
.mkdir(_status.path!.path + '/' + textController.text);
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
listDir();
|
listDir();
|
||||||
},
|
},
|
||||||
@@ -234,8 +234,7 @@ class _SFTPPageState extends State<SFTPPage> {
|
|||||||
]);
|
]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await _status
|
await _status.client!
|
||||||
.client!
|
|
||||||
.rename(file.filename, textController.text);
|
.rename(file.filename, textController.text);
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
listDir();
|
listDir();
|
||||||
@@ -270,9 +269,8 @@ class _SFTPPageState extends State<SFTPPage> {
|
|||||||
final sftpc = await client.sftp();
|
final sftpc = await client.sftp();
|
||||||
_status.client = sftpc;
|
_status.client = sftpc;
|
||||||
}
|
}
|
||||||
final fs = await _status
|
final fs =
|
||||||
.client!
|
await _status.client!.listdir(path ?? (_status.path?.path ?? '/'));
|
||||||
.listdir(path ?? (_status.path?.path ?? '/'));
|
|
||||||
fs.sort((a, b) => a.filename.compareTo(b.filename));
|
fs.sort((a, b) => a.filename.compareTo(b.filename));
|
||||||
fs.removeAt(0);
|
fs.removeAt(0);
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
@@ -339,7 +337,7 @@ class _SFTPPageState extends State<SFTPPage> {
|
|||||||
_status.selected = true;
|
_status.selected = true;
|
||||||
_status.path = AbsolutePath('/');
|
_status.path = AbsolutePath('/');
|
||||||
listDir(
|
listDir(
|
||||||
client: locator<ServerProvider>()
|
client: locator<ServerProvider>()
|
||||||
.servers
|
.servers
|
||||||
.firstWhere((s) => s.info == spi)
|
.firstWhere((s) => s.info == spi)
|
||||||
.client,
|
.client,
|
||||||
|
|||||||
@@ -1,17 +1,24 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class TwoLineText extends StatelessWidget {
|
class TwoLineText extends StatelessWidget {
|
||||||
const TwoLineText({Key? key, required this.up, required this.down}) : super(key: key);
|
const TwoLineText({Key? key, required this.up, required this.down})
|
||||||
|
: super(key: key);
|
||||||
final String up;
|
final String up;
|
||||||
final String down;
|
final String down;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
Text(up, style: const TextStyle(fontSize: 15),),
|
Text(
|
||||||
Text(down, style: const TextStyle(fontSize: 11),)
|
up,
|
||||||
],
|
style: const TextStyle(fontSize: 15),
|
||||||
);
|
),
|
||||||
|
Text(
|
||||||
|
down,
|
||||||
|
style: const TextStyle(fontSize: 11),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -335,6 +335,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.11"
|
version: "0.12.11"
|
||||||
|
material_color_utilities:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: material_color_utilities
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.1.3"
|
||||||
meta:
|
meta:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -521,7 +528,7 @@ packages:
|
|||||||
name: test_api
|
name: test_api
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.4.3"
|
version: "0.4.8"
|
||||||
typed_data:
|
typed_data:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
Reference in New Issue
Block a user