diff options
Diffstat (limited to 'web/html/xui/index.html')
| -rw-r--r-- | web/html/xui/index.html | 41 |
1 files changed, 31 insertions, 10 deletions
diff --git a/web/html/xui/index.html b/web/html/xui/index.html index 5ced0a26..b084a84a 100644 --- a/web/html/xui/index.html +++ b/web/html/xui/index.html @@ -199,11 +199,30 @@ :class="siderDrawer.isDarkTheme ? darkClass : ''" width="800px" footer=""> - <table style="margin: 0px; width: 100%; background-color: black; color: hsla(0,0%,100%,.65);"> - <tr v-for="log , index in logModal.logs"> - <td style="vertical-align: top;">[[ index ]]</td><td>[[ log ]]</td> - </tr> - </table> + <a-form layout="inline"> + <a-form-item label="Count"> + <a-select v-model="logModal.rows" + style="width: 80px" + @change="openLogs(logModal.rows)" + :dropdown-class-name="siderDrawer.isDarkTheme ? 'ant-card-dark' : ''"> + <a-select-option value="10">10</a-select-option> + <a-select-option value="20">20</a-select-option> + <a-select-option value="50">50</a-select-option> + <a-select-option value="100">100</a-select-option> + </a-select> + </a-form-item> + <a-form-item> + <button class="ant-btn ant-btn-primary" @click="openLogs(logModal.rows)"><a-icon type="sync"></a-icon> Reload</button> + </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"> + {{ i18n "download" }} x-ui.log + </a-button> + </a-form-item> + </a-form> + <a-input type="textarea" v-model="logModal.logs" disabled="true" + :autosize="{ minRows: 10, maxRows: 22}"></a-input> </a-modal> </a-layout> {{template "js" .}} @@ -301,9 +320,11 @@ const logModal = { visible: false, logs: '', - show(logs) { + rows: 20, + show(logs, rows) { this.visible = true; - this.logs = logs; + this.rows = rows; + this.logs = logs.join("\n"); }, hide() { this.visible = false; @@ -377,14 +398,14 @@ return; } }, - async openLogs(){ + async openLogs(rows){ this.loading(true); - const msg = await HttpUtil.post('server/logs'); + const msg = await HttpUtil.post('server/logs/'+rows); this.loading(false); if (!msg.success) { return; } - logModal.show(msg.obj); + logModal.show(msg.obj,rows); } }, async mounted() { |
