diff --git a/Web/Pages/CreateServer.razor b/Web/Pages/CreateServer.razor index 311f37f..1a3029e 100644 --- a/Web/Pages/CreateServer.razor +++ b/Web/Pages/CreateServer.razor @@ -4,11 +4,12 @@ @inject IHttpContextAccessor _httpContextAccessor @attribute [Authorize] + + @code { protected async override Task OnInitializedAsync() { - string token = await _httpContextAccessor.HttpContext.GetTokenAsync("access_token"); - var t = 2; + base.OnInitializedAsync(); } } \ No newline at end of file diff --git a/Web/Shared/Forms/ServerCreationForm.razor b/Web/Shared/Forms/ServerCreationForm.razor new file mode 100644 index 0000000..94ad991 --- /dev/null +++ b/Web/Shared/Forms/ServerCreationForm.razor @@ -0,0 +1,18 @@ +@using Web.Shared.Models + + + + + + + + + +@code { + private ServerModel _serverModel = new(); + + private void HandleValidSubmit() + { + + } +} \ No newline at end of file diff --git a/Web/Shared/Models/ServerModels.cs b/Web/Shared/Models/ServerModels.cs new file mode 100644 index 0000000..d33476f --- /dev/null +++ b/Web/Shared/Models/ServerModels.cs @@ -0,0 +1,38 @@ +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Web.Shared.Models +{ + public class ServerLimitsModel + { + public int Memory { get; set; } + public int Swap { get; set; } + public int Disk { get; set; } + public int Io { get; set; } + public int Cpu { get; set; } + } + public class ServerFeatureLimits + { + public int Databases { get; set; } + public int Backups { get; set; } + public int Allocations { get; set; } + } + public class ServerAllocationModel + { + public int Default { get; set; } + } + public class ServerModel + { + public string Name { get; set; } + public int User { get; set; } + public int Egg { get; set; } + [JsonPropertyName("docker_image")] + public string DockerImage { get; set; } + public string Startup { get; set; } + public Dictionary Environment { get; set; } + public ServerLimitsModel Limits { get; set; } + [JsonPropertyName("feature_limits")] + public ServerFeatureLimits FeatureLimits { get; set; } + public ServerAllocationModel Allocation { get; set; } + } +} \ No newline at end of file diff --git a/Web/Startup.cs b/Web/Startup.cs index be69f4f..cc62f02 100644 --- a/Web/Startup.cs +++ b/Web/Startup.cs @@ -48,6 +48,7 @@ namespace Web options.ResponseType = OpenIdConnectResponseType.Code; options.GetClaimsFromUserInfoEndpoint = true; options.SaveTokens = true; + options.UseTokenLifetime = true; options.Scope.Add("openid"); options.Scope.Add("profile"); options.Scope.Add("email"); diff --git a/Web/_Imports.razor b/Web/_Imports.razor index cfd8786..048e19d 100644 --- a/Web/_Imports.razor +++ b/Web/_Imports.razor @@ -7,4 +7,5 @@ @using Microsoft.AspNetCore.Components.Web.Virtualization @using Microsoft.JSInterop @using Web -@using Web.Shared \ No newline at end of file +@using Web.Shared +@using Web.Shared.Forms \ No newline at end of file