diff --git a/src/components/QueryLog.js b/src/components/QueryLog.js index bcfedc2..6f1f966 100644 --- a/src/components/QueryLog.js +++ b/src/components/QueryLog.js @@ -71,6 +71,14 @@ export default class QueryLog extends Component { } } +const status = { + "1": "Blocked", + "2": "Allowed (forwarded)", + "3": "Allowed (cached)", + "4": "Blocked (wildcard)", + "5": "Blocked (blacklist)" +}; + const columns = [ { Header: "Time", @@ -108,22 +116,13 @@ const columns = [ id: "status", accessor: r => r[4], width: 140, - Cell: row => { - switch(row.value) { - case 1: - return "Blocked"; - case 2: - return "Allowed (forwarded)"; - case 3: - return "Allowed (cached)"; - case 4: - return "Blocked (wildcard)"; - case 5: - return "Blocked (blacklist)"; - default: - return "Unknown"; - } - } + Cell: row => status[row.value], + filterMethod: (filter, row) => + status[row[filter.id]] + .toLowerCase() + .includes( + filter.value.toLowerCase() + ) }, { Header: "Action",