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 7D66C7B12F for ; Thu, 7 Jul 2022 14:37:50 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 739E01F31F for ; Thu, 7 Jul 2022 14:37:50 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Thu, 7 Jul 2022 14:37: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 D4B7540C72 for ; Thu, 7 Jul 2022 14:37:45 +0200 (CEST) Message-ID: <938ef2cb-d6f6-aa1a-098a-bf3aeea66602@proxmox.com> Date: Thu, 7 Jul 2022 14:37:44 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Content-Language: en-US To: Dominik Csapak , Proxmox VE development discussion References: <20220629122322.816989-1-m.heiserer@proxmox.com> <58120bd2-2d68-3748-c7b7-547c0be861cf@proxmox.com> From: Matthias Heiserer In-Reply-To: <58120bd2-2d68-3748-c7b7-547c0be861cf@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.185 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.001 Looks like a legit reply (A) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: Re: [pve-devel] [RFC manager] fix #3248: GUI: storage: upload multiple files 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: Thu, 07 Jul 2022 12:37:50 -0000 On 01.07.2022 16:21, Dominik Csapak wrote: > i can add the same isos multiple times. does that make sense? > i know i can use different target names for them, but what would > that be good for? imho preventing the user from uploading > the same iso multiple times would be good Same iso meaning two files with same name? afaic that's the only thing the browser allows us to see. > i think what could make the whole thing a bit better in general is > by having the selecting and uploading part split into two windows: Good idea, will change it in v2 [...] >> +    currentUploadIndex: 1, >> +    startUpload: function() { >> +        const me = this; >> +        const view = me.getView(); >> +        const grid = me.lookup('grid'); >> +        view.taskDone(); >> + > > what's that doing here? > why do you call 'taskDone' at the beginning of the upload? > to update the view, so that uploaded files are shown in the background :) but you're right, it should be called when the upload is actually finished. > >> +        const last = grid.store.last(); >> +        if (!last) { >> +        me.getViewModel().set('uploadInProgress', false); >> +        return; >> +        } >> +        const endId = parseInt(last.id.replace('pve-multiupload-', >> ''), 10); >> +        let record; >> +        while (!record && me.currentUploadIndex <= endId) { >> +        record = >> grid.store.getById(`pve-multiupload-${me.currentUploadIndex++}`); >> +        } >> + >> +        if (!record) { >> +        me.getViewModel().set('uploadInProgress', false); >> +        return; >> +        } > > AFAICS, you try to get the record with lowest id higher than > currentUploadIndex ? > you rely here on extjs generated id, but you could handle that yourself by > e.g. having a list with the added files (and use e.g. the filename as id) > then you have simple lookup like > > let filename = me.uploadList[currentUploadIndex]; > let record = grid.getStore().getById(filename); > > does that make sense?Sounds good. [...]