[pve-devel] applied: [PATCH v2 manager 2/2] Show supported file types in upload file selector

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Sep 3 10:19:10 CEST 2019


On 03.09.19 10:06, Stefan Reiter wrote:
> On 9/3/19 9:53 AM, Thomas Lamprecht wrote:
>> On 22.08.19 14:39, Stefan Reiter wrote:
>>> By default, all file types are shown, but the user now has the option of
>>> filtering only by supported types in the file selector dialog.
>>>
>>> Signed-off-by: Stefan Reiter <s.reiter at proxmox.com>
>>> Acked-by: Dominik Csapak <d.csapak at proxmox.com>
>>> ---
>>>
>>> I found it weird too, but also couldn't find a different way to go about it...
>>>
>>>   www/manager6/storage/ContentView.js | 9 ++++++++-
>>>   1 file changed, 8 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/www/manager6/storage/ContentView.js b/www/manager6/storage/ContentView.js
>>> index 3677f8ad..b72fc88d 100644
>>> --- a/www/manager6/storage/ContentView.js
>>> +++ b/www/manager6/storage/ContentView.js
>>> @@ -218,7 +218,14 @@ Ext.define('PVE.storage.Upload', {
>>>               xtype: 'filefield',
>>>               name: 'filename',
>>>               buttonText: gettext('Select File...'),
>>> -            allowBlank: false
>>> +            allowBlank: false,
>>> +            listeners: {
>>> +            afterrender: function(cmp) {
>>> +                cmp.fileInputEl.set({
>>> +                accept: '.img, .iso'
>>> +                });
>>> +            }
>>> +            }
>>>           },
>>>           pbar
>>>           ]
>>>
>>
>> applied, but this is not case insensitive..
>>
>> If that's not easily possible to do as single flag, I'd maybe
>> add .IMG and .ISO to cover at least most reasonable cases.
>>
> 
> It ignores casing for me... Tested on Chromium 76 and Firefox 70.

It does not depend on the internet browser but on the file browser used, AFAICT.
But yes, I had a bad test here, Thunar seems to work fine indeed.

> 
> And thanks for the fixup on the other patch, didn't know partial regexes could have their own flags.

# perldoc perlretut
# perldoc perlre
and https://perldoc.perl.org/perlop.html#Regexp-Quote-Like-Operators

are good references, there's really a lot possible with perl regular
expressions :)





More information about the pve-devel mailing list