add openhack files

This commit is contained in:
Ryan Peters
2022-11-03 16:41:13 -04:00
commit b2c9f7e29f
920 changed files with 118861 additions and 0 deletions

View File

@ -0,0 +1,7 @@
@{
ViewData["Title"] = "About";
}
<h2>@ViewData["Title"]</h2>
<h3>@ViewData["Message"]</h3>
<p>Use this area to provide additional information.</p>

View File

@ -0,0 +1,17 @@
@{
ViewData["Title"] = "Contact";
}
<h2>@ViewData["Title"]</h2>
<h3>@ViewData["Message"]</h3>
<address>
One Microsoft Way<br />
Redmond, WA 98052-6399<br />
<abbr title="Phone">P:</abbr>
425.555.0100
</address>
<address>
<strong>Support:</strong> <a href="mailto:Support@example.com">Support@example.com</a><br />
<strong>Marketing:</strong> <a href="mailto:Marketing@example.com">Marketing@example.com</a>
</address>

View File

@ -0,0 +1,166 @@
@model TripViewer.Utility.TripViewerConfiguration
@{
ViewData["Title"] = "TripViewer Home Page";
//Swagger Endpoints
var urlUser = Model.USER_ROOT_URL + "/api/docs/user";
var urlUserJava = Model.USER_JAVA_ROOT_URL + "/api/docs/user-java";
var urlTrips = Model.TRIPS_ROOT_URL;
var urlPoi = Model.POI_ROOT_URL + "/api/docs/poi";
//Healthcheck EndPoints
var hcUser = Model.USER_ROOT_URL + "/api/healthcheck/user";
var hcUserJava = Model.USER_JAVA_ROOT_URL + "/api/healthcheck/user-java";
var hcTrips = Model.TRIPS_ROOT_URL + "/api/healthcheck/trips";
var hcPoi = Model.POI_ROOT_URL + "/api/healthcheck/poi";
//Staging Healthcheck EndPoints
var hcStagingUser = Model.STAGING_USER_ROOT_URL + "/api/healthcheck/user";
var hcStagingUserJava = Model.STAGING_USER_JAVA_ROOT_URL + "/api/healthcheck/user-java";
var hcStagingTrips = Model.STAGING_TRIPS_ROOT_URL + "/api/healthcheck/trips";
var hcStagingPoi = Model.STAGING_POI_ROOT_URL + "/api/healthcheck/poi";
//Version EndPoints
var vUser = Model.USER_ROOT_URL + "/api/version/user";
var vUserJava = Model.USER_JAVA_ROOT_URL + "/api/version/user-java";
var vTrips = Model.TRIPS_ROOT_URL + "/api/version/trips";
var vPoi = Model.POI_ROOT_URL + "/api/version/poi";
//Staging Version EndPoints
var vStagingUser = Model.STAGING_USER_ROOT_URL + "/api/version/user";
var vStagingUserJava = Model.STAGING_USER_JAVA_ROOT_URL + "/api/version/user-java";
var vStagingTrips = Model.STAGING_TRIPS_ROOT_URL + "/api/version/trips";
var vStagingPoi = Model.STAGING_POI_ROOT_URL + "/api/version/poi";
}
<div class="text-center">
<h2 class="display-4">DevOps OpenHack Team Resources</h2>
<p>
Welcome to your team's Trip viewer website running on Azure App Service on Linux.
The <a href="/Trip"> trip page </a> will replay the trips being sent via the simulator in your App Service.
The <a href="/UserProfile"> profile page </a> will show the total number of trips and distance traveled for the
user of those simulated trips.
Both of these pages are one way to verify that all of your APIs are functioning.
</p>
</div>
<div style="width: 100%;">
<div style="float: left; width: 33%;">
<h4>Production Health Check Links</h4>
<ul>
<li>
<a href="@hcUser" title="View User Profile Health Check" target="_blank">User Profile API Health
Check</a>
</li>
<li>
<a href="@hcUserJava" title="View User Health Check" target="_blank">User API (Java) Health Check</a>
</li>
<li>
<a href="@hcTrips" title="View Trips Health Check" target="_blank">Trips API (Golang) Health Check</a>
</li>
<li>
<a href="@hcPoi" title="View POI Health Check" target="_blank">POI API (dotnet) Health Check</a>
</li>
</ul>
</div>
<div style="float: left; width: 33%;">
<h4>Check Production Version</h4>
<ul>
<li>
<a href="@vUser" title="User Profile API version" target="_blank">User Profile API (Node.js) version</a>
</li>
<li>
<a href="@vUserJava" title="User Java API version" target="_blank">User API (Java) version</a>
</li>
<li>
<a href="@vTrips" title="Trips API version" target="_blank">Trips API (Golang) version</a>
</li>
<li>
<a href="@vPoi" title="POI API version" target="_blank">POI API (dotnet) version</a>
</li>
</ul>
</div>
<div style="float: left; width: 33%;">
<h4>Swagger Docs Links</h4>
<ul>
<li>
<a href="@urlUser" title="User Profile API swagger docs" target="_blank">User Profile API (Node.js)</a>
</li>
<li>
<a href="@urlUserJava" title="User Java API swagger docs" target="_blank">User API (Java)</a>
</li>
<li>
<a href="@urlTrips" title="Trips API swagger docs" target="_blank">Trips API (Golang)</a>
</li>
<li>
<a href="@urlPoi" title="POI API swagger docs" target="_blank">POI API (dotnet)</a>
</li>
</ul>
</div>
<br style="clear: left;" />
</div>
<div style="width: 100%;">
<div style="float: left; width: 33%;">
<h4>Staging Health Check Links</h4>
<ul>
<li>
<a href="@hcStagingUser" title="View User Profile Health Check" target="_blank">User Profile API Health
Check</a>
</li>
<li>
<a href="@hcStagingUserJava" title="View User Health Check" target="_blank">User API (Java) Health
Check</a>
</li>
<li>
<a href="@hcStagingTrips" title="View Trips Health Check" target="_blank">Trips API (Golang) Health
Check</a>
</li>
<li>
<a href="@hcStagingPoi" title="View POI Health Check" target="_blank">POI API (dotnet) Health Check</a>
</li>
</ul>
</div>
<div style="float: left; width: 33%;">
<h4>Check Staging Version</h4>
<ul>
<li>
<a href="@vStagingUser" title="User Profile API version" target="_blank">User Profile API (Node.js)
version</a>
</li>
<li>
<a href="@vStagingUserJava" title="User Java API version" target="_blank">User API (Java) version</a>
</li>
<li>
<a href="@vStagingTrips" title="Trips API version" target="_blank">Trips API (Golang) version</a>
</li>
<li>
<a href="@vStagingPoi" title="POI API version" target="_blank">POI API (dotnet) version</a>
</li>
</ul>
</div>
<div style="float: left; width: 33%;">
</div>
<br style="clear: left;" />
</div>

View File

@ -0,0 +1,6 @@
@{
ViewData["Title"] = "Privacy Policy";
}
<h1>@ViewData["Title"]</h1>
<p>Use this page to detail your site's privacy policy.</p>

View File

@ -0,0 +1,25 @@
@model ErrorViewModel
@{
ViewData["Title"] = "Error";
}
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
@if (Model.ShowRequestId)
{
<p>
<strong>Request ID:</strong> <code>@Model.RequestId</code>
</p>
}
<h3>Development Mode</h3>
<p>
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
</p>
<p>
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
It can result in displaying sensitive information from exceptions to end users.
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
and restarting the app.
</p>

View File

@ -0,0 +1,54 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - TripViewer</title>
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" />
</head>
<body>
<header>
<div class="fillspace">
<img src="/images/openhack-banner.png" />
</div>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container">
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">TripViewer</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse">
<ul class="navbar-nav flex-grow-1">
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Home</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="UserProfile" asp-action="Index">User Profile</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Trip" asp-action="Index">Trips</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="container">
<main role="main" class="pb-3">
@RenderBody()
</main>
</div>
<footer class="border-top footer text-muted">
<div class="container">
&copy; 2020 - TripViewer - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
</div>
</footer>
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>
@RenderSection("Scripts", required: false)
</body>
</html>

View File

@ -0,0 +1,2 @@
<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>

View File

@ -0,0 +1,147 @@

@using Simulator.DataObjects;
@model IEnumerable<TripPoint>
@{
ViewData["Title"] = "Trips";
var mapKey = ViewData["MapKey"];
}
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<script type='text/javascript'>
var map, directionsManager;
var stepDistance = 0.10; //The distance in Miles along the route to retrieve locations.
function GetMap()
{
map = new Microsoft.Maps.Map('#myMap', {});
//Load the directions and spatial math modules.
Microsoft.Maps.loadModule(['Microsoft.Maps.Directions', 'Microsoft.Maps.SpatialMath'], function () {
//Create an instance of the directions manager.
directionsManager = new Microsoft.Maps.Directions.DirectionsManager(map);
@*var startpoint = @($"{Model.FirstOrDefault().Latitude},{Model.FirstOrDefault().Longitude}");
var endpoint = @($"{Model.Last().Latitude},{Model.Last().Longitude}");*@
//Create waypoints to route between.
var startWaypoint = new Microsoft.Maps.Directions.Waypoint({ address: '@($"{Model.FirstOrDefault().Latitude},{Model.FirstOrDefault().Longitude}")' });
directionsManager.addWaypoint(startWaypoint);
var endWaypoint = new Microsoft.Maps.Directions.Waypoint({ address: '@($"{Model.Last().Latitude},{Model.Last().Longitude}")' });
directionsManager.addWaypoint(endWaypoint);
//Add event handler to directions manager.
Microsoft.Maps.Events.addHandler(directionsManager, 'directionsUpdated', directionsUpdated);
//Calculate directions.
directionsManager.calculateDirections();
});
}
function directionsUpdated(e) {
//Remove any previously calculated locations from the map.
map.entities.clear();
//Get the current route index.
var route = directionsManager.getCurrentRoute();
if (route && route.routePath && route.routePath.length > 0) {
//Create an array to store the calculated locations, add the starting location.
var locationsAlongPath = [route.routePath[0]];
//Calculate the length of the route.
var routeLength = Microsoft.Maps.SpatialMath.getLengthOfPath(route.routePath, Microsoft.Maps.SpatialMath.DistanceUnits.Miles)
var numSteps = Math.floor(routeLength / stepDistance);
var loc;
for (var i = 1; i <= numSteps; i++) {
loc = Microsoft.Maps.SpatialMath.getLocationAlongPath(route.routePath, stepDistance * i, Microsoft.Maps.SpatialMath.DistanceUnits.Miles);
locationsAlongPath.push(loc);
}
//Add the last location on the route.
locationsAlongPath.push(route.routePath[route.routePath.length - 1]);
//Do something with the calculates locations. Lets show red pushpins for now.
//for (var i = 0, len = locationsAlongPath.length; i < len; i++) {
// map.entities.push(new Microsoft.Maps.Pushpin(locationsAlongPath[i], { color: 'red' }))
//}
}
}
function showDetail() {
var x = document.getElementById("myInfoPanel");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}
</script>
<script type='text/javascript' src='https://www.bing.com/api/maps/mapcontrol?callback=GetMap&key=@(mapKey)' async defer></script>
</head>
<body>
@* @{ Html.RenderPartial("RenderMap"); }*@
<div>
<h2>View Last Trip</h2>
<button onclick="showDetail()">Toggle Detail</button>
</div>
<div id="myMap" style="position:relative;width:800px;height:600px;"></div>
<div id="myInfoPanel" style="display:none;">
<table class="table">
<thead>
<tr>
<th>
@Html.DisplayNameFor(model => model.Id)
</th>
<th>
@Html.DisplayNameFor(model => model.Latitude)
</th>
<th>
@Html.DisplayNameFor(model => model.Longitude)
</th>
<th>
@Html.DisplayNameFor(model => model.RecordedTimeStamp)
</th>
<th>
@Html.DisplayNameFor(model => model.Speed)
</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.Id)
</td>
<td>
@Html.DisplayFor(modelItem => item.Latitude)
</td>
<td>
@Html.DisplayFor(modelItem => item.Longitude)
</td>
<td>
@Html.DisplayFor(modelItem => item.RecordedTimeStamp)
</td>
<td>
@Html.DisplayFor(modelItem => item.Speed)
</td>
</tr>
}
</tbody>
</table>
</div>
</body>
</html>

View File

