public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Daniel Tschlatscher <d.tschlatscher@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager] Replaced system-report file download
Date: Fri,  1 Apr 2022 16:07:58 +0200	[thread overview]
Message-ID: <20220401140758.1997754-2-d.tschlatscher@proxmox.com> (raw)
In-Reply-To: <20220401140758.1997754-1-d.tschlatscher@proxmox.com>

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

Signed-off-by: Daniel Tschlatscher <d.tschlatscher@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





  reply	other threads:[~2022-04-01 14:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-01 14:07 [pve-devel] [PATCH widget-toolkit] fix #3971: Download and copy button in the TaskViewer Daniel Tschlatscher
2022-04-01 14:07 ` Daniel Tschlatscher [this message]
2022-04-01 15:20   ` [pve-devel] [PATCH manager] Replaced system-report file download Thomas Lamprecht
2022-04-01 15:18 ` [pve-devel] [PATCH widget-toolkit] fix #3971: Download and copy button in the TaskViewer Thomas Lamprecht
2022-04-04  9:25   ` Daniel Tschlatscher
     [not found]     ` <2a4863fa-2d27-f088-f381-09e02f9180c4@proxmox.com>
2022-04-04 11:58       ` Daniel Tschlatscher

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=20220401140758.1997754-2-d.tschlatscher@proxmox.com \
    --to=d.tschlatscher@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