From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 2250069697 for ; Mon, 31 Aug 2020 12:52:17 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 10AD9131D9 for ; Mon, 31 Aug 2020 12:51:47 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 9254B131CF for ; Mon, 31 Aug 2020 12:51:46 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 55E6644967 for ; Mon, 31 Aug 2020 12:51:46 +0200 (CEST) Date: Mon, 31 Aug 2020 12:51:44 +0200 From: Dominic =?iso-8859-1?Q?J=E4ger?= To: Proxmox VE development discussion Message-ID: <20200831105144.GA120313@mala.proxmox.com> References: <20200825151426.17428-1-a.lauterer@proxmox.com> <20200825151426.17428-4-a.lauterer@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200825151426.17428-4-a.lauterer@proxmox.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-SPAM-LEVEL: Spam detection results: 0 AWL 1.652 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [x.data] Subject: Re: [pve-devel] [PATCH manager 3/4] ui: utils: add method to get VM data from resource store X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Aug 2020 10:52:17 -0000 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]));