-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from lukesUbuntu/dns
Added DNS tab and listing of DNS entries issue #14
- Loading branch information
Showing
5 changed files
with
156 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<style> | ||
.type{ | ||
width : 100px; | ||
} | ||
.value { | ||
width : 100%; | ||
} | ||
</style> | ||
<h4>DNS Records</h4> | ||
<div class="table-responsive" style=""> | ||
|
||
<table id= "dns_records_table" class="table table-curved table-striped"> | ||
<thead> | ||
|
||
<tr> | ||
<th>Type</th> | ||
<th>Value</th> | ||
<th>Actions</th> | ||
</tr> | ||
|
||
</thead> | ||
<tbody> | ||
<tr class="dns_row" style="display:none;"> | ||
<td class="type"></td> | ||
<td class="value"></td> | ||
<td class="action" > | ||
<div class="dropdown pull-right"> | ||
<button class="btn btn-warning" data-toggle="modal" data-target="#editDnsRecord" role="presentation"> Edit </button> | ||
</div> | ||
</td> | ||
</tr> | ||
|
||
|
||
|
||
|
||
</tbody> | ||
</table> | ||
</div> | ||
|
||
<div class="modal fade" id="editDnsRecord" tabindex="-1" role="dialog" aria-labelledby="confirmation" | ||
aria-hidden="true"> | ||
<div class="modal-dialog"> | ||
<div class="modal-content"> | ||
|
||
<div class="modal-header"> | ||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">X</button> | ||
<h4 class="modal-title" id="confirmation">Edit Record</h4> | ||
</div> | ||
|
||
<div class="modal-body"> | ||
<p>Sorry still in development</p> | ||
</div> | ||
|
||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> | ||
<a id="confirmed" href="#" class="btn btn-success success">Save</a> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<script type="text/javascript"> | ||
//declared for our external js pagehelper.js | ||
var $action_url = '<?php echo $action_url; ?>'; | ||
var $CsrfToken = '<?php echo $this->Form->getCsrfToken();?>'; | ||
var $CurrentPage = $("#statusPage"); | ||
var dnsRecords = <?php echo json_encode($dns_records); ?> | ||
</script> | ||
<!--Include our javascript file !--> | ||
<script type='text/javascript' src='<?php echo $this->Html->safe($this->view_dir . 'js/pagehelper.js'); ?>'></script> | ||
<script type='text/javascript' src='<?php echo $this->Html->safe($this->view_dir . 'js/client_tab_dns.js'); ?>'></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
$(document).ready(function () { | ||
renderDnsRecords(); | ||
}) | ||
|
||
function renderDnsRecords(){ | ||
var dns_records_table = $("#dns_records_table > tbody:last-child"); | ||
var row_template = $('.dns_row').html() | ||
for(var dns_index in dnsRecords){ | ||
var record = dnsRecords[dns_index]; | ||
var row = row_template; | ||
if (record.type.toLowerCase() == "soa"){ | ||
continue; | ||
} | ||
row = $('<tr>' + row + '</tr>'); | ||
$('.type', row).text(record.type) | ||
var value = record.value.toString(); | ||
if (value.length > 50){ | ||
value = value.substr(0,80) + '...' | ||
} | ||
$('.value', row).text(value) | ||
|
||
|
||
$(dns_records_table).append(row) | ||
// > tbody:last-child | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters