Changed the view and css file
authork.wieclaw <k.wieclaw@samsung.com>
Thu, 8 Nov 2018 12:03:41 +0000 (13:03 +0100)
committerLukasz Stanislawski <l.stanislaws@samsung.com>
Mon, 4 Mar 2019 06:29:17 +0000 (07:29 +0100)
GearRacingCloud/Controllers/TestController.cs
GearRacingCloud/Properties/launchSettings.json
GearRacingCloud/Views/Home/Index.cshtml
GearRacingCloud/Views/Test/FullCar.cshtml [new file with mode: 0644]
GearRacingCloud/Views/Test/FullLap.cshtml [new file with mode: 0644]
GearRacingCloud/Views/Test/FullLapView.cshtml [deleted file]
GearRacingCloud/wwwroot/css/site.css

index 28a334a..468a414 100644 (file)
@@ -37,16 +37,28 @@ namespace GearRacingCloud.Controllers
         [Route("/test/racing-lap-test.html")]
         public IActionResult RacingLaps()
         {
-            Debug.Print(configuration.GetValue<string>("Defaults:Texts:PostLap"));
             return View();
         }
         [Route("test/racing-test.html")]
         public IActionResult RacingCars()
         {
-            Debug.Print(configuration.GetValue<string>("Defaults:Texts:PostCar"));
             return View();
         }
 
