Skip to content

Commit

Permalink
fix downloaded log format
Browse files Browse the repository at this point in the history
Co-Authored-By: Alireza Ahmadi <[email protected]>
  • Loading branch information
MHSanaei and alireza0 committed Jan 26, 2024
1 parent 979fded commit 5f9058c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions web/html/xui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,12 @@
</a-form-item>
<a-form-item>
<a-button type="primary" style="margin-bottom: 10px;"
:href="'data:application/text;charset=utf-8,' + encodeURIComponent(logModal.logs)" download="x-ui.log">
:href="'data:application/text;charset=utf-8,' + encodeURIComponent(logModal.logs.join('\n'))" download="x-ui.log">
{{ i18n "download" }} x-ui.log
</a-button>
</a-form-item>
</a-form>
<div class="ant-input" style="height: auto; max-height: 500px; overflow: auto;" v-html="logModal.logs"></div>
<div class="ant-input" style="height: auto; max-height: 500px; overflow: auto;" v-html="logModal.formattedLogs"></div>
</a-modal>

<a-modal id="backup-modal" v-model="backupModal.visible" :title="backupModal.title"
Expand Down Expand Up @@ -432,14 +432,16 @@

const logModal = {
visible: false,
logs: '',
logs: [],
formattedLogs: '',
rows: 20,
level: 'info',
syslog: false,
loading: false,
show(logs) {
this.visible = true;
this.logs = logs? this.formatLogs(logs) : "No Record...";
this.logs = logs;
this.formattedLogs = logs.length > 0 ? this.formatLogs(logs) : "No Record...";
},
formatLogs(logs) {
let formattedLogs = '';
Expand Down

0 comments on commit 5f9058c

Please sign in to comment.