#948 Column order wrong when displaying custom fields
This commit is contained in:
@@ -173,12 +173,12 @@ hook after_error_render => sub { setting('layout' => 'main') };
|
|||||||
map {{ name => $_, %{ setting('sidebar_defaults')->{'device_ports'}->{$_} } }}
|
map {{ name => $_, %{ setting('sidebar_defaults')->{'device_ports'}->{$_} } }}
|
||||||
grep { $_ =~ m/^c_/ } keys %{ setting('sidebar_defaults')->{'device_ports'} };
|
grep { $_ =~ m/^c_/ } keys %{ setting('sidebar_defaults')->{'device_ports'} };
|
||||||
|
|
||||||
splice @port_columns, setting('device_port_col_idx_left'), 0,
|
splice @port_columns, setting('device_port_col_idx_right') + 1, 0,
|
||||||
grep {$_->{position} eq 'left'} @{ setting('_extra_device_port_cols') };
|
|
||||||
splice @port_columns, setting('device_port_col_idx_mid'), 0,
|
|
||||||
grep {$_->{position} eq 'mid'} @{ setting('_extra_device_port_cols') };
|
|
||||||
splice @port_columns, setting('device_port_col_idx_right'), 0,
|
|
||||||
grep {$_->{position} eq 'right'} @{ setting('_extra_device_port_cols') };
|
grep {$_->{position} eq 'right'} @{ setting('_extra_device_port_cols') };
|
||||||
|
splice @port_columns, setting('device_port_col_idx_mid') + 1, 0,
|
||||||
|
grep {$_->{position} eq 'mid'} @{ setting('_extra_device_port_cols') };
|
||||||
|
splice @port_columns, setting('device_port_col_idx_left') + 1, 0,
|
||||||
|
grep {$_->{position} eq 'left'} @{ setting('_extra_device_port_cols') };
|
||||||
|
|
||||||
set('port_columns' => \@port_columns);
|
set('port_columns' => \@port_columns);
|
||||||
|
|
||||||
|
|||||||
@@ -162,9 +162,9 @@ sidebar_defaults:
|
|||||||
report_portutilization:
|
report_portutilization:
|
||||||
age_num: { default: 3 }
|
age_num: { default: 3 }
|
||||||
age_unit: { default: months }
|
age_unit: { default: months }
|
||||||
device_port_col_idx_left: 0
|
device_port_col_idx_left: 7
|
||||||
device_port_col_idx_mid: 2
|
device_port_col_idx_mid: 18
|
||||||
device_port_col_idx_right: -1
|
device_port_col_idx_right: 22
|
||||||
jobqueue_refresh: 10
|
jobqueue_refresh: 10
|
||||||
safe_password_store: true
|
safe_password_store: true
|
||||||
reports: []
|
reports: []
|
||||||
|
|||||||
@@ -58,30 +58,6 @@
|
|||||||
[% END %]
|
[% END %]
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
[% FOREACH config IN settings._extra_device_port_cols %]
|
|
||||||
[% NEXT UNLESS config.position == 'left' AND params.${config.name} %]
|
|
||||||
|
|
||||||
[% TRY %]
|
|
||||||
<td>
|
|
||||||
[% INCLUDE "plugin/${config.name}/device_port_column.tt" %]
|
|
||||||
</td>
|
|
||||||
[% CATCH %]
|
|
||||||
[% CLEAR %]
|
|
||||||
[% IF config.editable AND user_can_port_control AND params.c_admin AND row.portctl %]
|
|
||||||
<td nowrap class="nd_editable-cell" contenteditable="true"
|
|
||||||
data-field="[% config.field | html_entity %]" data-for-device="[% device.ip | html_entity %]" data-for-port="[% row.port | html_entity %]">
|
|
||||||
<i class="icon-edit nd_edit-icon"></i>
|
|
||||||
[% ELSE %]
|
|
||||||
<td nowrap class="nd_editable-cell">
|
|
||||||
[% END %]
|
|
||||||
<div class="nd_editable-cell-content">
|
|
||||||
[% row.get_column(config.field) | html_entity %]
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
[% END %]
|
|
||||||
|
|
||||||
[% END %]
|
|
||||||
|
|
||||||
[% IF params.c_port %]
|
[% IF params.c_port %]
|
||||||
[% IF user_can_port_control AND params.c_admin AND row.portctl %]
|
[% IF user_can_port_control AND params.c_admin AND row.portctl %]
|
||||||
[% IF row.up_admin == 'up' %]
|
[% IF row.up_admin == 'up' %]
|
||||||
@@ -135,30 +111,6 @@
|
|||||||
</td>
|
</td>
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
||||||
[% FOREACH config IN settings._extra_device_port_cols %]
|
|
||||||
[% NEXT UNLESS config.position == 'mid' AND params.${config.name} %]
|
|
||||||
|
|
||||||
[% TRY %]
|
|
||||||
<td>
|
|
||||||
[% INCLUDE "plugin/${config.name}/device_port_column.tt" %]
|
|
||||||
</td>
|
|
||||||
[% CATCH %]
|
|
||||||
[% CLEAR %]
|
|
||||||
[% IF config.editable AND user_can_port_control AND params.c_admin AND row.portctl %]
|
|
||||||
<td nowrap class="nd_editable-cell" contenteditable="true"
|
|
||||||
data-field="[% config.field | html_entity %]" data-for-device="[% device.ip | html_entity %]" data-for-port="[% row.port | html_entity %]">
|
|
||||||
<i class="icon-edit nd_edit-icon"></i>
|
|
||||||
[% ELSE %]
|
|
||||||
<td nowrap class="nd_editable-cell">
|
|
||||||
[% END %]
|
|
||||||
<div class="nd_editable-cell-content">
|
|
||||||
[% row.get_column(config.field) | html_entity %]
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
[% END %]
|
|
||||||
|
|
||||||
[% END %]
|
|
||||||
|
|
||||||
[% IF params.c_descr %]
|
[% IF params.c_descr %]
|
||||||
<td nowrap>[% row.descr | html_entity %]</td>
|
<td nowrap>[% row.descr | html_entity %]</td>
|
||||||
[% END %]
|
[% END %]
|
||||||
@@ -193,6 +145,30 @@
|
|||||||
</td>
|
</td>
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
||||||
|
[% FOREACH config IN settings._extra_device_port_cols %]
|
||||||
|
[% NEXT UNLESS config.position == 'left' AND params.${config.name} %]
|
||||||
|
|
||||||
|
[% TRY %]
|
||||||
|
<td>
|
||||||
|
[% INCLUDE "plugin/${config.name}/device_port_column.tt" %]
|
||||||
|
</td>
|
||||||
|
[% CATCH %]
|
||||||
|
[% CLEAR %]
|
||||||
|
[% IF config.editable AND user_can_port_control AND params.c_admin AND row.portctl %]
|
||||||
|
<td nowrap class="nd_editable-cell" contenteditable="true"
|
||||||
|
data-field="[% config.field | html_entity %]" data-for-device="[% device.ip | html_entity %]" data-for-port="[% row.port | html_entity %]">
|
||||||
|
<i class="icon-edit nd_edit-icon"></i>
|
||||||
|
[% ELSE %]
|
||||||
|
<td nowrap class="nd_editable-cell">
|
||||||
|
[% END %]
|
||||||
|
<div class="nd_editable-cell-content">
|
||||||
|
[% row.get_column(config.field) | html_entity %]
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
[% END %]
|
||||||
|
|
||||||
|
[% END %]
|
||||||
|
|
||||||
[% IF params.c_speed_admin %]
|
[% IF params.c_speed_admin %]
|
||||||
<td>[% row.speed_admin | html_entity %]</td>
|
<td>[% row.speed_admin | html_entity %]</td>
|
||||||
[% END %]
|
[% END %]
|
||||||
@@ -332,6 +308,30 @@
|
|||||||
</td>
|
</td>
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
||||||
|
[% FOREACH config IN settings._extra_device_port_cols %]
|
||||||
|
[% NEXT UNLESS config.position == 'mid' AND params.${config.name} %]
|
||||||
|
|
||||||
|
[% TRY %]
|
||||||
|
<td>
|
||||||
|
[% INCLUDE "plugin/${config.name}/device_port_column.tt" %]
|
||||||
|
</td>
|
||||||
|
[% CATCH %]
|
||||||
|
[% CLEAR %]
|
||||||
|
[% IF config.editable AND user_can_port_control AND params.c_admin AND row.portctl %]
|
||||||
|
<td nowrap class="nd_editable-cell" contenteditable="true"
|
||||||
|
data-field="[% config.field | html_entity %]" data-for-device="[% device.ip | html_entity %]" data-for-port="[% row.port | html_entity %]">
|
||||||
|
<i class="icon-edit nd_edit-icon"></i>
|
||||||
|
[% ELSE %]
|
||||||
|
<td nowrap class="nd_editable-cell">
|
||||||
|
[% END %]
|
||||||
|
<div class="nd_editable-cell-content">
|
||||||
|
[% row.get_column(config.field) | html_entity %]
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
[% END %]
|
||||||
|
|
||||||
|
[% END %]
|
||||||
|
|
||||||
[% IF params.c_nodes OR params.c_neighbors %]
|
[% IF params.c_nodes OR params.c_neighbors %]
|
||||||
<td>
|
<td>
|
||||||
[% IF params.c_neighbors AND (row.remote_ip OR row.is_uplink) %]
|
[% IF params.c_neighbors AND (row.remote_ip OR row.is_uplink) %]
|
||||||
|
|||||||
Reference in New Issue
Block a user