Skip to content
Snippets Groups Projects
Commit 4ac69558 authored by Guillaume Heurtier's avatar Guillaume Heurtier
Browse files

FEAT #14949 TIME 0:40 fix indexing models list loading time in indexation page

parent 5d25d69f
No related branches found
No related tags found
No related merge requests found
...@@ -55,14 +55,16 @@ class IndexingModelController ...@@ -55,14 +55,16 @@ class IndexingModelController
$models = IndexingModelModel::get(['where' => $where, 'data' => [$GLOBALS['id'], 'false']]); $models = IndexingModelModel::get(['where' => $where, 'data' => [$GLOBALS['id'], 'false']]);
foreach ($models as $key => $value) { if (!empty($query['admin'])) {
$resources = ResModel::get([ foreach ($models as $key => $value) {
'select' => ['status', 'count(1)'], $resources = ResModel::get([
'where' => ['model_id = ?'], 'select' => ['status', 'count(1)'],
'data' => [$value['id']], 'where' => ['model_id = ?'],
'groupBy' => ['status'] 'data' => [$value['id']],
]); 'groupBy' => ['status']
$models[$key]['used'] = $resources; ]);
$models[$key]['used'] = $resources;
}
} }
return $response->withJson(['indexingModels' => $models]); return $response->withJson(['indexingModels' => $models]);
......
...@@ -56,7 +56,7 @@ export class IndexingModelsAdministrationComponent implements OnInit { ...@@ -56,7 +56,7 @@ export class IndexingModelsAdministrationComponent implements OnInit {
this.loading = true; this.loading = true;
this.http.get('../rest/indexingModels?showDisabled=true').pipe( this.http.get('../rest/indexingModels?showDisabled=true&admin=true').pipe(
map((data: any) => { map((data: any) => {
return data.indexingModels.filter((info: any) => info.private === false); return data.indexingModels.filter((info: any) => info.private === false);
}), }),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment