with the newly added downloadStringAsFile() function in the proxmox-
widget-toolkit repository in the Utils class (Proxmox.Utils).

Signed-off-by: Daniel Tschlatscher <d.tschlatsc...@proxmox.com>
---
 js/Subscription.js | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/js/Subscription.js b/js/Subscription.js
index 8d3bc80..16c4c82 100644
--- a/js/Subscription.js
+++ b/js/Subscription.js
@@ -62,19 +62,7 @@ Ext.define('PMG.Subscription', {
                        let fileContent = 
Ext.String.htmlDecode(reportWindow.getComponent('system-report-view').html);
                        let fileName = getReportFileName();
 
-                       // Internet Explorer
-                       if (window.navigator.msSaveOrOpenBlob) {
-                           navigator.msSaveOrOpenBlob(new Blob([fileContent]), 
fileName);
-                       } else {
-                           let 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.downloadStringAsFile(fileContent, 
fileName);
                    },
                },
            ],
-- 
2.30.2



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to