$(document).ready(function () {
    $.getJSON("/api/urls/replication/targets/datatable/")
        .done(function (data) {
            AjaxDatatableViewUtils.initialize_table(
                $('#datatable_replication_targets'),
                data,
            );
        });
});

function deleteReplicationTarget(row) {
    id = row.closest('tr').id.substr(4);
    $.getJSON("/api/urls/replication/targets/delete/" + id + "/")
        .done(function (data) {
            window.location.href = data;
        });
}

function editReplicationTarget(row) {
    id = row.closest('tr').id.substr(4);
    $.getJSON("/api/urls/replication/targets/edit/" + id + "/")
        .done(function (data) {
            window.location.href = data;
        });
}