diff --git a/modules/portal/app/views/dnsChanges/dnsChangeDetail.scala.html b/modules/portal/app/views/dnsChanges/dnsChangeDetail.scala.html index 956fa95f7..b9e254c1d 100644 --- a/modules/portal/app/views/dnsChanges/dnsChangeDetail.scala.html +++ b/modules/portal/app/views/dnsChanges/dnsChangeDetail.scala.html @@ -41,7 +41,9 @@
-

ID: {{batch.id}}

+

ID: {{batch.id}} + +

Submitted: {{batch.createdTimestamp}}

Submitter: {{batch.userName}}

Description: {{batch.comments}}

diff --git a/modules/portal/public/css/vinyldns.css b/modules/portal/public/css/vinyldns.css index 4beac8b20..7085d6e5e 100644 --- a/modules/portal/public/css/vinyldns.css +++ b/modules/portal/public/css/vinyldns.css @@ -133,6 +133,11 @@ a.action-link { border-bottom-left-radius: 4px; } +.btn-right-corner { + float: right; + margin-left: 10px; +} + .form-control.zone-edit { background: #F9F9F9; color:#555; diff --git a/modules/portal/public/lib/dns-change/dns-change-detail.controller.js b/modules/portal/public/lib/dns-change/dns-change-detail.controller.js index 024177d5c..7c2d5cf5f 100644 --- a/modules/portal/public/lib/dns-change/dns-change-detail.controller.js +++ b/modules/portal/public/lib/dns-change/dns-change-detail.controller.js @@ -138,6 +138,33 @@ $("#cancel_batch_change").modal("hide"); } + $scope.exportToCSV = function (batchId) { + var filename = batchId + '.csv'; + var csv = []; + var changes = document.querySelectorAll("table tr"); + $log.debug(batchId) + for (var i = 0; i < changes.length; i++) { + var row = [], cols = changes[i].querySelectorAll("td, th"); + + for (var j = 0; j < cols.length; j++) { + row.push('"' + cols[j].innerText + '"'); + } + csv.push(row.join(",")); + } + var csvFile = new Blob([csv.join("\n")], { type: "text/csv" }); + + // Create a link to download it + var downloadBatchChanges = document.createElement("a"); + downloadBatchChanges.download = filename; + + // Create a URL for the link + downloadBatchChanges.href = window.URL.createObjectURL(csvFile); + document.body.appendChild(downloadBatchChanges); + downloadBatchChanges.click(); + document.body.removeChild(downloadBatchChanges); + } + + $timeout($scope.refresh, 0); }); })();