release 2.010002

This commit is contained in:
Oliver Gorwits
2013-07-24 00:00:19 +01:00
parent c2f392b72d
commit eee6598c95
16 changed files with 88 additions and 51 deletions

View File

@@ -1,4 +1,22 @@
2.009000_001 -
2.010002 - 2013-07-23
[ENHANCEMENTS]
* Nullify unused schema changes
[BUG FIXES]
* Fix FF bug with forms embedded in tables
* Fix bugs in topo update code
2.010001_003 - 2013-06-20
[BUG FIXES]
* Pass event param to all js functions which require it
* Handle UTF-8 data in the device port remote_id
2.010000 - 2013-06-16
[NEW FEATURES]

View File

@@ -96,6 +96,8 @@ lib/App/Netdisco/DB/schema_versions/App-Netdisco-DB-19-20-PostgreSQL.sql
lib/App/Netdisco/DB/schema_versions/App-Netdisco-DB-2-3-PostgreSQL.sql
lib/App/Netdisco/DB/schema_versions/App-Netdisco-DB-2-PostgreSQL.sql
lib/App/Netdisco/DB/schema_versions/App-Netdisco-DB-20-21-PostgreSQL.sql
lib/App/Netdisco/DB/schema_versions/App-Netdisco-DB-21-22-PostgreSQL.sql
lib/App/Netdisco/DB/schema_versions/App-Netdisco-DB-22-23-PostgreSQL.sql
lib/App/Netdisco/DB/schema_versions/App-Netdisco-DB-3-4-PostgreSQL.sql
lib/App/Netdisco/DB/schema_versions/App-Netdisco-DB-4-5-PostgreSQL.sql
lib/App/Netdisco/DB/schema_versions/App-Netdisco-DB-5-6-PostgreSQL.sql

View File

@@ -60,4 +60,4 @@ resources:
homepage: http://netdisco.org/
license: http://opensource.org/licenses/bsd-license.php
repository: git://git.code.sf.net/p/netdisco/netdisco-ng
version: 2.010000
version: 2.010002

View File

@@ -3,6 +3,12 @@
use strict;
use warnings FATAL => 'all';
BEGIN {
if ($ENV{_} and $ENV{_} =~ m/netdisco-web-fg$/) {
die "You probably want: '~/bin/localenv starman $0 --workers=1 --disable-keepalive'\n";
}
}
use FindBin;
FindBin::again();
use Path::Class 'dir';

View File