+        [Route("test/full-lap.html")]
+        public IActionResult FullLap()
+        {
+            IEnumerable<Lap> laps = Laps.GetInstance().GetLaps();
+            return View(laps);
+        }
+
+        [Route("test/full-car.html")]
+        public IActionResult FullCar()
+        {
+            IEnumerable<Car> cars = Cars.GetInstance().GetCars();
+            return View(cars);
+        }
+
         [HttpPost]
         public async Task<IActionResult> PostCar()
         {
index 5994b13..2105e32 100644 (file)
@@ -1,9 +1,10 @@
 {
   "iisSettings": {
     "windowsAuthentication": false, 
-    "anonymousAuthentication": true, 
+    "anonymousAuthentication": true,
     "iisExpress": {
-      "applicationUrl": "http://106.120.62.58:63687",
+      //"applicationUrl": "http://106.120.62.58:63687",
+      "applicationUrl": "http://0.0.0.0:63687",
       "sslPort": 0
     }
   },
@@ -18,7 +19,8 @@
     "GearRacingCloud": {
       "commandName": "Project",
       "launchBrowser": true,
-      "applicationUrl": "http://106.120.62.58:63687",
+      //"applicationUrl": "http://106.120.62.58:63687",
+      "applicationUrl": "http://0.0.0.0:63687",
       "environmentVariables": {
         "ASPNETCORE_ENVIRONMENT": "Development"
       }
index e9e0813..fddcc71 100644 (file)
@@ -6,18 +6,31 @@
 
 <h1 class="text-center">Lap Counter</h1>
 
-<table class="table table-bordered table-striped">
-    <tr>
-        <th class="text-center"><h2>Driver</h2></th>
-        <th class="text-center"><h2>Laptime</h2></th>
-        <th class="text-center"><h2>Car Id</h2></th>
-    </tr>
-    @foreach (Lap lap in Model.OrderBy(l => l.laptime))
-    {
-    <tr>
-        <th class="text-center"><p>@lap.driver</p></th>
-        <th class="text-center"><p>@TimeSpan.FromMilliseconds(lap.laptime)</p></th>
-        <th class="text-center"><p>@lap.carId</p></th>
-    </tr>
-    }
-</table>
\ No newline at end of file
+<div>
+    <table class="table-striped table-rounded" width="100%">
+        <thead>
+            <tr>
+                <th class="text-center"><h2>Driver</h2></th>
+                <th class="text-center"><h2>Laptime</h2></th>
+                <th class="text-center"><h2>Car Id</h2></th>
+            </tr>
+        </thead>
+        <tbody>
+            @if(Model.Count() == 0)
+            {
+                <tr>
+                    <th class="text-center" colspan="5"><p>No registered lap!</p></th>
+                </tr>
+            }
+
+            @foreach (Lap lap in Model.OrderBy(l => l.laptime))
+            {
+                <tr>
+                    <th class="text-center"><p>@lap.driver</p></th>
+                    <th class="text-center"><p>@TimeSpan.FromMilliseconds(lap.laptime)</p></th>
+                    <th class="text-center"><p>@lap.carId</p></th>
+                </tr>
+            }
+        </tbody>
+    </table>
+</div>
diff --git a/GearRacingCloud/Views/Test/FullCar.cshtml b/GearRacingCloud/Views/Test/FullCar.cshtml
new file mode 100644 (file)
index 0000000..7147cc2
--- /dev/null
@@ -0,0 +1,40 @@
+@model IEnumerable<Car>
+
+@{
+    ViewData["Title"] = "FullCarView";
+}
+
+<h2>FullCarView</h2>
+
+<div>
+    <table class="table-striped table-rounded" width="100%">
+        <thead>
+            <tr>
+                <th class="text-center"><h2>Id</h2></th>
+                <th class="text-center"><h2>IP adress</h2></th>
+                <th class="text-center"><h2>Name</h2></th>
+                <th class="text-center"><h2>Access point's MAC</h2></th>
+                <th class="text-center"><h2>Access point's SSID</h2></th>
+            </tr>
+        </thead>
+        <tbody>
+            @if (Model.Count() == 0)
+            {
+                <tr>
+                    <th class="text-center" colspan="5"><p>No registered car!</p></th>
+                </tr>
+            }
+
+            @foreach (Car car in Model)
+            {
+                <tr>
+                    <th class="text-center"><p>@car.carId</p></th>
+                    <th class="text-center"><p>@car.carIp</p></th>
+                    <th class="text-center"><p>@car.carName</p></th>
+                    <th class="text-center"><p>@car.apMac</p></th>
+                    <th class="text-center"><p>@car.apSsid</p></th>
+                </tr>
+            }
+        </tbody>
+    </table>
+</div>
\ No newline at end of file
diff --git a/GearRacingCloud/Views/Test/FullLap.cshtml b/GearRacingCloud/Views/Test/FullLap.cshtml
new file mode 100644 (file)
index 0000000..576ae51
--- /dev/null
@@ -0,0 +1,40 @@
+@model  IEnumerable<Lap>
+
+@{
+    ViewData["Title"] = "FullLapView";
+}
+
+<h1 class="text-center">Full Lap View</h1>
+
+<div>
+    <table class="table-striped table-rounded" width="100%">
+        <thead>
+            <tr>
+                <th class="text-center"><h2>Lap Id</h2></th>
+                <th class="text-center"><h2>TimeStamp</h2></th>
+                <th class="text-center"><h2>Laptime</h2></th>
+                <th class="text-center"><h2>Driver</h2></th>
+                <th class="text-center"><h2>Car Id</h2></th>
+            </tr>
+        </thead>
+        <tbody>
+            @if (Model.Count() == 0)
+            {
+                <tr>
+                    <th class="text-center" colspan="5"><p>No registered lap!</p></th>
+                </tr>
+            }
+
+            @foreach (Lap lap in Model)
+            {
+                <tr>
+                    <th class="text-center"><p>@lap.id</p></th>
+                    <th class="text-center"><p>@lap.timeStamp</p></th>
+                    <th class="text-center"><p>@TimeSpan.FromMilliseconds(lap.laptime)</p></th>
+                    <th class="text-center"><p>@lap.driver</p></th>
+                    <th class="text-center"><p>@lap.carId</p></th>
+                </tr>
+            }
+        </tbody>
+    </table>
+</div>
diff --git a/GearRacingCloud/Views/Test/FullLapView.cshtml b/GearRacingCloud/Views/Test/FullLapView.cshtml
deleted file mode 100644 (file)
index 4f6b6c0..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-@{
-    ViewData["Title"] = "FullLapView";
-}
-
-<h1 class="text-center">Lap Counter</h1>
-
-<div class="container">
-    <div class="row">
-        <div class="col-md-4 text-center"><h2>Id</h2></div>
-        <div class="col-md-2 text-center"><h2>Timestamp</h2></div>
-        <div class="col-md-2 text-center"><h2>Laptime</h2></div>
-        <div class="col-md-2 text-center"><h2>Driver</h2></div>
-        <div class="col-md-2 text-center"><h2>Car Id</h2></div>
-    </div>
-    @foreach (Lap lap in Model)
-    {
-        <div class="row">
-            <div class="col-md-4 text-center"><p>@lap.id</p></div>
-            <div class="col-md-2 text-center"><p>@lap.timeStamp</p></div>
-            <div class="col-md-2 text-center"><p>@TimeSpan.FromMilliseconds(lap.laptime)</p></div>
-            <div class="col-md-2 text-center"><p>@lap.driver</p></div>
-            <div class="col-md-2 text-center"><p>@lap.carId</p></div>
-        </div>
-    }
-</div>
-
index 1fbb3cc..6ee8ff7 100644 (file)
@@ -3,6 +3,13 @@ for details on configuring this project to bundle and minify static web assets.
 body {
     padding-top: 50px;
     padding-bottom: 20px;
+    background-image: radial-gradient(rgba(255,255,255,1), #f97777);
+    background-repeat: no-repeat, repeat, repeat;
+    min-height: 100%;
+}
+
+html {
+    min-height: 100%;
 }
 
 /* Wrapping element */
@@ -38,9 +45,45 @@ body {
 
 .table-striped > tbody > tr:nth-child(odd) > td,
 .table-striped > tbody > tr:nth-child(odd) > th {
-    background-color: #f97777;
+    background-color: lightcyan;
+}
+
+.table-striped > tbody > tr:nth-child(even) > td,
+.table-striped > tbody > tr:nth-child(even) > th {
+    background-color: lightblue;
+}
+
+.table-rounded {
+    border-collapse: separate;
+    border: solid black 1px;
+    border-radius: 10px;
+    -moz-border-radius: 10px;
+}
+
+.table-rounded > thead {
+    background-color: white;
+}
+
+.table-rounded > thead > tr > th:first-child {
+    border-radius: 10px 0 0 0;
 }
 
-.table {
-    border-radius: 25px
-}
\ No newline at end of file
+.table-rounded > thead > tr > th:last-child {
+    border-radius: 0 10px 0 0;
+}
+
+.table-rounded > thead > tr > th:only-child {
+    border-radius: 10px 10px 0 0;
+}
+
+.table-rounded > tbody > tr:last-child > th:first-child {
+    border-radius: 0 0 0 10px;
+}
+
+.table-rounded > tbody > tr:last-child > th:last-child {
+    border-radius: 0 0 10px 0;
+}
+
+.table-rounded > tbody > tr:last-child > th:only-child {
+    border-radius: 0 0 10px 10px;
+}