Update Program.cs
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
This commit is contained in:
34
Program.cs
34
Program.cs
@@ -491,39 +491,39 @@ namespace domain_utility
|
|||||||
BackToMenu(DisableKdeWallet);
|
BackToMenu(DisableKdeWallet);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class MenuClass
|
private class MenuItem
|
||||||
{
|
{
|
||||||
public string Name { get; }
|
public string Name { get; }
|
||||||
public Action Executor { get; }
|
public Action Executor { get; }
|
||||||
|
|
||||||
public MenuClass(string _name, Action _executor)
|
public MenuItem(string _name, Action _executor)
|
||||||
{
|
{
|
||||||
Name = _name;
|
Name = _name;
|
||||||
Executor = _executor;
|
Executor = _executor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static readonly MenuClass[] availableOptions = new[]
|
static readonly MenuItem[] availableOptions = new[]
|
||||||
{
|
{
|
||||||
new MenuClass("ping компьютера", () => StartPing()),
|
new MenuItem("ping компьютера", () => StartPing()),
|
||||||
new MenuClass("удаленный доступ к компьютеру", () => StartRDPConnection()),
|
new MenuItem("удаленный доступ к компьютеру", () => StartRDPConnection()),
|
||||||
new MenuClass("посмотреть информацию о пользователе", () => ShowDomainUserInfo()),
|
new MenuItem("посмотреть информацию о пользователе", () => ShowDomainUserInfo()),
|
||||||
new MenuClass("посмотреть дату последней загрузки компьютера", () => ShowComputerBootupTime()),
|
new MenuItem("посмотреть дату последней загрузки компьютера", () => ShowComputerBootupTime()),
|
||||||
new MenuClass("удаленная перезагрузка компьютера", () => RemoteRebootWindows()),
|
new MenuItem("удаленная перезагрузка компьютера", () => RemoteRebootWindows()),
|
||||||
new MenuClass("открыть CUPS выбранного компьютера (Linux)", () => OpenComputerCups()),
|
new MenuItem("открыть CUPS выбранного компьютера (Linux)", () => OpenComputerCups()),
|
||||||
new MenuClass("выполнить команду через SSH (Linux)", () => ExecuteCustomCommandViaSSH()),
|
new MenuItem("выполнить команду через SSH (Linux)", () => ExecuteCustomCommandViaSSH()),
|
||||||
new MenuClass("изменить время обновления conky с 0.5 на 300 (Linux)", () => FixConky()),
|
new MenuItem("изменить время обновления conky с 0.5 на 300 (Linux)", () => FixConky()),
|
||||||
new MenuClass("удаленная перезагрузка компьютера (Linux)", () => RemoteRebootLinux()),
|
new MenuItem("удаленная перезагрузка компьютера (Linux)", () => RemoteRebootLinux()),
|
||||||
new MenuClass("посмотреть время работы компьютера (Linux)", () => ShowLinuxComputerBootupTime()),
|
new MenuItem("посмотреть время работы компьютера (Linux)", () => ShowLinuxComputerBootupTime()),
|
||||||
new MenuClass("сменить пароль для 802.1x (Linux)", () => ChangeRemote802Password()),
|
new MenuItem("сменить пароль для 802.1x (Linux)", () => ChangeRemote802Password()),
|
||||||
new MenuClass("отключить KDE кошелек (Linux)", () => DisableKdeWallet()),
|
new MenuItem("отключить KDE кошелек (Linux)", () => DisableKdeWallet()),
|
||||||
};
|
};
|
||||||
|
|
||||||
static void Menu()
|
static void Menu()
|
||||||
{
|
{
|
||||||
Console.Clear();
|
Console.Clear();
|
||||||
var choice = AnsiConsole.Prompt(
|
MenuItem choice = AnsiConsole.Prompt(
|
||||||
new SelectionPrompt<MenuClass>()
|
new SelectionPrompt<MenuItem>()
|
||||||
.Title("Выберите действие:")
|
.Title("Выберите действие:")
|
||||||
.PageSize(15)
|
.PageSize(15)
|
||||||
//.MoreChoicesText("[grey](Move up and down to reveal more fruits)[/]")
|
//.MoreChoicesText("[grey](Move up and down to reveal more fruits)[/]")
|
||||||
|
|||||||
Reference in New Issue
Block a user