From ff1f33385b8cad02883359627a4e01463a89ceb0 Mon Sep 17 00:00:00 2001 From: Deon George Date: Fri, 4 Jul 2025 19:47:16 +0800 Subject: [PATCH] Show size limit exceptions in the tree, if when expanding a tree branch the container has more items --- app/Classes/LDAP/Server.php | 5 +++++ app/Http/Controllers/AjaxController.php | 11 +++++++++++ public/js/custom.js | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/app/Classes/LDAP/Server.php b/app/Classes/LDAP/Server.php index d3a51792..9854178a 100644 --- a/app/Classes/LDAP/Server.php +++ b/app/Classes/LDAP/Server.php @@ -329,6 +329,11 @@ final class Server : NULL; } + public function hasMore(): bool + { + return (new Entry)->hasMore(); + } + /** * Does this server support RFC3666 language tags * OID: 1.3.6.1.4.1.4203.1.5.4 diff --git a/app/Http/Controllers/AjaxController.php b/app/Http/Controllers/AjaxController.php index aaa7b9cf..6decb9bb 100644 --- a/app/Http/Controllers/AjaxController.php +++ b/app/Http/Controllers/AjaxController.php @@ -67,6 +67,17 @@ class AjaxController extends Controller ] : [] ) + ->push( + config('server')->hasMore() + ? [ + 'title'=>sprintf('[%s]',__('Size Limit')), + 'item'=>'', + 'lazy'=>FALSE, + 'icon'=>'fas fa-fw fa-triangle-exclamation text-danger', + 'tooltip'=>__('There may be more entries'), + ] + : [] + ) ->filter() ->values(); } diff --git a/public/js/custom.js b/public/js/custom.js index d1ca60a2..c14f4049 100644 --- a/public/js/custom.js +++ b/public/js/custom.js @@ -89,7 +89,7 @@ $(document).ready(function() { types: 'active expanded focus selected' // which status types to store }, click: function(event,data) { - if (data.targetType === 'title') + if (data.targetType === 'title' && data.node.data.item) getNode(data.node.data.item); }, source: sources,