diff --git a/.vs/Server Dashboard/DesignTimeBuild/.dtbcache.v2 b/.vs/Server Dashboard/DesignTimeBuild/.dtbcache.v2 index 272ce64..5836e70 100644 Binary files a/.vs/Server Dashboard/DesignTimeBuild/.dtbcache.v2 and b/.vs/Server Dashboard/DesignTimeBuild/.dtbcache.v2 differ diff --git a/.vs/Server Dashboard/v16/.suo b/.vs/Server Dashboard/v16/.suo index e6b8a61..7707516 100644 Binary files a/.vs/Server Dashboard/v16/.suo and b/.vs/Server Dashboard/v16/.suo differ diff --git a/Server Dashboard/ViewModels/Login/LoginViewModel.cs b/Server Dashboard/ViewModels/Login/LoginViewModel.cs index a2d8b49..1999147 100644 --- a/Server Dashboard/ViewModels/Login/LoginViewModel.cs +++ b/Server Dashboard/ViewModels/Login/LoginViewModel.cs @@ -60,18 +60,15 @@ namespace Server_Dashboard { Username = Settings.Default.Username; RememberUser = Settings.Default.RememberMe; } + AutoLoginAsync(); } public ICommand LoginCommand { get; set; } private async void LoginAsync(object parameter) { if (!String.IsNullOrWhiteSpace(Username) && !String.IsNullOrWhiteSpace((parameter as IHavePassword).SecurePassword.Unsecure())) { - int result = 0; - if (RememberUser && !String.IsNullOrEmpty(Settings.Default.Username) && !String.IsNullOrEmpty(Settings.Default.Cookies) && Settings.Default.Password.Length == 6) { - result = await Task.Run(() => DatabaseHandler.CheckCookie(Settings.Default.Cookies, Username)); - } Loading = "Visible"; - result = await Task.Run(() => DatabaseHandler.CheckLogin(Username, (parameter as IHavePassword).SecurePassword.Unsecure())); + int result = await Task.Run(() => DatabaseHandler.CheckLogin(Username, (parameter as IHavePassword).SecurePassword.Unsecure())); Loading = "Hidden"; switch (result) { case 0: @@ -123,5 +120,19 @@ namespace Server_Dashboard { } ErrorText = ""; } + //TODO: Add autologin function that locks the UI untill the user hits the abort button or the login completes + /*private async void AutoLoginAsync() { + if (Settings.Default.RememberMe && !String.IsNullOrEmpty(Settings.Default.Username) && !String.IsNullOrEmpty(Settings.Default.Cookies)) { + Loading = "Visible"; + int result = await Task.Run(() => DatabaseHandler.CheckCookie(Settings.Default.Cookies, Username)); + Loading = "Hidden"; + if (result == 1) { + DashboardWindow window = new DashboardWindow(); + window.Show(); + Close?.Invoke(); + return; + } + } + }*/ } } diff --git a/Server Dashboard/bin/Debug/netcoreapp3.1/Server Dashboard.dll b/Server Dashboard/bin/Debug/netcoreapp3.1/Server Dashboard.dll index 9988d79..7318603 100644 Binary files a/Server Dashboard/bin/Debug/netcoreapp3.1/Server Dashboard.dll and b/Server Dashboard/bin/Debug/netcoreapp3.1/Server Dashboard.dll differ diff --git a/Server Dashboard/bin/Debug/netcoreapp3.1/Server Dashboard.pdb b/Server Dashboard/bin/Debug/netcoreapp3.1/Server Dashboard.pdb index 7a6506c..8878f10 100644 Binary files a/Server Dashboard/bin/Debug/netcoreapp3.1/Server Dashboard.pdb and b/Server Dashboard/bin/Debug/netcoreapp3.1/Server Dashboard.pdb differ diff --git a/Server Dashboard/obj/Debug/netcoreapp3.1/LoginWindow.g.i.cs b/Server Dashboard/obj/Debug/netcoreapp3.1/LoginWindow.g.i.cs index a87f9b3..6294198 100644 --- a/Server Dashboard/obj/Debug/netcoreapp3.1/LoginWindow.g.i.cs +++ b/Server Dashboard/obj/Debug/netcoreapp3.1/LoginWindow.g.i.cs @@ -1,5 +1,4 @@ -// Updated by XamlIntelliSenseFileGenerator 05.08.2021 22:10:48 -#pragma checksum "..\..\..\LoginWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "BC333A5F7B9E8D68E824FFFBFE4539E4AA85365F" +#pragma checksum "..\..\..\LoginWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "BC333A5F7B9E8D68E824FFFBFE4539E4AA85365F" //------------------------------------------------------------------------------ // // This code was generated by a tool. @@ -41,42 +40,47 @@ using System.Windows.Shell; namespace Server_Dashboard { - - + + /// /// LoginWindow /// public partial class LoginWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector { - -#line default -#line hidden - - -#line 130 "..\..\..\LoginWindow.xaml" + + + #line 9 "..\..\..\LoginWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal Server_Dashboard.LoginWindow Login; + + #line default + #line hidden + + + #line 130 "..\..\..\LoginWindow.xaml" [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] internal System.Windows.Controls.TextBox UserName; - -#line default -#line hidden - - -#line 174 "..\..\..\LoginWindow.xaml" + + #line default + #line hidden + + + #line 174 "..\..\..\LoginWindow.xaml" [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] internal System.Windows.Controls.PasswordBox Password; - -#line default -#line hidden - - -#line 185 "..\..\..\LoginWindow.xaml" + + #line default + #line hidden + + + #line 185 "..\..\..\LoginWindow.xaml" [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] internal System.Windows.Controls.TextBlock PasswordHint; - -#line default -#line hidden - + + #line default + #line hidden + private bool _contentLoaded; - + /// /// InitializeComponent /// @@ -88,21 +92,21 @@ namespace Server_Dashboard { } _contentLoaded = true; System.Uri resourceLocater = new System.Uri("/Server Dashboard;component/loginwindow.xaml", System.UriKind.Relative); - -#line 1 "..\..\..\LoginWindow.xaml" + + #line 1 "..\..\..\LoginWindow.xaml" System.Windows.Application.LoadComponent(this, resourceLocater); - -#line default -#line hidden + + #line default + #line hidden } - + [System.Diagnostics.DebuggerNonUserCodeAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "5.0.4.0")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal System.Delegate _CreateDelegate(System.Type delegateType, string handler) { return System.Delegate.CreateDelegate(delegateType, this, handler); } - + [System.Diagnostics.DebuggerNonUserCodeAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "5.0.4.0")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -110,24 +114,23 @@ namespace Server_Dashboard { [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { - switch (connectionId) { - case 1: - this.Login = ((Server_Dashboard.LoginWindow)(target)); - return; - case 2: - this.UserName = ((System.Windows.Controls.TextBox)(target)); - return; - case 3: - this.Password = ((System.Windows.Controls.PasswordBox)(target)); - return; - case 4: - this.PasswordHint = ((System.Windows.Controls.TextBlock)(target)); - return; + switch (connectionId) + { + case 1: + this.Login = ((Server_Dashboard.LoginWindow)(target)); + return; + case 2: + this.UserName = ((System.Windows.Controls.TextBox)(target)); + return; + case 3: + this.Password = ((System.Windows.Controls.PasswordBox)(target)); + return; + case 4: + this.PasswordHint = ((System.Windows.Controls.TextBlock)(target)); + return; } this._contentLoaded = true; } - - internal System.Windows.Window Login; } } diff --git a/Server Dashboard/obj/Debug/netcoreapp3.1/Server Dashboard.csprojAssemblyReference.cache b/Server Dashboard/obj/Debug/netcoreapp3.1/Server Dashboard.csprojAssemblyReference.cache index e607ae1..26ea6b7 100644 Binary files a/Server Dashboard/obj/Debug/netcoreapp3.1/Server Dashboard.csprojAssemblyReference.cache and b/Server Dashboard/obj/Debug/netcoreapp3.1/Server Dashboard.csprojAssemblyReference.cache differ diff --git a/Server Dashboard/obj/Debug/netcoreapp3.1/Server Dashboard.dll b/Server Dashboard/obj/Debug/netcoreapp3.1/Server Dashboard.dll index 9988d79..7318603 100644 Binary files a/Server Dashboard/obj/Debug/netcoreapp3.1/Server Dashboard.dll and b/Server Dashboard/obj/Debug/netcoreapp3.1/Server Dashboard.dll differ diff --git a/Server Dashboard/obj/Debug/netcoreapp3.1/Server Dashboard.pdb b/Server Dashboard/obj/Debug/netcoreapp3.1/Server Dashboard.pdb index 7a6506c..8878f10 100644 Binary files a/Server Dashboard/obj/Debug/netcoreapp3.1/Server Dashboard.pdb and b/Server Dashboard/obj/Debug/netcoreapp3.1/Server Dashboard.pdb differ diff --git a/Server Dashboard/obj/Debug/netcoreapp3.1/Server Dashboard_MarkupCompile.i.cache b/Server Dashboard/obj/Debug/netcoreapp3.1/Server Dashboard_MarkupCompile.i.cache index cf7027a..465d905 100644 --- a/Server Dashboard/obj/Debug/netcoreapp3.1/Server Dashboard_MarkupCompile.i.cache +++ b/Server Dashboard/obj/Debug/netcoreapp3.1/Server Dashboard_MarkupCompile.i.cache @@ -16,5 +16,5 @@ C:\Users\Crylia\Documents\Git\Server Dashboard\Server Dashboard\App.xaml 2061472260849 Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml;Controls\DoubleRoundProgressBar\DoubleRoundProgressBar.xaml;Controls\HalfRoundProgressBar\HalfRoundProgressBar.xaml;Controls\LoadingIndicator\LoadingIndicator.xaml;Controls\ServerModules\ServerModule.xaml;LoginWindow.xaml;Views\DashboardPages\MainDashboardPage.xaml;Views\DashboardWindow.xaml; -False +True diff --git a/Server Dashboard/obj/Debug/netcoreapp3.1/Server Dashboard_MarkupCompile.i.lref b/Server Dashboard/obj/Debug/netcoreapp3.1/Server Dashboard_MarkupCompile.i.lref new file mode 100644 index 0000000..835b885 --- /dev/null +++ b/Server Dashboard/obj/Debug/netcoreapp3.1/Server Dashboard_MarkupCompile.i.lref @@ -0,0 +1,11 @@ +C:\Users\Crylia\Documents\Git\Server Dashboard\Server Dashboard\obj\Debug\netcoreapp3.1\GeneratedInternalTypeHelper.g.i.cs +FC:\Users\Crylia\Documents\Git\Server Dashboard\Server Dashboard\App.xaml;; +FC:\Users\Crylia\Documents\Git\Server Dashboard\Server Dashboard\Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml;; +FC:\Users\Crylia\Documents\Git\Server Dashboard\Server Dashboard\Controls\DoubleRoundProgressBar\DoubleRoundProgressBar.xaml;; +FC:\Users\Crylia\Documents\Git\Server Dashboard\Server Dashboard\Controls\HalfRoundProgressBar\HalfRoundProgressBar.xaml;; +FC:\Users\Crylia\Documents\Git\Server Dashboard\Server Dashboard\Controls\LoadingIndicator\LoadingIndicator.xaml;; +FC:\Users\Crylia\Documents\Git\Server Dashboard\Server Dashboard\Controls\ServerModules\ServerModule.xaml;; +FC:\Users\Crylia\Documents\Git\Server Dashboard\Server Dashboard\LoginWindow.xaml;; +FC:\Users\Crylia\Documents\Git\Server Dashboard\Server Dashboard\Views\DashboardPages\MainDashboardPage.xaml;; +FC:\Users\Crylia\Documents\Git\Server Dashboard\Server Dashboard\Views\DashboardWindow.xaml;; +