-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add - doc - Added IFM for FTP (local/remote)
--- We've finally added an interactive file manager for FTP servers! It brings local/remote interaction. --- Type: add Breaking: False Doc Required: True Backport Required: False Part: 1/1
- Loading branch information
Showing
4 changed files
with
906 additions
and
2 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
public/Nitrocid.Addons/Nitrocid.Extras.FtpShell/FTP/Commands/Ifm.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// | ||
// Nitrocid KS Copyright (C) 2018-2025 Aptivi | ||
// | ||
// This file is part of Nitrocid KS | ||
// | ||
// Nitrocid KS is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Nitrocid KS is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY, without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
// | ||
|
||
using Terminaux.Inputs.Interactive; | ||
using Nitrocid.Shell.ShellBase.Commands; | ||
using Nitrocid.Files.Instances; | ||
using Nitrocid.Languages; | ||
using System; | ||
using Nitrocid.Extras.FtpShell.FTP.Interactive; | ||
using FluentFTP; | ||
|
||
namespace Nitrocid.Extras.FtpShell.FTP.Commands | ||
{ | ||
class IfmCommand : BaseCommand, ICommand | ||
{ | ||
|
||
public override int Execute(CommandParameters parameters, ref string variableValue) | ||
{ | ||
var tui = new FtpFileManagerCli(); | ||
tui.Bindings.Add(new InteractiveTuiBinding<FileSystemEntry, FtpListItem>(Translate.DoTranslation("Open"), ConsoleKey.Enter, (entry1, _, entry2, _) => tui.Open(entry1, entry2))); | ||
tui.Bindings.Add(new InteractiveTuiBinding<FileSystemEntry, FtpListItem>(Translate.DoTranslation("Copy"), ConsoleKey.F1, (entry1, _, entry2, _) => tui.CopyFileOrDir(entry1, entry2))); | ||
tui.Bindings.Add(new InteractiveTuiBinding<FileSystemEntry, FtpListItem>(Translate.DoTranslation("Move"), ConsoleKey.F2, (entry1, _, entry2, _) => tui.MoveFileOrDir(entry1, entry2))); | ||
tui.Bindings.Add(new InteractiveTuiBinding<FileSystemEntry, FtpListItem>(Translate.DoTranslation("Delete"), ConsoleKey.F3, (entry1, _, entry2, _) => tui.RemoveFileOrDir(entry1, entry2))); | ||
tui.Bindings.Add(new InteractiveTuiBinding<FileSystemEntry, FtpListItem>(Translate.DoTranslation("Up"), ConsoleKey.F4, (_, _, _, _) => tui.GoUp())); | ||
tui.Bindings.Add(new InteractiveTuiBinding<FileSystemEntry, FtpListItem>(Translate.DoTranslation("Info"), ConsoleKey.F5, (entry1, _, entry2, _) => tui.PrintFileSystemEntry(entry1, entry2))); | ||
tui.Bindings.Add(new InteractiveTuiBinding<FileSystemEntry, FtpListItem>(Translate.DoTranslation("Copy To"), ConsoleKey.F1, ConsoleModifiers.Shift, (entry1, _, entry2, _) => tui.CopyTo(entry1, entry2))); | ||
tui.Bindings.Add(new InteractiveTuiBinding<FileSystemEntry, FtpListItem>(Translate.DoTranslation("Move to"), ConsoleKey.F2, ConsoleModifiers.Shift, (entry1, _, entry2, _) => tui.MoveTo(entry1, entry2))); | ||
tui.Bindings.Add(new InteractiveTuiBinding<FileSystemEntry, FtpListItem>(Translate.DoTranslation("Rename"), ConsoleKey.F6, (entry1, _, entry2, _) => tui.Rename(entry1, entry2))); | ||
tui.Bindings.Add(new InteractiveTuiBinding<FileSystemEntry, FtpListItem>(Translate.DoTranslation("New Folder"), ConsoleKey.F7, (_, _, _, _) => tui.MakeDir())); | ||
InteractiveTuiTools.OpenInteractiveTui(tui); | ||
return 0; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.