forked from Cacti/plugin_mactrack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmactrack.js
67 lines (61 loc) · 2 KB
/
mactrack.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
var url
function scan_device(device_id) {
url=urlPath+'plugins/mactrack/mactrack_ajax_admin.php?action=rescan&device_id='+device_id
$('#r_'+device_id).attr('src', 'images/view_busy.gif');
$.get(url, function(data) {
reply = data.split('!!!!')
type = reply[0]
device_id = reply[1]
content = reply[2]
$('#r_'+device_id).attr('src', 'images/rescan_site.gif');
$('#response').html(content);
});
}
function site_scan(site_id) {
url=urlPath+'plugins/mactrack/mactrack_ajax_admin.php?action=site_scan&site_id='+site_id;
$('#r_'+site_id).attr('src', urlPath+'plugins/mactrack/images/view_busy.gif');
$.get(url, function(data) {
reply = data.split('!!!!')
type = reply[0]
site_id = reply[1]
content = reply[2]
$('#r_'+site_id).attr('src', 'images/rescan_site.gif');
$('#response').html(content);
});
}
function scan_device_interface(device_id, ifName) {
url=urlPath+'plugins/mactrack/mactrack_ajax_admin.php?action=rescan&device_id='+device_id+'&ifName='+ifName;
$('#r_'+device_id+'_'+ifName).attr('src', urlPath+'plugins/mactrack/images/view_busy.gif');
$.get(url, function(data) {
reply = data.split('!!!!')
type = reply[0]
device_id = reply[1]
ifName = reply[2]
content = reply[3]
$('#r_'+device_id+'_'+ifName).attr('src', 'images/rescan_device.gif');
$('#response').html(content);
});
}
function clearScanResults() {
$('#response').html('');
}
function disable_device(device_id) {
url=urlPath+'plugins/mactrack/mactrack_ajax_admin.php?action=disable&device_id='+device_id;
$.get(url, function(data) {
reply = data.split('!!!!')
type = reply[0]
device_id = reply[1]
content = reply[2]
$('#row_'+device_id).html(content);
});
}
function enable_device(device_id) {
url=urlPath+'plugins/mactrack/mactrack_ajax_admin.php?action=enable&device_id='+device_id;
$.get(url, function(data) {
reply = data.split('!!!!')
type = reply[0]
device_id = reply[1]
content = reply[2]
$('#row_'+device_id).html(content);
});
}