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

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

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