Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/web/html
diff options
context:
space:
mode:
Diffstat (limited to 'web/html')
-rw-r--r--web/html/index.html4
-rw-r--r--web/html/modals/text_modal.html13
2 files changed, 2 insertions, 15 deletions
diff --git a/web/html/index.html b/web/html/index.html
index 1be7df13..574fc539 100644
--- a/web/html/index.html
+++ b/web/html/index.html
@@ -400,9 +400,7 @@
<a-checkbox v-model="logModal.syslog" @change="openLogs()">SysLog</a-checkbox>
</a-form-item>
<a-form-item :style="{ float: 'right' }">
- <a-button type="primary" icon="download"
- :href="'data:application/text;charset=utf-8,' + encodeURIComponent(logModal.logs?.join('\n'))" download="x-ui.log">
- </a-button>
+ <a-button type="primary" icon="download" @click="FileManager.downloadTextFile(logModal.logs?.join('\n'), 'x-ui.log')"></a-button>
</a-form-item>
</a-form>
<div class="ant-input" :style="{ height: 'auto', maxHeight: '500px', overflow: 'auto', marginTop: '0.5rem' }" v-html="logModal.formattedLogs"></div>
diff --git a/web/html/modals/text_modal.html b/web/html/modals/text_modal.html
index cd90821d..38844e92 100644
--- a/web/html/modals/text_modal.html
+++ b/web/html/modals/text_modal.html
@@ -5,7 +5,7 @@
:autosize="{ minRows: 10, maxRows: 20}"></a-input>
<template slot="footer">
<a-button v-if="!ObjectUtil.isEmpty(txtModal.fileName)" icon="download"
- @click="txtModal.download(txtModal.content, txtModal.fileName)">
+ @click="FileManager.downloadTextFile(txtModal.content, txtModal.fileName)">
<span>[[ txtModal.fileName ]]</span>
</a-button>
<a-button type="primary" icon="copy" @click="txtModal.copy(txtModal.content)">
@@ -35,17 +35,6 @@
this.close();
})
},
- download: function (content = '', fileName = '') {
- let link = document.createElement('a');
-
- link.download = fileName;
- link.href = URL.createObjectURL(new Blob([content], { type: 'text/plain' }));
- link.click();
-
- URL.revokeObjectURL(link.href);
-
- link.remove();
- },
close: function () {
this.visible = false;
},