From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Timothy Nicholson <t.nicholson@proxmox.com>
Subject: Re: [pve-devel] [PATCH manager] fix #5787: ui: display vm description in confirm dialogs
Date: Tue, 22 Oct 2024 08:58:56 +0200 [thread overview]
Message-ID: <87323348-4002-463b-9d6f-48db6eac6d8b@proxmox.com> (raw)
In-Reply-To: <20241021121733.143909-1-t.nicholson@proxmox.com>
The subject made me think you added the VM description property, i.e. the
comment a user can set for VMs in the note field, to the confirmation.
But it's for all guests, i.e., bot VMs and CTs, and it's the guest name, so
I'd go for something like:
fix #5787: ui: display guest name in confirm dialogs
Am 21/10/2024 um 14:17 schrieb Timothy Nicholson:
> Signed-off-by: Timothy Nicholson <t.nicholson@proxmox.com>
> ---
>
> This patch adds a new function to the PVE Utils that formats a task confirmation message to display in confirm dialogs, for example when shutting down a VM. As requested by the Bugzilla entry #5787, the message now includes the VM name in addition to the VM ID.
why isn't above stated in the commit message but only as patch note?
>
> www/manager6/Utils.js | 4 ++++
> www/manager6/lxc/CmdMenu.js | 4 ++--
> www/manager6/lxc/Config.js | 8 +++++---
> www/manager6/qemu/CmdMenu.js | 4 ++--
> www/manager6/qemu/Config.js | 14 ++++++++------
> www/manager6/window/GuestStop.js | 2 +-
> 6 files changed, 22 insertions(+), 14 deletions(-)
>
> diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
> index db86fa9a..462eb148 100644
> --- a/www/manager6/Utils.js
> +++ b/www/manager6/Utils.js
> @@ -1960,6 +1960,10 @@ Ext.define('PVE.Utils', {
> }
> return languageCookie || Proxmox.defaultLang || 'en';
> },
> +
> + format_task_confirmation_message: function(type, vmid, vmname) {
As this is not for arbitrary tasks but for guests I'd change the signature
of this function to:
format_guest_confirmation: function(taskType, vmid, guestName) {
vmid could also become guestId, but vmid is so widely used in various code
bases that it is often easier to ignore that it implies VMs only, as "vmid"
seldom does that.
And yes, we have some wrong terminology in LXC code, like the "vm" variable
below, but for new functions I'd still like to use the generic terms if the
function is applicable for both, CTs and VMs.
> + return `${Proxmox.Utils.format_task_description(type, `${vmid} (${vmname})`)}?`;
This also adds a "?" at the end, is that all right? The nested template string
isn't making things easier to read IMO, and if the "?" is indeed superfluous then
a simple
return Proxmox.Utils.format_task_description(taskType, `${vmid} (${guestName})`);
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2024-10-22 6:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-21 12:17 Timothy Nicholson
2024-10-22 6:58 ` Thomas Lamprecht [this message]
2024-10-22 10:39 ` Fiona Ebner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87323348-4002-463b-9d6f-48db6eac6d8b@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
--cc=t.nicholson@proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox