#788 use device.name instead of device.dns for pseudo devices
This commit is contained in:
1
Changes
1
Changes
@@ -8,6 +8,7 @@
|
|||||||
[BUG FIXES]
|
[BUG FIXES]
|
||||||
|
|
||||||
* #784 empty device_skip table when also emptying job queue
|
* #784 empty device_skip table when also emptying job queue
|
||||||
|
* #788 use device.name instead of device.dns for pseudo devices
|
||||||
|
|
||||||
2.047005 - 2021-02-24
|
2.047005 - 2021-02-24
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ __PACKAGE__->load_namespaces(
|
|||||||
);
|
);
|
||||||
|
|
||||||
our # try to hide from kwalitee
|
our # try to hide from kwalitee
|
||||||
$VERSION = 64; # schema version used for upgrades, keep as integer
|
$VERSION = 65; # schema version used for upgrades, keep as integer
|
||||||
|
|
||||||
use Path::Class;
|
use Path::Class;
|
||||||
use File::ShareDir 'dist_dir';
|
use File::ShareDir 'dist_dir';
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ register_admin_task({
|
|||||||
});
|
});
|
||||||
|
|
||||||
sub _sanity_ok {
|
sub _sanity_ok {
|
||||||
return 0 unless param('dns')
|
return 0 unless param('name')
|
||||||
and param('dns') =~ m/^[[:print:]]+$/
|
and param('name') =~ m/^[[:print:]]+$/
|
||||||
and param('dns') !~ m/[[:space:]]/;
|
and param('name') !~ m/[[:space:]]/;
|
||||||
|
|
||||||
my $ip = NetAddr::IP::Lite->new(param('ip'));
|
my $ip = NetAddr::IP::Lite->new(param('ip'));
|
||||||
return 0 unless ($ip and $ip->addr ne '0.0.0.0');
|
return 0 unless ($ip and $ip->addr ne '0.0.0.0');
|
||||||
@@ -34,7 +34,7 @@ ajax '/ajax/control/admin/pseudodevice/add' => require_role admin => sub {
|
|||||||
my $device = schema('netdisco')->resultset('Device')
|
my $device = schema('netdisco')->resultset('Device')
|
||||||
->create({
|
->create({
|
||||||
ip => param('ip'),
|
ip => param('ip'),
|
||||||
dns => param('dns'),
|
name => param('name'),
|
||||||
vendor => 'netdisco',
|
vendor => 'netdisco',
|
||||||
layers => param('layers'),
|
layers => param('layers'),
|
||||||
last_discover => \'now()',
|
last_discover => \'now()',
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
BEGIN;
|
||||||
|
|
||||||
|
UPDATE device SET name = dns WHERE vendor = 'netdisco';
|
||||||
|
|
||||||
|
COMMIT;
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="nd_center-cell"><input data-form="add" name="dns" type="text"></td>
|
<td class="nd_center-cell"><input data-form="add" name="name" type="text"></td>
|
||||||
<td class="nd_center-cell"><input data-form="add" name="ip" type="text"></td>
|
<td class="nd_center-cell"><input data-form="add" name="ip" type="text"></td>
|
||||||
<td class="nd_center-cell"><input data-form="add" name="ports" type="number" value="1"></td>
|
<td class="nd_center-cell"><input data-form="add" name="ports" type="number" value="1"></td>
|
||||||
<td class="nd_center-cell">
|
<td class="nd_center-cell">
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
[% SET count = count + 1 %]
|
[% SET count = count + 1 %]
|
||||||
<tr>
|
<tr>
|
||||||
<td class="nd_center-cell"><a class="nd_linkcell"
|
<td class="nd_center-cell"><a class="nd_linkcell"
|
||||||
href="[% uri_for('/device') | none %]?q=[% row.ip | uri %]">[% row.dns | html_entity %]</a></td>
|
href="[% uri_for('/device') | none %]?q=[% row.ip | uri %]">[% row.name | html_entity %]</a></td>
|
||||||
<td class="nd_center-cell">[% row.ip | html_entity %]</td>
|
<td class="nd_center-cell">[% row.ip | html_entity %]</td>
|
||||||
<td class="nd_center-cell">
|
<td class="nd_center-cell">
|
||||||
<input data-form="update" name="ports" type="number" value="[% row.port_count | html_entity %]">
|
<input data-form="update" name="ports" type="number" value="[% row.port_count | html_entity %]">
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
<input data-form="update" name="layers" type="hidden" value="[% row.layers | html_entity %]">
|
<input data-form="update" name="layers" type="hidden" value="[% row.layers | html_entity %]">
|
||||||
</td>
|
</td>
|
||||||
<td class="nd_center-cell">
|
<td class="nd_center-cell">
|
||||||
<input data-form="update" name="dns" type="hidden" value="[% row.dns | html_entity %]">
|
<input data-form="update" name="name" type="hidden" value="[% row.name | html_entity %]">
|
||||||
<input data-form="update" name="ip" type="hidden" value="[% row.ip | html_entity %]">
|
<input data-form="update" name="ip" type="hidden" value="[% row.ip | html_entity %]">
|
||||||
<button class="btn nd_adminbutton" name="update" type="submit"><i class="icon-save text-warning"></i></button>
|
<button class="btn nd_adminbutton" name="update" type="submit"><i class="icon-save text-warning"></i></button>
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p class="text-info">
|
<p class="text-info">
|
||||||
Pseudo-device "[% row.dns | html_entity %] / [% row.ip | html_entity %]" will be deleted.</p>
|
Pseudo-device "[% row.name | html_entity %] / [% row.ip | html_entity %]" will be deleted.</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<input data-form="delete" name="device" type="hidden" value="[% row.ip | html_entity %]">
|
<input data-form="delete" name="device" type="hidden" value="[% row.ip | html_entity %]">
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user