diff options
| author | Bobby <[email protected]> | 2026-03-07 18:42:40 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2026-03-07 18:42:40 +0530 |
| commit | 96c136f046d78c51210927e61483a36a220fedcb (patch) | |
| tree | 8f5baf294d92ec3bc503bd02f4a08871874f048d /services/overview.go | |
| parent | 6bc2ef7a8972547f10a5a8f50269b0e6b487a580 (diff) | |
| download | dove-96c136f046d78c51210927e61483a36a220fedcb.tar.xz dove-96c136f046d78c51210927e61483a36a220fedcb.zip | |
Refactor dashboard and mailboxes pages to integrate services for data retrieval
- Updated `Dashboard` function to use `services.Overview()` for rendering overview data.
- Enhanced `Mailboxes` function to include pagination, sorting, and search functionality using `services.ListMailboxes()`.
- Modified `Users` function to implement pagination, sorting, and search with `services.ListUsers()`.
Revamped templates for mailboxes and users
- Updated `mailboxes.htmx.django` to display mailbox items dynamically with total count.
- Enhanced `users.htmx.django` to show user details and total count, with improved layout for user information.
Introduced new response types and constants
- Added `PaginatedResponse` type in `types/response.go` for consistent pagination responses.
- Introduced constants for pagination in `utils/meta/constants.go`.
Implemented email processing and storage services
- Created `services/email.go` for processing incoming emails and storing them in the database.
- Added email parsing utilities in `utils/email` for handling email content and attachments.
Established repository functions for mailboxes, users, and emails
- Created repository functions in `repositories` for managing mailboxes, users, and emails, including listing and searching capabilities.
Refactored SMTP server functions
- Updated SMTP server handling in `utils/smtp` to streamline session management and message processing.
- Removed obsolete storage functions and integrated email processing directly into the SMTP session.
Added new message constants for better logging and error handling
- Introduced message constants in `messages/email.go` and `messages/mailbox.go` for improved clarity in logs.
Diffstat (limited to 'services/overview.go')
| -rw-r--r-- | services/overview.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/services/overview.go b/services/overview.go new file mode 100644 index 0000000..d0d3f60 --- /dev/null +++ b/services/overview.go @@ -0,0 +1,16 @@ +package services + +import ( + "dove/config" + "dove/repositories" + "dove/types" + "fmt" +) + +func Overview() types.Overview { + return types.Overview{ + MailboxCount: repositories.CountMailboxes(), + EmailCount: repositories.CountEmails(), + SMTPAddress: fmt.Sprintf(":%d", config.SMTP.Port), + } +} |
