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

Daniel Tschlatscher d.tschlatscher at proxmox.com
Fri Apr 1 16:07:58 CEST 2022


with a function call to the newly added textToFile() function in
the utils class (Proxmox.Utils).

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);
 		    },
 		},
 	    ],
-- 
2.30.2






More information about the pve-devel mailing list