mirror of
https://github.com/tuxis-ie/nsedit.git
synced 2025-05-09 22:53:57 +03:00
Merge pull request #24 from zeha/remove-priority
Remove priority field. PLEASE NOTE THAT THIS BREAKS COMPATIBILITY WITH VERSION < 3.4.2
This commit is contained in:
commit
6f3c5f8a20
4 changed files with 3 additions and 32 deletions
|
@ -155,8 +155,7 @@ tr.jtable-data-row td {
|
||||||
white-space: -o-pre-wrap; /* Opera 7 */
|
white-space: -o-pre-wrap; /* Opera 7 */
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
}
|
}
|
||||||
tr.jtable-data-row td.ttl, tr.jtable-data-row td.priority,
|
tr.jtable-data-row td.ttl, .jtable-input input.ttl {
|
||||||
.jtable-input input.ttl, .jtable-input input.priority {
|
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
tr.jtable-data-row td.content {
|
tr.jtable-data-row td.content {
|
||||||
|
|
|
@ -39,8 +39,7 @@ $templates[] = array(
|
||||||
array(
|
array(
|
||||||
'name' => '',
|
'name' => '',
|
||||||
'type' => 'MX',
|
'type' => 'MX',
|
||||||
'content' => 'mx2.tuxis.nl',
|
'content' => '200 mx2.tuxis.nl')
|
||||||
'priority' => '200')
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
*/
|
*/
|
||||||
|
@ -51,4 +50,3 @@ $defaults['defaulttype'] = 'Master'; # Choose between 'Native
|
||||||
$defaults['primaryns'] = 'unconfigured.primaryns'; # The value of the first NS-record
|
$defaults['primaryns'] = 'unconfigured.primaryns'; # The value of the first NS-record
|
||||||
$defaults['secondaryns'] = 'unconfigured.secondaryns'; # The value of the second NS-record
|
$defaults['secondaryns'] = 'unconfigured.secondaryns'; # The value of the second NS-record
|
||||||
$defaults['ttl'] = 3600; # Default TTL for records
|
$defaults['ttl'] = 3600; # Default TTL for records
|
||||||
$defaults['priority'] = 0; # Default for priority in records
|
|
||||||
|
|
23
index.php
23
index.php
|
@ -189,13 +189,7 @@ function displayExportIcon(zone) {
|
||||||
|
|
||||||
function displayContent(fieldName) {
|
function displayContent(fieldName) {
|
||||||
return function(data) {
|
return function(data) {
|
||||||
var value = data.record[fieldName];
|
return $('<span>').text(data.record[fieldName]);
|
||||||
switch (fieldName) {
|
|
||||||
case 'priority':
|
|
||||||
value = (value === 0) ? '' : value;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $('<span>').text(value);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -320,12 +314,6 @@ $(document).ready(function () {
|
||||||
display: displayContent('type'),
|
display: displayContent('type'),
|
||||||
listClass: 'type'
|
listClass: 'type'
|
||||||
},
|
},
|
||||||
priority: {
|
|
||||||
title: 'Prio',
|
|
||||||
width: '1%',
|
|
||||||
display: displayContent('priority'),
|
|
||||||
listClass: 'priority'
|
|
||||||
},
|
|
||||||
content: {
|
content: {
|
||||||
title: 'Content',
|
title: 'Content',
|
||||||
width: '30%',
|
width: '30%',
|
||||||
|
@ -554,15 +542,6 @@ $(document).ready(function () {
|
||||||
inputClass: 'type',
|
inputClass: 'type',
|
||||||
listClass: 'type'
|
listClass: 'type'
|
||||||
},
|
},
|
||||||
priority: {
|
|
||||||
title: 'Prio',
|
|
||||||
width: '1%',
|
|
||||||
create: true,
|
|
||||||
display: displayContent('priority'),
|
|
||||||
defaultValue: '<?php echo $defaults['priority']; ?>',
|
|
||||||
inputClass: 'priority',
|
|
||||||
listClass: 'priority'
|
|
||||||
},
|
|
||||||
content: {
|
content: {
|
||||||
title: 'Content',
|
title: 'Content',
|
||||||
width: '30%',
|
width: '30%',
|
||||||
|
|
|
@ -143,7 +143,6 @@ function make_record($zone, $input) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$ttl = (int) ((isset($input['ttl']) && $input['ttl']) ? $input['ttl'] : $defaults['ttl']);
|
$ttl = (int) ((isset($input['ttl']) && $input['ttl']) ? $input['ttl'] : $defaults['ttl']);
|
||||||
$priority = (int) ((isset($input['priority']) && $input['priority']) ? $input['priority'] : $defaults['priority']);
|
|
||||||
$type = isset($input['type']) ? $input['type'] : '';
|
$type = isset($input['type']) ? $input['type'] : '';
|
||||||
$disabled = (bool) (isset($input['disabled']) && $input['disabled']);
|
$disabled = (bool) (isset($input['disabled']) && $input['disabled']);
|
||||||
|
|
||||||
|
@ -172,7 +171,6 @@ function make_record($zone, $input) {
|
||||||
'type' => $type,
|
'type' => $type,
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
'ttl' => $ttl,
|
'ttl' => $ttl,
|
||||||
'priority' => $priority,
|
|
||||||
'content' => $content);
|
'content' => $content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,7 +240,6 @@ function decode_record_id($id) {
|
||||||
|| !isset($record['name'])
|
|| !isset($record['name'])
|
||||||
|| !isset($record['type'])
|
|| !isset($record['type'])
|
||||||
|| !isset($record['ttl'])
|
|| !isset($record['ttl'])
|
||||||
|| !isset($record['priority'])
|
|
||||||
|| !isset($record['content'])
|
|| !isset($record['content'])
|
||||||
|| !isset($record['disabled'])) {
|
|| !isset($record['disabled'])) {
|
||||||
jtable_respond(null, 'error', "Invalid record id");
|
jtable_respond(null, 'error', "Invalid record id");
|
||||||
|
@ -267,7 +264,6 @@ function get_records_except($zone, $exclude) {
|
||||||
$found = true;
|
$found = true;
|
||||||
} elseif ($record['content'] != $exclude['content']
|
} elseif ($record['content'] != $exclude['content']
|
||||||
or $record['ttl'] != $exclude['ttl']
|
or $record['ttl'] != $exclude['ttl']
|
||||||
or $record['priority'] != $exclude['priority']
|
|
||||||
or $record['disabled'] != $exclude['disabled']) {
|
or $record['disabled'] != $exclude['disabled']) {
|
||||||
array_push($records, $record);
|
array_push($records, $record);
|
||||||
} else {
|
} else {
|
||||||
|
@ -320,7 +316,6 @@ function rrtype_compare($a, $b) {
|
||||||
function record_compare($a, $b) {
|
function record_compare($a, $b) {
|
||||||
if ($cmp = compareName($a['name'], $b['name'])) return $cmp;
|
if ($cmp = compareName($a['name'], $b['name'])) return $cmp;
|
||||||
if ($cmp = rrtype_compare($a['type'], $b['type'])) return $cmp;
|
if ($cmp = rrtype_compare($a['type'], $b['type'])) return $cmp;
|
||||||
if ($cmp = ($a['priority'] - $b['priority'])) return $cmp;
|
|
||||||
if ($cmp = strnatcasecmp($a['content'], $b['content'])) return $cmp;
|
if ($cmp = strnatcasecmp($a['content'], $b['content'])) return $cmp;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue