[pve-devel] [PATCH manager] Replaced system-report file download

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Apr 1 17:20:22 CEST 2022


On 01.04.22 16:07, Daniel Tschlatscher wrote:
> with a function call to the newly added textToFile() function in
> the utils class (Proxmox.Utils).

please refer to the fact that it got moved to proxmox-widget-toolkit to imply
the required dependency bump more explicitly.

> 
> Signed-off-by: Daniel Tschlatscher <d.tschlatscher at proxmox.com>
> ---
>  www/manager6/node/Subscription.js | 14 +-------------
>  1 file changed, 1 insertion(+), 13 deletions(-)
> 
> diff --git a/www/manager6/node/Subscription.js b/www/manager6/node/Subscription.js
> index 2558f523..d3502eca 100644
> --- a/www/manager6/node/Subscription.js
> +++ b/www/manager6/node/Subscription.js
> @@ -61,19 +61,7 @@ Ext.define('PVE.node.Subscription', {
>  			var fileContent = Ext.String.htmlDecode(reportWindow.getComponent('system-report-view').html);
>  			var fileName = getReportFileName();
>  
> -			// Internet Explorer
> -			if (window.navigator.msSaveOrOpenBlob) {
> -			    navigator.msSaveOrOpenBlob(new Blob([fileContent]), fileName);
> -			} else {
> -			    var element = document.createElement('a');
> -			    element.setAttribute('href', 'data:text/plain;charset=utf-8,' +
> -			      encodeURIComponent(fileContent));
> -			    element.setAttribute('download', fileName);
> -			    element.style.display = 'none';
> -			    document.body.appendChild(element);
> -			    element.click();
> -			    document.body.removeChild(element);
> -			}
> +			Proxmox.Utils.textToFile(fileName, fileContent);
>  		    },
>  		},
>  	    ],

fyi, there's another similar usage in the PVE.Storage.PBSKeyShow class, maybe there are
more - please also check PMG/PBS if not already done.





More information about the pve-devel mailing list