This is an automated email from the ASF dual-hosted git repository. hanahmily pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-skywalking-ui.git
commit 2f5564abd39a61a1414cceac36422377c3cf8811 Author: gaohongtao <hanahm...@gmail.com> AuthorDate: Tue Oct 30 09:52:44 2018 +0800 Change service instance select name The last combination of service instance select name is a process number with host name or ip. The backend supplied a new name attribute for ui to display, which is a more convenient way to accomplish it. --- mock/metadata.js | 12 ++++++++---- src/utils/utils.js | 11 +---------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/mock/metadata.js b/mock/metadata.js index 999a76d..15a130f 100644 --- a/mock/metadata.js +++ b/mock/metadata.js @@ -32,19 +32,23 @@ export default { name: '@natural(4, 20)', attributes: [ { - name: 'os', + name: 'os_name', value: 'LINUX', }, { - name: 'host', + name: 'host_name', value: 'WORKSAPCE-@name', }, { - name: 'pid', + name: 'process_no', value: '@natural(4, 20)', }, { - name: 'ipv4', + name: 'ipv4s', + value: '@ip', + }, + { + name: 'ipv4s', value: '@ip', }, ], diff --git a/src/utils/utils.js b/src/utils/utils.js index 537832d..f8060f6 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -115,16 +115,7 @@ export function isUrl(path) { } export function getServiceInstanceId(serviceInstanceInfo) { - const { attributes } = serviceInstanceInfo; - if (!attributes || attributes.length < 1) { - return ''; - } - let host = getAttributes(attributes, 'host_name'); - const ipv4 = getAttributes(attributes, 'ipv4s'); - if (ipv4 && ipv4.length > 0) { - host = ipv4; - } - return `${getAttributes(attributes, 'process_no')}@${host}`; + return serviceInstanceInfo.name; } export function getAttributes(attributes, name) {