diff --git a/bazarr/main.py b/bazarr/main.py index 73561f2f2..eeef226da 100644 --- a/bazarr/main.py +++ b/bazarr/main.py @@ -511,7 +511,8 @@ if args.dev: else: server = create_server(app, host=str(settings.general.ip), - port=int(args.port) if args.port else int(settings.general.port)) + port=int(args.port) if args.port else int(settings.general.port), + threads=24) if __name__ == "__main__": try: diff --git a/views/_main.html b/views/_main.html index 567dc3704..cda300856 100644 --- a/views/_main.html +++ b/views/_main.html @@ -315,24 +315,15 @@ {% if not request.endpoint == 'login_page' %} $(document).ready(function () { BadgesAjax(); - $(window).on('load resize', function () { - if ($('body').hasClass('mini-sidebar')) { - $('#buttons_bars').width($(window).width()); - $('.page-wrapper').attr('style', 'padding-top: 60px !important'); - $('.badge').each(function() { - $(this).css('max-width', $(this).closest( "div" ).width()); - }) - $('form .row :first-child').each( function() { - $(this).removeClass('text-right'); - }) - $('.container-fluid .row :first-child').each( function() { - $(this).removeClass('text-right'); - }) - } else { - $('#buttons_bars').width($('.page-wrapper').width()); - } + + $(window).on( 'ready orientationchange resize', function() { + adjustResponsiveUI(); }); + $('.table').on( 'init.dt', function () { + adjustResponsiveUI(); + } ); + $('.table').on('draw.dt', function () { $('[data-toggle="tooltip"]').tooltip({html: true}); }); @@ -416,12 +407,7 @@ } }); - if ($('#buttons_bar_left').children().length > 0 || $('#buttons_bar_right').children().length > 0) { - $('#buttons_bars').show(); - } else { - $('#buttons_bars').hide(); - $('.page-wrapper').css('padding-top', '-=60'); - } + $(window).trigger('orientationchange'); }); // Add apikey to all AJAX requests. @@ -461,6 +447,38 @@ }); } + function adjustResponsiveUI() { + if ($(window).width() <= 750) { + $('#buttons_bars').width($('body').width()); + $('#buttons_bars').css('left', '30px'); + } else if ($(window).width() <= 1152) { + $('#buttons_bars').width($('body').width() - 60); + } else { + $('#buttons_bars').width($('body').width() - 240); + } + + $('.badge').each(function() { + $(this).css('max-width', $(this).closest( "div" ).width()); + }) + + if ($(window).width() <= 1170) { + $('form .row :first-child').each( function() { + $(this).removeClass('text-right'); + }) + $('.container-fluid .row :first-child').each( function() { + $(this).removeClass('text-right'); + }) + } + + if ($('#buttons_bar_left').children().length > 0 || $('#buttons_bar_right').children().length > 0) { + $('#buttons_bars').show(); + $('.page-wrapper').attr('style', 'padding-top: 60px !important'); + } else { + $('#buttons_bars').hide(); + $('.page-wrapper').attr('style', 'padding-top: 0px !important'); + } + } + $('#shutdown').on('click', function () { document.open(); document.write('Bazarr has shutdown.');