Upgraded mooncore packages. Added css variables for theming. Made all db calls use async/await

This commit is contained in:
2025-01-04 10:37:40 +01:00
parent bf89ef16f7
commit d477e803ab
8 changed files with 224 additions and 101 deletions

View File

@@ -47,7 +47,7 @@ public class ApiKeysController : Controller
Secret = secret Secret = secret
}; };
var finalApiKey = ApiKeyRepository.Add(apiKey); var finalApiKey = await ApiKeyRepository.Add(apiKey);
return Mapper.Map<CreateApiKeyResponse>(finalApiKey); return Mapper.Map<CreateApiKeyResponse>(finalApiKey);
} }

View File

@@ -41,7 +41,7 @@ public class LocalOAuth2Provider : ILocalProviderImplementation<User>
return Task.FromResult(user); return Task.FromResult(user);
} }
public Task<User> Register(string username, string email, string password) public async Task<User> Register(string username, string email, string password)
{ {
if (UserRepository.Get().Any(x => x.Username == username)) if (UserRepository.Get().Any(x => x.Username == username))
throw new HttpApiException("A user with that username already exists", 400); throw new HttpApiException("A user with that username already exists", 400);
@@ -56,8 +56,8 @@ public class LocalOAuth2Provider : ILocalProviderImplementation<User>
Password = HashHelper.Hash(password) Password = HashHelper.Hash(password)
}; };
var finalUser = UserRepository.Add(user); var finalUser = await UserRepository.Add(user);
return Task.FromResult(finalUser); return finalUser;
} }
} }

View File

@@ -25,7 +25,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="MoonCore" Version="1.8.1" /> <PackageReference Include="MoonCore" Version="1.8.1" />
<PackageReference Include="MoonCore.Extended" Version="1.2.4" /> <PackageReference Include="MoonCore.Extended" Version="1.2.5" />
<PackageReference Include="MoonCore.PluginFramework" Version="1.0.5" /> <PackageReference Include="MoonCore.PluginFramework" Version="1.0.5" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.2" /> <PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.2" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0"/> <PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0"/>

View File

@@ -27,7 +27,7 @@
<PackageReference Include="MoonCore" Version="1.8.1" /> <PackageReference Include="MoonCore" Version="1.8.1" />
<PackageReference Include="MoonCore.Blazor" Version="1.2.8" /> <PackageReference Include="MoonCore.Blazor" Version="1.2.8" />
<PackageReference Include="MoonCore.PluginFramework" Version="1.0.5"/> <PackageReference Include="MoonCore.PluginFramework" Version="1.0.5"/>
<PackageReference Include="MoonCore.Blazor.Tailwind" Version="1.2.2" /> <PackageReference Include="MoonCore.Blazor.Tailwind" Version="1.2.3" />
</ItemGroup> </ItemGroup>
<!-- <!--

View File

