Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew Blessing <drew@gitlab.com>2017-11-10 23:39:00 +0300
committerDrew Blessing <drew@gitlab.com>2017-11-15 17:28:33 +0300
commit03b1bcbb686f8e56fe6c6303adacdc01c5403790 (patch)
tree45e21665a23e6ce6ce616f91b1ea5901dcbccc48 /app/views/projects/tree
parenta4072db0198896242886d22c644ed91c1016aa8d (diff)
Truncate tree to max 1,000 items and display notice to users
Rendering ten thousands of tree items consumes a lot of server time and can cause timeouts in extreme cases. Realistically, displaying more than 1,000 files is probably not useful so truncate and show the user a notice instead. 'Find files' can be used to locate specific files beyond the 1,000 limit.
Diffstat (limited to 'app/views/projects/tree')
-rw-r--r--app/views/projects/tree/_truncated_notice_tree_row.html.haml7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/views/projects/tree/_truncated_notice_tree_row.html.haml b/app/views/projects/tree/_truncated_notice_tree_row.html.haml
new file mode 100644
index 00000000000..693b641888b
--- /dev/null
+++ b/app/views/projects/tree/_truncated_notice_tree_row.html.haml
@@ -0,0 +1,7 @@
+%tr.tree-truncated-warning
+ %td{ colspan: '3' }
+ = icon('exclamation-triangle fw')
+ %span
+ Too many items to show. To preserve performance only
+ %strong #{number_with_delimiter(limit)} of #{number_with_delimiter(total)}
+ items are displayed.