simplified dashboard
This commit is contained in:
parent
fb80b381f6
commit
de92fbe778
@ -15,26 +15,19 @@ import jakarta.ws.rs.core.Response;
|
||||
@Path("api")
|
||||
public class Endpoints {
|
||||
|
||||
@Inject
|
||||
SecurityIdentity identity;
|
||||
@Inject SecurityIdentity identity;
|
||||
|
||||
@Inject
|
||||
InstanceService instanceService;
|
||||
@Inject InstanceService instanceService;
|
||||
|
||||
@Inject
|
||||
SujetService sujetService;
|
||||
@Inject SujetService sujetService;
|
||||
|
||||
@GET
|
||||
@Path("dashboard")
|
||||
public Response getDashboard() {
|
||||
String username = identity.getPrincipal().getName();
|
||||
DashboardResponse dashboard = new DashboardResponse();
|
||||
if (identity.getRoles().contains("root")) {
|
||||
dashboard.tps = sujetService.getAllSujetsAdmin();
|
||||
} else {
|
||||
|
||||
dashboard.tps = sujetService.getAllSujetsRespo(identity.getPrincipal().getName());
|
||||
}
|
||||
dashboard.tps =
|
||||
sujetService.getAllSujetsRespo(identity.getPrincipal().getName());
|
||||
dashboard.instances = instanceService.getAllInstances(username);
|
||||
return Response.ok(dashboard).build();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user