package components import ( "context" "fmt" "time" ) type BackupFile struct { Name string Size string ModTime time.Time } type LogFile struct { Name string Size string ModTime time.Time Path string } type AdminToolsData struct { JobHistoryCount int DatabaseSize string LastBackupTime *time.Time BackupCount int SystemUptime string ActiveJobs int TotalConfigs int TotalJobs int TotalUsers int DatabasePath string BackupPath string MaintenanceMessage string BackupFiles []BackupFile LogFiles []LogFile LogContent string CurrentLogFile string EmailTestSuccess *bool EmailTestMessage string SmtpServer string } // Dialog component for confirmation dialogs templ Dialog(id string, title string, message string, confirmClass string, confirmText string, formId string, targetAction string) {
{ message }
{ message }
{ data.MaintenanceMessage }
Test your email configuration by sending a test email to verify the server can send emails properly.
Current SMTP server: { data.SmtpServer }
} else {Email settings are configured in your application configuration file. Make sure SMTP settings are properly configured before testing.
}GoMFT can send webhook notifications when jobs run. You can configure webhooks for individual jobs in the job edit form. Below is the format of the webhook payload:
{
"event_type": "job_execution",
"job_id": 123,
"job_name": "Daily Backup",
"config_id": 456,
"config_name": "Backup Config",
"status": "completed",
"start_time": "2023-06-18T15:30:45Z",
"end_time": "2023-06-18T15:35:12Z",
"duration_seconds": 267,
"history_id": 789,
"bytes_transferred": 1048576,
"files_transferred": 5,
"source": {
"type": "local",
"path": "/path/to/source"
},
"destination": {
"type": "s3",
"path": "bucket/path"
}
}
When configuring a webhook, you can optionally provide a secret key. This will be used to sign
the webhook payload with HMAC-SHA256. The signature is provided in the X-Hub-Signature-256 header.
| Property | Value |
|---|---|
| Method | POST |
| Content-Type | application/json |
| User-Agent | GoMFT-Webhook/1.0 |
| X-Hub-Signature-256 | HMAC SHA256 signature (if secret configured) |
| Custom Headers | Any additional headers specified in the job configuration |
Create a backup using the "Backup Database" button.
Select a log file to view its contents