fix:采集器管理-右侧功能不能使用(下载、同步、部署、启动、停止、复制、解绑资源)
Showing
1 changed file
with
15 additions
and
15 deletions
@@ -273,8 +273,8 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin', 'upload', | @@ -273,8 +273,8 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin', 'upload', | ||
273 | }); | 273 | }); |
274 | 274 | ||
275 | // 同步事件 | 275 | // 同步事件 |
276 | - $('button[collector-data-sync]').unbind('click').on('click', function () { | ||
277 | - if (!common.hasPermission('back:collector:synchronization')){ | 276 | + $('a[collector-data-sync]').unbind('click').on('click', function () { |
277 | + if (!common.hasPermission('back:collector:synchronization')) { | ||
278 | return; | 278 | return; |
279 | } | 279 | } |
280 | var collector = JSON.parse(JSON.stringify(res.data[$(this).attr('collector-data-sync')])); | 280 | var collector = JSON.parse(JSON.stringify(res.data[$(this).attr('collector-data-sync')])); |
@@ -334,7 +334,7 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin', 'upload', | @@ -334,7 +334,7 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin', 'upload', | ||
334 | }); | 334 | }); |
335 | }); | 335 | }); |
336 | // 复制采集器ID | 336 | // 复制采集器ID |
337 | - $('button[collector-data-copy]').unbind('click').on('click', function () { | 337 | + $('a[collector-data-copy]').unbind('click').on('click', function () { |
338 | //背景色改变 | 338 | //背景色改变 |
339 | $.each($(this).parents('tbody').eq(0).find('tr'), function (i, v) { | 339 | $.each($(this).parents('tbody').eq(0).find('tr'), function (i, v) { |
340 | $(this).css('background-color', ''); | 340 | $(this).css('background-color', ''); |
@@ -389,16 +389,16 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin', 'upload', | @@ -389,16 +389,16 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin', 'upload', | ||
389 | }); | 389 | }); |
390 | }); | 390 | }); |
391 | // 部署采集器 | 391 | // 部署采集器 |
392 | - $('button[collector-data-deploy]').unbind('click').on('click', function () { | ||
393 | - if (!common.hasPermission('back:collector:deploy')){ | 392 | + $('a[collector-data-deploy]').unbind('click').on('click', function () { |
393 | + if (!common.hasPermission('back:collector:deploy')) { | ||
394 | return; | 394 | return; |
395 | } | 395 | } |
396 | var collectorId = $(this).attr('collector-data-deploy'); | 396 | var collectorId = $(this).attr('collector-data-deploy'); |
397 | deployCollector([collectorId]); | 397 | deployCollector([collectorId]); |
398 | }); | 398 | }); |
399 | // 启动采集器 | 399 | // 启动采集器 |
400 | - $('button[collector-data-start]').unbind('click').on('click', function () { | ||
401 | - if (!common.hasPermission('back:collector:start')){ | 400 | + $('a[collector-data-start]').unbind('click').on('click', function () { |
401 | + if (!common.hasPermission('back:collector:start')) { | ||
402 | return; | 402 | return; |
403 | } | 403 | } |
404 | var collectorId = $(this).attr('collector-data-start'); | 404 | var collectorId = $(this).attr('collector-data-start'); |
@@ -456,8 +456,8 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin', 'upload', | @@ -456,8 +456,8 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin', 'upload', | ||
456 | }); | 456 | }); |
457 | 457 | ||
458 | // 停止采集器 | 458 | // 停止采集器 |
459 | - $('button[collector-data-stop]').unbind('click').on('click', function () { | ||
460 | - if (!common.hasPermission('back:collector:stop')){ | 459 | + $('a[collector-data-stop]').unbind('click').on('click', function () { |
460 | + if (!common.hasPermission('back:collector:stop')) { | ||
461 | return; | 461 | return; |
462 | } | 462 | } |
463 | var collectorId = $(this).attr('collector-data-stop'); | 463 | var collectorId = $(this).attr('collector-data-stop'); |
@@ -465,16 +465,16 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin', 'upload', | @@ -465,16 +465,16 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin', 'upload', | ||
465 | }); | 465 | }); |
466 | 466 | ||
467 | // 解绑全部资源 | 467 | // 解绑全部资源 |
468 | - $('button[collector-data-unbindRes]').unbind('click').on('click',function (){ | ||
469 | - if (!common.hasPermission('back:collector:start')){ | 468 | + $('a[collector-data-unbindRes]').unbind('click').on('click', function () { |
469 | + if (!common.hasPermission('back:collector:start')) { | ||
470 | return; | 470 | return; |
471 | } | 471 | } |
472 | let collectorId = $(this).attr('collector-data-unbindRes'); | 472 | let collectorId = $(this).attr('collector-data-unbindRes'); |
473 | admin.req({ | 473 | admin.req({ |
474 | - url:domainName + '/api-web/trapoid/unbind', | ||
475 | - data:{ | ||
476 | - collectorId:collectorId, | ||
477 | - resIdList:"", | 474 | + url: domainName + '/api-web/trapoid/unbind', |
475 | + data: { | ||
476 | + collectorId: collectorId, | ||
477 | + resIdList: "", | ||
478 | }, | 478 | }, |
479 | success(response){ | 479 | success(response){ |
480 | if (response && response.success) { | 480 | if (response && response.success) { |
-
Please register or login to post a comment