...
|
...
|
@@ -19,18 +19,16 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate' |
|
|
layer.close(confirmIndex);
|
|
|
layer.load(2);
|
|
|
admin.req({
|
|
|
url: domainName + '/api-web/manage/sync/redis',
|
|
|
done: function (response) {
|
|
|
url: domainName + '/api-web/manage/sync/redis'
|
|
|
}).done(function (response) {
|
|
|
layer.closeAll('loading');
|
|
|
if (response.success) {
|
|
|
layer.msg('同步成功!', {icon: 1, time: 3000});
|
|
|
} else {
|
|
|
layer.msg('同步失败!' + response.msg, {icon: 2, time: 3000});
|
|
|
}
|
|
|
},
|
|
|
error: function () {
|
|
|
}).error(function () {
|
|
|
layer.closeAll('loading');
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
});
|
...
|
...
|
@@ -41,18 +39,16 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate' |
|
|
layer.close(confirmIndex);
|
|
|
layer.load(2);
|
|
|
admin.req({
|
|
|
url: domainName + '/api-web/manage/sync/es',
|
|
|
done: function (response) {
|
|
|
url: domainName + '/api-web/manage/sync/es'
|
|
|
}).done(function (response) {
|
|
|
layer.closeAll('loading');
|
|
|
if (response.success) {
|
|
|
layer.msg('同步成功!', {icon: 1, time: 3000});
|
|
|
} else {
|
|
|
layer.msg('同步失败!' + response.msg, {icon: 2, time: 3000});
|
|
|
}
|
|
|
},
|
|
|
error: function () {
|
|
|
}).error(function () {
|
|
|
layer.closeAll('loading');
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
});
|
...
|
...
|
@@ -79,18 +75,16 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate' |
|
|
data: {
|
|
|
url: $btnDom.data('url'),
|
|
|
urlPrefix: $btnDom.data('prefix')
|
|
|
},
|
|
|
success: function (response) {
|
|
|
}
|
|
|
}).done(function (response) {
|
|
|
layer.closeAll('loading');
|
|
|
if (response.success) {
|
|
|
layer.confirm('请求成功!<br/>' + response.msg, {icon: 1});
|
|
|
} else {
|
|
|
layer.confirm('请求失败!' + response.msg, {icon: 2});
|
|
|
}
|
|
|
},
|
|
|
error: function (e) {
|
|
|
}).error(function (e) {
|
|
|
layer.closeAll('loading');
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
});
|
...
|
...
|
@@ -108,18 +102,16 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate' |
|
|
data: {
|
|
|
url: '/delete/key?key=' + value,
|
|
|
urlPrefix: $('#btn-delete-redis-key').data('prefix')
|
|
|
},
|
|
|
success: function (response) {
|
|
|
}
|
|
|
}).done(function (response) {
|
|
|
layer.closeAll('loading');
|
|
|
if (response.success) {
|
|
|
layer.confirm('请求成功!<br/>' + response.msg, {icon: 1});
|
|
|
} else {
|
|
|
layer.confirm('请求失败!' + response.msg, {icon: 2});
|
|
|
}
|
|
|
},
|
|
|
error: function (e) {
|
|
|
}).error(function (e) {
|
|
|
layer.closeAll('loading');
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
});
|
...
|
...
|
@@ -146,18 +138,16 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate' |
|
|
data: {
|
|
|
url: $btnDom.data('url') + data[0].resId,
|
|
|
urlPrefix: $btnDom.data('prefix')
|
|
|
},
|
|
|
success: function (response) {
|
|
|
}
|
|
|
}).done(function (response) {
|
|
|
layer.closeAll('loading');
|
|
|
if (response.success) {
|
|
|
layer.confirm('请求成功!<br/>' + response.msg, {icon: 1});
|
|
|
} else {
|
|
|
layer.confirm('请求失败!' + response.msg, {icon: 2});
|
|
|
}
|
|
|
},
|
|
|
error: function (e) {
|
|
|
}).error(function (e) {
|
|
|
layer.closeAll('loading');
|
|
|
}
|
|
|
});
|
|
|
return true
|
|
|
});
|
...
|
...
|
@@ -187,18 +177,16 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate' |
|
|
data: {
|
|
|
url: $btnDom.data('url') + data[0].id,
|
|
|
urlPrefix: $btnDom.data('prefix')
|
|
|
},
|
|
|
success: function (response) {
|
|
|
}
|
|
|
}).done(function (response) {
|
|
|
layer.closeAll('loading');
|
|
|
if (response.success) {
|
|
|
layer.confirm('请求成功!<br/>' + response.msg, {icon: 1});
|
|
|
} else {
|
|
|
layer.confirm('请求失败!' + response.msg, {icon: 2});
|
|
|
}
|
|
|
},
|
|
|
error: function (e) {
|
|
|
}).error(function (e) {
|
|
|
layer.closeAll('loading');
|
|
|
}
|
|
|
});
|
|
|
return true
|
|
|
}, null, null, function () {
|
...
|
...
|
@@ -247,7 +235,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate' |
|
|
}).done(function (response) {
|
|
|
if (response.data.length == 0) {
|
|
|
admin.req({
|
|
|
url: domainName + '/api-web/manage/ddic/save?access_token=' + accessToken,
|
|
|
url: domainName + '/api-web/manage/ddic/save',
|
|
|
type: 'POST',
|
|
|
contentType: 'application/json',
|
|
|
data: JSON.stringify(ddic)
|
...
|
...
|
@@ -273,7 +261,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate' |
|
|
//查询所有数据IP中的数据
|
|
|
function selectIP() {
|
|
|
admin.req({
|
|
|
url: domainName + '/api-web/manage/ddic/page?access_token=' + accessToken + "&ddicCategory=syncAddr",
|
|
|
url: domainName + '/api-web/manage/ddic/page?ddicCategory=syncAddr',
|
|
|
}).done(function (response) {
|
|
|
$('#url-prefix').empty();
|
|
|
var html = '<option value="http://127.0.0.1:8414">http://127.0.0.1:8414</option>'
|
...
|
...
|
@@ -305,19 +293,17 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate' |
|
|
layer.close(confirmIndex);
|
|
|
layer.load(2);
|
|
|
admin.req({
|
|
|
url: domainName + '/api-web/manage/sync/initInstallRelationInfo',
|
|
|
success: function (response) {
|
|
|
url: domainName + '/api-web/manage/sync/initInstallRelationInfo'
|
|
|
}).done(function (response) {
|
|
|
layer.closeAll('loading');
|
|
|
if (response.success) {
|
|
|
layer.confirm(response.str, {icon: 1});
|
|
|
} else {
|
|
|
layer.confirm('初始化失败!', {icon: 2});
|
|
|
}
|
|
|
},
|
|
|
error: function (e) {
|
|
|
}).error(function (e) {
|
|
|
layer.closeAll('loading');
|
|
|
layer.confirm('初始化失败!', {icon: 2});
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
});
|
...
|
...
|
@@ -363,8 +349,8 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate' |
|
|
url: domainName + '/api-web/manage/kpi/list',
|
|
|
data: {
|
|
|
restype: ''
|
|
|
},
|
|
|
success(response) {
|
|
|
}
|
|
|
}).done(function (response) {
|
|
|
if (response && response.success) {
|
|
|
var options = '<option value="">=指标Id=</option>';
|
|
|
response.data.forEach(item => {
|
...
|
...
|
@@ -375,10 +361,8 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate' |
|
|
} else {
|
|
|
this.error();
|
|
|
}
|
|
|
},
|
|
|
error() {
|
|
|
}).error(function () {
|
|
|
layer.msg('获取指标信息失败!', {icon: 2});
|
|
|
}
|
|
|
});
|
|
|
// 选择kpi
|
|
|
form.on('select(slt-input-collector-kpiId)', function (data) {
|
...
|
...
|
@@ -403,12 +387,12 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate' |
|
|
collectorData.kpiId = kpiInfos[0];
|
|
|
collectorData.kpiName = kpiInfos[1];
|
|
|
layer.load(2);
|
|
|
$.ajax({
|
|
|
url: domainName + '/api-web/manage/sync/crtDataReal?access_token=' + accessToken,
|
|
|
admin.req({
|
|
|
url: domainName + '/api-web/manage/sync/crtDataReal',
|
|
|
type: 'POST',
|
|
|
data: JSON.stringify(collectorData),
|
|
|
contentType: 'application/json',
|
|
|
success(response) {
|
|
|
contentType: 'application/json'
|
|
|
}).done(function (response) {
|
|
|
layer.closeAll('loading');
|
|
|
if (response && response.code === 'success') {
|
|
|
layer.closeAll('page');
|
...
|
...
|
@@ -416,11 +400,9 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate' |
|
|
} else {
|
|
|
layer.msg(response.message, {icon: 2});
|
|
|
}
|
|
|
},
|
|
|
error() {
|
|
|
}).error(function () {
|
|
|
layer.closeAll('loading');
|
|
|
layer.msg('录入失败!', {icon: 2});
|
|
|
}
|
|
|
})
|
|
|
});
|
|
|
},
|
...
|
...
|
@@ -468,8 +450,8 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate' |
|
|
layer.load(2);
|
|
|
admin.req({
|
|
|
url: domainName + '/api-web/manage/sync/sendMsg',
|
|
|
data: msgData,
|
|
|
success(response) {
|
|
|
data: msgData
|
|
|
}).done(function (response) {
|
|
|
layer.closeAll('loading');
|
|
|
if (response && response.success) {
|
|
|
layer.msg('发送成功!', {icon: 1});
|
...
|
...
|
@@ -477,12 +459,10 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate' |
|
|
} else {
|
|
|
layer.msg('发送失败!', {icon: 2});
|
|
|
}
|
|
|
},
|
|
|
error() {
|
|
|
}).error(function () {
|
|
|
layer.closeAll('loading');
|
|
|
layer.msg('发送失败!', {icon: 2});
|
|
|
}
|
|
|
});
|
|
|
})
|
|
|
});
|
|
|
},
|
|
|
yes() {
|
...
|
...
|
@@ -527,8 +507,8 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate' |
|
|
url: domainName + '/api-web/manage/kpi/list',
|
|
|
data: {
|
|
|
restype: ''
|
|
|
},
|
|
|
success(response) {
|
|
|
}
|
|
|
}).done(function (response) {
|
|
|
if (response && response.success) {
|
|
|
var options = '<option value="">=指标Id=</option>';
|
|
|
response.data.forEach(item => {
|
...
|
...
|
@@ -539,21 +519,19 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate' |
|
|
} else {
|
|
|
this.error();
|
|
|
}
|
|
|
},
|
|
|
error() {
|
|
|
}).error(function () {
|
|
|
layer.msg('获取指标信息失败!', {icon: 2});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
// 表单提交
|
|
|
form.on('submit(form-es-export)', function (data) {
|
|
|
var formData = form.val('form-es-export');
|
|
|
layer.load(2);
|
|
|
$.ajax({
|
|
|
url: domainName + '/api-web/manage/sync/esExport?access_token=' + accessToken,
|
|
|
admin.req({
|
|
|
url: domainName + '/api-web/manage/sync/esExport',
|
|
|
type: 'GET',
|
|
|
data: formData,
|
|
|
success(response) {
|
|
|
data: formData
|
|
|
}).done(function (response) {
|
|
|
layer.closeAll('loading');
|
|
|
if (response && response.success) {
|
|
|
layer.closeAll('page');
|
...
|
...
|
@@ -561,11 +539,9 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate' |
|
|
} else {
|
|
|
layer.msg(response.msg, {icon: 2});
|
|
|
}
|
|
|
},
|
|
|
error() {
|
|
|
}).error(function () {
|
|
|
layer.closeAll('loading');
|
|
|
layer.msg('导出失败!', {icon: 2});
|
|
|
}
|
|
|
})
|
|
|
});
|
|
|
},
|
...
|
...
|
@@ -580,12 +556,12 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate' |
|
|
$('#btn-es-import').unbind('click').on('click', function () {
|
|
|
|
|
|
layer.prompt({title: '文件路径', formType: 2}, function (text, index) {
|
|
|
$.ajax({
|
|
|
url: domainName + '/api-web/manage/sync/esImport?access_token=' + accessToken,
|
|
|
admin.req({
|
|
|
url: domainName + '/api-web/manage/sync/esImport',
|
|
|
data: {
|
|
|
filePath: text
|
|
|
},
|
|
|
success(response) {
|
|
|
}
|
|
|
}).done(function (response) {
|
|
|
layer.closeAll('loading');
|
|
|
if (response && response.success) {
|
|
|
layer.close(index);
|
...
|
...
|
@@ -593,11 +569,9 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate' |
|
|
} else {
|
|
|
layer.msg(response.msg, {icon: 2});
|
|
|
}
|
|
|
},
|
|
|
error() {
|
|
|
}).error(function () {
|
|
|
layer.closeAll('loading');
|
|
|
layer.msg('导出失败!', {icon: 2});
|
|
|
}
|
|
|
});
|
|
|
})
|
|
|
});
|
...
|
...
|
@@ -612,20 +586,18 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate' |
|
|
data: {
|
|
|
resTypeCode,
|
|
|
clusterResTypeCode
|
|
|
},
|
|
|
success(response) {
|
|
|
}
|
|
|
}).done(function (response) {
|
|
|
layer.closeAll('loading');
|
|
|
if (response.success) {
|
|
|
layer.confirm(response.msg, {icon: 1});
|
|
|
} else {
|
|
|
layer.confirm(response.msg, {icon: 2});
|
|
|
}
|
|
|
},
|
|
|
error(e) {
|
|
|
}).error(function () {
|
|
|
layer.closeAll('loading');
|
|
|
layer.confirm('生成失败!', {icon: 2});
|
|
|
}
|
|
|
});
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
|
...
|
...
|
@@ -649,22 +621,18 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate' |
|
|
layer.load(2);
|
|
|
admin.req({
|
|
|
url: domainName + '/api-web/bChecktemplate/gatherExport',
|
|
|
|
|
|
data: {
|
|
|
tempName: tempName.tempName
|
|
|
},
|
|
|
|
|
|
success: function (response) {
|
|
|
}
|
|
|
}).done(function (response) {
|
|
|
layer.closeAll('loading');
|
|
|
if (response.success) {
|
|
|
layer.confirm('请求成功!<br/>' + response.msg, {icon: 1});
|
|
|
} else {
|
|
|
layer.confirm('请求失败!' + response.msg, {icon: 2});
|
|
|
}
|
|
|
},
|
|
|
error: function (e) {
|
|
|
}).error(function (e) {
|
|
|
layer.closeAll('loading');
|
|
|
}
|
|
|
});
|
|
|
return true
|
|
|
});
|
...
|
...
|
@@ -674,12 +642,12 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate' |
|
|
$('#btn-gather-import').unbind('click').on('click', function () {
|
|
|
|
|
|
layer.prompt({title: '文件路径', formType: 2}, function (text, index) {
|
|
|
$.ajax({
|
|
|
url: domainName + '/api-web/manage/sync/gatherImport?access_token=' + accessToken,
|
|
|
admin.req({
|
|
|
url: domainName + '/api-web/manage/sync/gatherImport',
|
|
|
data: {
|
|
|
filePath: text
|
|
|
},
|
|
|
success(response) {
|
|
|
}
|
|
|
}).done(function (response) {
|
|
|
layer.closeAll('loading');
|
|
|
if (response && response.success) {
|
|
|
layer.close(index);
|
...
|
...
|
@@ -687,11 +655,9 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate' |
|
|
} else {
|
|
|
layer.msg(response.msg, {icon: 2});
|
|
|
}
|
|
|
},
|
|
|
error() {
|
|
|
}).error(function () {
|
|
|
layer.closeAll('loading');
|
|
|
layer.msg('导入失败!', {icon: 2});
|
|
|
}
|
|
|
});
|
|
|
})
|
|
|
});
|
...
|
...
|
|