feat: make Windows Agent configuration GUI-only
Build web service image / build (push) Successful in 40s
Build web service image / build (push) Successful in 40s
This commit is contained in:
@@ -9,6 +9,8 @@ internal static class RemoteCliCommands
|
||||
{
|
||||
if (args.Length < 3)
|
||||
throw Invalid("Remote commands require a group and action.");
|
||||
if (IsConfigurationCommand(args))
|
||||
throw Invalid("Windows Agent configuration is GUI-only; double-click WxAgent.Tray.exe and use 服务设置... .");
|
||||
var configPath = Path.GetFullPath(Required(args, "--config"));
|
||||
var group = args[1];
|
||||
var action = args[2];
|
||||
@@ -193,6 +195,13 @@ internal static class RemoteCliCommands
|
||||
return new { saved = path, accountId = Mask(accountId), chatId = Mask(chatId), type, reporting.ConfigVersion };
|
||||
}
|
||||
|
||||
private static bool IsConfigurationCommand(string[] args) => (args[1], args[2]) switch
|
||||
{
|
||||
("auth", "set" or "clear") => true,
|
||||
("reporting", "enable" or "disable" or "account-add" or "account-enable" or "account-disable" or "allow" or "deny") => true,
|
||||
_ => false
|
||||
};
|
||||
|
||||
private static ReportingChatType ParseChatType(string value) => value.ToLowerInvariant() switch
|
||||
{
|
||||
"group" => ReportingChatType.Group,
|
||||
|
||||
Reference in New Issue
Block a user