@ -0,0 +1,124 @@
@model IEnumerable<Simulator.DataObjects.TripPoint>
<table class="table">
<thead>
<tr>
<th>
@Html.DisplayNameFor(model => model.Id)
</th>
<th>
@Html.DisplayNameFor(model => model.TripId)
</th>
<th>
@Html.DisplayNameFor(model => model.Latitude)
</th>
<th>
@Html.DisplayNameFor(model => model.Longitude)
</th>
<th>
@Html.DisplayNameFor(model => model.Speed)
</th>
<th>
@Html.DisplayNameFor(model => model.RecordedTimeStamp)
</th>
<th>
@Html.DisplayNameFor(model => model.Sequence)
</th>
<th>
@Html.DisplayNameFor(model => model.Rpm)
</th>
<th>
@Html.DisplayNameFor(model => model.ShortTermFuelBank)
</th>
<th>
@Html.DisplayNameFor(model => model.LongTermFuelBank)
</th>
<th>
@Html.DisplayNameFor(model => model.ThrottlePosition)
</th>
<th>
@Html.DisplayNameFor(model => model.RelativeThrottlePosition)
</th>
<th>
@Html.DisplayNameFor(model => model.Runtime)
</th>
<th>
@Html.DisplayNameFor(model => model.DistanceWithMalfunctionLight)
</th>
<th>
@Html.DisplayNameFor(model => model.EngineLoad)
</th>
<th>
@Html.DisplayNameFor(model => model.EngineFuelRate)
</th>
<th>
@Html.DisplayNameFor(model => model.CreatedAt)
</th>
<th>
@Html.DisplayNameFor(model => model.UpdatedAt)
</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.Id)
</td>
<td>
@Html.DisplayFor(modelItem => item.TripId)
</td>
<td>
@Html.DisplayFor(modelItem => item.Latitude)
</td>
<td>
@Html.DisplayFor(modelItem => item.Longitude)
</td>
<td>
@Html.DisplayFor(modelItem => item.Speed)
</td>
<td>
@Html.DisplayFor(modelItem => item.RecordedTimeStamp)
</td>
<td>
@Html.DisplayFor(modelItem => item.Sequence)
</td>
<td>
@Html.DisplayFor(modelItem => item.Rpm)
</td>
<td>
@Html.DisplayFor(modelItem => item.ShortTermFuelBank)
</td>
<td>
@Html.DisplayFor(modelItem => item.LongTermFuelBank)
</td>
<td>
@Html.DisplayFor(modelItem => item.ThrottlePosition)
</td>
<td>
@Html.DisplayFor(modelItem => item.RelativeThrottlePosition)
</td>
<td>
@Html.DisplayFor(modelItem => item.Runtime)
</td>
<td>
@Html.DisplayFor(modelItem => item.DistanceWithMalfunctionLight)
</td>
<td>
@Html.DisplayFor(modelItem => item.EngineLoad)
</td>
<td>
@Html.DisplayFor(modelItem => item.EngineFuelRate)
</td>
<td>
@Html.DisplayFor(modelItem => item.CreatedAt)
</td>
<td>
@Html.DisplayFor(modelItem => item.UpdatedAt)
</td>
</tr>
}
</tbody>
</table>

View File

@ -0,0 +1,84 @@
@model IEnumerable<Simulator.DataObjects.User>
@{
ViewData["Title"] = "DriverProfiles";
}
<h2>Driver Profile</h2>
<table class="table">
<thead>
<tr>
<th>
@Html.DisplayNameFor(model => model.FirstName)
</th>
<th>
@Html.DisplayNameFor(model => model.LastName)
</th>
<th>
@Html.DisplayNameFor(model => model.ProfilePictureUri)
</th>
<th>
@Html.DisplayNameFor(model => model.Rating)
</th>
<th>
@Html.DisplayNameFor(model => model.Ranking)
</th>
<th>
@Html.DisplayNameFor(model => model.TotalDistance)
</th>
<th>
@Html.DisplayNameFor(model => model.TotalTrips)
</th>
<th>
@Html.DisplayNameFor(model => model.HardStops)
</th>
<th>
@Html.DisplayNameFor(model => model.HardAccelerations)
</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.FirstName)
</td>
<td>
@Html.DisplayFor(modelItem => item.LastName)
</td>
<td>
<img src="@Url.Content(item.ProfilePictureUri)" alt="test" height="100" />
</td>
<td>
@Html.DisplayFor(modelItem => item.Rating)
</td>
<td>
@Html.DisplayFor(modelItem => item.Ranking)
</td>
<td>
@Html.DisplayFor(modelItem => item.TotalDistance)
</td>
<td>
@Html.DisplayFor(modelItem => item.TotalTrips)
</td>
<td>
@Html.DisplayFor(modelItem => item.HardStops)
</td>
<td>
@Html.DisplayFor(modelItem => item.HardAccelerations)
</td>
</tr>
}
</tbody>
</table>

View File

@ -0,0 +1,3 @@
@using TripViewer
@using TripViewer.Models
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

View File

@ -0,0 +1,3 @@
@{
Layout = "_Layout";
}