From 172322061ed8dc330345706264ac65d7e42b87fb Mon Sep 17 00:00:00 2001 From: vapao Date: Sun, 27 Jun 2021 22:28:31 +0800 Subject: [PATCH] improve host page --- spug_web/src/pages/host/Table.js | 10 +++++++--- spug_web/src/pages/host/store.js | 2 ++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/spug_web/src/pages/host/Table.js b/spug_web/src/pages/host/Table.js index 969c54b..c8ee07e 100644 --- a/spug_web/src/pages/host/Table.js +++ b/spug_web/src/pages/host/Table.js @@ -3,9 +3,9 @@ * Copyright (c) * Released under the AGPL-3.0 License. */ -import React from 'react'; +import React from 'react'; import { observer } from 'mobx-react'; -import { Table, Modal, Dropdown, Button, Menu, Avatar, Tooltip, Space, Tag, message } from 'antd'; +import { Table, Modal, Dropdown, Button, Menu, Avatar, Tooltip, Space, Tag, Radio, message } from 'antd'; import { PlusOutlined, DownOutlined } from '@ant-design/icons'; import { Action, TableCard, AuthButton, AuthFragment } from 'components'; import { http, hasPermission } from 'libs'; @@ -83,7 +83,11 @@ function ComTable() { )}> - + , + store.f_status = e.target.value}> + 全部 + 未验证 + ]} pagination={{ showSizeChanger: true, diff --git a/spug_web/src/pages/host/store.js b/spug_web/src/pages/host/store.js index 50394a1..b30f282 100644 --- a/spug_web/src/pages/host/store.js +++ b/spug_web/src/pages/host/store.js @@ -27,12 +27,14 @@ class Store { @observable f_name; @observable f_host; + @observable f_status = ''; @computed get dataSource() { let records = []; if (this.group.all_host_ids) records = this.records ? this.records.filter(x => this.group.all_host_ids.includes(x.id)) : []; if (this.f_name) records = records.filter(x => x.name.toLowerCase().includes(this.f_name.toLowerCase())); if (this.f_host) records = records.filter(x => x.hostname.toLowerCase().includes(this.f_host.toLowerCase())); + if (this.f_status !== '') records = records.filter(x => this.f_status === x.is_verified); return records }