[PR #26] [MERGED] Feat/display backup size #140

Closed
opened 2026-02-26 21:34:38 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/eduardolat/pgbackweb/pull/26
Author: @julien-wff
Created: 8/11/2024
Status: Merged
Merged: 8/12/2024
Merged by: @eduardolat

Base: mainHead: Feat/display-backup-size


📝 Commits (5)

  • 03604df Add file_size field to execution table
  • 8e149cf Save file_size
  • 4881f04 Specify the unit of size
  • 94759c6 Add component to display file size
  • 3df6d96 Add file size display on execution list and popup

📊 Changes

11 files changed (+132 additions, -13 deletions)

View changed files

internal/database/migrations/20240811205655_add_file_size_to_executions_table.sql (+9 -0)
📝 internal/integration/storage/local.go (+12 -5)
📝 internal/integration/storage/s3.go (+16 -5)
📝 internal/service/executions/run_execution.go (+4 -2)
📝 internal/service/executions/update_execution.sql (+2 -1)
internal/util/strutil/format_file_size.go (+22 -0)
internal/util/strutil/format_file_size_test.go (+29 -0)
internal/view/web/component/pretty_file_size.go (+24 -0)
📝 internal/view/web/dashboard/executions/index.go (+1 -0)
📝 internal/view/web/dashboard/executions/list_executions.go (+6 -0)
📝 internal/view/web/dashboard/executions/show_execution.go (+7 -0)

📄 Description

Hi there!

Thank you very much for making this piece of software. A GUI database backup project has been on my todo list for a long time, but I'll use yours since it's pretty good!

When using pgbackweb, I wished the size of the backups would be displayed, so I made it. Hope you think it fits the project!

Since I don't think we can't get the size of an io.Reader without consuming the stream, I had to pull the file size from the destinations. I just returned a simple int64, but I wonder if a struct with a single field would not be better for code sustainability.

image
image

Backups prior to this PR simply won't have a display size


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/eduardolat/pgbackweb/pull/26 **Author:** [@julien-wff](https://github.com/julien-wff) **Created:** 8/11/2024 **Status:** ✅ Merged **Merged:** 8/12/2024 **Merged by:** [@eduardolat](https://github.com/eduardolat) **Base:** `main` ← **Head:** `Feat/display-backup-size` --- ### 📝 Commits (5) - [`03604df`](https://github.com/eduardolat/pgbackweb/commit/03604dfd53148bd0959b954b5dc1be1ce59015ec) Add file_size field to execution table - [`8e149cf`](https://github.com/eduardolat/pgbackweb/commit/8e149cf4d51c721da838ef2f176ee67bc9e365ca) Save file_size - [`4881f04`](https://github.com/eduardolat/pgbackweb/commit/4881f049177505f56139bda158a8d6bec2d52258) Specify the unit of size - [`94759c6`](https://github.com/eduardolat/pgbackweb/commit/94759c65cdc917ce8629b52d9e599913c226b96a) Add component to display file size - [`3df6d96`](https://github.com/eduardolat/pgbackweb/commit/3df6d96884219e87b7b4be22306667f2203f01ca) Add file size display on execution list and popup ### 📊 Changes **11 files changed** (+132 additions, -13 deletions) <details> <summary>View changed files</summary> ➕ `internal/database/migrations/20240811205655_add_file_size_to_executions_table.sql` (+9 -0) 📝 `internal/integration/storage/local.go` (+12 -5) 📝 `internal/integration/storage/s3.go` (+16 -5) 📝 `internal/service/executions/run_execution.go` (+4 -2) 📝 `internal/service/executions/update_execution.sql` (+2 -1) ➕ `internal/util/strutil/format_file_size.go` (+22 -0) ➕ `internal/util/strutil/format_file_size_test.go` (+29 -0) ➕ `internal/view/web/component/pretty_file_size.go` (+24 -0) 📝 `internal/view/web/dashboard/executions/index.go` (+1 -0) 📝 `internal/view/web/dashboard/executions/list_executions.go` (+6 -0) 📝 `internal/view/web/dashboard/executions/show_execution.go` (+7 -0) </details> ### 📄 Description Hi there! Thank you very much for making this piece of software. A GUI database backup project has been on my todo list for a long time, but I'll use yours since it's pretty good! When using pgbackweb, I wished the size of the backups would be displayed, so I made it. Hope you think it fits the project! Since I don't think we can't get the size of an `io.Reader` without consuming the stream, I had to pull the file size from the destinations. I just returned a simple `int64`, but I wonder if a struct with a single field would not be better for code sustainability. ![image](https://github.com/user-attachments/assets/00b455df-f2f5-4e56-ad2f-614b25786431) ![image](https://github.com/user-attachments/assets/69deac73-add4-4a51-a98d-15bb81260a7f) Backups prior to this PR simply won't have a display size --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 21:34:38 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/pgbackweb#140
No description provided.