|
@@ -37,6 +37,18 @@
|
|
|
<input code="text" class="layui-input" name="project" id="project" value="">
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div class="layui-inline">
|
|
|
+ <label class="layui-form-label">应用IP</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <input code="text" class="layui-input" name="applicationIp" id="q_applicationIp" value="">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="layui-inline">
|
|
|
+ <label class="layui-form-label">主题</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <input code="text" class="layui-input" name="topic" id="q_topic" value="">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="layui-form-item">
|
|
|
<div class="layui-inline">
|
|
@@ -57,6 +69,13 @@
|
|
|
<input code="text" class="layui-input" name="dataId" id="data_id">
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <div class="layui-inline">
|
|
|
+ <label class="layui-form-label">执行耗时</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <input code="text" class="layui-input" name="requestTime" id="q_request_time">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="layui-form-item">
|
|
|
<div class="layui-inline">
|
|
@@ -93,15 +112,66 @@
|
|
|
//
|
|
|
</script>
|
|
|
<script>
|
|
|
+ var _self = this;
|
|
|
+ var catUrl = '[(${catUrl})]';
|
|
|
+ var nextTree = function nextTree(logId) {
|
|
|
+ let date = $("#d_date").val();
|
|
|
+ var requestBody = {};
|
|
|
+ requestBody["date"] = date;
|
|
|
+ requestBody["parentLogId"] = logId;
|
|
|
+ requestBody["pageSize"] = 100;
|
|
|
+ elab_common.postReq(urlConfig.trace.mqListService, requestBody, function (result) {
|
|
|
+ let resultSet = result.pageModel.resultSet;
|
|
|
+ if (resultSet) {
|
|
|
+ var jsonConfig = {collapsed: false, withQuotes: true, withLinks: true}
|
|
|
+ debugger;
|
|
|
+ var resultJson = [];
|
|
|
+ $(resultSet).each(function (index, obj) {
|
|
|
+ debugger;
|
|
|
+ var data = {};
|
|
|
+ data["应用名称"] = obj.applicationName;
|
|
|
+ data["应用ip"] = obj.applicationIp+"";
|
|
|
+ data["日志"] = catUrl+obj.logId;
|
|
|
+ data["执行状态"] = elab_common.getConfigTypeText("common_status", obj.status);
|
|
|
+ data["创建时间"] = elab_common.longConvertDateTime(obj.createdTime);
|
|
|
+ data["请求时长"] = obj.requestTime;
|
|
|
+ resultJson[index] = data;
|
|
|
+ })
|
|
|
+
|
|
|
+ showJson(resultJson, jsonConfig);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function showJson(obj, jsonConfig) {
|
|
|
+
|
|
|
+ if (jsonConfig == undefined) {
|
|
|
+ jsonConfig = {collapsed: false, withQuotes: true, withLinks: false};
|
|
|
+ }
|
|
|
+
|
|
|
+ $('#json-renderer').jsonViewer(obj, jsonConfig);
|
|
|
+ layer.open({
|
|
|
+ type: 1
|
|
|
+ , title: false //不显示标题栏
|
|
|
+ , closeBtn: false
|
|
|
+ , area: '800px;'
|
|
|
+ , shade: 0.8
|
|
|
+ , id: 'LAY_layuipro' //设定一个id,防止重复弹出
|
|
|
+ , btnAlign: 'c'
|
|
|
+ , shadeClose: true
|
|
|
+ , moveType: 1 //拖拽模式,0或者1
|
|
|
+ , content: $('#json-renderer').show()
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
layui.use(['laydate', 'layer', 'table', 'form', 'element'], function () {
|
|
|
var laydate = layui.laydate, layer = layui.layer, table = layui.table, form = layui.form;
|
|
|
- var catUrl = '[(${catUrl})]';
|
|
|
var listUrl = urlConfig.trace.mqListService;
|
|
|
var updateUrl = urlConfig.route.updateHtml;
|
|
|
var delUrl = "";
|
|
|
var addUrl = urlConfig.route.refreshHtml;
|
|
|
var method = "post";
|
|
|
- var title = "路由列表"
|
|
|
+ var title = "路由列表";
|
|
|
|
|
|
// 构建数据
|
|
|
var dataColumn = [
|
|
@@ -133,15 +203,20 @@
|
|
|
field: 'dataId', title: '索引编号', width: 100
|
|
|
}, {
|
|
|
field: 'rootLogId', title: '链路顶层编号', hide: true, templet: function (res) {
|
|
|
- return '<em><a href="' + catUrl + res.rootLogId + '" target="_blank">顶层日志</a></em>'
|
|
|
+ return '<em><a href="' + catUrl + res.rootLogId + '" target="_blank" title="点击查看日志详情"><i class="layui-icon" style="font-size: 30px; color: #1E9FFF;"></i></a></em>'
|
|
|
}
|
|
|
}, {
|
|
|
field: 'parentLogId', title: '链路上级编号', templet: function (res) {
|
|
|
- return '<em><a href="' + catUrl + res.parentLogId + '" target="_blank">上层日志</a></em>'
|
|
|
+ var style = "";
|
|
|
+ // var style = "style=\"color: blue;text-decoration: underline;\"";
|
|
|
+ return '<em> <a href="' + catUrl + res.parentLogId + '" target="_blank" ' + style + ' title="点击查看日志详情"><i class="layui-icon" style="font-size: 30px; color: #1E9FFF;"></i></a> </em>' +
|
|
|
+ '<em><a href="javascript:void(0);" onclick="nextTree(\'' + res.logId + '\')" ' + style + ' title="查看下级消息树"><i class="layui-icon" style="font-size: 30px; color: #1E9FFF;"></i></a></em>'
|
|
|
}
|
|
|
}, {
|
|
|
field: 'logId', title: '链路编号', rowspan: 2, width: 100, templet: function (res) {
|
|
|
- return '<em><a href="' + catUrl + res.logId + '" target="_blank">当前日志</a></em>'
|
|
|
+ // var style = "style=\"color: blue;text-decoration: underline;\"";
|
|
|
+ var style = "";
|
|
|
+ return '<em><a href="' + catUrl + res.logId + '" target="_blank" ' + style + ' title="点击查看日志详情"><i class="layui-icon" style="font-size: 30px; color: #1E9FFF;"></i></a></em>'
|
|
|
}
|
|
|
}, {
|
|
|
field: 'status', title: '是否有效', rowspan: 1, width: 80, templet: function (res) {
|
|
@@ -151,10 +226,18 @@
|
|
|
}
|
|
|
return '<em ' + styleString + '>' + elab_common.getConfigTypeText("common_status", res.status) + '</em>'
|
|
|
}
|
|
|
+ }, {
|
|
|
+ field: 'requestTime', title: '执行耗时', rowspan: 1, width: 80, templet: function (res) {
|
|
|
+ var styleString = "style=\"color: red;\"";
|
|
|
+ if (res.requestTime < 500) {
|
|
|
+ styleString = "style=\"color: #5fb878;\"";
|
|
|
+ }
|
|
|
+ return '<em ' + styleString + '>' + res.requestTime + '</em>'
|
|
|
+ }
|
|
|
}
|
|
|
,
|
|
|
{
|
|
|
- field: 'sourceTime', title: '来源时间', width: 160, templet: function (res) {
|
|
|
+ field: 'sourceTime', title: '来源时间', width: 160, hide: true, templet: function (res) {
|
|
|
return '<em>' + elab_common.longConvertDateTime(res.sourceTime) + '</em>'
|
|
|
}
|
|
|
}
|
|
@@ -173,39 +256,13 @@
|
|
|
debugger;
|
|
|
if ("findDetail" == event) {
|
|
|
elab_common.getReq("/api/log/mq?id=" + obj.data.id, null, function (data) {
|
|
|
- debugger;
|
|
|
- $('#json-renderer').jsonViewer(data, {collapsed: false, withQuotes: true, withLinks: false});
|
|
|
- layer.open({
|
|
|
- type: 1
|
|
|
- , title: false //不显示标题栏
|
|
|
- , closeBtn: false
|
|
|
- , area: '500px;'
|
|
|
- , shade: 0.8
|
|
|
- , id: 'LAY_layuipro' //设定一个id,防止重复弹出
|
|
|
- , btnAlign: 'c'
|
|
|
- , shadeClose: true
|
|
|
- , moveType: 1 //拖拽模式,0或者1
|
|
|
- , content: $('#json-renderer').show()
|
|
|
- });
|
|
|
+ showJson(data);
|
|
|
})
|
|
|
-
|
|
|
}
|
|
|
});
|
|
|
|
|
|
table.on('rowDouble(list_table)', function (obj) {
|
|
|
- $('#json-renderer').jsonViewer(obj.data, {collapsed: false, withQuotes: true, withLinks: false});
|
|
|
- layer.open({
|
|
|
- type: 1
|
|
|
- , title: false //不显示标题栏
|
|
|
- , closeBtn: false
|
|
|
- , area: '500px;'
|
|
|
- , shade: 0.8
|
|
|
- , id: 'LAY_layuipro' //设定一个id,防止重复弹出
|
|
|
- , btnAlign: 'c'
|
|
|
- , shadeClose: true
|
|
|
- , moveType: 1 //拖拽模式,0或者1
|
|
|
- , content: $('#json-renderer').show()
|
|
|
- });
|
|
|
+ showJson(obj.data);
|
|
|
});
|
|
|
|
|
|
form.on('submit(submit_from)', function (data) {
|
|
@@ -243,7 +300,7 @@
|
|
|
|
|
|
</script>
|
|
|
<script code="text/html" id="barDemo">
|
|
|
- <a className="layui-btn layui-btn-xs" lay-event="findDetail"> 消息内容 </a>
|
|
|
+ <a className="layui-btn layui-btn-xs" lay-event="findDetail">消息内容</a>
|
|
|
</script>
|
|
|
</body>
|
|
|
|