Remove deprecated Web solution
This commit is contained in:
parent
6a73b3bdd6
commit
295f9f8abc
@ -1,26 +0,0 @@
|
||||
@page
|
||||
@model ErrorModel
|
||||
@{
|
||||
ViewData["Title"] = "Error";
|
||||
}
|
||||
|
||||
<h1 class="text-danger">Error.</h1>
|
||||
<h2 class="text-danger">An error occurred while processing your request.</h2>
|
||||
|
||||
@if (Model.ShowRequestId)
|
||||
{
|
||||
<p>
|
||||
<strong>Request ID:</strong> <code>@Model.RequestId</code>
|
||||
</p>
|
||||
}
|
||||
|
||||
<h3>Development Mode</h3>
|
||||
<p>
|
||||
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
|
||||
</p>
|
||||
<p>
|
||||
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
|
||||
It can result in displaying sensitive information from exceptions to end users.
|
||||
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
|
||||
and restarting the app.
|
||||
</p>
|
@ -1,19 +0,0 @@
|
||||
using System.Diagnostics;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
|
||||
namespace PluralKit.Web.Pages
|
||||
{
|
||||
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
||||
public class ErrorModel : PageModel
|
||||
{
|
||||
public string RequestId { get; set; }
|
||||
|
||||
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||
|
||||
public void OnGet()
|
||||
{
|
||||
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
@page
|
||||
@model IndexModel
|
||||
@{
|
||||
ViewData["Title"] = "Home page";
|
||||
}
|
||||
|
||||
<div class="text-center">
|
||||
<h1 class="display-4">Welcome</h1>
|
||||
<p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
|
||||
</div>
|
@ -1,11 +0,0 @@
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
|
||||
namespace PluralKit.Web.Pages
|
||||
{
|
||||
public class IndexModel : PageModel
|
||||
{
|
||||
public void OnGet()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>@ViewData["Title"] - PluralKit.Web</title>
|
||||
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/css/bootstrap.min.css"/>
|
||||
<link href="https://fonts.googleapis.com/css?family=PT+Sans" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
body {
|
||||
font-family: "PT Sans", sans-serif;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
<main role="main" class="p-3">
|
||||
@RenderBody()
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<footer class="border-top footer text-muted">
|
||||
<div class="container">
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@RenderSection("Scripts", required: false)
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/feather-icons/4.21.0/feather.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
|
||||
<script>
|
||||
feather.replace();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -1,122 +0,0 @@
|
||||
@page "/s/{systemId}"
|
||||
@model PluralKit.Web.Pages.ViewSystem
|
||||
|
||||
<div class="system">
|
||||
<ul class="taglist">
|
||||
<li>
|
||||
<i data-feather="hash"></i>
|
||||
@Model.System.Hid
|
||||
</li>
|
||||
|
||||
@if (Model.System.Tag != null)
|
||||
{
|
||||
<li>
|
||||
<i data-feather="tag"></i>
|
||||
@Model.System.Tag
|
||||
</li>
|
||||
}
|
||||
|
||||
@if (Model.System.UiTz != null)
|
||||
{
|
||||
<li>
|
||||
<i data-feather="clock"></i>
|
||||
@Model.System.UiTz
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
|
||||
@if (Model.System.Name != null)
|
||||
{
|
||||
<h1>@Model.System.Name</h1>
|
||||
}
|
||||
|
||||
@if (Model.System.Description != null)
|
||||
{
|
||||
<div>@Model.System.Description</div>
|
||||
}
|
||||
|
||||
<h2>Members</h2>
|
||||
@foreach (var member in Model.Members)
|
||||
{
|
||||
<div class="member-card">
|
||||
<div class="member-avatar" style="background-image: url(@member.AvatarUrl); border-color: #@member.Color;"></div>
|
||||
<div class="member-body">
|
||||
<span class="member-name">@member.Name</span>
|
||||
<div class="member-description">@member.Description</div>
|
||||
|
||||
<ul class="taglist">
|
||||
<li>
|
||||
<i data-feather="hash"></i>
|
||||
@member.Hid
|
||||
</li>
|
||||
|
||||
@if (member.Birthday != null)
|
||||
{
|
||||
<li>
|
||||
<i data-feather="calendar"></i>
|
||||
@member.BirthdayString
|
||||
</li>
|
||||
}
|
||||
|
||||
@if (member.Pronouns != null)
|
||||
{
|
||||
<li>
|
||||
<i data-feather="message-circle"></i>
|
||||
@member.Pronouns
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
<style>
|
||||
.taglist {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
color: #aaa;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.taglist li {
|
||||
display: inline-block;
|
||||
margin-right: 1rem;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
.taglist .feather {
|
||||
display: inline-block;
|
||||
margin-top: -2px;
|
||||
width: 1em;
|
||||
}
|
||||
|
||||
.member-card {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.member-avatar {
|
||||
margin: 1.5rem 1rem 0 0;
|
||||
border-radius: 50%;
|
||||
background-size: cover;
|
||||
background-position: top center;
|
||||
flex-basis: 4rem;
|
||||
height: 4rem;
|
||||
border: 4px solid white;
|
||||
}
|
||||
|
||||
.member-body {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 1rem 1rem 1rem 0;
|
||||
}
|
||||
|
||||
.member-name {
|
||||
font-size: 13pt;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
|
||||
namespace PluralKit.Web.Pages
|
||||
{
|
||||
public class ViewSystem : PageModel
|
||||
{
|
||||
private IDataStore _data;
|
||||
|
||||
public ViewSystem(IDataStore data)
|
||||
{
|
||||
_data = data;
|
||||
}
|
||||
|
||||
public PKSystem System { get; set; }
|
||||
public IEnumerable<PKMember> Members { get; set; }
|
||||
|
||||
public async Task<IActionResult> OnGet(string systemId)
|
||||
{
|
||||
System = await _data.GetSystemByHid(systemId);
|
||||
if (System == null) return NotFound();
|
||||
|
||||
Members = await _data.GetSystemMembers(System);
|
||||
|
||||
return Page();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
@using PluralKit.Web
|
||||
@namespace PluralKit.Web.Pages
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
@ -1,3 +0,0 @@
|
||||
@{
|
||||
Layout = "Shared/_Layout";
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||
<DebugType>full</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.HttpsPolicy" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\PluralKit.Core\PluralKit.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -1,19 +0,0 @@
|
||||
using Microsoft.AspNetCore;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
|
||||
namespace PluralKit.Web
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
CreateWebHostBuilder(args).Build().Run();
|
||||
}
|
||||
|
||||
public static IWebHostBuilder CreateWebHostBuilder(string[] args)
|
||||
{
|
||||
return WebHost.CreateDefaultBuilder(args)
|
||||
.UseStartup<Startup>();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,56 +0,0 @@
|
||||
using System.Data;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Npgsql;
|
||||
|
||||
namespace PluralKit.Web
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
public Startup(IConfiguration configuration)
|
||||
{
|
||||
Configuration = configuration;
|
||||
}
|
||||
|
||||
public IConfiguration Configuration { get; }
|
||||
|
||||
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
InitUtils.Init();
|
||||
|
||||
var config = Configuration.GetSection("PluralKit").Get<CoreConfig>();
|
||||
|
||||
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
|
||||
|
||||
services
|
||||
.AddScoped<IDbConnection, NpgsqlConnection>(_ => new NpgsqlConnection(config.Database))
|
||||
.AddTransient<IDataStore, PostgresDataStore>()
|
||||
.AddSingleton(config);
|
||||
}
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
public async void Configure(IApplicationBuilder app, IHostingEnvironment env)
|
||||
{
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
else
|
||||
{
|
||||
app.UseExceptionHandler("/Error");
|
||||
}
|
||||
|
||||
//app.UseHttpsRedirection();
|
||||
app.UseMvc();
|
||||
|
||||
var conn = app.ApplicationServices.GetRequiredService<IDbConnection>();
|
||||
conn.Open();
|
||||
|
||||
await Schema.CreateTables(conn);
|
||||
}
|
||||
}
|
||||
}
|
@ -4,8 +4,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PluralKit.Bot", "PluralKit.
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PluralKit.Core", "PluralKit.Core\PluralKit.Core.csproj", "{5DBE037D-179D-4C05-8A28-35E37129C961}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PluralKit.Web", "PluralKit.Web\PluralKit.Web.csproj", "{975F9DED-78D1-4742-8412-DF70BB381E92}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PluralKit.API", "PluralKit.API\PluralKit.API.csproj", "{3420F8A9-125C-4F7F-A444-10DD16945754}"
|
||||
EndProject
|
||||
Global
|
||||
@ -22,10 +20,6 @@ Global
|
||||
{5DBE037D-179D-4C05-8A28-35E37129C961}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{5DBE037D-179D-4C05-8A28-35E37129C961}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{5DBE037D-179D-4C05-8A28-35E37129C961}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{975F9DED-78D1-4742-8412-DF70BB381E92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{975F9DED-78D1-4742-8412-DF70BB381E92}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{975F9DED-78D1-4742-8412-DF70BB381E92}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{975F9DED-78D1-4742-8412-DF70BB381E92}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{3420F8A9-125C-4F7F-A444-10DD16945754}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{3420F8A9-125C-4F7F-A444-10DD16945754}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3420F8A9-125C-4F7F-A444-10DD16945754}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
|
@ -16,16 +16,6 @@ services:
|
||||
- db
|
||||
- influx
|
||||
restart: always
|
||||
web:
|
||||
image: pluralkit
|
||||
command: ["PluralKit.Web.dll"]
|
||||
environment:
|
||||
- "PluralKit:Database=Host=db;Username=postgres;Password=postgres;Database=postgres;Maximum Pool Size=1000"
|
||||
links:
|
||||
- db
|
||||
ports:
|
||||
- 2837:5000
|
||||
restart: always
|
||||
api:
|
||||
image: pluralkit
|
||||
command: ["PluralKit.API.dll"]
|
||||
|
Loading…
Reference in New Issue
Block a user