public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Matthias Heiserer <m.heiserer@proxmox.com>
To: Dominik Csapak <d.csapak@proxmox.com>,
	Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [RFC manager] fix #3248: GUI: storage: upload multiple files
Date: Thu, 7 Jul 2022 14:37:44 +0200	[thread overview]
Message-ID: <938ef2cb-d6f6-aa1a-098a-bf3aeea66602@proxmox.com> (raw)
In-Reply-To: <58120bd2-2d68-3748-c7b7-547c0be861cf@proxmox.com>

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.

[...]




      parent reply	other threads:[~2022-07-07 12:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-29 12:23 Matthias Heiserer
2022-07-01 14:21 ` Dominik Csapak
2022-07-05  6:50   ` Thomas Lamprecht
2022-07-07 12:37   ` Matthias Heiserer [this message]

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=938ef2cb-d6f6-aa1a-098a-bf3aeea66602@proxmox.com \
    --to=m.heiserer@proxmox.com \
    --cc=d.csapak@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 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