From 48c68adcc6ebea83c30676dde4000f5b4fd78471 Mon Sep 17 00:00:00 2001 From: LD-Reborn Date: Mon, 6 Oct 2025 19:42:44 +0200 Subject: [PATCH 1/2] Added Inventory, Assets, Locations, Users pages --- src/Controllers/HomeController.cs | 26 +++- src/Views/Home/Assets.cshtml | 205 ++++++++++++++++++++++++++++++ src/Views/Home/Index.cshtml | 197 +--------------------------- src/Views/Home/Inventory.cshtml | 22 ++++ src/Views/Home/Locations.cshtml | 163 ++++++++++++++++++++++++ src/Views/Home/Users.cshtml | 163 ++++++++++++++++++++++++ src/Views/Shared/_Layout.cshtml | 15 +++ 7 files changed, 594 insertions(+), 197 deletions(-) create mode 100644 src/Views/Home/Assets.cshtml create mode 100644 src/Views/Home/Inventory.cshtml create mode 100644 src/Views/Home/Locations.cshtml create mode 100644 src/Views/Home/Users.cshtml diff --git a/src/Controllers/HomeController.cs b/src/Controllers/HomeController.cs index 52e9ec2..3f42871 100644 --- a/src/Controllers/HomeController.cs +++ b/src/Controllers/HomeController.cs @@ -22,7 +22,13 @@ public class HomeController : Controller [Authorize] [HttpGet("Index")] [HttpGet("/")] - public async Task Index() + public ActionResult Index() + { + return View(); + } + + [HttpGet("Assets")] + public async Task Assets() { IEnumerable users = await _ldap.ListUsersAsync(); IEnumerable assets = await _ldap.ListDeviceAsync(); @@ -41,6 +47,24 @@ public class HomeController : Controller return View(new HomeIndexViewModel() { AssetsTableViewModels = assetsTableViewModels }); } + [HttpGet("Inventory")] + public ActionResult Inventory() + { + return View(); + } + + [HttpGet("Locations")] + public ActionResult Locations() + { + return View(); + } + + [HttpGet("Users")] + public ActionResult Users() + { + return View(); + } + [HttpPost("Login")] public async Task Login(string username, string password) { diff --git a/src/Views/Home/Assets.cshtml b/src/Views/Home/Assets.cshtml new file mode 100644 index 0000000..9e3e0e7 --- /dev/null +++ b/src/Views/Home/Assets.cshtml @@ -0,0 +1,205 @@ +@using Microsoft.AspNetCore.Mvc.Localization +@using Berufsschule_HAM.Models +@model HomeIndexViewModel +@inject IViewLocalizer T +@{ + ViewData["Title"] = T["Assets"]; +} + + +
+

@T["Assets"]

+ + +
+ +
+ + +
+ + + + + + + + + + + + @{ + foreach (AssetsTableViewModel assetsTableViewModel in Model.AssetsTableViewModels) + { + + + + + + + + } + } + +
UserAsset IDAsset NameLocationAction
@assetsTableViewModel.UserUID@assetsTableViewModel.AssetCn@assetsTableViewModel.AssetName@assetsTableViewModel.LocationName +
+ + +
+
+
+
+ + + + + + +@* *@ + + diff --git a/src/Views/Home/Index.cshtml b/src/Views/Home/Index.cshtml index 710229d..fd02ad8 100644 --- a/src/Views/Home/Index.cshtml +++ b/src/Views/Home/Index.cshtml @@ -9,203 +9,8 @@

@T["Overview"]

- -
+ - - - - - - -
- - -
- - - - - - - - - - - - @{ - foreach (AssetsTableViewModel assetsTableViewModel in Model.AssetsTableViewModels) - { - - - - - - - - } - } - -
UserAsset IDAsset NameLocationAction
@assetsTableViewModel.UserUID@assetsTableViewModel.AssetCn@assetsTableViewModel.AssetName@assetsTableViewModel.LocationName -
- - -
-
- - - - - - -@* *@ - - diff --git a/src/Views/Home/Inventory.cshtml b/src/Views/Home/Inventory.cshtml new file mode 100644 index 0000000..8b97126 --- /dev/null +++ b/src/Views/Home/Inventory.cshtml @@ -0,0 +1,22 @@ +@using Microsoft.AspNetCore.Mvc.Localization +@using Berufsschule_HAM.Models +@model HomeIndexViewModel +@inject IViewLocalizer T +@{ + ViewData["Title"] = T["Inventory"]; +} + + +
+

@T["Inventory"]

+ + +
+ + + +
+ + + +
diff --git a/src/Views/Home/Locations.cshtml b/src/Views/Home/Locations.cshtml new file mode 100644 index 0000000..f836acc --- /dev/null +++ b/src/Views/Home/Locations.cshtml @@ -0,0 +1,163 @@ +@using Microsoft.AspNetCore.Mvc.Localization +@using Berufsschule_HAM.Models +@model HomeIndexViewModel +@inject IViewLocalizer T +@{ + ViewData["Title"] = T["Locations"]; +} + + +
+

@T["Locations"]

+ + +
+ +
+ + +
+ + + + + + + + + + + + @* @{ + foreach (AssetsTableViewModel assetsTableViewModel in Model.AssetsTableViewModels) + { + + + + + + + + } + } *@ + +
UserAsset IDAsset NameLocationAction
@assetsTableViewModel.UserUID@assetsTableViewModel.AssetCn@assetsTableViewModel.AssetName@assetsTableViewModel.LocationName +
+ + +
+
+
+
+ + + + + +@* *@ diff --git a/src/Views/Home/Users.cshtml b/src/Views/Home/Users.cshtml new file mode 100644 index 0000000..257b9aa --- /dev/null +++ b/src/Views/Home/Users.cshtml @@ -0,0 +1,163 @@ +@using Microsoft.AspNetCore.Mvc.Localization +@using Berufsschule_HAM.Models +@model HomeIndexViewModel +@inject IViewLocalizer T +@{ + ViewData["Title"] = T["Users"]; +} + + +
+

@T["Users"]

+ + +
+ +
+ + +
+ + + + + + + + + + + + @* @{ + foreach (AssetsTableViewModel assetsTableViewModel in Model.AssetsTableViewModels) + { + + + + + + + + } + } *@ + +
UserAsset IDAsset NameLocationAction
@assetsTableViewModel.UserUID@assetsTableViewModel.AssetCn@assetsTableViewModel.AssetName@assetsTableViewModel.LocationName +
+ + +
+
+
+
+ + + + + +@* *@ diff --git a/src/Views/Shared/_Layout.cshtml b/src/Views/Shared/_Layout.cshtml index 6a52d0d..3d07f61 100644 --- a/src/Views/Shared/_Layout.cshtml +++ b/src/Views/Shared/_Layout.cshtml @@ -26,6 +26,21 @@ + @if (User.Identity.IsAuthenticated) + { + + + + + }