优化代码/支持IP名单的更多格式的导入、导出

This commit is contained in:
刘祥超
2021-08-07 18:26:50 +08:00
parent d97f4da7fa
commit c3e68915a3
11 changed files with 272 additions and 21 deletions

View File

@@ -2,12 +2,24 @@
{$template "list_menu"}
<div class="margin"></div>
<form class="ui form">
<form class="ui form" method="get" action="/servers/iplists/exportData">
<input type="hidden" name="listId" :value="list.id"/>
<table class="ui table definition selectable">
<tr>
<td class="title">说明</td>
<td>导出所有的IP</td>
</tr>
<tr>
<td>格式</td>
<td>
<select class="ui dropdown auto-width" name="format">
<option value="xlsx">Excel</option>
<option value="csv">CSV</option>
<option value="txt">TXT</option>
<option value="json">JSON</option>
</select>
</td>
</tr>
</table>
<a :href="'/servers/iplists/exportData?listId=' + list.id" class="ui button primary">导出</a>
<submit-btn>导出</submit-btn>
</form>

View File

@@ -3,15 +3,15 @@
<div class="margin"></div>
<form class="ui form" data-tea-action="$" data-tea-success="success">
<form class="ui form" data-tea-action="$" data-tea-success="success" data-tea-timeout="300">
<input type="hidden" name="listId" :value="list.id"/>
<csrf-token></csrf-token>
<table class="ui table definition selectable">
<tr>
<td class="title">选择IP文件 *</td>
<td>
<input type="file" name="file" accept=".data"/>
<p class="comment">文件名类似于<code-label>ip-list-123.data</code-label></p>
<input type="file" name="file" accept=".xlsx, .json, .txt, .csv"/>
<p class="comment">文件名类似于<code-label>ip-list-123.xxx</code-label>支持Excel、CSV、JSON和纯文本TXT</p>
</td>
</tr>
</table>