enable csv icon link rewrite for all pages
This commit is contained in:
@@ -25,12 +25,12 @@ get '/ajax/content/search/vlan' => require_login sub {
|
|||||||
return unless $set->count;
|
return unless $set->count;
|
||||||
|
|
||||||
if (request->is_ajax) {
|
if (request->is_ajax) {
|
||||||
template 'ajax/search/vlan.tt', { results => $set}
|
template 'ajax/search/vlan.tt', { results => $set },
|
||||||
{ layout => undef };
|
{ layout => undef };
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||||
template 'ajax/search/vlan_csv.tt', { results => $set}
|
template 'ajax/search/vlan_csv.tt', { results => $set },
|
||||||
{ layout => undef };
|
{ layout => undef };
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,10 +4,8 @@
|
|||||||
var form = '#' + tab + '_form';
|
var form = '#' + tab + '_form';
|
||||||
var query = $(form).serialize();
|
var query = $(form).serialize();
|
||||||
|
|
||||||
// this is needed otherwise we can 404 on url with traling slash
|
$('#nd_csv-download').attr('href',
|
||||||
if (query.length) { query = '/' + query }
|
'/ajax/content/' + type + '/' + tab + '?' + query);
|
||||||
|
|
||||||
$('#nd_csv-download').attr('href', '/ajax/content/' + type + '/' + tab + query);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// page title includes tab name and possibly device name
|
// page title includes tab name and possibly device name
|
||||||
@@ -58,6 +56,7 @@
|
|||||||
[% FOREACH tab IN settings._search_tabs %]
|
[% FOREACH tab IN settings._search_tabs %]
|
||||||
$('[% "#${tab.tag}_form" %]').submit(function (event) {
|
$('[% "#${tab.tag}_form" %]').submit(function (event) {
|
||||||
var pgtitle = update_page_title('[% tab.tag %]');
|
var pgtitle = update_page_title('[% tab.tag %]');
|
||||||
|
update_csv_download_link('search', '[% tab.tag %]');
|
||||||
update_browser_history('[% tab.tag %]', pgtitle);
|
update_browser_history('[% tab.tag %]', pgtitle);
|
||||||
copy_navbar_to_sidebar('[% tab.tag %]');
|
copy_navbar_to_sidebar('[% tab.tag %]');
|
||||||
do_search(event, '[% tab.tag %]');
|
do_search(event, '[% tab.tag %]');
|
||||||
@@ -70,8 +69,10 @@
|
|||||||
[% FOREACH tab IN settings._device_tabs %]
|
[% FOREACH tab IN settings._device_tabs %]
|
||||||
$('[% "#${tab.tag}_form" %]').submit(function (event) {
|
$('[% "#${tab.tag}_form" %]').submit(function (event) {
|
||||||
var pgtitle = update_page_title('[% tab.tag %]');
|
var pgtitle = update_page_title('[% tab.tag %]');
|
||||||
|
update_csv_download_link('device', '[% tab.tag %]');
|
||||||
update_browser_history('[% tab.tag %]', pgtitle);
|
update_browser_history('[% tab.tag %]', pgtitle);
|
||||||
copy_navbar_to_sidebar('[% tab.tag %]');
|
copy_navbar_to_sidebar('[% tab.tag %]');
|
||||||
|
|
||||||
[% IF tab.tag == 'ports' %]
|
[% IF tab.tag == 'ports' %]
|
||||||
var cookie = $('#ports_form').find('input,select')
|
var cookie = $('#ports_form').find('input,select')
|
||||||
.not('#nd_port-query,input[name="q"],input[name="tab"]')
|
.not('#nd_port-query,input[name="q"],input[name="tab"]')
|
||||||
@@ -81,6 +82,7 @@
|
|||||||
});
|
});
|
||||||
$.cookie('nd_ports-form', $.param(cookie) ,{ expires: 365 });
|
$.cookie('nd_ports-form', $.param(cookie) ,{ expires: 365 });
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
||||||
do_search(event, '[% tab.tag %]');
|
do_search(event, '[% tab.tag %]');
|
||||||
});
|
});
|
||||||
[% END %]
|
[% END %]
|
||||||
@@ -99,6 +101,7 @@
|
|||||||
// for the admin pages
|
// for the admin pages
|
||||||
$('[% "#${task.tag}_form" %]').submit(function (event) {
|
$('[% "#${task.tag}_form" %]').submit(function (event) {
|
||||||
update_page_title('[% task.tag %]');
|
update_page_title('[% task.tag %]');
|
||||||
|
update_csv_download_link('task', '[% task.tag %]');
|
||||||
do_search(event, '[% task.tag %]');
|
do_search(event, '[% task.tag %]');
|
||||||
});
|
});
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|||||||
Reference in New Issue
Block a user