diff --git a/compose/production/nginx/default.conf b/compose/production/nginx/default.conf index aafdd5be..484f8f58 100644 --- a/compose/production/nginx/default.conf +++ b/compose/production/nginx/default.conf @@ -1,6 +1,15 @@ server { listen 80; server_name localhost; + + # Enable gzip compression + gzip on; + gzip_comp_level 6; + gzip_min_length 1024; + gzip_proxied any; + gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript application/x-javascript text/x-js text/html; + gzip_vary on; + location /media/ { alias /usr/share/nginx/media/; } diff --git a/config/settings/base.py b/config/settings/base.py index 45097ab5..1ef0fd43 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -145,6 +145,7 @@ # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#middleware MIDDLEWARE = [ + "django.middleware.gzip.GZipMiddleware", "django.middleware.security.SecurityMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", "django.middleware.locale.LocaleMiddleware", @@ -351,3 +352,6 @@ XLI_TOKEN = env("XLI_TOKEN") INFERENCE_API_URL = env("INFERENCE_API_URL", default="http://host.docker.internal:8000") TDAMM_CLASSIFICATION_THRESHOLD = env("TDAMM_CLASSIFICATION_THRESHOLD", default="0.5") + +# Setting this to a larger value like 1KB ensures we don't waste resources compressing small responses +GZIP_MIN_LENGTH = 1024 diff --git a/sde_indexing_helper/static/js/collection_list.js b/sde_indexing_helper/static/js/collection_list.js index 7eb5c7bf..a4f87170 100644 --- a/sde_indexing_helper/static/js/collection_list.js +++ b/sde_indexing_helper/static/js/collection_list.js @@ -566,3 +566,52 @@ function clearSearchValues() { let table = $("#collection_table").DataTable(); table.columns().search("").draw(); } + +$('body').on('click', '.workflow_status_dropdown .dropdown-toggle', function() { + const $menu = $(this).siblings('.dropdown-menu'); + + // Only populate if empty + if ($menu.children().length === 0) { + workflowStatuses.forEach(status => { + $menu.append( + ` + ${status.label} + ` + ); + }); + } +}); + +$('body').on('click', '.reindexing_status_dropdown .dropdown-toggle', function() { + const $menu = $(this).siblings('.dropdown-menu'); + + if ($menu.children().length === 0) { + reindexingStatuses.forEach(status => { + $menu.append( + ` + ${status.label} + ` + ); + }); + } +}); + +$('body').on('click', '.curator_dropdown .dropdown-toggle', function() { + const $menu = $(this).siblings('.dropdown-menu'); + + if ($menu.children().length === 0) { + curators.forEach(curator => { + $menu.append( + ` + ${curator.username} + ` + ); + }); + } +}); diff --git a/sde_indexing_helper/templates/sde_collections/collection_list.html b/sde_indexing_helper/templates/sde_collections/collection_list.html index 1930022e..6940fe9d 100644 --- a/sde_indexing_helper/templates/sde_collections/collection_list.html +++ b/sde_indexing_helper/templates/sde_collections/collection_list.html @@ -11,110 +11,132 @@ {% block content %} {% csrf_token %}
- -

Welcome back!

+ +

Welcome back!

- - - - - - - - - - - - - - - + + - - - - - + +
NameUrlDivisionDelta UrlsCurated UrlsWorkflow StatusCuratorConnector TypeReindexing Status
+ + + + + + + + + + + + + - - - - + + + + + - - + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - + + + + + + + + +
@@ -164,85 +186,51 @@

Welcome back!

role="button">{{ collection.num_curated_urls|intcomma }} -
- -
NameUrlDivisionDelta UrlsCurated UrlsWorkflow StatusCuratorConnector TypeReindexing Status
- -
- -
+ + - - + + + + - - - - + + - - + + - - + +
+ +
{{ collection.get_connector_display }}