Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions compose/production/nginx/default.conf
Original file line number Diff line number Diff line change
@@ -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/;
}
Expand Down
4 changes: 4 additions & 0 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
49 changes: 49 additions & 0 deletions sde_indexing_helper/static/js/collection_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
`<a class="dropdown-item workflow_status_select"
value="${status.value}"
data-collection-id="${$(this).closest('.workflow_status_dropdown').data('collection-id')}">
${status.label}
</a>`
);
});
}
});

$('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(
`<a class="dropdown-item reindexing_status_select"
value="${status.value}"
data-collection-id="${$(this).closest('.reindexing_status_dropdown').data('collection-id')}">
${status.label}
</a>`
);
});
}
});

$('body').on('click', '.curator_dropdown .dropdown-toggle', function() {
const $menu = $(this).siblings('.dropdown-menu');

if ($menu.children().length === 0) {
curators.forEach(curator => {
$menu.append(
`<a class="dropdown-item curator_select"
value="${curator.id}"
data-collection-id="${$(this).closest('.curator_dropdown').data('collection-id')}">
${curator.username}
</a>`
);
});
}
});
Loading