@@ -0,0 +1,122 @@
@layer base {
:root {
/* Color Variables */
/* Primary */
--color-primary-50: 238 242 255;
--color-primary-100: 224 231 255;
--color-primary-200: 199 210 254;
--color-primary-300: 165 180 252;
--color-primary-400: 129 140 248;
--color-primary-500: 99 102 241;
--color-primary-600: 79 70 229;
--color-primary-700: 67 56 202;
--color-primary-800: 55 48 163;
--color-primary-900: 49 46 129;
--color-primary-950: 30 27 75;
/* Secondary */
--color-secondary-100: 249 249 249;
--color-secondary-200: 241 241 242;
--color-secondary-300: 219 223 233;
--color-secondary-400: 181 181 195;
--color-secondary-500: 153 161 183;
--color-secondary-600: 112 121 147;
--color-secondary-700: 68 78 107;
--color-secondary-800: 28 36 56;
--color-secondary-900: 17 23 33;
--color-secondary-950: 14 18 28;
/* Tertiary */
--color-tertiary-50: 245 243 255;
--color-tertiary-100: 237 233 254;
--color-tertiary-200: 221 214 254;
--color-tertiary-300: 196 181 253;
--color-tertiary-400: 167 139 250;
--color-tertiary-500: 139 92 246;
--color-tertiary-600: 124 58 237;
--color-tertiary-700: 109 40 217;
--color-tertiary-800: 91 33 182;
--color-tertiary-900: 76 29 149;
--color-tertiary-950: 46 16 101;
/* Warning */
--color-warning-50: 254 252 232;
--color-warning-100: 254 249 195;
--color-warning-200: 254 240 138;
--color-warning-300: 253 224 71;
--color-warning-400: 250 204 21;
--color-warning-500: 234 179 8;
--color-warning-600: 202 138 4;
--color-warning-700: 161 98 7;
--color-warning-800: 133 77 14;
--color-warning-900: 113 63 18;
--color-warning-950: 66 32 6;
/* Danger */
--color-danger-50: 254 242 242;
--color-danger-100: 254 226 226;
--color-danger-200: 254 202 202;
--color-danger-300: 252 165 165;
--color-danger-400: 248 113 113;
--color-danger-500: 239 68 68;
--color-danger-600: 220 38 38;
--color-danger-700: 185 28 28;
--color-danger-800: 153 27 27;
--color-danger-900: 127 29 29;
--color-danger-950: 69 10 10;
/* Success */
--color-success-50: 240 253 244;
--color-success-100: 220 252 231;
--color-success-200: 187 247 208;
--color-success-300: 134 239 172;
--color-success-400: 74 222 128;
--color-success-500: 34 197 94;
--color-success-600: 22 163 74;
--color-success-700: 21 128 61;
--color-success-800: 22 101 52;
--color-success-900: 20 83 45;
--color-success-950: 5 46 22;
/* Info */
--color-info-50: 239 246 255;
--color-info-100: 219 234 254;
--color-info-200: 191 219 254;
--color-info-300: 147 197 253;
--color-info-400: 96 165 250;
--color-info-500: 59 130 246;
--color-info-600: 37 99 235;
--color-info-700: 29 78 216;
--color-info-800: 30 64 175;
--color-info-900: 30 58 138;
--color-info-950: 23 37 84;
/* Gray */
--color-gray-100: 249 249 249;
--color-gray-200: 241 241 242;
--color-gray-300: 219 223 233;
--color-gray-400: 181 181 195;
--color-gray-500: 153 161 183;
--color-gray-600: 112 121 147;
--color-gray-700: 68 78 107;
--color-gray-750: 41 50 73;
--color-gray-800: 28 36 56;
--color-gray-900: 17 23 33;
--color-gray-950: 14 18 28;
/* Full Colors */
--color-light: 255 255 255;
--color-dark: 0 0 0;
}
}

View File

@@ -108,7 +108,6 @@
"font-inter", "font-inter",
"font-medium", "font-medium",
"font-normal", "font-normal",
"font-scp",
"font-semibold", "font-semibold",
"form-checkbox", "form-checkbox",
"form-input", "form-input",
@@ -121,6 +120,7 @@
"gap-x-2", "gap-x-2",
"gap-x-3", "gap-x-3",
"gap-x-4", "gap-x-4",
"gap-x-5",
"gap-x-6", "gap-x-6",
"gap-y-2", "gap-y-2",
"gap-y-5", "gap-y-5",
@@ -188,7 +188,6 @@
"lg:inset-y-0", "lg:inset-y-0",
"lg:items-center", "lg:items-center",
"lg:last:pr-8", "lg:last:pr-8",
"lg:max-w-5xl",
"lg:pl-72", "lg:pl-72",
"lg:px-8", "lg:px-8",
"lg:w-72", "lg:w-72",
@@ -264,7 +263,6 @@
"p-2.5", "p-2.5",
"p-4", "p-4",
"p-5", "p-5",
"pb-1",
"pb-3", "pb-3",
"pb-4", "pb-4",
"pl-12", "pl-12",
@@ -279,7 +277,6 @@
"pr-3", "pr-3",
"pr-8", "pr-8",
"pt-0.5", "pt-0.5",
"pt-4",
"pt-5", "pt-5",
"pt-6", "pt-6",
"px-2", "px-2",
@@ -387,13 +384,15 @@
"text-lg", "text-lg",
"text-primary-500", "text-primary-500",
"text-red-500", "text-red-500",
"text-slate-400", "text-secondary-500",
"text-secondary-600",
"text-slate-600", "text-slate-600",
"text-sm", "text-sm",
"text-success-400", "text-success-400",
"text-success-500", "text-success-500",
"text-tertiary-500", "text-tertiary-500",
"text-warning-400", "text-warning-400",
"text-warning-500",
"text-white", "text-white",
"text-xl", "text-xl",
"text-xs", "text-xs",

