Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #642 - Searching for attributes in the web-UI's agent status vew is not working #658

Merged
merged 2 commits into from
Apr 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -217,20 +217,22 @@ class StatusTable extends React.Component {
}
}

getMappingFilter = ({ mappingName, attributes }) => {
const filterArray = map(attributes, (value, key) => key + ": " + value);
filterArray.push(mappingName);
return filterArray;
}

render() {
const { data: agents } = this.props;
const agentValues = agents.map((agent) => {
//build a dummy string to allow filtering
const attributesSearchString =
Object.keys(agent.attributes).sort().map((key) => {
return key + ": " + agent.attributes[key] + "\n"
});

const agentValues = map(agents, agent => {
return {
...agent,
name: this.getAgentName(agent),
attributesSearchString
}
})
mappingFilter: this.getMappingFilter(agent) // used for row filtering based on attribute values
};
});

return (
<div className="this">
Expand Down Expand Up @@ -260,7 +262,7 @@ class StatusTable extends React.Component {
<Column header="Agent Version" field="metaInformation.agentVersion" body={this.agentVersionTemplate} sortable style={{ width: '150px' }} />
<Column header="Java Version" field="metaInformation.javaVersion" body={this.javaVersionTemplate} sortable style={{ width: '150px' }} />
<Column header="Last JVM Restart" field="metaInformation.startTime" body={this.jvmRestartTemplate} sortable style={{ width: '175px' }} />
<Column header="Agent Mapping" field="mappingName" body={this.agentMappingTemplate} sortable />
<Column header="Agent Mapping" field="mappingFilter" body={this.agentMappingTemplate} sortable />
<Column header="Last Fetch" field="lastConfigFetch" body={this.lastFetchTemplate} sortable excludeGlobalFilter={true} style={{ width: '200px' }} />
</DataTable>

Expand Down