You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@skywalking.apache.org by ha...@apache.org on 2018/03/02 07:13:45 UTC
[incubator-skywalking-ui] branch fix/resources created (now dd72559)
This is an automated email from the ASF dual-hosted git repository.
hanahmily pushed a change to branch fix/resources
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking-ui.git.
at dd72559 Amend Search
This branch includes the following new commits:
new dd72559 Amend Search
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
--
To stop receiving notification emails like this one, please contact
hanahmily@apache.org.
[incubator-skywalking-ui] 01/01: Amend Search
Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hanahmily pushed a commit to branch fix/resources
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking-ui.git
commit dd72559886c54864e4ee7fb38e2ca273c1c7c203
Author: gaohongtao <ha...@gmail.com>
AuthorDate: Fri Mar 2 15:13:23 2018 +0800
Amend Search
---
mock/server.js | 2 +-
src/components/Page/Search/index.js | 7 ++++---
src/routes/Server/Server.js | 11 ++++++-----
3 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/mock/server.js b/mock/server.js
index 6740030..6078ac5 100644
--- a/mock/server.js
+++ b/mock/server.js
@@ -8,7 +8,7 @@ export default {
'searchServer|5': [
{
'key|+1': 3,
- label: function() { return `server-${this.key}`; }, // eslint-disable-line
+ name: function() { return `server-${this.key}`; }, // eslint-disable-line
os: 'Mac-@name',
host: 'WORKSAPCE-@name',
pid: '@natural',
diff --git a/src/components/Page/Search/index.js b/src/components/Page/Search/index.js
index dd019d6..97ec854 100644
--- a/src/components/Page/Search/index.js
+++ b/src/components/Page/Search/index.js
@@ -19,7 +19,7 @@ export default class Search extends PureComponent {
if (!value || value.length < 1) {
return;
}
- const { url, query, variables = {} } = this.props;
+ const { url, query, variables = {}, transform } = this.props;
this.lastFetchId += 1;
const fetchId = this.lastFetchId;
this.setState({ data: [], fetching: true });
@@ -37,7 +37,8 @@ export default class Search extends PureComponent {
if (!body.data || fetchId !== this.lastFetchId) { // for fetch callback order
return;
}
- this.setState({ data: body.data[Object.keys(body.data)[0]], fetching: false });
+ const list = body.data[Object.keys(body.data)[0]];
+ this.setState({ data: (transform ? list.map(transform) : list), fetching: false });
});
}
handleSelect = (value) => {
@@ -50,7 +51,7 @@ export default class Search extends PureComponent {
return (
<Select
showSearch
- style={{ width: 400 }}
+ style={{ width: 600 }}
placeholder={placeholder}
notFoundContent={this.state.fetching ? <Spin size="small" /> : null}
filterOption={false}
diff --git a/src/routes/Server/Server.js b/src/routes/Server/Server.js
index b212276..59f67bc 100644
--- a/src/routes/Server/Server.js
+++ b/src/routes/Server/Server.js
@@ -69,13 +69,14 @@ export default class Server extends PureComponent {
query SearchServer($keyword: String!, $duration: Duration!) {
searchServer(keyword: $keyword, duration: $duration) {
key: id
- label: name
+ name
host
pid
ipv4
}
}
`}
+ transform={r => ({ ...r, label: `${r.pid}@${r.host}` })}
/>
)}
</FormItem>
@@ -87,7 +88,7 @@ export default class Server extends PureComponent {
>
<Card title="Info" style={{ marginTop: 24 }} bordered={false}>
<DescriptionList>
- <Description term="OS">{serverInfo.label}</Description>
+ <Description term="OS">{serverInfo.name}</Description>
<Description term="Host Name">{serverInfo.host}</Description>
<Description term="Process Id">{serverInfo.pid}</Description>
<Description term="IPv4">{serverInfo.ipv4 ? serverInfo.ipv4.join() : ''}</Description>
@@ -142,18 +143,18 @@ export default class Server extends PureComponent {
>
<Area
data={axis(duration, getMemoryTrend.heap, ({ x, y }) => ({ x, y, type: 'value' }))
- .concat(axis(duration, getMemoryTrend.maxHeap, ({ x, y }) => ({ x, y, type: 'limit' })))}
+ .concat(axis(duration, getMemoryTrend.maxHeap, ({ x, y }) => ({ x, y, type: 'free' })))}
/>
</ChartCard>
</Col>
<Col xs={24} sm={24} md={12} lg={12} xl={12} style={{ marginTop: 24 }}>
<ChartCard
- title="No-Heap"
+ title="Non-Heap"
contentHeight={150}
>
<Area
data={axis(duration, getMemoryTrend.noheap, ({ x, y }) => ({ x, y, type: 'value' }))
- .concat(axis(duration, getMemoryTrend.maxNoheap, ({ x, y }) => ({ x, y, type: 'limit' })))}
+ .concat(axis(duration, getMemoryTrend.maxNoheap, ({ x, y }) => ({ x, y, type: 'free' })))}
/>
</ChartCard>
</Col>
--
To stop receiving notification emails like this one, please contact
hanahmily@apache.org.