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