...
|
...
|
@@ -203,8 +203,7 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin', 'upload', |
|
|
done: function (res) {
|
|
|
// 编辑事件
|
|
|
$('.link-collector-edit').unbind('click').click(function () {
|
|
|
if ($.inArray('back:collector:update', checkList) == -1) {
|
|
|
layer.msg('暂无权限!', {icon: 7, time: 3000});
|
|
|
if (!common.hasPermission('back:collector:update')){
|
|
|
return;
|
|
|
}
|
|
|
var collector = JSON.parse(JSON.stringify(res.data[$(this).data('index')]));
|
...
|
...
|
@@ -217,8 +216,7 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin', 'upload', |
|
|
|
|
|
// 查看资源列表事件(绑定资源)
|
|
|
$('.link-collector-reslist').unbind('click').click(function () {
|
|
|
if ($.inArray('back:collector:addResources', checkList) == -1) {
|
|
|
layer.msg('暂无权限!', {icon: 7, time: 3000});
|
|
|
if (!common.hasPermission('back:collector:addResources')){
|
|
|
return;
|
|
|
}
|
|
|
collectorId = $(this).data('collectorid');
|
...
|
...
|
@@ -239,8 +237,7 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin', 'upload', |
|
|
});
|
|
|
//下载采集器
|
|
|
$("[collector-data-download]").unbind('click').on("click", function () {
|
|
|
if ($.inArray('back:collector:download', checkList) == -1) {
|
|
|
layer.msg('暂无权限!', {icon: 7, time: 3000});
|
|
|
if (!common.hasPermission('back:collector:download')){
|
|
|
return;
|
|
|
}
|
|
|
var collectorId = $(this).attr("collector-data-download");
|
...
|
...
|
@@ -277,8 +274,7 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin', 'upload', |
|
|
|
|
|
// 同步事件
|
|
|
$('button[collector-data-sync]').unbind('click').on('click', function () {
|
|
|
if ($.inArray('back:collector:synchronization', checkList) == -1) {
|
|
|
layer.msg('暂无权限!', {icon: 7, time: 3000});
|
|
|
if (!common.hasPermission('back:collector:synchronization')){
|
|
|
return;
|
|
|
}
|
|
|
var collector = JSON.parse(JSON.stringify(res.data[$(this).attr('collector-data-sync')]));
|
...
|
...
|
@@ -360,8 +356,7 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin', 'upload', |
|
|
}
|
|
|
});
|
|
|
$(this).parents('tr').eq(0).addClass("tbody-tr-background-color");
|
|
|
if ($.inArray('back:collector:copy', checkList) == -1) {
|
|
|
layer.msg('暂无权限!', {icon: 7, time: 3000});
|
|
|
if (!common.hasPermission('back:collector:copy')){
|
|
|
return;
|
|
|
}
|
|
|
if (common.copyText($(this).attr('collector-data-copy'), 'collector-query-form')) {
|
...
|
...
|
@@ -395,8 +390,7 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin', 'upload', |
|
|
});
|
|
|
// 部署采集器
|
|
|
$('button[collector-data-deploy]').unbind('click').on('click', function () {
|
|
|
if ($.inArray('back:collector:deploy', checkList) == -1) {
|
|
|
layer.msg('暂无权限!', {icon: 7, time: 3000});
|
|
|
if (!common.hasPermission('back:collector:deploy')){
|
|
|
return;
|
|
|
}
|
|
|
var collectorId = $(this).attr('collector-data-deploy');
|
...
|
...
|
@@ -404,8 +398,7 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin', 'upload', |
|
|
});
|
|
|
// 启动采集器
|
|
|
$('button[collector-data-start]').unbind('click').on('click', function () {
|
|
|
if ($.inArray('back:collector:start', checkList) == -1) {
|
|
|
layer.msg('暂无权限!', {icon: 7, time: 3000});
|
|
|
if (!common.hasPermission('back:collector:start')){
|
|
|
return;
|
|
|
}
|
|
|
var collectorId = $(this).attr('collector-data-start');
|
...
|
...
|
@@ -464,8 +457,7 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin', 'upload', |
|
|
|
|
|
// 停止采集器
|
|
|
$('button[collector-data-stop]').unbind('click').on('click', function () {
|
|
|
if ($.inArray('back:collector:stop', checkList) == -1) {
|
|
|
layer.msg('暂无权限!', {icon: 7, time: 3000});
|
|
|
if (!common.hasPermission('back:collector:stop')){
|
|
|
return;
|
|
|
}
|
|
|
var collectorId = $(this).attr('collector-data-stop');
|
...
|
...
|
@@ -474,8 +466,7 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin', 'upload', |
|
|
|
|
|
// 解绑全部资源
|
|
|
$('button[collector-data-unbindRes]').unbind('click').on('click',function (){
|
|
|
if ($.inArray('back:collector:start', checkList) == -1) {
|
|
|
layer.msg('暂无权限!', {icon: 7, time: 3000});
|
|
|
if (!common.hasPermission('back:collector:start')){
|
|
|
return;
|
|
|
}
|
|
|
let collectorId = $(this).attr('collector-data-unbindRes');
|
...
|
...
|
@@ -562,16 +553,14 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin', 'upload', |
|
|
|
|
|
// 新增按钮事件
|
|
|
$('#btn-collector-add').unbind('click').click(function () {
|
|
|
if ($.inArray('back:collector:save', checkList) == -1) {
|
|
|
layer.msg('暂无权限!', {icon: 7, time: 3000});
|
|
|
if (!common.hasPermission('back:collector:save')){
|
|
|
return;
|
|
|
}
|
|
|
saveCollector('insert', '新增');
|
|
|
});
|
|
|
// 创建采集器
|
|
|
$('#btn-collector-generate').unbind('click').click(function () {
|
|
|
if ($.inArray('back:collector:generate', checkList) === -1) {
|
|
|
layer.msg('暂无权限!', {icon: 0});
|
|
|
if (!common.hasPermission('back:collector:generate')){
|
|
|
return;
|
|
|
}
|
|
|
common.openWin("/baseconfig/collector/generate", '<a class="layui-icon layui-icon-edit win_title_icon"></a>创建采集器', null, ['创建', '取消'], function () {
|
...
|
...
|
@@ -594,8 +583,7 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin', 'upload', |
|
|
|
|
|
// 删除按钮事件
|
|
|
$('#btn-collector-delete').unbind('click').click(function () {
|
|
|
if ($.inArray('back:collector:delete', checkList) == -1) {
|
|
|
layer.msg('暂无权限!', {icon: 7, time: 3000});
|
|
|
if (!common.hasPermission('back:collector:delete')){
|
|
|
return;
|
|
|
}
|
|
|
var checks = getSelectedCollectorData();
|
...
|
...
|
@@ -632,8 +620,7 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin', 'upload', |
|
|
|
|
|
// 批量同步
|
|
|
$('#btn-collector-sync').unbind('click').on('click', function () {
|
|
|
if ($.inArray('back:collector:synchronization', checkList) == -1) {
|
|
|
layer.msg('暂无权限!', {icon: 7, time: 3000});
|
|
|
if (!common.hasPermission('back:collector:synchronization')){
|
|
|
return;
|
|
|
}
|
|
|
var $btn = $(this);
|
...
|
...
|
@@ -710,8 +697,7 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin', 'upload', |
|
|
|
|
|
// 发送采集器(部署)
|
|
|
$('#btn-collector-deploy').unbind('click').on('click', function () {
|
|
|
if ($.inArray('back:collector:deploy', checkList) == -1) {
|
|
|
layer.msg('暂无权限!', {icon: 7, time: 3000});
|
|
|
if (!common.hasPermission('back:collector:deploy')){
|
|
|
return;
|
|
|
}
|
|
|
var checks = getSelectedCollectorData();
|
...
|
...
|
@@ -799,8 +785,7 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin', 'upload', |
|
|
|
|
|
// 上传采集器模板
|
|
|
$('#btn-collector-upload').unbind('click').on('click', function () {
|
|
|
if ($.inArray('back:collector:uploading', checkList) == -1) {
|
|
|
layer.msg('暂无权限!', {icon: 7, time: 3000});
|
|
|
if (!common.hasPermission('back:collector:uploading')){
|
|
|
return;
|
|
|
}
|
|
|
layer.prompt({
|
...
|
...
|
@@ -845,8 +830,7 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin', 'upload', |
|
|
|
|
|
// 启动采集器
|
|
|
$('#btn-collector-start').unbind('click').on('click', function () {
|
|
|
if ($.inArray('back:collector:start', checkList) == -1) {
|
|
|
layer.msg('暂无权限!', {icon: 7, time: 3000});
|
|
|
if (!common.hasPermission('back:collector:start')){
|
|
|
return;
|
|
|
}
|
|
|
var $btn = $(this);
|
...
|
...
|
@@ -923,8 +907,7 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin', 'upload', |
|
|
|
|
|
// 停止采集器
|
|
|
$('#btn-collector-stop').unbind('click').on('click', function () {
|
|
|
if ($.inArray('back:collector:stop', checkList) == -1) {
|
|
|
layer.msg('暂无权限!', {icon: 7, time: 3000});
|
|
|
if (!common.hasPermission('back:collector:stop')){
|
|
|
return;
|
|
|
}
|
|
|
var checks = getSelectedCollectorData();
|
...
|
...
|
|