mirror of
https://github.com/tuxis-ie/nsedit.git
synced 2025-04-19 20:09:14 +03:00
Don't show a 'records' button anymore. Open the zone by clicking it. Closes #2
This commit is contained in:
parent
749478c36a
commit
5b4bcc34cc
1 changed files with 153 additions and 157 deletions
228
index.php
228
index.php
|
@ -453,130 +453,34 @@ $(document).ready(function () {
|
|||
],
|
||||
},
|
||||
sorting: false,
|
||||
openChildAsAccordion: true,
|
||||
actions: {
|
||||
listAction: 'zones.php?action=list',
|
||||
<?php if (is_adminuser() or $allowzoneadd === TRUE) { ?>
|
||||
createAction: 'zones.php?action=create',
|
||||
deleteAction: 'zones.php?action=delete',
|
||||
<?php } ?>
|
||||
<?php if (is_adminuser()) { ?>
|
||||
updateAction: 'zones.php?action=update'
|
||||
<?php } ?>
|
||||
},
|
||||
fields: {
|
||||
id: {
|
||||
key: true,
|
||||
type: 'hidden'
|
||||
},
|
||||
name: {
|
||||
title: 'Domain',
|
||||
width: '8%',
|
||||
display: displayContent('name'),
|
||||
edit: false,
|
||||
inputClass: 'domain',
|
||||
listClass: 'domain'
|
||||
},
|
||||
dnssec: {
|
||||
title: 'DNSSEC',
|
||||
width: '3%',
|
||||
create: false,
|
||||
edit: false,
|
||||
display: displayDnssecIcon,
|
||||
listClass: 'dnssec'
|
||||
},
|
||||
<?php if (is_adminuser()) { ?>
|
||||
account: {
|
||||
title: 'Account',
|
||||
width: '8%',
|
||||
display: displayContent('account'),
|
||||
options: function(data) {
|
||||
return 'users.php?action=listoptions&e='+$epoch;
|
||||
},
|
||||
defaultValue: 'admin',
|
||||
inputClass: 'account',
|
||||
listClass: 'account'
|
||||
},
|
||||
<?php } ?>
|
||||
kind: {
|
||||
title: 'Type',
|
||||
width: '20%',
|
||||
display: displayContent('kind'),
|
||||
options: {'Native': 'Native', 'Master': 'Master'},
|
||||
defaultValue: '<?php echo $defaults['defaulttype']; ?>',
|
||||
edit: false,
|
||||
inputClass: 'kind',
|
||||
listClass: 'kind'
|
||||
},
|
||||
template: {
|
||||
title: 'Template',
|
||||
options: <?php echo json_encode(user_template_names()); ?>,
|
||||
list: false,
|
||||
create: true,
|
||||
edit: false,
|
||||
inputClass: 'template'
|
||||
},
|
||||
nameserver: {
|
||||
title: 'Nameservers',
|
||||
create: true,
|
||||
list: false,
|
||||
edit: false,
|
||||
input: function(data) {
|
||||
var $template = data.form.find('#Edit-template');
|
||||
var ns_form = '<?php foreach($defaults['ns'] as $ns) echo '<input type="text" name="nameserver[]" value="'.$ns.'" /><br />'; ?>';
|
||||
var $elem = $('<div id="nameservers">' + ns_form + '</div>');
|
||||
$template.change(function() {
|
||||
$.get('zones.php?action=getformnameservers&template='+$template.val(), function(getdata) {
|
||||
if (getdata != "") {
|
||||
$("#nameservers").html(getdata);
|
||||
} else {
|
||||
$("#nameservers").html(ns_form);
|
||||
}
|
||||
});
|
||||
});
|
||||
return $elem;
|
||||
},
|
||||
inputClass: 'nameserver nameserver1'
|
||||
},
|
||||
serial: {
|
||||
title: 'Serial',
|
||||
width: '10%',
|
||||
display: displayContent('serial'),
|
||||
create: false,
|
||||
edit: false,
|
||||
inputClass: 'serial',
|
||||
listClass: 'serial'
|
||||
},
|
||||
records: {
|
||||
width: '5%',
|
||||
title: 'Records',
|
||||
edit: false,
|
||||
create: false,
|
||||
display: function (zone) {
|
||||
var $img = $('<img class="list" src="img/list.png" title="Records" />');
|
||||
$img.click(function () {
|
||||
selecting: true,
|
||||
selectOnRowClick: true,
|
||||
selectionChanged: function (data) {
|
||||
var $selectedRows = $('#MasterZones').jtable('selectedRows');
|
||||
$selectedRows.each(function () {
|
||||
var zone = $(this).data('record');
|
||||
$('#MasterZones').jtable('openChildTable',
|
||||
$img.closest('tr'), {
|
||||
title: 'Records in ' + zone.record.name,
|
||||
$(this).closest('tr'), {
|
||||
title: 'Records in ' + zone.name,
|
||||
messages: {
|
||||
addNewRecord: 'Add to ' + zone.record.name,
|
||||
noDataAvailable: 'No records for ' + zone.record.name
|
||||
addNewRecord: 'Add to ' + zone.name,
|
||||
noDataAvailable: 'No records for ' + zone.name
|
||||
},
|
||||
paging: true,
|
||||
sorting: true,
|
||||
pageSize: 20,
|
||||
openChildAsAccordion: true,
|
||||
actions: {
|
||||
listAction: 'zones.php?action=listrecords&zoneid=' + zone.record.id,
|
||||
createAction: 'zones.php?action=createrecord&zoneid=' + zone.record.id,
|
||||
deleteAction: 'zones.php?action=deleterecord&zoneid=' + zone.record.id,
|
||||
updateAction: 'zones.php?action=editrecord&zoneid=' + zone.record.id
|
||||
listAction: 'zones.php?action=listrecords&zoneid=' + zone.id,
|
||||
createAction: 'zones.php?action=createrecord&zoneid=' + zone.id,
|
||||
deleteAction: 'zones.php?action=deleterecord&zoneid=' + zone.id,
|
||||
updateAction: 'zones.php?action=editrecord&zoneid=' + zone.id
|
||||
},
|
||||
fields: {
|
||||
domid: {
|
||||
create: true,
|
||||
type: 'hidden',
|
||||
defaultValue: zone.record.id
|
||||
defaultValue: zone.id
|
||||
},
|
||||
id: {
|
||||
key: true,
|
||||
|
@ -588,14 +492,14 @@ $(document).ready(function () {
|
|||
domain: {
|
||||
create: true,
|
||||
type: 'hidden',
|
||||
defaultValue: zone.record.name
|
||||
defaultValue: zone.name
|
||||
},
|
||||
name: {
|
||||
title: 'Label',
|
||||
width: '7%',
|
||||
sorting: true,
|
||||
create: true,
|
||||
display: displayContent('name', zone.record.name),
|
||||
display: displayContent('name', zone.name),
|
||||
inputClass: 'name',
|
||||
listClass: 'name'
|
||||
},
|
||||
|
@ -603,7 +507,7 @@ $(document).ready(function () {
|
|||
title: 'Type',
|
||||
width: '2%',
|
||||
options: function() {
|
||||
zonename = new String(zone.record.name);
|
||||
zonename = new String(zone.name);
|
||||
if (zonename.match(/(\.in-addr|\.ip6)\.arpa/)) {
|
||||
return {
|
||||
'PTR': 'PTR',
|
||||
|
@ -699,10 +603,102 @@ $(document).ready(function () {
|
|||
}
|
||||
}, function (data) {
|
||||
data.childTable.jtable('load');
|
||||
})
|
||||
});
|
||||
return $img;
|
||||
});
|
||||
},
|
||||
openChildAsAccordion: true,
|
||||
actions: {
|
||||
listAction: 'zones.php?action=list',
|
||||
<?php if (is_adminuser() or $allowzoneadd === TRUE) { ?>
|
||||
createAction: 'zones.php?action=create',
|
||||
deleteAction: 'zones.php?action=delete',
|
||||
<?php } ?>
|
||||
<?php if (is_adminuser()) { ?>
|
||||
updateAction: 'zones.php?action=update'
|
||||
<?php } ?>
|
||||
},
|
||||
fields: {
|
||||
id: {
|
||||
key: true,
|
||||
type: 'hidden'
|
||||
},
|
||||
name: {
|
||||
title: 'Domain',
|
||||
width: '8%',
|
||||
display: displayContent('name'),
|
||||
edit: false,
|
||||
inputClass: 'domain',
|
||||
listClass: 'domain'
|
||||
},
|
||||
dnssec: {
|
||||
title: 'DNSSEC',
|
||||
width: '3%',
|
||||
create: false,
|
||||
edit: false,
|
||||
display: displayDnssecIcon,
|
||||
listClass: 'dnssec'
|
||||
},
|
||||
<?php if (is_adminuser()) { ?>
|
||||
account: {
|
||||
title: 'Account',
|
||||
width: '8%',
|
||||
display: displayContent('account'),
|
||||
options: function(data) {
|
||||
return 'users.php?action=listoptions&e='+$epoch;
|
||||
},
|
||||
defaultValue: 'admin',
|
||||
inputClass: 'account',
|
||||
listClass: 'account'
|
||||
},
|
||||
<?php } ?>
|
||||
kind: {
|
||||
title: 'Type',
|
||||
width: '20%',
|
||||
display: displayContent('kind'),
|
||||
options: {'Native': 'Native', 'Master': 'Master'},
|
||||
defaultValue: '<?php echo $defaults['defaulttype']; ?>',
|
||||
edit: false,
|
||||
inputClass: 'kind',
|
||||
listClass: 'kind'
|
||||
},
|
||||
template: {
|
||||
title: 'Template',
|
||||
options: <?php echo json_encode(user_template_names()); ?>,
|
||||
list: false,
|
||||
create: true,
|
||||
edit: false,
|
||||
inputClass: 'template'
|
||||
},
|
||||
nameserver: {
|
||||
title: 'Nameservers',
|
||||
create: true,
|
||||
list: false,
|
||||
edit: false,
|
||||
input: function(data) {
|
||||
var $template = data.form.find('#Edit-template');
|
||||
var ns_form = '<?php foreach($defaults['ns'] as $ns) echo '<input type="text" name="nameserver[]" value="'.$ns.'" /><br />'; ?>';
|
||||
var $elem = $('<div id="nameservers">' + ns_form + '</div>');
|
||||
$template.change(function() {
|
||||
$.get('zones.php?action=getformnameservers&template='+$template.val(), function(getdata) {
|
||||
if (getdata != "") {
|
||||
$("#nameservers").html(getdata);
|
||||
} else {
|
||||
$("#nameservers").html(ns_form);
|
||||
}
|
||||
});
|
||||
});
|
||||
return $elem;
|
||||
},
|
||||
inputClass: 'nameserver nameserver1'
|
||||
},
|
||||
serial: {
|
||||
title: 'Serial',
|
||||
width: '10%',
|
||||
display: displayContent('serial'),
|
||||
create: false,
|
||||
edit: false,
|
||||
inputClass: 'serial',
|
||||
listClass: 'serial'
|
||||
},
|
||||
exportzone: {
|
||||
title: '',
|
||||
|
|
Loading…
Add table
Reference in a new issue