mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 15:24:35 +01:00
#25 fix sftp rmdir
This commit is contained in:
@@ -152,6 +152,7 @@
|
||||
"stop": "Stop",
|
||||
"success": "Success",
|
||||
"sureDelete": "Are you sure to delete [{name}]?",
|
||||
"sureDirEmpty": "Make sure dir is empty.",
|
||||
"sureNoPwd": "Are you sure to use no password?",
|
||||
"sureToDeleteServer": "Are you sure to delete server [{server}]?",
|
||||
"termTheme": "Terminal theme",
|
||||
|
||||
@@ -152,6 +152,7 @@
|
||||
"stop": "停止",
|
||||
"success": "成功",
|
||||
"sureDelete": "确定删除[{name}]?",
|
||||
"sureDirEmpty": "请确保文件夹为空",
|
||||
"sureNoPwd": "确认使用无密码?",
|
||||
"sureToDeleteServer": "你确定要删除服务器 [{server}] 吗?",
|
||||
"termTheme": "终端主题",
|
||||
|
||||
@@ -326,18 +326,23 @@ class _SFTPPageState extends State<SFTPPage> {
|
||||
|
||||
void delete(BuildContext context, SftpName file) {
|
||||
Navigator.of(context).pop();
|
||||
final isDir = file.attr.isDirectory;
|
||||
showRoundDialog(
|
||||
context,
|
||||
_s.attention,
|
||||
Text(_s.sureDelete(file.filename)),
|
||||
Text('${_s.sureDelete(file.filename)}\n${isDir ? _s.sureDirEmpty : ''}'),
|
||||
[
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
child: const Text('Cancel'),
|
||||
child: Text(_s.cancel),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
_status.client!.remove(file.filename);
|
||||
onPressed: () async {
|
||||
if (file.attr.isDirectory) {
|
||||
await _status.client!.rmdir(file.filename);
|
||||
} else {
|
||||
await _status.client!.remove(file.filename);
|
||||
}
|
||||
Navigator.of(context).pop();
|
||||
listDir();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user