function NodeViewModel() { var self = this; // handle requests to create a new node. $(".modal-node button").click(function(e) { var addr = $(".modal-node input").val(); var node = { address: addr }; $.ajax({ url: "/api/nodes", type: "POST", contentType: "application/json", data: JSON.stringify(node), success: function( data ) { // clears the form value $(".modal-node input").val(""); var el = $("
").attr("class", "col-sm-4").append( $("
").attr("class", "card").attr("data-id", data.id).append( $("
").attr("class", "card-header").append( $("").attr("class", "linux_amd64") ) ).append( $("
").attr("class", "card-block").append( $("

").text(data.address) ).append( $("

").attr("class", "card-text").text(data.architecture) ).append( $("

").attr("class", "btn-group").append( $("