@@ -7,7 +7,7 @@ use 5.010_000;
use File::ShareDir 'dist_dir';
use Path::Class;
our $VERSION = '2.010000';
our $VERSION = '2.010002';
BEGIN {
if (not ($ENV{DANCER_APPDIR} || '')

View File

@@ -6,6 +6,7 @@ use Dancer::Plugin::DBIC 'schema';
use App::Netdisco::Util::Device qw/get_device is_discoverable/;
use App::Netdisco::Util::DNS ':all';
use NetAddr::IP::Lite ':lower';
use Encode;
use Try::Tiny;
use base 'Exporter';
@@ -611,7 +612,7 @@ sub store_neighbors {
my $remote_ipad = NetAddr::IP::Lite->new($remote_ip);
my $remote_port = undef;
my $remote_type = $c_platform->{$entry};
my $remote_id = $c_id->{$entry};
my $remote_id = Encode::decode('UTF-8', $c_id->{$entry});
next unless $remote_ip;

View File

@@ -8,7 +8,7 @@ use base 'DBIx::Class::Schema';
__PACKAGE__->load_namespaces;
our $VERSION = 21; # schema version used for upgrades, keep as integer
our $VERSION = 23; # schema version used for upgrades, keep as integer
use Path::Class;
use File::Basename;

View File

@@ -0,0 +1,5 @@
BEGIN;
-- ALTER TABLE device_port ALTER COLUMN remote_id TYPE bytea USING remote_id::bytea;
COMMIT;

View File

@@ -0,0 +1,5 @@
BEGIN;
-- ALTER TABLE device_port ALTER COLUMN remote_id TYPE text USING remote_id::text;
COMMIT;

View File

@@ -5,6 +5,9 @@ use Dancer::Plugin::Ajax;
use Dancer::Plugin::DBIC;
use App::Netdisco::Web::Plugin;
use App::Netdisco::Util::Device 'get_device';
use Try::Tiny;
use NetAddr::IP::Lite ':lower';
register_admin_task({
@@ -50,7 +53,8 @@ ajax '/ajax/control/admin/topology/add' => sub {
return unless ($left->in_storage and $right->in_storage);
$left->ports
->single({port => param('port1')}, {for => 'update'})
->search({port => param('port1')}, {for => 'update'})
->single()
->update({
remote_ip => param('dev2'),
remote_port => param('port2'),
@@ -61,7 +65,8 @@ ajax '/ajax/control/admin/topology/add' => sub {
});
$right->ports
->single({port => param('port2')}, {for => 'update'})
->search({port => param('port2')}, {for => 'update'})
->single()
->update({
remote_ip => param('dev1'),
remote_port => param('port1'),

View File

@@ -40,10 +40,8 @@
<td class="nd_center-cell">[% row.started_stamp | html_entity %]</td>
<td class="nd_center-cell">[% row.finished_stamp | html_entity %]</td>
<td class="nd_center-cell">
<form name="del" class="nd_inline-form">
<input name="job" type="hidden" value="[% row.job | html_entity %]">
<button class="btn" name="del" type="submit"><i class="icon-trash text-error"></i></button>
</form>
<input data-form="del" name="job" type="hidden" value="[% row.job | html_entity %]">
<button class="btn nd_adminbutton" name="del" type="submit"><i class="icon-trash text-error"></i></button>
</td>
</tr>
[% END %]

View File

@@ -9,33 +9,29 @@
</thead>
</tbody>
<tr>
<form name="add">
<td class="nd_center-cell"><input name="dns" type="text"></td>
<td class="nd_center-cell"><input name="ip" type="text"></td>
<td class="nd_center-cell"><input name="ports" type="number"></td>
<td class="nd_center-cell"><input data-form="add" name="dns" 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"></td>
<td class="nd_center-cell">
<button class="btn btn-small" name="add" type="submit"><i class="icon-plus-sign"></i> Add</button>
<button class="btn btn-small nd_adminbutton" name="add" type="submit"><i class="icon-plus-sign"></i> Add</button>
</td>
</form>
</tr>
[% WHILE (row = results.next) %]
<tr>
<form name="update">
<td class="nd_center-cell"><a class="nd_linkcell"
href="[% uri_for('/device') %]?q=[% row.dns | uri %]">[% row.dns | html_entity %]</a></td>
<td class="nd_center-cell">[% row.ip | html_entity %]</td>
<td class="nd_center-cell"><input name="ports" type="number" value="[% row.port_count | html_entity %]"></td>
<td class="nd_center-cell">
<input name="dns" type="hidden" value="[% row.dns | html_entity %]">
<input name="ip" type="hidden" value="[% row.ip | html_entity %]">
<button class="btn" name="update" type="submit"><i class="icon-save text-warning"></i></button>
</form>
<form name="del" class="nd_inline-form">
<input name="dns" type="hidden" value="[% row.dns | html_entity %]">
<input name="ip" type="hidden" value="[% row.ip | html_entity %]">
<input name="ports" type="hidden" value="[% row.port_count | html_entity %]">
<button class="btn" name="del" type="submit"><i class="icon-trash text-error"></i></button>
</form>
<input data-form="update" name="ports" type="number" value="[% row.port_count | html_entity %]">
</td>
<td class="nd_center-cell">
<input data-form="update" name="dns" type="hidden" value="[% row.dns | 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>
<input data-form="del" name="dns" type="hidden" value="[% row.dns | html_entity %]">
<input data-form="del" name="ip" type="hidden" value="[% row.ip | html_entity %]">
<input data-form="del" name="ports" type="hidden" value="[% row.port_count | html_entity %]">
<button class="btn nd_adminbutton" name="del" type="submit"><i class="icon-trash text-error"></i></button>
</td>
</tr>
[% END %]

View File

@@ -10,39 +10,36 @@
</thead>
</tbody>
<tr>
<form name="add">
<td class="nd_center-cell">
<div class="input-append">
<input class="nd_topo_dev nd_topo_dev1" name="dev1" type="text">
<input data-form="add" class="nd_topo_dev nd_topo_dev1" name="dev1" type="text">
<span class="add-on nd_topo_dev_caret"><i class="icon-caret-down icon-large"></i></span>
</div>
</td>
<td class="nd_center-cell">
<div class="input-append">
<input class="nd_topo_port nd_topo_dev1" name="port1" type="text">
<input data-form="add" class="nd_topo_port nd_topo_dev1" name="port1" type="text">
<span class="add-on nd_topo_port_caret"><i class="icon-caret-down icon-large"></i></span>
</div>
</td>
<td class="nd_center-cell">
<div class="input-append">
<input class="nd_topo_dev nd_topo_dev2" name="dev2" type="text">
<input data-form="add" class="nd_topo_dev nd_topo_dev2" name="dev2" type="text">
<span class="add-on nd_topo_dev_caret"><i class="icon-caret-down icon-large"></i></span>
</div>
</td>
<td class="nd_center-cell">
<div class="input-append">
<input class="nd_topo_port nd_topo_dev2" name="port2" type="text">
<input data-form="add" class="nd_topo_port nd_topo_dev2" name="port2" type="text">
<span class="add-on nd_topo_port_caret"><i class="icon-caret-down icon-large"></i></span>
</div>
</td>
<td class="nd_center-cell">
<button class="btn btn-small" name="add" type="submit"><i class="icon-plus-sign"></i> Add</button>
<button class="btn btn-small nd_adminbutton" name="add" type="submit"><i class="icon-plus-sign"></i> Add</button>
</td>
</form>
</tr>
[% WHILE (row = results.next) %]
<tr>
<form name="del">
<td class="nd_center-cell"><a class="nd_linkcell"
href="[% uri_for('/device') %]?q=[% row.dev1 | uri %]">[% row.dev1 | html_entity %]</a></td>
<td class="nd_center-cell">[% row.port1 | html_entity %]</td>
@@ -50,12 +47,11 @@
href="[% uri_for('/device') %]?q=[% row.dev2 | uri %]">[% row.dev2 | html_entity %]</a></td>
<td class="nd_center-cell">[% row.port2 | html_entity %]</td>
<td class="nd_center-cell">
<input name="dev1" type="hidden" value="[% row.dev1 | html_entity %]">
<input name="port1" type="hidden" value="[% row.port1 | html_entity %]">
<input name="dev2" type="hidden" value="[% row.dev2 | html_entity %]">
<input name="port2" type="hidden" value="[% row.port2 | html_entity %]">
<button class="btn" name="del" type="submit"><i class="icon-trash text-error"></i></button>
</form>
<input data-form="del" name="dev1" type="hidden" value="[% row.dev1 | html_entity %]">
<input data-form="del" name="port1" type="hidden" value="[% row.port1 | html_entity %]">
<input data-form="del" name="dev2" type="hidden" value="[% row.dev2 | html_entity %]">
<input data-form="del" name="port2" type="hidden" value="[% row.port2 | html_entity %]">
<button class="btn nd_adminbutton" name="del" type="submit"><i class="icon-trash text-error"></i></button>
</td>
</tr>
[% END %]

View File

@@ -210,7 +210,9 @@
<a href="[% uri_for('/device',
self_options) %]&q=[% row.neighbor.dns || row.neighbor.ip | uri %]&f=[% row.remote_port | uri %]">
[% row.neighbor.dns.remove(settings.domain_suffix) || row.neighbor.ip | html_entity %]
([% row.remote_port | html_entity %])</a>
([% row.remote_port | html_entity %]
[% ' id: '_ row.remote_id IF row.remote_id %]
[% ' type: '_ row.remote_type IF row.remote_type %])</a>
[% ELSIF row.remote_ip AND row.remote_port %]
<span class="label label-important">N</span>
<a href="[% search_node %]&q=[% row.remote_ip | uri %]">

View File

@@ -80,7 +80,7 @@
});
// job control refresh icon should reload the page
$('#nd_countdown-refresh').click(function() {
$('#nd_countdown-refresh').click(function(event) {
event.preventDefault();
for (var i = 0; i < nd_timers.length; i++) {
clearTimeout(nd_timers[i]);
@@ -89,7 +89,7 @@
});
// job control pause/play icon switcheroo
$('#nd_countdown-control').click(function() {
$('#nd_countdown-control').click(function(event) {
event.preventDefault();
var icon = $('#nd_countdown-control-icon');
icon.toggleClass('icon-pause icon-play text-error text-success');
@@ -107,7 +107,7 @@
// activity for admin task tables
// dynamically bind to all forms in the table
$(target).on('submit', 'form', function() {
$(target).on('click', '.nd_adminbutton', function(event) {
// stop form from submitting normally
event.preventDefault();
@@ -116,13 +116,16 @@
clearTimeout(nd_timers[i]);
}
// what purpose - add/update/del
var mode = $(this).attr('name')
// submit the query and put results into the tab pane
$.ajax({
type: 'POST'
,async: true
,dataType: 'html'
,url: uri_base + '/ajax/control/admin/' + tab + '/' + $(this).attr('name')
,data: $(this).serializeArray()
,url: uri_base + '/ajax/control/admin/' + tab + '/' + mode
,data: $(this).closest('tr').find('input[data-form="' + mode + '"]').serializeArray()
,beforeSend: function() {
$(target).html(
'<div class="span2 alert">Request submitted...</div>'

View File

@@ -62,7 +62,7 @@
// clickable device port names can simply resubmit AJAX rather than
// fetch the whole page again.
$('#ports_pane').on('click', '.nd_this-port-only', function() {
$('#ports_pane').on('click', '.nd_this-port-only', function(event) {
event.preventDefault(); // link is real so prevent page submit
var port = $(this).text();
@@ -120,7 +120,7 @@
});
// activity for contenteditable control
$('.tab-content').on('keydown', '[contenteditable=true]', function() {
$('.tab-content').on('keydown', '[contenteditable=true]', function(event) {
var esc = event.which == 27,
nl = event.which == 13;