chore(ui): Move some field definitions server side

This commit is contained in:
Richard Palethorpe
2025-03-26 15:56:14 +00:00
parent 7fb99ecf21
commit 319caf8e91
62 changed files with 1534 additions and 1574 deletions

View File

@@ -6,6 +6,7 @@ import (
"net/smtp"
"github.com/mudler/LocalAgent/core/types"
"github.com/mudler/LocalAgent/pkg/config"
"github.com/sashabaranov/go-openai/jsonschema"
)
@@ -80,3 +81,45 @@ func (a *SendMailAction) Definition() types.ActionDefinition {
func (a *SendMailAction) Plannable() bool {
return true
}
// SendMailConfigMeta returns the metadata for SendMail action configuration fields
func SendMailConfigMeta() []config.Field {
return []config.Field{
{
Name: "smtpHost",
Label: "SMTP Host",
Type: config.FieldTypeText,
Required: true,
HelpText: "SMTP server host (e.g., smtp.gmail.com)",
},
{
Name: "smtpPort",
Label: "SMTP Port",
Type: config.FieldTypeText,
Required: true,
DefaultValue: "587",
HelpText: "SMTP server port (e.g., 587)",
},
{
Name: "username",
Label: "SMTP Username",
Type: config.FieldTypeText,
Required: true,
HelpText: "SMTP username/email address",
},
{
Name: "password",
Label: "SMTP Password",
Type: config.FieldTypeText,
Required: true,
HelpText: "SMTP password or app password",
},
{
Name: "email",
Label: "From Email",
Type: config.FieldTypeText,
Required: true,
HelpText: "Sender email address",
},
}
}