Commit df6fed76 authored by clauseliu's avatar clauseliu
Browse files

clauseliu

parent 992b1be9
Showing with 627 additions and 332 deletions
+627 -332
......@@ -45,7 +45,9 @@ onerror(app);
app.use(limitMidware());
//安全防护
app.use(helmet());
app.use(helmet({
frameguard: false
}));
//设置ejs模板
// app.use(views(__dirname + '/views', {
......
......@@ -16,6 +16,7 @@
const logger = require('../../logger');
const CallChainService = require('../../service/callChain/CallChainService');
const AdminService = require('../../service/admin/AdminService');
const util = require('../../tools/util');
const CallChainController = {}
......@@ -48,4 +49,15 @@ CallChainController.getTraceDetailList = async (ctx) => {
}
}
CallChainController.getTopo = async(ctx) => {
let {serviceName, start, end} = ctx.paramsObj;
try{
let ret = await AdminService.getTopoGraph(serviceName, start, end);
ctx.makeResObj(200, '', ret);
}catch(e) {
logger.error('[CallChainController.getTopo]:', e, ctx);
ctx.makeErrResObj();
}
}
module.exports = CallChainController;
\ No newline at end of file
......@@ -149,6 +149,7 @@ const apiConf = [
['get', '/get_trace_list', CallChainController.getTraceList],
['get', '/get_trace_detail', CallChainController.getTraceDetailList, {id: 'notEmpty'}],
['get', '/get_topo', CallChainController.getTopo, {serviceName:'notEmpty', start:'notEmpty', end:'notEmpty'}],
];
module.exports = {pageConf, apiConf};
\ No newline at end of file
......@@ -14,7 +14,7 @@
* specific language governing permissions and limitations under the License.
*/
const {configFPrx, configFStruct, adminRegPrx, adminRegStruct, client} = require('../util/rpcClient');
const {configFPrx, configFStruct, adminRegPrx, adminRegStruct, queryTracingPrx, client} = require('../util/rpcClient');
var registry = require("@tars/registry");
const TarsStream = require('@tars/stream');
const _ = require('lodash')
......@@ -111,4 +111,10 @@ AdminService.getEndpoints = async (objName) => {
return ret.response.return.value;
};
AdminService.getTopoGraph = async (serviceName, start, end) => {
let ret = await queryTracingPrx.getQueryChainResult(serviceName, start, end);
console.info(ret);
return ret;
}
module.exports = AdminService;
\ No newline at end of file
......@@ -15,7 +15,7 @@
*/
const client = require("@tars/rpc/protal.js").client;
const TarsProxy = require("./rpcProxy/NodeTarsProxy");
const QueryTracingProxy = require("./rpcProxy/QueryTracingProxy");
const AdminRegProxy = require("./rpcProxy/AdminRegProxy");
const ConfigFProxy = require("./rpcProxy/ConfigFProxy");
const path = require('path');
......@@ -83,13 +83,11 @@ module.exports = {
adminRegPrx : RPCClientPrx(AdminRegProxy, 'tars', 'AdminReg', 'tars.tarsAdminRegistry.AdminRegObj@tcp -h 100.117.137.106 -t 60000 -p 8081 -e 0'),
adminRegStruct : RPCStruct(AdminRegProxy, 'tars'),
// adminRegPrx : RPCClientPrx(AdminRegProxy, 'tars', 'AdminReg', 'TARS.NodeTarsServer.AdminReg@tcp -h 127.0.0.1 -p 14004 -t 10000'),
// adminRegStruct : RPCStruct(AdminRegProxy, 'tars'),
configFPrx : RPCClientPrx(ConfigFProxy, 'tars', 'Config', 'tars.tarsconfig.ConfigObj@tcp -h 100.117.137.106 -t 60000 -p 8081 -e 0'),
configFStruct : RPCStruct(ConfigFProxy, 'tars'),
queryTracingPrx : RPCClientPrx(QueryTracingProxy, 'tars', 'QueryController', 'tars.tarsQueryTracingProxy@tcp -h 100.117.137.106 -t 60000 -p 8081 -e 0'),
queryTracingStruct : RPCStruct(QueryTracingProxy, 'tars'),
client: client
// configFPrx : RPCClientPrx(ConfigFProxy, 'tars', 'Config', 'TARS.NodeTarsServer.Config@tcp -h 127.0.0.1 -p 14003 -t 10000'),
// configFStruct : RPCStruct(ConfigFProxy, 'tars'),
};
\ No newline at end of file
/**
* Tencent is pleased to support the open source community by making Tars available.
*
* Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved.
*
* Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* https://opensource.org/licenses/BSD-3-Clause
*
* Unless required by applicable law or agreed to in writing, software distributed
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
module tars
{
struct User_t
{
0 optional int id = 0;
1 optional int score = 0;
2 optional string name = "";
};
struct Result_t
{
0 optional int id = 0;
1 optional int iLevel = 0;
};
interface NodeTars
{
int test();
int getall(User_t stUser, out Result_t stResult);
int getUsrName(string sUsrName, out string sValue1, out string sValue2);
};
};
/**
* Tencent is pleased to support the open source community by making Tars available.
*
* Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved.
*
* Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* https://opensource.org/licenses/BSD-3-Clause
*
* Unless required by applicable law or agreed to in writing, software distributed
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
// **********************************************************************
// This file was generated by a TARS parser!
// TARS version 1.0.1.
// **********************************************************************
var TarsStream = require('@tars/stream');
var TarsError = require('@tars/rpc').error;
var tars = tars || {};
module.exports.tars = tars;
tars.NodeTarsProxy = function () {
this._name = undefined;
this._worker = undefined;
}
tars.NodeTarsProxy.prototype.setTimeout = function (iTimeout) {
this._worker.timeout = iTimeout;
}
tars.NodeTarsProxy.prototype.getTimeout = function ( ) {
return this._worker.timeout;
}
tars.User_t = function() {
this.id = 0;
this.score = 0;
this.name = "";
this._classname = "tars.User_t";
};
tars.User_t._classname = "tars.User_t";
tars.User_t._write = function (os, tag, value) { os.writeStruct(tag, value); }
tars.User_t._read = function (is, tag, def) { return is.readStruct(tag, true, def); }
tars.User_t._readFrom = function (is) {
var tmp = new tars.User_t();
tmp.id = is.readInt32(0, false, 0);
tmp.score = is.readInt32(1, false, 0);
tmp.name = is.readString(2, false, "");
return tmp;
};
tars.User_t.prototype._writeTo = function (os) {
os.writeInt32(0, this.id);
os.writeInt32(1, this.score);
os.writeString(2, this.name);
};
tars.User_t.prototype._equal = function (anItem) {
assert(false, 'this structure not define key operation');
}
tars.User_t.prototype._genKey = function () {
if (!this._proto_struct_name_) {
this._proto_struct_name_ = 'STRUCT' + Math.random();
}
return this._proto_struct_name_;
}
tars.User_t.prototype.toObject = function() {
var tmp = {};
tmp.id = this.id;
tmp.score = this.score;
tmp.name = this.name;
return tmp;
}
tars.User_t.prototype.readFromObject = function(json) {
!json.hasOwnProperty("id") || (this.id = json.id);
!json.hasOwnProperty("score") || (this.score = json.score);
!json.hasOwnProperty("name") || (this.name = json.name);
}
tars.User_t.prototype.toBinBuffer = function () {
var os = new TarsStream.OutputStream();
this._writeTo(os);
return os.getBinBuffer();
}
tars.User_t.new = function () {
return new tars.User_t();
}
tars.User_t.create = function (is) {
return tars.User_t._readFrom(is);
}
tars.Result_t = function() {
this.id = 0;
this.iLevel = 0;
this._classname = "tars.Result_t";
};
tars.Result_t._classname = "tars.Result_t";
tars.Result_t._write = function (os, tag, value) { os.writeStruct(tag, value); }
tars.Result_t._read = function (is, tag, def) { return is.readStruct(tag, true, def); }
tars.Result_t._readFrom = function (is) {
var tmp = new tars.Result_t();
tmp.id = is.readInt32(0, false, 0);
tmp.iLevel = is.readInt32(1, false, 0);
return tmp;
};
tars.Result_t.prototype._writeTo = function (os) {
os.writeInt32(0, this.id);
os.writeInt32(1, this.iLevel);
};
tars.Result_t.prototype._equal = function (anItem) {
assert(false, 'this structure not define key operation');
}
tars.Result_t.prototype._genKey = function () {
if (!this._proto_struct_name_) {
this._proto_struct_name_ = 'STRUCT' + Math.random();
}
return this._proto_struct_name_;
}
tars.Result_t.prototype.toObject = function() {
var tmp = {};
tmp.id = this.id;
tmp.iLevel = this.iLevel;
return tmp;
}
tars.Result_t.prototype.readFromObject = function(json) {
!json.hasOwnProperty("id") || (this.id = json.id);
!json.hasOwnProperty("iLevel") || (this.iLevel = json.iLevel);
}
tars.Result_t.prototype.toBinBuffer = function () {
var os = new TarsStream.OutputStream();
this._writeTo(os);
return os.getBinBuffer();
}
tars.Result_t.new = function () {
return new tars.Result_t();
}
tars.Result_t.create = function (is) {
return tars.Result_t._readFrom(is);
}
tars.NodeTarsProxy.prototype.getUsrName = function (sUsrName) {
var _encode = function () {
var os = new TarsStream.OutputStream();
os.writeString(1, sUsrName);
return os.getBinBuffer();
}
var _decode = function (data) {
try {
var response = {arguments:{}};
var is = new TarsStream.InputStream(data.response.sBuffer);
response.costtime = data.request.costtime;
response.return = is.readInt32(0, true, TarsStream.Int32);
response.arguments.sValue1 = is.readString(2, true, TarsStream.String);
response.arguments.sValue2 = is.readString(3, true, TarsStream.String);
return {request:data.request, response:response};
} catch (e) {
var response = { };
response.costtime = data.request.costtime;
response.error = {};
response.error.code = TarsError.CLIENT.DECODE_ERROR;
response.error.message = e.message;
throw { request : data.request, response : response};
}
}
var _error = function(data) {
var response = {};
response.costtime = data.request.costtime;
response.error = data.error;
throw {request:data.request, response:response};
}
return this._worker.tars_invoke('getUsrName', _encode(), arguments.length != 0?arguments[arguments.length - 1]:undefined).then(_decode, _error);
}
tars.NodeTarsProxy.prototype.getall = function (stUser) {
var _encode = function () {
var os = new TarsStream.OutputStream();
os.writeStruct(1, stUser);
return os.getBinBuffer();
}
var _decode = function (data) {
try {
var response = {arguments:{}};
var is = new TarsStream.InputStream(data.response.sBuffer);
response.costtime = data.request.costtime;
response.return = is.readInt32(0, true, TarsStream.Int32);
response.arguments.stResult = is.readStruct(2, true, tars.Result_t);
return {request:data.request, response:response};
} catch (e) {
var response = { };
response.costtime = data.request.costtime;
response.error = {};
response.error.code = TarsError.CLIENT.DECODE_ERROR;
response.error.message = e.message;
throw { request : data.request, response : response};
}
}
var _error = function(data) {
var response = {};
response.costtime = data.request.costtime;
response.error = data.error;
throw {request:data.request, response:response};
}
return this._worker.tars_invoke('getall', _encode(), arguments.length != 0?arguments[arguments.length - 1]:undefined).then(_decode, _error);
}
tars.NodeTarsProxy.prototype.test = function () {
var _encode = function () {
var os = new TarsStream.OutputStream();
return os.getBinBuffer();
}
var _decode = function (data) {
try {
var response = {arguments:{}};
var is = new TarsStream.InputStream(data.response.sBuffer);
response.costtime = data.request.costtime;
response.return = is.readInt32(0, true, TarsStream.Int32);
return {request:data.request, response:response};
} catch (e) {
var response = { };
response.costtime = data.request.costtime;
response.error = {};
response.error.code = TarsError.CLIENT.DECODE_ERROR;
response.error.message = e.message;
throw { request : data.request, response : response};
}
}
var _error = function(data) {
var response = {};
response.costtime = data.request.costtime;
response.error = data.error;
throw {request:data.request, response:response};
}
return this._worker.tars_invoke('test', _encode(), arguments.length != 0?arguments[arguments.length - 1]:undefined).then(_decode, _error);
}
module tars {
struct TracingAnalysisReq {
0 require string serviceName;
1 require long start;
2 require long end;
};
struct DependencyLink {
0 require string parent;
1 require string child;
};
struct ToPoGraph {
0 require vector<DependencyLink> links;
};
struct ChainNodeItem {
0 require string serviceName;
1 require string method;
2 require int order;
3 require int layer;
4 require int QPS;
5 require int peakQPS;
6 require float callPercent;
7 require int avgCost;
8 require float failRate;
};
struct ChainShape {
0 require vector<ChainNodeItem> shape;
1 optional string rootSign;
};
struct ChainShapeCollection {
0 require string timestamp;
1 require map<string, ChainShape> chainShapes;
};
struct TracingAnalysisRes {
0 require ToPoGraph dependencyGraph;
1 require ChainShapeCollection chainShapes;
};
interface QueryController {
TracingAnalysisRes getQueryChainResult(TracingAnalysisReq request);
};
};
\ No newline at end of file
// **********************************************************************
// Parsed By TarsParser(1.1.0), Generated By tools(20180620)
// TarsParser Maintained By <WSRD> and tools Maintained By <superzheng>
// Generated from "QueryTracing.tars" by Client Mode
// **********************************************************************
"use strict";
var assert = require("assert");
var TarsStream = require("@tars/stream");
var TarsError = require("@tars/rpc").error;
var tars = tars || {};
module.exports.tars = tars;
tars.QueryControllerProxy = function () {
this._name = undefined;
this._worker = undefined;
};
tars.QueryControllerProxy.prototype.setTimeout = function (iTimeout) {
this._worker.timeout = iTimeout;
};
tars.QueryControllerProxy.prototype.getTimeout = function () {
return this._worker.timeout;
};
tars.TracingAnalysisReq = function() {
this.serviceName = "";
this.start = 0;
this.end = 0;
this._classname = "tars.TracingAnalysisReq";
};
tars.TracingAnalysisReq._classname = "tars.TracingAnalysisReq";
tars.TracingAnalysisReq._write = function (os, tag, value) { os.writeStruct(tag, value); };
tars.TracingAnalysisReq._read = function (is, tag, def) { return is.readStruct(tag, true, def); };
tars.TracingAnalysisReq._readFrom = function (is) {
var tmp = new tars.TracingAnalysisReq();
tmp.serviceName = is.readString(0, true, "");
tmp.start = is.readInt64(1, true, 0);
tmp.end = is.readInt64(2, true, 0);
return tmp;
};
tars.TracingAnalysisReq.prototype._writeTo = function (os) {
os.writeString(0, this.serviceName);
os.writeInt64(1, this.start);
os.writeInt64(2, this.end);
};
tars.TracingAnalysisReq.prototype._equal = function () {
assert.fail("this structure not define key operation");
};
tars.TracingAnalysisReq.prototype._genKey = function () {
if (!this._proto_struct_name_) {
this._proto_struct_name_ = "STRUCT" + Math.random();
}
return this._proto_struct_name_;
};
tars.TracingAnalysisReq.prototype.toObject = function() {
return {
"serviceName" : this.serviceName,
"start" : this.start,
"end" : this.end
};
};
tars.TracingAnalysisReq.prototype.readFromObject = function(json) {
json.hasOwnProperty("serviceName") && (this.serviceName = json.serviceName);
json.hasOwnProperty("start") && (this.start = json.start);
json.hasOwnProperty("end") && (this.end = json.end);
};
tars.TracingAnalysisReq.prototype.toBinBuffer = function () {
var os = new TarsStream.TarsOutputStream();
this._writeTo(os);
return os.getBinBuffer();
};
tars.TracingAnalysisReq.new = function () {
return new tars.TracingAnalysisReq();
};
tars.TracingAnalysisReq.create = function (is) {
return tars.TracingAnalysisReq._readFrom(is);
};
tars.DependencyLink = function() {
this.parent = "";
this.child = "";
this._classname = "tars.DependencyLink";
};
tars.DependencyLink._classname = "tars.DependencyLink";
tars.DependencyLink._write = function (os, tag, value) { os.writeStruct(tag, value); };
tars.DependencyLink._read = function (is, tag, def) { return is.readStruct(tag, true, def); };
tars.DependencyLink._readFrom = function (is) {
var tmp = new tars.DependencyLink();
tmp.parent = is.readString(0, true, "");
tmp.child = is.readString(1, true, "");
return tmp;
};
tars.DependencyLink.prototype._writeTo = function (os) {
os.writeString(0, this.parent);
os.writeString(1, this.child);
};
tars.DependencyLink.prototype._equal = function () {
assert.fail("this structure not define key operation");
};
tars.DependencyLink.prototype._genKey = function () {
if (!this._proto_struct_name_) {
this._proto_struct_name_ = "STRUCT" + Math.random();
}
return this._proto_struct_name_;
};
tars.DependencyLink.prototype.toObject = function() {
return {
"parent" : this.parent,
"child" : this.child
};
};
tars.DependencyLink.prototype.readFromObject = function(json) {
json.hasOwnProperty("parent") && (this.parent = json.parent);
json.hasOwnProperty("child") && (this.child = json.child);
};
tars.DependencyLink.prototype.toBinBuffer = function () {
var os = new TarsStream.TarsOutputStream();
this._writeTo(os);
return os.getBinBuffer();
};
tars.DependencyLink.new = function () {
return new tars.DependencyLink();
};
tars.DependencyLink.create = function (is) {
return tars.DependencyLink._readFrom(is);
};
tars.ToPoGraph = function() {
this.links = new TarsStream.List(tars.DependencyLink);
this._classname = "tars.ToPoGraph";
};
tars.ToPoGraph._classname = "tars.ToPoGraph";
tars.ToPoGraph._write = function (os, tag, value) { os.writeStruct(tag, value); };
tars.ToPoGraph._read = function (is, tag, def) { return is.readStruct(tag, true, def); };
tars.ToPoGraph._readFrom = function (is) {
var tmp = new tars.ToPoGraph();
tmp.links = is.readList(0, true, TarsStream.List(tars.DependencyLink));
return tmp;
};
tars.ToPoGraph.prototype._writeTo = function (os) {
os.writeList(0, this.links);
};
tars.ToPoGraph.prototype._equal = function () {
assert.fail("this structure not define key operation");
};
tars.ToPoGraph.prototype._genKey = function () {
if (!this._proto_struct_name_) {
this._proto_struct_name_ = "STRUCT" + Math.random();
}
return this._proto_struct_name_;
};
tars.ToPoGraph.prototype.toObject = function() {
return {
"links" : this.links.toObject()
};
};
tars.ToPoGraph.prototype.readFromObject = function(json) {
json.hasOwnProperty("links") && (this.links.readFromObject(json.links));
};
tars.ToPoGraph.prototype.toBinBuffer = function () {
var os = new TarsStream.TarsOutputStream();
this._writeTo(os);
return os.getBinBuffer();
};
tars.ToPoGraph.new = function () {
return new tars.ToPoGraph();
};
tars.ToPoGraph.create = function (is) {
return tars.ToPoGraph._readFrom(is);
};
tars.ChainNodeItem = function() {
this.serviceName = "";
this.method = "";
this.order = 0;
this.layer = 0;
this.QPS = 0;
this.peakQPS = 0;
this.callPercent = 0;
this.avgCost = 0;
this.failRate = 0;
this._classname = "tars.ChainNodeItem";
};
tars.ChainNodeItem._classname = "tars.ChainNodeItem";
tars.ChainNodeItem._write = function (os, tag, value) { os.writeStruct(tag, value); };
tars.ChainNodeItem._read = function (is, tag, def) { return is.readStruct(tag, true, def); };
tars.ChainNodeItem._readFrom = function (is) {
var tmp = new tars.ChainNodeItem();
tmp.serviceName = is.readString(0, true, "");
tmp.method = is.readString(1, true, "");
tmp.order = is.readInt32(2, true, 0);
tmp.layer = is.readInt32(3, true, 0);
tmp.QPS = is.readInt32(4, true, 0);
tmp.peakQPS = is.readInt32(5, true, 0);
tmp.callPercent = is.readFloat(6, true, 0);
tmp.avgCost = is.readInt32(7, true, 0);
tmp.failRate = is.readFloat(8, true, 0);
return tmp;
};
tars.ChainNodeItem.prototype._writeTo = function (os) {
os.writeString(0, this.serviceName);
os.writeString(1, this.method);
os.writeInt32(2, this.order);
os.writeInt32(3, this.layer);
os.writeInt32(4, this.QPS);
os.writeInt32(5, this.peakQPS);
os.writeFloat(6, this.callPercent);
os.writeInt32(7, this.avgCost);
os.writeFloat(8, this.failRate);
};
tars.ChainNodeItem.prototype._equal = function () {
assert.fail("this structure not define key operation");
};
tars.ChainNodeItem.prototype._genKey = function () {
if (!this._proto_struct_name_) {
this._proto_struct_name_ = "STRUCT" + Math.random();
}
return this._proto_struct_name_;
};
tars.ChainNodeItem.prototype.toObject = function() {
return {
"serviceName" : this.serviceName,
"method" : this.method,
"order" : this.order,
"layer" : this.layer,
"QPS" : this.QPS,
"peakQPS" : this.peakQPS,
"callPercent" : this.callPercent,
"avgCost" : this.avgCost,
"failRate" : this.failRate
};
};
tars.ChainNodeItem.prototype.readFromObject = function(json) {
json.hasOwnProperty("serviceName") && (this.serviceName = json.serviceName);
json.hasOwnProperty("method") && (this.method = json.method);
json.hasOwnProperty("order") && (this.order = json.order);
json.hasOwnProperty("layer") && (this.layer = json.layer);
json.hasOwnProperty("QPS") && (this.QPS = json.QPS);
json.hasOwnProperty("peakQPS") && (this.peakQPS = json.peakQPS);
json.hasOwnProperty("callPercent") && (this.callPercent = json.callPercent);
json.hasOwnProperty("avgCost") && (this.avgCost = json.avgCost);
json.hasOwnProperty("failRate") && (this.failRate = json.failRate);
};
tars.ChainNodeItem.prototype.toBinBuffer = function () {
var os = new TarsStream.TarsOutputStream();
this._writeTo(os);
return os.getBinBuffer();
};
tars.ChainNodeItem.new = function () {
return new tars.ChainNodeItem();
};
tars.ChainNodeItem.create = function (is) {
return tars.ChainNodeItem._readFrom(is);
};
tars.ChainShape = function() {
this.shape = new TarsStream.List(tars.ChainNodeItem);
this.rootSign = "";
this._classname = "tars.ChainShape";
};
tars.ChainShape._classname = "tars.ChainShape";
tars.ChainShape._write = function (os, tag, value) { os.writeStruct(tag, value); };
tars.ChainShape._read = function (is, tag, def) { return is.readStruct(tag, true, def); };
tars.ChainShape._readFrom = function (is) {
var tmp = new tars.ChainShape();
tmp.shape = is.readList(0, true, TarsStream.List(tars.ChainNodeItem));
tmp.rootSign = is.readString(1, false, "");
return tmp;
};
tars.ChainShape.prototype._writeTo = function (os) {
os.writeList(0, this.shape);
os.writeString(1, this.rootSign);
};
tars.ChainShape.prototype._equal = function () {
assert.fail("this structure not define key operation");
};
tars.ChainShape.prototype._genKey = function () {
if (!this._proto_struct_name_) {
this._proto_struct_name_ = "STRUCT" + Math.random();
}
return this._proto_struct_name_;
};
tars.ChainShape.prototype.toObject = function() {
return {
"shape" : this.shape.toObject(),
"rootSign" : this.rootSign
};
};
tars.ChainShape.prototype.readFromObject = function(json) {
json.hasOwnProperty("shape") && (this.shape.readFromObject(json.shape));
json.hasOwnProperty("rootSign") && (this.rootSign = json.rootSign);
};
tars.ChainShape.prototype.toBinBuffer = function () {
var os = new TarsStream.TarsOutputStream();
this._writeTo(os);
return os.getBinBuffer();
};
tars.ChainShape.new = function () {
return new tars.ChainShape();
};
tars.ChainShape.create = function (is) {
return tars.ChainShape._readFrom(is);
};
tars.ChainShapeCollection = function() {
this.timestamp = "";
this.chainShapes = new TarsStream.Map(TarsStream.String, tars.ChainShape);
this._classname = "tars.ChainShapeCollection";
};
tars.ChainShapeCollection._classname = "tars.ChainShapeCollection";
tars.ChainShapeCollection._write = function (os, tag, value) { os.writeStruct(tag, value); };
tars.ChainShapeCollection._read = function (is, tag, def) { return is.readStruct(tag, true, def); };
tars.ChainShapeCollection._readFrom = function (is) {
var tmp = new tars.ChainShapeCollection();
tmp.timestamp = is.readString(0, true, "");
tmp.chainShapes = is.readMap(1, true, TarsStream.Map(TarsStream.String, tars.ChainShape));
return tmp;
};
tars.ChainShapeCollection.prototype._writeTo = function (os) {
os.writeString(0, this.timestamp);
os.writeMap(1, this.chainShapes);
};
tars.ChainShapeCollection.prototype._equal = function () {
assert.fail("this structure not define key operation");
};
tars.ChainShapeCollection.prototype._genKey = function () {
if (!this._proto_struct_name_) {
this._proto_struct_name_ = "STRUCT" + Math.random();
}
return this._proto_struct_name_;
};
tars.ChainShapeCollection.prototype.toObject = function() {
return {
"timestamp" : this.timestamp,
"chainShapes" : this.chainShapes.toObject()
};
};
tars.ChainShapeCollection.prototype.readFromObject = function(json) {
json.hasOwnProperty("timestamp") && (this.timestamp = json.timestamp);
json.hasOwnProperty("chainShapes") && (this.chainShapes.readFromObject(json.chainShapes));
};
tars.ChainShapeCollection.prototype.toBinBuffer = function () {
var os = new TarsStream.TarsOutputStream();
this._writeTo(os);
return os.getBinBuffer();
};
tars.ChainShapeCollection.new = function () {
return new tars.ChainShapeCollection();
};
tars.ChainShapeCollection.create = function (is) {
return tars.ChainShapeCollection._readFrom(is);
};
tars.TracingAnalysisRes = function() {
this.dependencyGraph = new tars.ToPoGraph;
this.chainShapes = new tars.ChainShapeCollection;
this._classname = "tars.TracingAnalysisRes";
};
tars.TracingAnalysisRes._classname = "tars.TracingAnalysisRes";
tars.TracingAnalysisRes._write = function (os, tag, value) { os.writeStruct(tag, value); };
tars.TracingAnalysisRes._read = function (is, tag, def) { return is.readStruct(tag, true, def); };
tars.TracingAnalysisRes._readFrom = function (is) {
var tmp = new tars.TracingAnalysisRes();
tmp.dependencyGraph = is.readStruct(0, true, tars.ToPoGraph);
tmp.chainShapes = is.readStruct(1, true, tars.ChainShapeCollection);
return tmp;
};
tars.TracingAnalysisRes.prototype._writeTo = function (os) {
os.writeStruct(0, this.dependencyGraph);
os.writeStruct(1, this.chainShapes);
};
tars.TracingAnalysisRes.prototype._equal = function () {
assert.fail("this structure not define key operation");
};
tars.TracingAnalysisRes.prototype._genKey = function () {
if (!this._proto_struct_name_) {
this._proto_struct_name_ = "STRUCT" + Math.random();
}
return this._proto_struct_name_;
};
tars.TracingAnalysisRes.prototype.toObject = function() {
return {
"dependencyGraph" : this.dependencyGraph.toObject(),
"chainShapes" : this.chainShapes.toObject()
};
};
tars.TracingAnalysisRes.prototype.readFromObject = function(json) {
json.hasOwnProperty("dependencyGraph") && (this.dependencyGraph.readFromObject(json.dependencyGraph));
json.hasOwnProperty("chainShapes") && (this.chainShapes.readFromObject(json.chainShapes));
};
tars.TracingAnalysisRes.prototype.toBinBuffer = function () {
var os = new TarsStream.TarsOutputStream();
this._writeTo(os);
return os.getBinBuffer();
};
tars.TracingAnalysisRes.new = function () {
return new tars.TracingAnalysisRes();
};
tars.TracingAnalysisRes.create = function (is) {
return tars.TracingAnalysisRes._readFrom(is);
};
var __tars_QueryController$getQueryChainResult$EN = function (request) {
var os = new TarsStream.TarsOutputStream();
os.writeStruct(1, request);
return os.getBinBuffer();
};
var __tars_QueryController$getQueryChainResult$DE = function (data) {
try {
var is = new TarsStream.TarsInputStream(data.response.sBuffer);
return {
"request" : data.request,
"response" : {
"costtime" : data.request.costtime,
"return" : is.readStruct(0, true, tars.TracingAnalysisRes)
}
};
} catch (e) {
throw {
"request" : data.request,
"response" : {
"costtime" : data.request.costtime,
"error" : {
"code" : TarsError.CLIENT.DECODE_ERROR,
"message" : e.message
}
}
};
}
};
var __tars_QueryController$getQueryChainResult$ER = function (data) {
throw {
"request" : data.request,
"response" : {
"costtime" : data.request.costtime,
"error" : data.error
}
}
};
tars.QueryControllerProxy.prototype.getQueryChainResult = function (request) {
return this._worker.tars_invoke("getQueryChainResult", __tars_QueryController$getQueryChainResult$EN(request), arguments[arguments.length - 1]).then(__tars_QueryController$getQueryChainResult$DE, __tars_QueryController$getQueryChainResult$ER);
};
......@@ -19,7 +19,7 @@
#proxy需要的配置
<client>
#地址
locator = tars.tarsregistry.QueryObj@tcp -h registry1.tars.com -p 17890:tars.tarsregistry.QueryObj@tcp -h registry2.tars.com -p 17890
locator = tars.tarsregistry.QueryObj@tcp -h registry.tars.com -p 17890
sync-invoke-timeout = 20000
#最大超时时间(毫秒)
max-invoke-timeout = 60000
......
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>TARS</title><link href=/static/css/app.c804e.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.6f04e.js></script><script type=text/javascript src=/static/js/vendor.c722c.js></script><script type=text/javascript src=/static/js/app.d7279.js></script></body></html>
\ No newline at end of file
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>TARS</title><link href=/static/css/app.87109.css rel=stylesheet></head><body><div id=app></div><link rel=stylesheet href=/vis/css/vis-network.min.css><script type=text/javascript src=/vis/js/vis-network.min.js></script><script type=text/javascript src=/static/js/manifest.6f04e.js></script><script type=text/javascript src=/static/js/vendor.c722c.js></script><script type=text/javascript src=/static/js/app.a7545.js></script></body></html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
.vis .overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10}.vis-active{box-shadow:0 0 10px #86d5f8}.vis [class*=span]{min-height:0;width:auto}div.vis-configuration{position:relative;display:block;float:left;font-size:12px}div.vis-configuration-wrapper{display:block;width:700px}div.vis-configuration-wrapper::after{clear:both;content:"";display:block}div.vis-configuration.vis-config-option-container{display:block;width:495px;background-color:#fff;border:2px solid #f7f8fa;border-radius:4px;margin-top:20px;left:10px;padding-left:5px}div.vis-configuration.vis-config-button{display:block;width:495px;height:25px;vertical-align:middle;line-height:25px;background-color:#f7f8fa;border:2px solid #ceced0;border-radius:4px;margin-top:20px;left:10px;padding-left:5px;cursor:pointer;margin-bottom:30px}div.vis-configuration.vis-config-button.hover{background-color:#4588e6;border:2px solid #214373;color:#fff}div.vis-configuration.vis-config-item{display:block;float:left;width:495px;height:25px;vertical-align:middle;line-height:25px}div.vis-configuration.vis-config-item.vis-config-s2{left:10px;background-color:#f7f8fa;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-item.vis-config-s3{left:20px;background-color:#e4e9f0;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-item.vis-config-s4{left:30px;background-color:#cfd8e6;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-header{font-size:18px;font-weight:700}div.vis-configuration.vis-config-label{width:120px;height:25px;line-height:25px}div.vis-configuration.vis-config-label.vis-config-s3{width:110px}div.vis-configuration.vis-config-label.vis-config-s4{width:100px}div.vis-configuration.vis-config-colorBlock{top:1px;width:30px;height:19px;border:1px solid #444;border-radius:2px;padding:0;margin:0;cursor:pointer}input.vis-configuration.vis-config-checkbox{left:-5px}input.vis-configuration.vis-config-rangeinput{position:relative;top:-5px;width:60px;padding:1px;margin:0;pointer-events:none}input.vis-configuration.vis-config-range{-webkit-appearance:none;border:0 solid #fff;background-color:rgba(0,0,0,0);width:300px;height:20px}input.vis-configuration.vis-config-range::-webkit-slider-runnable-track{width:300px;height:5px;background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#dedede),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-o-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:linear-gradient(to bottom,#dedede 0,#c8c8c8 99%);border:1px solid #999;box-shadow:#aaa 0 0 3px 0;border-radius:3px}input.vis-configuration.vis-config-range::-webkit-slider-thumb{-webkit-appearance:none;border:1px solid #14334b;height:17px;width:17px;border-radius:50%;background:#3876c2;background:-moz-linear-gradient(top,#3876c2 0,#385380 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#3876c2),color-stop(100%,#385380));background:-webkit-linear-gradient(top,#3876c2 0,#385380 100%);background:-o-linear-gradient(top,#3876c2 0,#385380 100%);background:-ms-linear-gradient(top,#3876c2 0,#385380 100%);background:linear-gradient(to bottom,#3876c2 0,#385380 100%);box-shadow:#111927 0 0 1px 0;margin-top:-7px}input.vis-configuration.vis-config-range:focus{outline:0}input.vis-configuration.vis-config-range:focus::-webkit-slider-runnable-track{background:#9d9d9d;background:-moz-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#9d9d9d),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-o-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:linear-gradient(to bottom,#9d9d9d 0,#c8c8c8 99%)}input.vis-configuration.vis-config-range::-moz-range-track{width:300px;height:10px;background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#dedede),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-o-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:linear-gradient(to bottom,#dedede 0,#c8c8c8 99%);border:1px solid #999;box-shadow:#aaa 0 0 3px 0;border-radius:3px}input.vis-configuration.vis-config-range::-moz-range-thumb{border:none;height:16px;width:16px;border-radius:50%;background:#385380}input.vis-configuration.vis-config-range:-moz-focusring{outline:1px solid #fff;outline-offset:-1px}input.vis-configuration.vis-config-range::-ms-track{width:300px;height:5px;background:0 0;border-color:transparent;border-width:6px 0;color:transparent}input.vis-configuration.vis-config-range::-ms-fill-lower{background:#777;border-radius:10px}input.vis-configuration.vis-config-range::-ms-fill-upper{background:#ddd;border-radius:10px}input.vis-configuration.vis-config-range::-ms-thumb{border:none;height:16px;width:16px;border-radius:50%;background:#385380}input.vis-configuration.vis-config-range:focus::-ms-fill-lower{background:#888}input.vis-configuration.vis-config-range:focus::-ms-fill-upper{background:#ccc}.vis-configuration-popup{position:absolute;background:rgba(57,76,89,.85);border:2px solid #f2faff;line-height:30px;height:30px;width:150px;text-align:center;color:#fff;font-size:14px;border-radius:4px;-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out}.vis-configuration-popup:after,.vis-configuration-popup:before{left:100%;top:50%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.vis-configuration-popup:after{border-color:rgba(136,183,213,0);border-left-color:rgba(57,76,89,.85);border-width:8px;margin-top:-8px}.vis-configuration-popup:before{border-color:rgba(194,225,245,0);border-left-color:#f2faff;border-width:12px;margin-top:-12px}div.vis-tooltip{position:absolute;visibility:hidden;padding:5px;white-space:nowrap;font-family:verdana;font-size:14px;color:#000;background-color:#f5f4ed;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;border:1px solid #808074;box-shadow:3px 3px 10px rgba(0,0,0,.2);pointer-events:none;z-index:5}div.vis-color-picker{position:absolute;top:0;left:30px;margin-top:-140px;margin-left:30px;width:310px;height:444px;z-index:1;padding:10px;border-radius:15px;background-color:#fff;display:none;box-shadow:rgba(0,0,0,.5) 0 0 10px 0}div.vis-color-picker div.vis-arrow{position:absolute;top:147px;left:5px}div.vis-color-picker div.vis-arrow::after,div.vis-color-picker div.vis-arrow::before{right:100%;top:50%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}div.vis-color-picker div.vis-arrow:after{border-color:rgba(255,255,255,0);border-right-color:#fff;border-width:30px;margin-top:-30px}div.vis-color-picker div.vis-color{position:absolute;width:289px;height:289px;cursor:pointer}div.vis-color-picker div.vis-brightness{position:absolute;top:313px}div.vis-color-picker div.vis-opacity{position:absolute;top:350px}div.vis-color-picker div.vis-selector{position:absolute;top:137px;left:137px;width:15px;height:15px;border-radius:15px;border:1px solid #fff;background:#4c4c4c;background:-moz-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#4c4c4c),color-stop(12%,#595959),color-stop(25%,#666),color-stop(39%,#474747),color-stop(50%,#2c2c2c),color-stop(51%,#000),color-stop(60%,#111),color-stop(76%,#2b2b2b),color-stop(91%,#1c1c1c),color-stop(100%,#131313));background:-webkit-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:-o-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:-ms-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:linear-gradient(to bottom,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%)}div.vis-color-picker div.vis-new-color{position:absolute;width:140px;height:20px;border:1px solid rgba(0,0,0,.1);border-radius:5px;top:380px;left:159px;text-align:right;padding-right:2px;font-size:10px;color:rgba(0,0,0,.4);vertical-align:middle;line-height:20px}div.vis-color-picker div.vis-initial-color{position:absolute;width:140px;height:20px;border:1px solid rgba(0,0,0,.1);border-radius:5px;top:380px;left:10px;text-align:left;padding-left:2px;font-size:10px;color:rgba(0,0,0,.4);vertical-align:middle;line-height:20px}div.vis-color-picker div.vis-label{position:absolute;width:300px;left:10px}div.vis-color-picker div.vis-label.vis-brightness{top:300px}div.vis-color-picker div.vis-label.vis-opacity{top:338px}div.vis-color-picker div.vis-button{position:absolute;width:68px;height:25px;border-radius:10px;vertical-align:middle;text-align:center;line-height:25px;top:410px;border:2px solid #d9d9d9;background-color:#f7f7f7;cursor:pointer}div.vis-color-picker div.vis-button.vis-cancel{left:5px}div.vis-color-picker div.vis-button.vis-load{left:82px}div.vis-color-picker div.vis-button.vis-apply{left:159px}div.vis-color-picker div.vis-button.vis-save{left:236px}div.vis-color-picker input.vis-range{width:290px;height:20px}div.vis-network div.vis-manipulation{box-sizing:content-box;border-width:0;border-bottom:1px;border-style:solid;border-color:#d6d9d8;background:#fff;background:-moz-linear-gradient(top,#fff 0,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#fff),color-stop(48%,#fcfcfc),color-stop(50%,#fafafa),color-stop(100%,#fcfcfc));background:-webkit-linear-gradient(top,#fff 0,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%);background:-o-linear-gradient(top,#fff 0,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%);background:-ms-linear-gradient(top,#fff 0,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%);background:linear-gradient(to bottom,#fff 0,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%);padding-top:4px;position:absolute;left:0;top:0;width:100%;height:28px}div.vis-network div.vis-edit-mode{position:absolute;left:0;top:5px;height:30px}div.vis-network div.vis-close{position:absolute;right:0;top:0;width:30px;height:30px;background-position:20px 3px;background-repeat:no-repeat;background-image:url(img/network/cross.png);cursor:pointer;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}div.vis-network div.vis-close:hover{opacity:.6}div.vis-network div.vis-edit-mode div.vis-button,div.vis-network div.vis-manipulation div.vis-button{float:left;font-family:verdana;font-size:12px;-moz-border-radius:15px;border-radius:15px;display:inline-block;background-position:0 0;background-repeat:no-repeat;height:24px;margin-left:10px;cursor:pointer;padding:0 8px 0 8px;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}div.vis-network div.vis-manipulation div.vis-button:hover{box-shadow:1px 1px 8px rgba(0,0,0,.2)}div.vis-network div.vis-manipulation div.vis-button:active{box-shadow:1px 1px 8px rgba(0,0,0,.5)}div.vis-network div.vis-manipulation div.vis-button.vis-back{background-image:url(img/network/backIcon.png)}div.vis-network div.vis-manipulation div.vis-button.vis-none:hover{box-shadow:1px 1px 8px transparent;cursor:default}div.vis-network div.vis-manipulation div.vis-button.vis-none:active{box-shadow:1px 1px 8px transparent}div.vis-network div.vis-manipulation div.vis-button.vis-none{padding:0}div.vis-network div.vis-manipulation div.notification{margin:2px;font-weight:700}div.vis-network div.vis-manipulation div.vis-button.vis-add{background-image:url(img/network/addNodeIcon.png)}div.vis-network div.vis-edit-mode div.vis-button.vis-edit,div.vis-network div.vis-manipulation div.vis-button.vis-edit{background-image:url(img/network/editIcon.png)}div.vis-network div.vis-edit-mode div.vis-button.vis-edit.vis-edit-mode{background-color:#fcfcfc;border:1px solid #ccc}div.vis-network div.vis-manipulation div.vis-button.vis-connect{background-image:url(img/network/connectIcon.png)}div.vis-network div.vis-manipulation div.vis-button.vis-delete{background-image:url(img/network/deleteIcon.png)}div.vis-network div.vis-edit-mode div.vis-label,div.vis-network div.vis-manipulation div.vis-label{margin:0 0 0 23px;line-height:25px}div.vis-network div.vis-manipulation div.vis-separator-line{float:left;display:inline-block;width:1px;height:21px;background-color:#bdbdbd;margin:0 7px 0 15px}div.vis-network div.vis-navigation div.vis-button{width:34px;height:34px;-moz-border-radius:17px;border-radius:17px;position:absolute;display:inline-block;background-position:2px 2px;background-repeat:no-repeat;cursor:pointer;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}div.vis-network div.vis-navigation div.vis-button:hover{box-shadow:0 0 3px 3px rgba(56,207,21,.3)}div.vis-network div.vis-navigation div.vis-button:active{box-shadow:0 0 1px 3px rgba(56,207,21,.95)}div.vis-network div.vis-navigation div.vis-button.vis-up{background-image:url(img/network/upArrow.png);bottom:50px;left:55px}div.vis-network div.vis-navigation div.vis-button.vis-down{background-image:url(img/network/downArrow.png);bottom:10px;left:55px}div.vis-network div.vis-navigation div.vis-button.vis-left{background-image:url(img/network/leftArrow.png);bottom:10px;left:15px}div.vis-network div.vis-navigation div.vis-button.vis-right{background-image:url(img/network/rightArrow.png);bottom:10px;left:95px}div.vis-network div.vis-navigation div.vis-button.vis-zoomIn{background-image:url(img/network/plus.png);bottom:10px;right:15px}div.vis-network div.vis-navigation div.vis-button.vis-zoomOut{background-image:url(img/network/minus.png);bottom:10px;right:55px}div.vis-network div.vis-navigation div.vis-button.vis-zoomExtends{background-image:url(img/network/zoomExtends.png);bottom:50px;right:15px}
\ No newline at end of file
This diff is collapsed.
......@@ -2,7 +2,6 @@
"name": "tars-web",
"version": "1.0.0",
"description": "Tars web project",
"author": "Zhang Chengrong <zhangchengrong@yuewen.com>",
"private": true,
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js & y-server --hot",
......
<template>
<div class="call-chain-analyze">
<let-row>
<input class="custom_input" v-model="serviceName" @keyup.enter="showCallChainDetail" placeholder="请输入服务名"/>
<let-button theme="primary" @click="showCallChainDetail">查询</let-button>
</let-row>
<!-- <let-row>
<let-col class="grid-content bg-blue" span="8">
<input class="custom_input" v-model="serviceName" @keyup.enter="showTopo" placeholder="输入服务名"/>
</let-col>
<let-col class="grid-content bg-blue-little" span="7" offset="9">
<let-date-range-picker :start.sync="start_time" :end.sync="end_time"></let-date-range-picker>
<let-button theme="primary" @click="showTopo">查询</let-button>
</let-col>
</let-row> -->
<let-form inline ref="topoForm">
<let-form-item :size=3>
<input class="custom_input" v-model="serviceName" @keyup.enter="showTopo" placeholder="输入服务名"/>
</let-form-item>
<let-form-item :size=3>
<let-date-range-picker required :start.sync="start_time" :end.sync="end_time"></let-date-range-picker>
<let-button theme="primary" @click="showTopo">查询</let-button>
</let-form-item>
</let-form>
</div>
</template>
<script>
......@@ -21,12 +36,47 @@ export default {
set_area: '',
set_group: '',
},
serviceName : ''
serviceName : '',
start_time: '',
end_time: '',
}
},
methods : {
showCallChainDetail() {
console.info(this.serviceName);
showTopo() {
if(this.$refs.topoForm.validate()){
const loading = this.$Loading.show();
this.$ajax.getJSON('/server/api/get_topo', {
serviceName : this.serviceName,
start : this.start_time,
end : this.end_time
}).then(data => {
loading.hide();
console.info(data);
}).catch((err) => {
loading.hide();
this.$tip.error(err.message || err.err_msg);
});
}
},
setDate() {
let day = new Date().getDate();
let oldDay = new Date().setDate(day-1);
this.start_time = this.dateToStr(new Date(oldDay), 'yyyy-mm-dd');
this.end_time = this.dateToStr(new Date(), 'yyyy-mm-dd');
},
dateToStr(date, format) {
if(!date || date=='Invalid Date') return;
return format.replace(/yyyy/gi, date.getFullYear().toString())
.replace(/MM/i, fn(date.getMonth() + 1))
.replace(/dd/gi, fn(date.getDate()))
.replace(/hh/gi, fn(date.getHours()))
.replace(/mm/gi, fn(date.getMinutes()))
.replace(/ss/gi, fn(date.getSeconds()));
function fn (n) {
return (n < 10 ? '0' + n : n).toString();
}
}
},
created() {
......@@ -36,6 +86,7 @@ export default {
return item.substr(1);
});
this.serviceName = serviceName.join('.');
this.setDate();
},
mounted() {
......
......@@ -8,7 +8,7 @@
</let-col>
<let-col class="grid-content bg-blue-little" span="7" offset="9">
<let-date-range-picker :start.sync="start_time" :end.sync="end_time"></let-date-range-picker>
<let-button theme="primary">查询</let-button>
<let-button theme="primary" @click="getTracesList">查询</let-button>
</let-col>
</let-row>
......
......@@ -22,15 +22,14 @@ var path = require('path');
module.exports = {
enableLogin: false, //是否启用登录验证
defaultLoginUid: 'admin', //若不启用登录验证,默认用户为admin
loginUrl: 'http://passport.oa.com/modules/passport/signin.ashx', //登录跳转url
loginUrl: '', //登录跳转url
redirectUrlParamName: 'url', //跳转到登录url的时带的原url参数名,如:***/login?service=***,默认是service
logoutUrl: 'http://passport.oa.com/modules/passport/signout.ashx',
logoutUrl: '',
logoutredirectUrlParamName: 'url',
ticketCookieName: 'ticket', //cookie中保存ticket信息的cookie名
uidCookieName: 'uid', //cookie中保存用户信息的cookie名
cookieDomain: 'wsd.com', //cookie值对应的域
cookieDomain: '', //cookie值对应的域
ticketParamName: 'ticket', //第三方登录服务回调时候,url中表示st的参数名
// getUidByTicket: 'http://oss.api.tof.oa.com/api/v1/Passport/DecryptTicketWithClientIP', //通过ticket从cas服务端校验和获取用户基本信息的url
getUidByTicket: '', //通过ticket从cas服务端校验和获取用户基本信息的url,或获取用户基本信息的方法
getUidByTicketParamName: 'ticket', //调用获取用户信息接口时候st的参数名
uidKey: 'data.uid', //结果JSON里面取出用户名的位置,取到该用户名才认为成功,可以多层
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment