-
-
Save ijunaid8989/479aa158331b29b99c11 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#merge_datatables").on 'click', '.action-cam', -> | |
$('#loading-popup').show() | |
host = $(this).parents('tr').find('td:nth-child(1)').text() | |
port = $(this).parents('tr').find('td:nth-child(2)').text() | |
jpg = $(this).parents('tr').find('td:nth-child(3)').text() | |
d = {} | |
d.host = host | |
d.port = port | |
d.jpg = jpg | |
$.ajax | |
url: 'merge' | |
data: d | |
type: 'get' | |
success: (data) -> | |
console.log(data) | |
$('#loading-popup').hide() | |
content = "<table class='table table-striped'>" | |
content += "<thead>" | |
content += "<tr>" | |
content += "<th>Name</th><th>exid</th><th>Online</th><th>Owner Name</th><th>Public</th><th>Shared Count</th><th>Created At</th>" | |
content += "</tr>" | |
data.forEach (cam) -> | |
content += '<tr> | |
<td><a href="/cameras/'+ cam[1] + '">' + cam[2] + '</a></td><td>' + cam[1] + '</td><td>' + colorMe(cam[6]) + '</td><td><a href="/users/'+ cam[9] + '">' + cam[3] + ' ' + cam[4] + '</a></td><td>' + colorMe(cam[8]) + '</td><td>' + cam[5] + '</td><td>' + cam[7] + '</td> | |
</tr>' | |
content += '</table>' | |
$('#dat').append content | |
$('#add-action').modal('show') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment