From: "Dominic Jäger" <d.jaeger@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH manager 3/4] ui: utils: add method to get VM data from resource store
Date: Mon, 31 Aug 2020 12:51:44 +0200 [thread overview]
Message-ID: <20200831105144.GA120313@mala.proxmox.com> (raw)
In-Reply-To: <20200825151426.17428-4-a.lauterer@proxmox.com>
Not 100% sure if I currently have the right eslint version
On Tue, Aug 25, 2020 at 05:14:25PM +0200, Aaron Lauterer wrote:
> + getNodeVMs: function(nodename) {
> + let rstore = PVE.data.ResourceStore;
> + let vms = {}
WARN: line 1573 col 14: semi - Missing semicolon. (*)
> + rstore.data.items.forEach((item) => {
> + if (!item.id.startsWith('qemu/')) { return; }
> + let vmdata = item.data;
> + if (vmdata.node != nodename) { return; }
ERR : line 1577 col 22: eqeqeq - Expected '!==' and instead saw '!='.
> +
> + vms[vmdata.vmid] = vmdata;
> + });
> + return vms;
> + },
Looking at the forEach: Functional programming can be fun :)
return Object.fromEntries(rstore.data.items.filter(x => x.id.startsWith('qemu/')).filter(x => x.data.node === nodename).map(x => [x.data.vmid, x.data]));
next prev parent reply other threads:[~2020-08-31 10:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-25 15:14 [pve-devel] [PATCH series 0/4] Add GUI for disk reassignment Aaron Lauterer
2020-08-25 15:14 ` [pve-devel] [PATCH widget-toolkit 1/4] window/edit: add option to disable reset button Aaron Lauterer
2020-08-25 15:14 ` [pve-devel] [PATCH manager 2/4] ui: qemu/HardwareView: white space fixes Aaron Lauterer
2020-08-25 15:14 ` [pve-devel] [PATCH manager 3/4] ui: utils: add method to get VM data from resource store Aaron Lauterer
2020-08-31 10:51 ` Dominic Jäger [this message]
2020-08-25 15:14 ` [pve-devel] [PATCH manager 4/4] ui: qemu: Add disk reassign dialog Aaron Lauterer
2020-08-31 10:55 ` Dominic Jäger
2020-08-31 11:04 ` [pve-devel] [PATCH series 0/4] Add GUI for disk reassignment Dominic Jäger
2020-08-31 11:21 ` Aaron Lauterer
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=20200831105144.GA120313@mala.proxmox.com \
--to=d.jaeger@proxmox.com \
--cc=pve-devel@lists.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.