From 359c088edff541d6e663eb4f31aa8aeb053a6d63 Mon Sep 17 00:00:00 2001 From: Lucas Hinderberger Date: Thu, 4 Jul 2024 10:06:43 +0200 Subject: [PATCH] SMTP GUI: Adding size to Body / Multipart index --- internal/smtp/gui_message.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/smtp/gui_message.html b/internal/smtp/gui_message.html index feea800..ad44491 100644 --- a/internal/smtp/gui_message.html +++ b/internal/smtp/gui_message.html @@ -60,6 +60,12 @@

Message Metadata

Body / Multiparts:

+ {{ define "humanSize" -}} + {{- if lt . 1000 }}{{ . }} B + {{- else if lt . 1000000 }}{{ div . 1000 }} KB + {{- else }}{{ div . 1000000 }} MB{{ end -}} + {{- end }} + {{ define "contentLinks" }} {{ $contentType := .metadata.contentType }} {{ if not $contentType }} @@ -67,7 +73,7 @@

Body / Multiparts:

{{ end }}
  • - {{ .metadata.idx }}: {{ $contentType }}
    + {{ .metadata.idx }}: {{ $contentType }} ({{ template "humanSize" .metadata.bodySize }})
    PreviewDownload / Open in new Tab