config: smtp,packages,json (1 files)

This commit is contained in:
Richard Ward
2025-12-30 19:15:51 +00:00
parent a72b44226c
commit 39b404c885

View File

@@ -1 +1,754 @@
[]
[
{
"id": "smtp_config_editor",
"type": "Card",
"name": "SMTPConfigEditor",
"description": "Form for SMTP server configuration with host, port, authentication, and encryption settings",
"props": {
"variant": "outlined",
"className": "smtp-config-editor"
},
"children": [
{
"id": "smtp_config_header",
"type": "Box",
"props": {
"sx": {
"p": 3,
"borderBottom": 1,
"borderColor": "divider"
}
},
"children": [
{
"id": "smtp_config_title",
"type": "Text",
"props": {
"variant": "h5",
"fontWeight": "bold",
"text": "SMTP Configuration"
},
"children": []
},
{
"id": "smtp_config_subtitle",
"type": "Text",
"props": {
"variant": "body2",
"color": "text.secondary",
"text": "Configure your outgoing email server settings"
},
"children": []
}
]
},
{
"id": "smtp_config_body",
"type": "Box",
"props": {
"sx": { "p": 3 }
},
"children": [
{
"id": "smtp_server_section",
"type": "Stack",
"props": {
"spacing": 3
},
"children": [
{
"id": "smtp_server_section_title",
"type": "Text",
"props": {
"variant": "subtitle1",
"fontWeight": "bold",
"text": "Server Settings"
},
"children": []
},
{
"id": "smtp_server_row",
"type": "Stack",
"props": {
"direction": "row",
"spacing": 2
},
"children": [
{
"id": "smtp_host_field",
"type": "TextField",
"props": {
"label": "SMTP Host",
"value": "{{state.config.host}}",
"onChange": "updateHost",
"placeholder": "smtp.example.com",
"required": true,
"fullWidth": true,
"disabled": "{{props.readonly}}",
"helperText": "SMTP server hostname or IP address"
},
"children": []
},
{
"id": "smtp_port_field",
"type": "TextField",
"props": {
"label": "Port",
"type": "number",
"value": "{{state.config.port}}",
"onChange": "updatePort",
"placeholder": "587",
"required": true,
"disabled": "{{props.readonly}}",
"helperText": "Common ports: 25, 465, 587",
"sx": { "minWidth": 120, "maxWidth": 150 }
},
"children": []
}
]
},
{
"id": "smtp_encryption_field",
"type": "Select",
"props": {
"label": "Encryption",
"value": "{{state.config.encryption}}",
"onChange": "updateEncryption",
"disabled": "{{props.readonly}}",
"fullWidth": true,
"options": [
{ "value": "none", "label": "None" },
{ "value": "tls", "label": "TLS" },
{ "value": "ssl", "label": "SSL" },
{ "value": "starttls", "label": "STARTTLS" }
],
"helperText": "Select the encryption method for secure connection"
},
"children": []
},
{
"id": "smtp_timeout_field",
"type": "TextField",
"props": {
"label": "Timeout (seconds)",
"type": "number",
"value": "{{state.config.timeout}}",
"onChange": "updateTimeout",
"placeholder": "30",
"disabled": "{{props.readonly}}",
"helperText": "Connection timeout in seconds",
"sx": { "maxWidth": 200 }
},
"children": []
}
]
},
{
"id": "smtp_auth_divider",
"type": "Divider",
"props": {
"sx": { "my": 3 }
},
"children": []
},
{
"id": "smtp_auth_section",
"type": "Stack",
"props": {
"spacing": 3
},
"children": [
{
"id": "smtp_auth_section_title",
"type": "Text",
"props": {
"variant": "subtitle1",
"fontWeight": "bold",
"text": "Authentication"
},
"children": []
},
{
"id": "smtp_auth_method_field",
"type": "Select",
"props": {
"label": "Authentication Method",
"value": "{{state.config.authMethod}}",
"onChange": "updateAuthMethod",
"disabled": "{{props.readonly}}",
"fullWidth": true,
"options": [
{ "value": "plain", "label": "Plain" },
{ "value": "login", "label": "Login" },
{ "value": "cram-md5", "label": "CRAM-MD5" },
{ "value": "oauth2", "label": "OAuth2" }
],
"helperText": "Select the authentication method supported by your server"
},
"children": []
},
{
"id": "smtp_username_field",
"type": "TextField",
"props": {
"label": "Username",
"value": "{{state.config.username}}",
"onChange": "updateUsername",
"placeholder": "user@example.com",
"required": true,
"fullWidth": true,
"disabled": "{{props.readonly}}",
"helperText": "SMTP authentication username"
},
"children": []
},
{
"id": "smtp_password_field",
"type": "TextField",
"props": {
"label": "Password",
"type": "password",
"value": "{{state.config.password}}",
"onChange": "updatePassword",
"placeholder": "••••••••",
"required": true,
"fullWidth": true,
"disabled": "{{props.readonly}}",
"helperText": "SMTP authentication password (stored encrypted)"
},
"children": []
}
]
},
{
"id": "smtp_sender_divider",
"type": "Divider",
"props": {
"sx": { "my": 3 }
},
"children": []
},
{
"id": "smtp_sender_section",
"type": "Stack",
"props": {
"spacing": 3
},
"children": [
{
"id": "smtp_sender_section_title",
"type": "Text",
"props": {
"variant": "subtitle1",
"fontWeight": "bold",
"text": "Sender Information"
},
"children": []
},
{
"id": "smtp_from_row",
"type": "Stack",
"props": {
"direction": "row",
"spacing": 2
},
"children": [
{
"id": "smtp_from_email_field",
"type": "TextField",
"props": {
"label": "From Email",
"value": "{{state.config.fromEmail}}",
"onChange": "updateFromEmail",
"placeholder": "noreply@example.com",
"required": true,
"fullWidth": true,
"disabled": "{{props.readonly}}",
"helperText": "Default sender email address"
},
"children": []
},
{
"id": "smtp_from_name_field",
"type": "TextField",
"props": {
"label": "From Name",
"value": "{{state.config.fromName}}",
"onChange": "updateFromName",
"placeholder": "My Application",
"required": true,
"fullWidth": true,
"disabled": "{{props.readonly}}",
"helperText": "Default sender display name"
},
"children": []
}
]
},
{
"id": "smtp_reply_to_field",
"type": "TextField",
"props": {
"label": "Reply-To Email",
"value": "{{state.config.replyTo}}",
"onChange": "updateReplyTo",
"placeholder": "support@example.com",
"fullWidth": true,
"disabled": "{{props.readonly}}",
"helperText": "Optional reply-to address (defaults to From Email if empty)"
},
"children": []
}
]
},
{
"id": "smtp_advanced_divider",
"type": "Divider",
"props": {
"sx": { "my": 3 }
},
"children": []
},
{
"id": "smtp_advanced_section",
"type": "Stack",
"props": {
"spacing": 2
},
"children": [
{
"id": "smtp_advanced_section_title",
"type": "Text",
"props": {
"variant": "subtitle1",
"fontWeight": "bold",
"text": "Advanced Settings"
},
"children": []
},
{
"id": "smtp_max_retries_field",
"type": "TextField",
"props": {
"label": "Max Retries",
"type": "number",
"value": "{{state.config.maxRetries}}",
"onChange": "updateMaxRetries",
"placeholder": "3",
"disabled": "{{props.readonly}}",
"helperText": "Maximum number of retry attempts on failure",
"sx": { "maxWidth": 200 }
},
"children": []
},
{
"id": "smtp_tls_toggle",
"type": "Box",
"props": {
"sx": {
"display": "flex",
"alignItems": "center",
"gap": 2
}
},
"children": [
{
"id": "smtp_verify_tls_switch",
"type": "Switch",
"props": {
"checked": "{{state.config.verifyTls}}",
"onChange": "toggleVerifyTls",
"disabled": "{{props.readonly}}"
},
"children": []
},
{
"id": "smtp_verify_tls_label",
"type": "Text",
"props": {
"variant": "body2",
"text": "Verify TLS Certificate"
},
"children": []
}
]
}
]
}
]
},
{
"id": "smtp_config_footer",
"type": "Box",
"props": {
"sx": {
"p": 3,
"borderTop": 1,
"borderColor": "divider",
"display": "flex",
"justifyContent": "flex-end",
"gap": 2
}
},
"children": [
{
"id": "smtp_cancel_button",
"type": "Button",
"props": {
"variant": "outlined",
"onClick": "onCancel",
"disabled": "{{!props.onCancel}}",
"text": "Cancel"
},
"children": []
},
{
"id": "smtp_save_button",
"type": "Button",
"props": {
"variant": "contained",
"color": "primary",
"onClick": "onSave",
"disabled": "{{props.readonly || !state.isValid}}",
"text": "Save Configuration"
},
"children": []
}
]
}
]
},
{
"id": "smtp_test_panel",
"type": "Card",
"name": "SMTPTestPanel",
"description": "Panel to test SMTP connection and send test emails",
"props": {
"variant": "outlined",
"className": "smtp-test-panel"
},
"children": [
{
"id": "smtp_test_header",
"type": "Box",
"props": {
"sx": {
"p": 3,
"borderBottom": 1,
"borderColor": "divider"
}
},
"children": [
{
"id": "smtp_test_title",
"type": "Text",
"props": {
"variant": "h6",
"fontWeight": "bold",
"text": "Test SMTP Connection"
},
"children": []
},
{
"id": "smtp_test_subtitle",
"type": "Text",
"props": {
"variant": "body2",
"color": "text.secondary",
"text": "Verify your SMTP configuration by testing the connection and sending a test email"
},
"children": []
}
]
},
{
"id": "smtp_test_body",
"type": "Box",
"props": {
"sx": { "p": 3 }
},
"children": [
{
"id": "smtp_test_status_alert",
"type": "Alert",
"props": {
"severity": "{{state.testResult.success ? 'success' : 'error'}}",
"visible": "{{state.testResult !== null}}",
"sx": { "mb": 3 }
},
"children": [
{
"id": "smtp_test_status_message",
"type": "Text",
"props": {
"text": "{{state.testResult.message}}"
},
"children": []
}
]
},
{
"id": "smtp_test_form",
"type": "Stack",
"props": {
"spacing": 3
},
"children": [
{
"id": "smtp_test_connection_section",
"type": "Box",
"props": {},
"children": [
{
"id": "smtp_test_connection_title",
"type": "Text",
"props": {
"variant": "subtitle2",
"fontWeight": "bold",
"text": "Connection Test",
"sx": { "mb": 2 }
},
"children": []
},
{
"id": "smtp_test_connection_button",
"type": "Button",
"props": {
"variant": "outlined",
"color": "primary",
"onClick": "testConnection",
"disabled": "{{state.isTesting}}",
"startIcon": "NetworkCheck",
"text": "{{state.isTesting ? 'Testing...' : 'Test Connection'}}"
},
"children": []
}
]
},
{
"id": "smtp_test_divider",
"type": "Divider",
"props": {},
"children": []
},
{
"id": "smtp_test_email_section",
"type": "Stack",
"props": {
"spacing": 2
},
"children": [
{
"id": "smtp_test_email_title",
"type": "Text",
"props": {
"variant": "subtitle2",
"fontWeight": "bold",
"text": "Send Test Email"
},
"children": []
},
{
"id": "smtp_test_recipient_field",
"type": "TextField",
"props": {
"label": "Recipient Email",
"value": "{{state.testEmail}}",
"onChange": "updateTestEmail",
"placeholder": "test@example.com",
"required": true,
"fullWidth": true,
"helperText": "Email address to send the test message to"
},
"children": []
},
{
"id": "smtp_test_subject_field",
"type": "TextField",
"props": {
"label": "Subject",
"value": "{{state.testSubject}}",
"onChange": "updateTestSubject",
"placeholder": "SMTP Test Email",
"fullWidth": true,
"helperText": "Subject line for the test email"
},
"children": []
},
{
"id": "smtp_test_body_field",
"type": "TextField",
"props": {
"label": "Message Body",
"value": "{{state.testBody}}",
"onChange": "updateTestBody",
"placeholder": "This is a test email from MetaBuilder.",
"multiline": true,
"rows": 4,
"fullWidth": true,
"helperText": "Content of the test email"
},
"children": []
},
{
"id": "smtp_send_test_button",
"type": "Button",
"props": {
"variant": "contained",
"color": "primary",
"onClick": "sendTestEmail",
"disabled": "{{state.isSending || !state.testEmail}}",
"startIcon": "Send",
"text": "{{state.isSending ? 'Sending...' : 'Send Test Email'}}"
},
"children": []
}
]
}
]
}
]
},
{
"id": "smtp_test_details",
"type": "Box",
"props": {
"visible": "{{state.testResult && state.testResult.details}}",
"sx": {
"p": 3,
"borderTop": 1,
"borderColor": "divider",
"backgroundColor": "action.hover"
}
},
"children": [
{
"id": "smtp_test_details_title",
"type": "Text",
"props": {
"variant": "subtitle2",
"fontWeight": "bold",
"text": "Connection Details",
"sx": { "mb": 2 }
},
"children": []
},
{
"id": "smtp_test_details_stack",
"type": "Stack",
"props": {
"spacing": 1
},
"children": [
{
"id": "smtp_test_detail_connected",
"type": "Box",
"props": {
"sx": { "display": "flex", "alignItems": "center", "gap": 1 }
},
"children": [
{
"id": "smtp_test_connected_icon",
"type": "Icon",
"props": {
"name": "{{state.testResult.details.connected ? 'CheckCircle' : 'Cancel'}}",
"color": "{{state.testResult.details.connected ? 'success' : 'error'}}",
"size": "small"
},
"children": []
},
{
"id": "smtp_test_connected_text",
"type": "Text",
"props": {
"variant": "body2",
"text": "Connection: {{state.testResult.details.connected ? 'Established' : 'Failed'}}"
},
"children": []
}
]
},
{
"id": "smtp_test_detail_authenticated",
"type": "Box",
"props": {
"sx": { "display": "flex", "alignItems": "center", "gap": 1 }
},
"children": [
{
"id": "smtp_test_auth_icon",
"type": "Icon",
"props": {
"name": "{{state.testResult.details.authenticated ? 'CheckCircle' : 'Cancel'}}",
"color": "{{state.testResult.details.authenticated ? 'success' : 'error'}}",
"size": "small"
},
"children": []
},
{
"id": "smtp_test_auth_text",
"type": "Text",
"props": {
"variant": "body2",
"text": "Authentication: {{state.testResult.details.authenticated ? 'Success' : 'Failed'}}"
},
"children": []
}
]
},
{
"id": "smtp_test_detail_tls",
"type": "Box",
"props": {
"sx": { "display": "flex", "alignItems": "center", "gap": 1 }
},
"children": [
{
"id": "smtp_test_tls_icon",
"type": "Icon",
"props": {
"name": "{{state.testResult.details.tlsEnabled ? 'Lock' : 'LockOpen'}}",
"color": "{{state.testResult.details.tlsEnabled ? 'success' : 'warning'}}",
"size": "small"
},
"children": []
},
{
"id": "smtp_test_tls_text",
"type": "Text",
"props": {
"variant": "body2",
"text": "TLS: {{state.testResult.details.tlsEnabled ? 'Enabled' : 'Disabled'}}"
},
"children": []
}
]
},
{
"id": "smtp_test_detail_duration",
"type": "Text",
"props": {
"variant": "body2",
"color": "text.secondary",
"text": "Response time: {{state.testResult.duration}}ms"
},
"children": []
},
{
"id": "smtp_test_detail_response",
"type": "Text",
"props": {
"variant": "caption",
"color": "text.secondary",
"text": "Server: {{state.testResult.details.serverResponse}}",
"sx": { "fontFamily": "monospace" }
},
"children": []
}
]
}
]
}
]
}
]