A 登录日志增加IP搜索

pull/586/head v3.2.1
vapao 2022-07-14 23:50:53 +08:00
parent eaaf105010
commit 8811793ff3
2 changed files with 5 additions and 0 deletions

View File

@ -22,6 +22,9 @@ export default observer(function () {
<SearchForm.Item span={8} title="账户名称">
<Input allowClear value={store.f_name} onChange={e => store.f_name = e.target.value} placeholder="请输入"/>
</SearchForm.Item>
<SearchForm.Item span={8} title="登录IP">
<Input allowClear value={store.f_ip} onChange={e => store.f_ip = e.target.value} placeholder="请输入"/>
</SearchForm.Item>
</SearchForm>
<ComTable/>
</AuthDiv>

View File

@ -10,11 +10,13 @@ class Store {
@observable records = [];
@observable isFetching = false;
@observable f_ip;
@observable f_name;
@observable f_status = '';
@computed get dataSource() {
let records = this.records;
if (this.f_ip) records = records.filter(x => includes(x.ip, this.f_ip));
if (this.f_name) records = records.filter(x => includes(x.username, this.f_name));
if (this.f_status) records = records.filter(x => String(x.is_success) === this.f_status);
return records