A 添加主机管理连接地址搜索项 #61

pull/103/head
vapao 2020-04-29 17:46:07 +08:00
parent 34daac5fc0
commit 9de66a0534
3 changed files with 10 additions and 3 deletions

View File

@ -78,6 +78,9 @@ class ComTable extends React.Component {
if (store.f_zone) {
data = data.filter(item => item['zone'].toLowerCase().includes(store.f_zone.toLowerCase()))
}
if (store.f_host) {
data = data.filter(item => item['hostname'].toLowerCase().includes(store.f_host.toLowerCase()))
}
return (
<React.Fragment>
<Table rowKey="id" loading={store.isFetching} dataSource={data} columns={this.columns}/>

View File

@ -14,17 +14,20 @@ export default observer(function () {
return (
<AuthCard auth="host.host.view">
<SearchForm>
<SearchForm.Item span={8} title="主机类别">
<SearchForm.Item span={6} title="主机类别">
<Select allowClear placeholder="请选择" value={store.f_zone} onChange={v => store.f_zone = v}>
{store.zones.map(item => (
<Select.Option value={item} key={item}>{item}</Select.Option>
))}
</Select>
</SearchForm.Item>
<SearchForm.Item span={8} title="主机别名">
<SearchForm.Item span={6} title="主机别名">
<Input allowClear value={store.f_name} onChange={e => store.f_name = e.target.value} placeholder="请输入"/>
</SearchForm.Item>
<SearchForm.Item span={8}>
<SearchForm.Item span={6} title="连接地址">
<Input allowClear value={store.f_host} onChange={e => store.f_host = e.target.value} placeholder="请输入"/>
</SearchForm.Item>
<SearchForm.Item span={6}>
<Button type="primary" icon="sync" onClick={store.fetchRecords}>刷新</Button>
</SearchForm.Item>
</SearchForm>

View File

@ -16,6 +16,7 @@ class Store {
@observable f_name;
@observable f_zone;
@observable f_host;
fetchRecords = () => {
this.isFetching = true;