function renderClientList(data) { $.each(data, function(index, obj) { // render client status css tag style let clientStatusHtml = '>' if (obj.Client.enabled) { clientStatusHtml = `style="visibility: hidden;">` } // render client allocated ip addresses let allocatedIpsHtml = ""; $.each(obj.Client.allocated_ips, function(index, obj) { allocatedIpsHtml += `${obj} `; }) // render client allowed ip addresses let allowedIpsHtml = ""; $.each(obj.Client.allowed_ips, function(index, obj) { allowedIpsHtml += `${obj} `; }) // render client html content let html = `

${obj.Client.name} ${obj.Client.email} ${obj.Client.created_at} ${obj.Client.updated_at} IP Allocation` + allocatedIpsHtml + `Allowed IPs` + allowedIpsHtml +`
` // add the client html elements to the list $('#client-list').append(html); }); }