]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Change overview behaviour in objects endpoint if used together with groupby...
authorMarcin Haba <marcin.haba@bacula.pl>
Thu, 27 Apr 2023 11:04:05 +0000 (13:04 +0200)
committerMarcin Haba <marcin.haba@bacula.pl>
Mon, 1 May 2023 11:18:25 +0000 (13:18 +0200)
gui/baculum/protected/API/Modules/ObjectManager.php
gui/baculum/protected/API/openapi_baculum.json

index 4b0724571ba13a5e6a9b95ed6887c9cf615c02e4..45e65781372fa084a5f4df4a27695c24696e67a5 100644 (file)
@@ -123,7 +123,7 @@ LEFT JOIN Client USING (ClientId) '
                        // Overview mode.
                        $result = [
                                'objects' => $result,
-                               'overview' => $overview
+                               'overview' => (is_string($group_by) ? $overview : $this->getObjectCountByObjectType($criteria))
                        ];
                }
                return $result;
index beadb4dc7ff5ec925d3312d960fb17a25d749852..afeb9b703f31ab47bd405ad79549acfd934e3d6e 100644 (file)
                                                "name": "overview",
                                                "in": "query",
                                                "required": false,
-                                               "description": "If set, it puts objects in 'objects' property and adds the 'overview' property with the object count by object type (PostgreSQL, MySQL, vSphere ...etc.)  NOTE: Offset and limit parameters do not apply to overview counts.",
+                                               "description": "If set, it puts objects in 'objects' property and adds the 'overview' property with the object count by object type (PostgreSQL, MySQL, vSphere ...etc.)  NOTE: Offset and limit parameters do apply to overview counts if used together 'groupby' parameter. With 'groupby' the counters behaviour is chanining and they display only count of currently listed objects.",
                                                "schema": {
                                                        "type": "boolean"
                                                }