-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new status rest api endpoint containing all system status data.
added cpu usage% changed server mode from ServerPrerendered to Server
- Loading branch information
Showing
12 changed files
with
166 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using kiosk_server.Metrics; | ||
using kiosk_server.Model; | ||
using Microsoft.AspNetCore.Authorization; | ||
using Microsoft.AspNetCore.Mvc; | ||
using System.Xml.Linq; | ||
|
||
namespace kiosk_server.Api | ||
{ | ||
[Route("api/[controller]")] | ||
[ApiController] | ||
[AllowAnonymous] | ||
public class StatusController : ControllerBase | ||
{ | ||
private class StatusData | ||
{ | ||
public DiskMetrics Disk { get; set; } = default!; | ||
public TemperatureMetrics Temperature { get; set; } = default!; | ||
public MemoryMetrics Memory { get; set; } = default!; | ||
public CpuMetrics Cpu { get; set; } = default!; | ||
} | ||
|
||
[HttpGet] | ||
public IActionResult Get() | ||
{ | ||
var statusData = new StatusData | ||
{ | ||
Memory = new MemoryMetricsClient().GetMetrics(), | ||
Temperature = new TemperatureMetricsClient().GetMetrics(), | ||
Disk = new DiskMetricsClient().GetMetrics(), | ||
Cpu = new CpuMetricsClient().GetMetrics() | ||
}; | ||
return Ok(statusData); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters