From 936e35c81d8421fb6a18bb2d94c46b008cdf3ac2 Mon Sep 17 00:00:00 2001 From: Marcel Baumgartner Date: Thu, 6 Apr 2023 19:02:29 +0200 Subject: [PATCH 1/4] Update de_de.lang --- Moonlight/resources/lang/de_de.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/Moonlight/resources/lang/de_de.lang b/Moonlight/resources/lang/de_de.lang index 1d9fd9c9..c0ba8c4f 100644 --- a/Moonlight/resources/lang/de_de.lang +++ b/Moonlight/resources/lang/de_de.lang @@ -512,3 +512,4 @@ The name should only contain of lower case characters and numbers;The name shoul Error from plesk;Error from plesk Host;Host Username;Username +SRV records cannot be updated thanks to the cloudflare api client. Please delete the record and create a new one;SRV records cannot be updated thanks to the cloudflare api client. Please delete the record and create a new one From 9332029c4a0dd9533e9698f1d20c5b30c974b460 Mon Sep 17 00:00:00 2001 From: Marcel Baumgartner Date: Thu, 6 Apr 2023 19:20:28 +0200 Subject: [PATCH 2/4] Removed legacy database ui --- .../Components/Partials/SidebarMenu.razor | 8 -- Moonlight/Shared/Views/Admin/Index.razor | 34 +++------ Moonlight/Shared/Views/Index.razor | 76 +++++-------------- 3 files changed, 30 insertions(+), 88 deletions(-) diff --git a/Moonlight/Shared/Components/Partials/SidebarMenu.razor b/Moonlight/Shared/Components/Partials/SidebarMenu.razor index 2d82030e..c7e6c692 100644 --- a/Moonlight/Shared/Components/Partials/SidebarMenu.razor +++ b/Moonlight/Shared/Components/Partials/SidebarMenu.razor @@ -52,14 +52,6 @@ else Websites -
@@ -50,27 +53,6 @@
-
-
-
-
-
-
- Databases -
- - @(DatabaseCount) - -
-
- - - -
-
-
-
-
@@ -80,7 +62,7 @@ Domains - 0 + @(DomainCount)
-
-
-
-
-
-
- Databases -
- - @(DatabaseCount) - -
-
- - - -
-
-
-
-
-
-
- -
-
- - Create a database - - - A quick way to store your data and manage it from all around the world - -
-
-
@@ -188,20 +157,6 @@
-
-
- -
-
- - Manage your databases - - - Insert, delete and update the data in your databases - -
-
-
@@ -239,16 +194,27 @@ [CascadingParameter] public User User { get; set; } - private int DatabaseCount = 0; private int ServerCount = 0; + private int DomainCount = 0; + private int WebsiteCount = 0; - private async Task Load(LazyLoader lazyLoader) + private Task Load(LazyLoader lazyLoader) { - DatabaseCount = 0; - ServerCount = ServerRepository .Get() .Include(x => x.Owner) .Count(x => x.Owner.Id == User.Id); + + DomainCount = DomainRepository + .Get() + .Include(x => x.Owner) + .Count(x => x.Owner.Id == User.Id); + + WebsiteCount = WebsiteRepository + .Get() + .Include(x => x.Owner) + .Count(x => x.Owner.Id == User.Id); + + return Task.CompletedTask; } } \ No newline at end of file From c18d683fb8b99bb0bfd76cae38f210dbd4dcbbe2 Mon Sep 17 00:00:00 2001 From: Marcel Baumgartner Date: Thu, 6 Apr 2023 19:33:34 +0200 Subject: [PATCH 3/4] Replaced legacy dependency resolve with server service function for wingsfileaccess --- .../Settings/JavascriptFileSetting.razor | 12 +++--------- .../ServerControl/Settings/PythonFileSetting.razor | 11 +++-------- .../ServerControl/Settings/ServerResetSetting.razor | 12 ++---------- 3 files changed, 8 insertions(+), 27 deletions(-) diff --git a/Moonlight/Shared/Components/ServerControl/Settings/JavascriptFileSetting.razor b/Moonlight/Shared/Components/ServerControl/Settings/JavascriptFileSetting.razor index 1d97402b..2787979c 100644 --- a/Moonlight/Shared/Components/ServerControl/Settings/JavascriptFileSetting.razor +++ b/Moonlight/Shared/Components/ServerControl/Settings/JavascriptFileSetting.razor @@ -2,13 +2,12 @@ @using Moonlight.App.Repositories.Servers @using Moonlight.Shared.Components.FileManagerPartials @using Moonlight.App.Database.Entities -@using Moonlight.App.Helpers @using Moonlight.App.Helpers.Files @using Moonlight.App.Services @inject ServerRepository ServerRepository -@inject WingsApiHelper WingsApiHelper @inject SmartTranslateService SmartTranslateService +@inject ServerService ServerService
@@ -42,14 +41,9 @@ private FileSelectModal FileSelectModal; private LazyLoader LazyLoader; - protected override void OnInitialized() + protected override async Task OnInitializedAsync() { - Access = new WingsFileAccess(WingsApiHelper, - null!, - CurrentServer, - null!, - null! - ); + Access = await ServerService.CreateFileAccess(CurrentServer, null!); } private async Task Load(LazyLoader lazyLoader) diff --git a/Moonlight/Shared/Components/ServerControl/Settings/PythonFileSetting.razor b/Moonlight/Shared/Components/ServerControl/Settings/PythonFileSetting.razor index 80e8ea9b..7cc041ff 100644 --- a/Moonlight/Shared/Components/ServerControl/Settings/PythonFileSetting.razor +++ b/Moonlight/Shared/Components/ServerControl/Settings/PythonFileSetting.razor @@ -7,7 +7,7 @@ @using Moonlight.App.Services @inject ServerRepository ServerRepository -@inject WingsApiHelper WingsApiHelper +@inject ServerService ServerService @inject SmartTranslateService SmartTranslateService
@@ -42,14 +42,9 @@ private FileSelectModal FileSelectModal; private LazyLoader LazyLoader; - protected override void OnInitialized() + protected override async Task OnInitializedAsync() { - Access = new WingsFileAccess(WingsApiHelper, - null!, - CurrentServer, - null!, - null! - ); + Access = await ServerService.CreateFileAccess(CurrentServer, null!); } private async Task Load(LazyLoader lazyLoader) diff --git a/Moonlight/Shared/Components/ServerControl/Settings/ServerResetSetting.razor b/Moonlight/Shared/Components/ServerControl/Settings/ServerResetSetting.razor index 0af95510..61795469 100644 --- a/Moonlight/Shared/Components/ServerControl/Settings/ServerResetSetting.razor +++ b/Moonlight/Shared/Components/ServerControl/Settings/ServerResetSetting.razor @@ -7,8 +7,6 @@ @inject SmartTranslateService SmartTranslateService @inject AlertService AlertService @inject ToastService ToastService -@inject WingsApiHelper WingsApiHelper -@inject ConfigService ConfigService @inject ServerService ServerService Date: Thu, 6 Apr 2023 22:04:52 +0200 Subject: [PATCH 4/4] masu is too stupid to use ulong --- Moonlight/App/Database/Entities/User.cs | 2 +- Moonlight/App/Services/OAuth2/DiscordOAuth2Service.cs | 2 +- Moonlight/App/Services/UserService.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Moonlight/App/Database/Entities/User.cs b/Moonlight/App/Database/Entities/User.cs index a0654a33..790d4e20 100644 --- a/Moonlight/App/Database/Entities/User.cs +++ b/Moonlight/App/Database/Entities/User.cs @@ -37,7 +37,7 @@ public class User public DateTime TokenValidTime { get; set; } = DateTime.Now; // Discord - public long DiscordId { get; set; } = -1; + public ulong DiscordId { get; set; } // Date stuff public DateTime CreatedAt { get; set; } = DateTime.UtcNow; diff --git a/Moonlight/App/Services/OAuth2/DiscordOAuth2Service.cs b/Moonlight/App/Services/OAuth2/DiscordOAuth2Service.cs index 3612de41..4971b933 100644 --- a/Moonlight/App/Services/OAuth2/DiscordOAuth2Service.cs +++ b/Moonlight/App/Services/OAuth2/DiscordOAuth2Service.cs @@ -115,7 +115,7 @@ public class DiscordOAuth2Service Email = getData.GetValue("email"), FirstName = "User", LastName = "User", - DiscordId = getData.GetValue("id"), + DiscordId = getData.GetValue("id"), Status = UserStatus.DataPending }; } diff --git a/Moonlight/App/Services/UserService.cs b/Moonlight/App/Services/UserService.cs index 60ec0a9d..9cf6aa77 100644 --- a/Moonlight/App/Services/UserService.cs +++ b/Moonlight/App/Services/UserService.cs @@ -69,7 +69,7 @@ public class UserService State = "", Status = UserStatus.Unverified, CreatedAt = DateTime.UtcNow, - DiscordId = -1, + DiscordId = 0, TotpEnabled = false, TotpSecret = "", UpdatedAt = DateTime.UtcNow,