Skip to content

Commit 9a49ca7

Browse files
committed
Fix dashboard bug
1 parent 3f3f594 commit 9a49ca7

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

.github/workflows/maven.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,3 @@ jobs:
2929
cache: maven
3030
- name: Build with Maven
3131
run: mvn -B package --file pom.xml
32-
33-
# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
34-
- name: Update dependency graph
35-
uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6

api/src/main/java/io/sentrius/sso/controllers/api/TerminalApiController.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,14 @@ public ResponseEntity<List<HostSystemDTO>> listTerminal(HttpServletRequest reque
9090
public ResponseEntity<List<TerminalLogOutputDTO>> getOutputSize(
9191
HttpServletRequest request, HttpServletResponse response) {
9292
// Check if the current user is a system admin
93+
log.info("getOutputSize");
9394
var currentUser = getOperatingUser(request, response);
9495
List<TerminalLogOutputDTO> outputData = new ArrayList<>();
9596
if (AccessUtil.canAccess(currentUser, ApplicationAccessEnum.CAN_MANAGE_APPLICATION)){
9697
outputData = sessionService.getLogOutputSummary(null);
9798
} else {
9899
outputData = sessionService.getLogOutputSummary(currentUser.getUsername());
100+
log.info("*** User {} requested terminal log output size", currentUser.getUsername());
99101
}
100102

101103
return ResponseEntity.ok(outputData);

api/src/main/resources/templates/sso/dashboard.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,10 +293,13 @@ <h3>Open Terminals</h3>
293293
let maxConnections = 10;
294294
let currentConnections = 0;
295295

296-
let tachometerChart; // Chart variable for tachometer
296+
let tachometerChart = null; // Chart variable for tachometer
297297
let outputSizeChart; // Chart variable for output size chart
298298

299299
function createTachometerChart() {
300+
if (null == document.getElementById('tachometerChart')){
301+
return;
302+
}
300303
const ctx = document.getElementById('tachometerChart').getContext('2d');
301304
if (tachometerChart){
302305
tachometerChart.destroy();
@@ -344,7 +347,7 @@ <h3>Open Terminals</h3>
344347
}
345348

346349
function updateTachometer(newConnections) {
347-
if (newConnections <= maxConnections) {
350+
if (newConnections <= maxConnections && null != tachometerChart) {
348351
tachometerChart.data.datasets[0].data[0] = newConnections;
349352
tachometerChart.data.datasets[0].data[1] = maxConnections - newConnections;
350353
tachometerChart.update();
@@ -484,6 +487,7 @@ <h3>Open Terminals</h3>
484487
});
485488

486489
// Render heatmap with Chart.js
490+
if (document.getElementById('heatmap-container')) {
487491
const ctx = document.getElementById('heatmap-container').getContext('2d');
488492
new Chart(ctx, {
489493
type: 'bar', // Use bar chart to display the heatmap
@@ -517,6 +521,7 @@ <h3>Open Terminals</h3>
517521
}
518522
}
519523
});
524+
}
520525
});
521526
});
522527

core/src/main/java/io/sentrius/sso/core/model/security/AccessControlAspect.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public void checkLimitAccess(LimitAccess limitAccess) throws SQLException, Gener
5656
}
5757

5858
if (!canAccess) {
59-
throw new ResponseStatusException(HttpStatus.FORBIDDEN, "Access Denied");
59+
throw new ResponseStatusException(HttpStatus.FORBIDDEN, "Access Denied to ");
6060
}
6161
}
6262
}

0 commit comments

Comments
 (0)