View File

@@ -1,6 +1,7 @@
@import "tailwindcss/base"; @import "tailwindcss/base";
@import "tailwindcss/components"; @import "tailwindcss/components";
@import "additions/theme.css";
@import "additions/animations.css"; @import "additions/animations.css";
@import "additions/fonts.css"; @import "additions/fonts.css";
@import "additions/buttons.css"; @import "additions/buttons.css";

View File

@@ -12,109 +12,110 @@ module.exports = {
}, },
colors: { colors: {
primary: { primary: {
50: '#eef2ff', 50: 'rgb(var(--color-primary-50))',
100: '#e0e7ff', 100: 'rgb(var(--color-primary-100))',
200: '#c7d2fe', 200: 'rgb(var(--color-primary-200))',
300: '#a5b4fc', 300: 'rgb(var(--color-primary-300))',
400: '#818cf8', 400: 'rgb(var(--color-primary-400))',
500: '#6366f1', 500: 'rgb(var(--color-primary-500))',
600: '#4f46e5', 600: 'rgb(var(--color-primary-600))',
700: '#4338ca', 700: 'rgb(var(--color-primary-700))',
800: '#3730a3', 800: 'rgb(var(--color-primary-800))',
900: '#312e81', 900: 'rgb(var(--color-primary-900))',
950: '#1e1b4b' 950: 'rgb(var(--color-primary-950))'
}, },
secondary: { secondary: {
100: '#F9F9F9', 100: 'rgb(var(--color-secondary-100))',
200: '#F1F1F2', 200: 'rgb(var(--color-secondary-200))',
300: '#DBDFE9', 300: 'rgb(var(--color-secondary-300))',
400: '#B5B5C3', 400: 'rgb(var(--color-secondary-400))',
500: '#99A1B7', 500: 'rgb(var(--color-secondary-500))',
600: '#707993', 600: 'rgb(var(--color-secondary-600))',
700: '#444e6b', 700: 'rgb(var(--color-secondary-700))',
750: '#293249', 800: 'rgb(var(--color-secondary-800))',
800: '#1c2438', 900: 'rgb(var(--color-secondary-900))',
900: '#111721', 950: 'rgb(var(--color-secondary-950))'
950: '#0e121c',
}, },
tertiary: { tertiary: {
50: '#f5f3ff', 50: 'rgb(var(--color-tertiary-50))',
100: '#ede9fe', 100: 'rgb(var(--color-tertiary-100))',
200: '#ddd6fe', 200: 'rgb(var(--color-tertiary-200))',
300: '#c4b5fd', 300: 'rgb(var(--color-tertiary-300))',
400: '#a78bfa', 400: 'rgb(var(--color-tertiary-400))',
500: '#8b5cf6', 500: 'rgb(var(--color-tertiary-500))',
600: '#7c3aed', 600: 'rgb(var(--color-tertiary-600))',
700: '#6d28d9', 700: 'rgb(var(--color-tertiary-700))',
800: '#5b21b6', 800: 'rgb(var(--color-tertiary-800))',
900: '#4c1d95', 900: 'rgb(var(--color-tertiary-900))',
950: '#2e1065' 950: 'rgb(var(--color-tertiary-950))'
}, },
warning: { warning: {
50: '#fefce8', 50: 'rgb(var(--color-warning-50))',
100: '#fef9c3', 100: 'rgb(var(--color-warning-100))',
200: '#fef08a', 200: 'rgb(var(--color-warning-200))',
300: '#fde047', 300: 'rgb(var(--color-warning-300))',
400: '#facc15', 400: 'rgb(var(--color-warning-400))',
500: '#eab308', 500: 'rgb(var(--color-warning-500))',
600: '#ca8a04', 600: 'rgb(var(--color-warning-600))',
700: '#a16207', 700: 'rgb(var(--color-warning-700))',
800: '#854d0e', 800: 'rgb(var(--color-warning-800))',
900: '#713f12', 900: 'rgb(var(--color-warning-900))',
950: '#422006' 950: 'rgb(var(--color-warning-950))'
}, },
danger: { danger: {
50: '#fef2f2', 50: 'rgb(var(--color-danger-50))',
100: '#fee2e2', 100: 'rgb(var(--color-danger-100))',
200: '#fecaca', 200: 'rgb(var(--color-danger-200))',
300: '#fca5a5', 300: 'rgb(var(--color-danger-300))',
400: '#f87171', 400: 'rgb(var(--color-danger-400))',
500: '#ef4444', 500: 'rgb(var(--color-danger-500))',
600: '#dc2626', 600: 'rgb(var(--color-danger-600))',
700: '#b91c1c', 700: 'rgb(var(--color-danger-700))',
800: '#991b1b', 800: 'rgb(var(--color-danger-800))',
900: '#7f1d1d', 900: 'rgb(var(--color-danger-900))',
950: '#450a0a' 950: 'rgb(var(--color-danger-950))'
}, },
success: { success: {
50: '#f0fdf4', 50: 'rgb(var(--color-success-50))',
100: '#dcfce7', 100: 'rgb(var(--color-success-100))',
200: '#bbf7d0', 200: 'rgb(var(--color-success-200))',
300: '#86efac', 300: 'rgb(var(--color-success-300))',
400: '#4ade80', 400: 'rgb(var(--color-success-400))',
500: '#22c55e', 500: 'rgb(var(--color-success-500))',
600: '#16a34a', 600: 'rgb(var(--color-success-600))',
700: '#15803d', 700: 'rgb(var(--color-success-700))',
800: '#166534', 800: 'rgb(var(--color-success-800))',
900: '#14532d', 900: 'rgb(var(--color-success-900))',
950: '#052e16' 950: 'rgb(var(--color-success-950))'
}, },
info: { info: {
50: '#eff6ff', 50: 'rgb(var(--color-info-50))',
100: '#dbeafe', 100: 'rgb(var(--color-info-100))',
200: '#bfdbfe', 200: 'rgb(var(--color-info-200))',
300: '#93c5fd', 300: 'rgb(var(--color-info-300))',
400: '#60a5fa', 400: 'rgb(var(--color-info-400))',
500: '#3b82f6', 500: 'rgb(var(--color-info-500))',
600: '#2563eb', 600: 'rgb(var(--color-info-600))',
700: '#1d4ed8', 700: 'rgb(var(--color-info-700))',
800: '#1e40af', 800: 'rgb(var(--color-info-800))',
900: '#1e3a8a', 900: 'rgb(var(--color-info-900))',
950: '#172554' 950: 'rgb(var(--color-info-950))'
}, },
gray: { gray: {
100: '#F9F9F9', 100: 'rgb(var(--color-gray-100))',
200: '#F1F1F2', 200: 'rgb(var(--color-gray-200))',
300: '#DBDFE9', 300: 'rgb(var(--color-gray-300))',
400: '#B5B5C3', 400: 'rgb(var(--color-gray-400))',
500: '#99A1B7', 500: 'rgb(var(--color-gray-500))',
600: '#707993', 600: 'rgb(var(--color-gray-600))',
700: '#444e6b', 700: 'rgb(var(--color-gray-700))',
750: '#293249', 750: 'rgb(var(--color-gray-750))',
800: '#1c2438', 800: 'rgb(var(--color-gray-800))',
900: '#111721', 900: 'rgb(var(--color-gray-900))',
950: '#0e121c', 950: 'rgb(var(--color-gray-950))'
} },
white: 'rgb(var(--color-light))',
black: 'rgb(var(--color-dark))'
}, },
animation: { animation: {
'shimmer': 'shimmer 2s linear infinite', 'shimmer': 'shimmer 2s linear infinite',