diff --git a/LANCommander/Areas/Identity/Pages/Account/FirstTimeSetup.cshtml b/LANCommander/Areas/Identity/Pages/Account/FirstTimeSetup.cshtml index 3ab2cf0..98e1382 100644 --- a/LANCommander/Areas/Identity/Pages/Account/FirstTimeSetup.cshtml +++ b/LANCommander/Areas/Identity/Pages/Account/FirstTimeSetup.cshtml @@ -1,4 +1,6 @@ @page +@using LANCommander.Models; +@using LANCommander.Services; @model FirstTimeSetupModel @{ Layout = "/Views/Shared/_LayoutBasic.cshtml"; @@ -11,7 +13,16 @@
- + @switch (SettingService.GetSettings().Theme) + { + case LANCommanderTheme.Light: + + break; + + case LANCommanderTheme.Dark: + + break; + }
diff --git a/LANCommander/Areas/Identity/Pages/Account/Login.cshtml b/LANCommander/Areas/Identity/Pages/Account/Login.cshtml index 8b0c13e..70892f8 100644 --- a/LANCommander/Areas/Identity/Pages/Account/Login.cshtml +++ b/LANCommander/Areas/Identity/Pages/Account/Login.cshtml @@ -1,4 +1,6 @@ @page +@using LANCommander.Models; +@using LANCommander.Services; @model LoginModel @{ Layout = "/Views/Shared/_LayoutBasic.cshtml"; } @@ -10,7 +12,16 @@
- + @switch (SettingService.GetSettings().Theme) + { + case LANCommanderTheme.Light: + + break; + + case LANCommanderTheme.Dark: + + break; + }
@foreach (var error in ModelState.SelectMany(x => x.Value.Errors)) diff --git a/LANCommander/Areas/Identity/Pages/Account/Register.cshtml b/LANCommander/Areas/Identity/Pages/Account/Register.cshtml index 22e087e..ac4c4cd 100644 --- a/LANCommander/Areas/Identity/Pages/Account/Register.cshtml +++ b/LANCommander/Areas/Identity/Pages/Account/Register.cshtml @@ -1,4 +1,6 @@ @page +@using LANCommander.Models; +@using LANCommander.Services; @model RegisterModel @{ Layout = "/Views/Shared/_LayoutBasic.cshtml"; } @{ @@ -9,7 +11,16 @@
- + @switch (SettingService.GetSettings().Theme) + { + case LANCommanderTheme.Light: + + break; + + case LANCommanderTheme.Dark: + + break; + }
diff --git a/LANCommander/Models/Settings.cs b/LANCommander/Models/Settings.cs index bede715..95ead7b 100644 --- a/LANCommander/Models/Settings.cs +++ b/LANCommander/Models/Settings.cs @@ -1,5 +1,11 @@ namespace LANCommander.Models { + public enum LANCommanderTheme + { + Light, + Dark + } + public class LANCommanderSettings { public int Port { get; set; } = 1337; @@ -7,6 +13,7 @@ public string DatabaseConnectionString { get; set; } = ""; public string IGDBClientId { get; set; } = ""; public string IGDBClientSecret { get; set; } = ""; + public LANCommanderTheme Theme { get; set; } public LANCommanderAuthenticationSettings Authentication { get; set; } = new LANCommanderAuthenticationSettings(); } diff --git a/LANCommander/Pages/Games/Edit.razor b/LANCommander/Pages/Games/Edit.razor index f9914ae..a12414c 100644 --- a/LANCommander/Pages/Games/Edit.razor +++ b/LANCommander/Pages/Games/Edit.razor @@ -15,8 +15,8 @@ @inject NavigationManager NavigationManager @inject ModalService ModalService - - + + General @@ -53,7 +53,7 @@ -
+
@@ -132,28 +132,10 @@ - - @if (!String.IsNullOrWhiteSpace(Panel)) { @@ -161,7 +143,7 @@ else { diff --git a/LANCommander/Pages/Servers/Edit.razor b/LANCommander/Pages/Servers/Edit.razor index e24d905..e8bbb8e 100644 --- a/LANCommander/Pages/Servers/Edit.razor +++ b/LANCommander/Pages/Servers/Edit.razor @@ -9,8 +9,8 @@ @inject IMessageService MessageService @inject NavigationManager NavigationManager - - + + General @@ -48,7 +48,7 @@ -
+
@if (Panel == "General" || String.IsNullOrWhiteSpace(Panel)) { @@ -140,20 +140,6 @@ - - @code { [Parameter] public Guid Id { get; set; } [Parameter] public string Panel { get; set; } diff --git a/LANCommander/Pages/Settings/General.razor b/LANCommander/Pages/Settings/General.razor index b61d8a8..480e5fb 100644 --- a/LANCommander/Pages/Settings/General.razor +++ b/LANCommander/Pages/Settings/General.razor @@ -1,6 +1,7 @@ @page "/Settings" @page "/Settings/General" @using LANCommander.Models; +@using LANCommander.Extensions; @layout SettingsLayout @inject SettingService SettingService @inject IGDBService IGDBService @@ -17,6 +18,13 @@ Enabling the beacon will allow clients on the same network to auto-discover the LANCommander address. + + + + In order to use IGDB metadata, you need a Twitch developer account. Click here for more details. diff --git a/LANCommander/Pages/Settings/SettingsLayout.razor b/LANCommander/Pages/Settings/SettingsLayout.razor index b0883d8..728eaf5 100644 --- a/LANCommander/Pages/Settings/SettingsLayout.razor +++ b/LANCommander/Pages/Settings/SettingsLayout.razor @@ -2,8 +2,8 @@ @layout MainLayout @attribute [Authorize(Roles = "Administrator")] - - + + General Users @@ -15,10 +15,4 @@ @Body - - - \ No newline at end of file + \ No newline at end of file diff --git a/LANCommander/Pages/_Layout.cshtml b/LANCommander/Pages/_Layout.cshtml index 5c4d75b..ae714f1 100644 --- a/LANCommander/Pages/_Layout.cshtml +++ b/LANCommander/Pages/_Layout.cshtml @@ -1,7 +1,9 @@ -@using Microsoft.AspNetCore.Components.Web +@using LANCommander.Services; +@using Microsoft.AspNetCore.Components.Web @using LANCommander.Components @namespace LANCommander.Pages @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers +@inject SettingService SettingService @@ -9,11 +11,23 @@ - + + @switch (SettingService.GetSettings().Theme) + { + case Models.LANCommanderTheme.Light: + + break; + + case Models.LANCommanderTheme.Dark: + + break; + } + + - +
diff --git a/LANCommander/Views/Shared/_LayoutBasic.cshtml b/LANCommander/Views/Shared/_LayoutBasic.cshtml index 858281d..2fd2c79 100644 --- a/LANCommander/Views/Shared/_LayoutBasic.cshtml +++ b/LANCommander/Views/Shared/_LayoutBasic.cshtml @@ -1,11 +1,25 @@ - +@using LANCommander.Services; +@using LANCommander.Models; + + @ViewData["Title"] - LANCommander - + + @switch (SettingService.GetSettings().Theme) + { + case LANCommanderTheme.Light: + + break; + + case LANCommanderTheme.Dark: + + break; + } + diff --git a/LANCommander/wwwroot/css/site.css b/LANCommander/wwwroot/css/site.css index 93864aa..184ae0e 100644 --- a/LANCommander/wwwroot/css/site.css +++ b/LANCommander/wwwroot/css/site.css @@ -1,3 +1,23 @@ +.panel-layout { + background: #fff; +} + +.panel-layout-content { + padding: 0 24px; +} + +.panel-layout .ant-layout-content > .ant-page-header-heading { + padding-top: 0; +} + +.panel-layout [data-panel] { + display: none; +} + +[data-theme="Dark"] .panel-layout { + background: #141414; +} + .ant-select-selector { line-height: 30px; }