feat: add JoeAppEngine OPC UA nodes, fix DCL auto-reconnect and quality push
- Add JoeAppEngine folder to OPC UA nodes.json (BTCS, AlarmCntsBySeverity, Scheduler/ScanTime) - Fix DataConnectionActor: capture Self in PreStart for use from non-actor threads, preventing Self.Tell failure in Disconnected event handler - Implement InstanceActor.HandleConnectionQualityChanged to mark attributes Bad on disconnect - Fix LmxFakeProxy TagMapper to serialize arrays as JSON instead of "System.Int32[]" - Allow DataType and DataSourceReference updates in TemplateService.UpdateAttributeAsync - Update test_infra_opcua.md with JoeAppEngine documentation
This commit is contained in:
@@ -6,21 +6,21 @@ namespace ScadaLink.CLI.Commands;
|
||||
|
||||
public static class NotificationCommands
|
||||
{
|
||||
public static Command Build(Option<string> contactPointsOption, Option<string> formatOption)
|
||||
public static Command Build(Option<string> contactPointsOption, Option<string> formatOption, Option<string> usernameOption, Option<string> passwordOption)
|
||||
{
|
||||
var command = new Command("notification") { Description = "Manage notification lists" };
|
||||
|
||||
command.Add(BuildList(contactPointsOption, formatOption));
|
||||
command.Add(BuildGet(contactPointsOption, formatOption));
|
||||
command.Add(BuildCreate(contactPointsOption, formatOption));
|
||||
command.Add(BuildUpdate(contactPointsOption, formatOption));
|
||||
command.Add(BuildDelete(contactPointsOption, formatOption));
|
||||
command.Add(BuildSmtp(contactPointsOption, formatOption));
|
||||
command.Add(BuildList(contactPointsOption, formatOption, usernameOption, passwordOption));
|
||||
command.Add(BuildGet(contactPointsOption, formatOption, usernameOption, passwordOption));
|
||||
command.Add(BuildCreate(contactPointsOption, formatOption, usernameOption, passwordOption));
|
||||
command.Add(BuildUpdate(contactPointsOption, formatOption, usernameOption, passwordOption));
|
||||
command.Add(BuildDelete(contactPointsOption, formatOption, usernameOption, passwordOption));
|
||||
command.Add(BuildSmtp(contactPointsOption, formatOption, usernameOption, passwordOption));
|
||||
|
||||
return command;
|
||||
}
|
||||
|
||||
private static Command BuildGet(Option<string> contactPointsOption, Option<string> formatOption)
|
||||
private static Command BuildGet(Option<string> contactPointsOption, Option<string> formatOption, Option<string> usernameOption, Option<string> passwordOption)
|
||||
{
|
||||
var idOption = new Option<int>("--id") { Description = "Notification list ID", Required = true };
|
||||
var cmd = new Command("get") { Description = "Get a notification list by ID" };
|
||||
@@ -29,12 +29,12 @@ public static class NotificationCommands
|
||||
{
|
||||
var id = result.GetValue(idOption);
|
||||
return await CommandHelpers.ExecuteCommandAsync(
|
||||
result, contactPointsOption, formatOption, new GetNotificationListCommand(id));
|
||||
result, contactPointsOption, formatOption, usernameOption, passwordOption, new GetNotificationListCommand(id));
|
||||
});
|
||||
return cmd;
|
||||
}
|
||||
|
||||
private static Command BuildUpdate(Option<string> contactPointsOption, Option<string> formatOption)
|
||||
private static Command BuildUpdate(Option<string> contactPointsOption, Option<string> formatOption, Option<string> usernameOption, Option<string> passwordOption)
|
||||
{
|
||||
var idOption = new Option<int>("--id") { Description = "Notification list ID", Required = true };
|
||||
var nameOption = new Option<string>("--name") { Description = "List name", Required = true };
|
||||
@@ -51,13 +51,13 @@ public static class NotificationCommands
|
||||
var emailsRaw = result.GetValue(emailsOption)!;
|
||||
var emails = emailsRaw.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries).ToList();
|
||||
return await CommandHelpers.ExecuteCommandAsync(
|
||||
result, contactPointsOption, formatOption,
|
||||
result, contactPointsOption, formatOption, usernameOption, passwordOption,
|
||||
new UpdateNotificationListCommand(id, name, emails));
|
||||
});
|
||||
return cmd;
|
||||
}
|
||||
|
||||
private static Command BuildSmtp(Option<string> contactPointsOption, Option<string> formatOption)
|
||||
private static Command BuildSmtp(Option<string> contactPointsOption, Option<string> formatOption, Option<string> usernameOption, Option<string> passwordOption)
|
||||
{
|
||||
var group = new Command("smtp") { Description = "Manage SMTP configuration" };
|
||||
|
||||
@@ -65,7 +65,7 @@ public static class NotificationCommands
|
||||
listCmd.SetAction(async (ParseResult result) =>
|
||||
{
|
||||
return await CommandHelpers.ExecuteCommandAsync(
|
||||
result, contactPointsOption, formatOption, new ListSmtpConfigsCommand());
|
||||
result, contactPointsOption, formatOption, usernameOption, passwordOption, new ListSmtpConfigsCommand());
|
||||
});
|
||||
group.Add(listCmd);
|
||||
|
||||
@@ -88,7 +88,7 @@ public static class NotificationCommands
|
||||
var authMode = result.GetValue(authModeOption)!;
|
||||
var from = result.GetValue(fromOption)!;
|
||||
return await CommandHelpers.ExecuteCommandAsync(
|
||||
result, contactPointsOption, formatOption,
|
||||
result, contactPointsOption, formatOption, usernameOption, passwordOption,
|
||||
new UpdateSmtpConfigCommand(id, server, port, authMode, from));
|
||||
});
|
||||
group.Add(updateCmd);
|
||||
@@ -96,18 +96,18 @@ public static class NotificationCommands
|
||||
return group;
|
||||
}
|
||||
|
||||
private static Command BuildList(Option<string> contactPointsOption, Option<string> formatOption)
|
||||
private static Command BuildList(Option<string> contactPointsOption, Option<string> formatOption, Option<string> usernameOption, Option<string> passwordOption)
|
||||
{
|
||||
var cmd = new Command("list") { Description = "List all notification lists" };
|
||||
cmd.SetAction(async (ParseResult result) =>
|
||||
{
|
||||
return await CommandHelpers.ExecuteCommandAsync(
|
||||
result, contactPointsOption, formatOption, new ListNotificationListsCommand());
|
||||
result, contactPointsOption, formatOption, usernameOption, passwordOption, new ListNotificationListsCommand());
|
||||
});
|
||||
return cmd;
|
||||
}
|
||||
|
||||
private static Command BuildCreate(Option<string> contactPointsOption, Option<string> formatOption)
|
||||
private static Command BuildCreate(Option<string> contactPointsOption, Option<string> formatOption, Option<string> usernameOption, Option<string> passwordOption)
|
||||
{
|
||||
var nameOption = new Option<string>("--name") { Description = "Notification list name", Required = true };
|
||||
var emailsOption = new Option<string>("--emails") { Description = "Comma-separated recipient emails", Required = true };
|
||||
@@ -121,13 +121,13 @@ public static class NotificationCommands
|
||||
var emailsRaw = result.GetValue(emailsOption)!;
|
||||
var emails = emailsRaw.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries).ToList();
|
||||
return await CommandHelpers.ExecuteCommandAsync(
|
||||
result, contactPointsOption, formatOption,
|
||||
result, contactPointsOption, formatOption, usernameOption, passwordOption,
|
||||
new CreateNotificationListCommand(name, emails));
|
||||
});
|
||||
return cmd;
|
||||
}
|
||||
|
||||
private static Command BuildDelete(Option<string> contactPointsOption, Option<string> formatOption)
|
||||
private static Command BuildDelete(Option<string> contactPointsOption, Option<string> formatOption, Option<string> usernameOption, Option<string> passwordOption)
|
||||
{
|
||||
var idOption = new Option<int>("--id") { Description = "Notification list ID", Required = true };
|
||||
var cmd = new Command("delete") { Description = "Delete a notification list" };
|
||||
@@ -136,7 +136,7 @@ public static class NotificationCommands
|
||||
{
|
||||
var id = result.GetValue(idOption);
|
||||
return await CommandHelpers.ExecuteCommandAsync(
|
||||
result, contactPointsOption, formatOption, new DeleteNotificationListCommand(id));
|
||||
result, contactPointsOption, formatOption, usernameOption, passwordOption, new DeleteNotificationListCommand(id));
|
||||
});
|
||||
return cmd;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user