From 386597e057059bbe11043504ddf31d57d6b89534 Mon Sep 17 00:00:00 2001 From: Ryazanov Alexander Mihailovich Date: Wed, 9 Oct 2024 23:32:32 +0300 Subject: [PATCH] UX: Config downloads without .txt extension (#314) * refactor: change mime type in PeerViewModal.vue * refactor: change download type in InterfaceView.vue --- frontend/src/components/PeerViewModal.vue | 2 +- frontend/src/views/InterfaceView.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/PeerViewModal.vue b/frontend/src/components/PeerViewModal.vue index ce487d8..18aa60f 100644 --- a/frontend/src/components/PeerViewModal.vue +++ b/frontend/src/components/PeerViewModal.vue @@ -100,7 +100,7 @@ function download() { let text = configString.value let element = document.createElement('a') - element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)) + element.setAttribute('href', 'data:application/octet-stream;charset=utf-8,' + encodeURIComponent(text)) element.setAttribute('download', filename) element.style.display = 'none' diff --git a/frontend/src/views/InterfaceView.vue b/frontend/src/views/InterfaceView.vue index 69b7953..cc8ed99 100644 --- a/frontend/src/views/InterfaceView.vue +++ b/frontend/src/views/InterfaceView.vue @@ -52,7 +52,7 @@ async function download() { let text = interfaces.configuration let element = document.createElement('a') - element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)) + element.setAttribute('href', 'data:application/octet-stream;charset=utf-8,' + encodeURIComponent(text)) element.setAttribute('download', filename) element.style.display = 'none'