public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager] vzdump mail: fix #3136: Add name to plain/text part
@ 2020-11-16  9:44 Dominic Jäger
  2020-11-16 17:06 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Dominic Jäger @ 2020-11-16  9:44 UTC (permalink / raw)
  To: pve-devel

The html/text part already has VMID NAME STATUS TIME..., but the text part only
had VMID STATUS TIME... so far. Therefore, add the missing "name" column.

Limit the length of names so that the content of the following columns remains
aligned to the headings. Note that (like before, too) this only works with
monospaced fonts.

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
---
Unfortunately, I had no idea for non-monospaced fonts yet.

 PVE/VZDump.pm | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
index 517becb1..1096d594 100644
--- a/PVE/VZDump.pm
+++ b/PVE/VZDump.pm
@@ -258,18 +258,20 @@ sub sendmail {
 
     # text part
     my $text = $err ? "$err\n\n" : '';
-    $text .= sprintf ("%-10s %-6s %10s %10s  %s\n", qw(VMID STATUS TIME SIZE FILENAME));
+    $text .= sprintf ("%-10s %-20s %-6s %10s %10s  %s\n", qw(VMID NAME STATUS TIME SIZE FILENAME));
     foreach my $task (@$tasklist) {
 	my $vmid = $task->{vmid};
 	if  ($task->{state} eq 'ok') {
 
-	    $text .= sprintf ("%-10s %-6s %10s %10s  %s\n", $vmid,
+	    $text .= sprintf ("%-10s %-20s %-6s %10s %10s  %s\n", $vmid,
+				substr($task->{hostname}, 0, 20),
 				$task->{state},
 				format_time($task->{backuptime}),
 				format_size ($task->{size}),
 				$task->{target});
 	} else {
-	    $text .= sprintf ("%-10s %-6s %10s %8.2fMB  %s\n", $vmid,
+	    $text .= sprintf ("%-10s %-20s %-6s %10s %8.2fMB  %s\n", $vmid,
+				substr($task->{hostname}, 0, 20),
 				$task->{state},
 				format_time($task->{backuptime}),
 				0, '-');
-- 
2.20.1




^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pve-devel] applied: [PATCH manager] vzdump mail: fix #3136: Add name to plain/text part
  2020-11-16  9:44 [pve-devel] [PATCH manager] vzdump mail: fix #3136: Add name to plain/text part Dominic Jäger
@ 2020-11-16 17:06 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2020-11-16 17:06 UTC (permalink / raw)
  To: Proxmox VE development discussion, Dominic Jäger

On 16.11.20 10:44, Dominic Jäger wrote:
> The html/text part already has VMID NAME STATUS TIME..., but the text part only
> had VMID STATUS TIME... so far. Therefore, add the missing "name" column.
> 
> Limit the length of names so that the content of the following columns remains
> aligned to the headings. Note that (like before, too) this only works with
> monospaced fonts.
> 
> Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
> ---
> Unfortunately, I had no idea for non-monospaced fonts yet.
> 
>  PVE/VZDump.pm | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
>

applied, thanks!





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-16 17:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-16  9:44 [pve-devel] [PATCH manager] vzdump mail: fix #3136: Add name to plain/text part Dominic Jäger
2020-11-16 17:06 ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal