Skip to content

Commit

Permalink
resolve #67;
Browse files Browse the repository at this point in the history
  • Loading branch information
sunface committed May 5, 2019
1 parent 25d3683 commit 2f51b54
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
14 changes: 7 additions & 7 deletions ui/src/views/apm/apiMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<span class="font-size-10">当前应用接口</span>
</span>

<div :id="id" class="app-service-map" style="width:calc(100vw - 180px);height:calc(100vh - 100px)"></div>
<div :id="id" class="app-service-map" style="width:calc(100vw - 180px);height:calc(100vh)"></div>
</div>


Expand Down Expand Up @@ -77,6 +77,7 @@ export default {
}
}).then(res => {
this.$Loading.finish();
console.log(res.data.data)
if (res.data.data.nodes.length == 0) {
this.$Message.info({
content: '没有查询到数据',
Expand All @@ -101,11 +102,11 @@ export default {
calcSize(nodes) {
var l = nodes.length
if (l < 20) {
this.lineLength = 200
this.lineLength = 100
this.primaryNodeSize = 50
this.smallNodeSize = 35
this.lineLabelSize = 13
this.repulsion = 500
this.smallNodeSize = 25
this.lineLabelSize = 12
this.repulsion = 100
return
}
Expand Down Expand Up @@ -136,6 +137,7 @@ export default {
initChart(nodes,links) {
console.log(nodes,links)
this.chart = echarts.init(document.getElementById(this.id));
this.calcSize(nodes)
for (var j = 0; j < nodes.length; j++) {
// 设置node的样式
nodes[j].symbolSize = this.smallNodeSize;
Expand Down Expand Up @@ -177,8 +179,6 @@ export default {
}
}
this.calcSize(nodes)
for (var i = 0; i < links.length; i++) {
var color = "#12b5d0";
if (links[i].access_count > 0) {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/views/apm/nav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export default {
this.items = ['monitoring','dashboard','tracing','serviceMap','apiMap','runtime','stats','api','database','method','exception','profiling','jvm']
this.level = {monitoring: 1,'dashboard':2, tracing:2,serviceMap:2,apiMap:2, runtime:2,system:2, stats:1,database:2,api:2,exception:2,method:2,profiling:1,jvm:2,}
this.names = {monitoring: '监控','dashboard': "应用总览",
tracing: '链路跟踪',serviceMap:'应用拓扑', apiMap:'API拓扑',
tracing: '链路跟踪',serviceMap:'应用拓扑', apiMap:'接口拓扑',
runtime: '应用运行时', system:'基础设施',profiling: '在线诊断', jvm:'JVM实时剖析',
stats: '数据统计',
database:'SQL语句', api:'请求接口', exception:'内部异常',method:'内部方法'}
Expand Down
1 change: 0 additions & 1 deletion ui/src/views/dashboard/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,6 @@ export default {
})
.then(res1 => {
this.appList = res1.data.data;
// 初始化应用地图
if (res.data.data.nodes.length == 0) {
this.$Message.info({
Expand Down
2 changes: 1 addition & 1 deletion web/internal/application/api_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func QueryApiMap(c echo.Context) error {
// 更新子节点信息
_, ok = nodeMap[api]
if !ok {
nodeMap[tname] = &Node{Name: api, Category: ApiNode}
nodeMap[api] = &Node{Name: api, Category: ApiNode}
}

// 更新父子之间的link信息
Expand Down

0 comments on commit 2f51b54

Please sign in to comment.