migrate welcome plugin to .NET Core 2.0

more fixes to stats database for migration
last connection set when client connects and disconnects
update GeoIP datatbase
This commit is contained in:
RaidMax
2018-04-09 14:17:10 -05:00
parent 63db309c5e
commit d233b8cb50
36 changed files with 395 additions and 481 deletions

View File

@ -18,11 +18,6 @@ namespace WebfrontCore.Controllers
protected bool Authorized { get; private set; }
protected EFClient User { get; private set; }
/* public BaseController(DatabaseContext ctx)
{
Context = ctx;
}*/
public override void OnActionExecuting(ActionExecutingContext context)
{
Manager = Program.Manager;

View File

@ -8,6 +8,11 @@ namespace WebfrontCore
{
public static IManager Manager;
static void Main(string[] args)
{
throw new System.Exception("Webfront core cannot be run as a standalone application");
}
public static void Init(IManager mgr)
{
Manager = mgr;

View File

@ -20,19 +20,12 @@ namespace WebfrontCore
{
var builder = new ConfigurationBuilder()
.SetBasePath(env.ContentRootPath)
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: false)
.AddJsonFile("WebfrontSettings.json", optional: true, reloadOnChange: false)
.AddEnvironmentVariables();
Configuration = builder.Build();
_appHost = env;
using (var db = new DatabaseContext())
{
db.Database.EnsureCreated();
db.Database.Migrate();
new ContextSeed(db).Seed().Wait();
}
}
// This method gets called by the runtime. Use this method to add services to the container.

View File

@ -12,11 +12,11 @@
<meta name="description" content="@ViewBag.Description">
<meta name="keywords" content="@ViewBag.Keywords">
<link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<environment names="Development">
<environment include="Development">
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="~/lib/open-iconic/font/css/open-iconic-bootstrap.css" />
</environment>
<environment names="Production">
<environment include="Production">
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/lib/open-iconic/font/css/open-iconic-bootstrap.min.css" />
</environment>
@ -103,7 +103,7 @@ else
@RenderBody()
<footer></footer>
</div>
<environment names="Development">
<environment include="Development">
<script type="text/javascript" src="~/lib/jQuery/dist/jquery.js"></script>
<script type="text/javascript" src="~/lib/moment/moment.js"></script>
<script type="text/javascript" src="~/lib/moment-timezone/builds/moment-timezone-with-data.js"></script>
@ -111,7 +111,7 @@ else
<script type="text/javascript" src="~/lib/bootstrap/dist/js/bootstrap.js"></script>
<script type="text/javascript" src="~/js/global.js"></script>
</environment>
<environment names="Production">
<environment include="Production">
<script type="text/javascript" src="~/lib/jQuery/dist/jquery.min.js"></script>
<script type="text/javascript" src="~/lib/moment/min/moment.min.js"></script>
<script type="text/javascript" src="~/lib/moment-timezone/builds/moment-timezone.min.js"></script>

View File

@ -1,2 +1 @@
@using WebfrontCore
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

View File

@ -2,6 +2,8 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<MvcRazorCompileOnPublish>false</MvcRazorCompileOnPublish>
<PreserveCompilationContext>true</PreserveCompilationContext>
<TypeScriptToolsVersion>2.6</TypeScriptToolsVersion>
<PackageId>RaidMax.IW4MAdmin.WebfrontCore</PackageId>
<Version>2.0.0</Version>
@ -15,7 +17,7 @@
<RepositoryUrl>https://github.com/RaidMax/IW4M-Admin</RepositoryUrl>
<PackageIconUrl>https://raidmax.org/IW4MAdmin/img/iw4adminicon-3.png</PackageIconUrl>
<ApplicationIcon />
<OutputType>Library</OutputType>
<OutputType>Exe</OutputType>
<StartupObject />
</PropertyGroup>
@ -26,7 +28,6 @@
</ItemGroup>
<ItemGroup>
<Folder Include="Views\Account\" />
<Folder Include="wwwroot\" />
</ItemGroup>
@ -41,13 +42,17 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SharedLibraryCore\SharedLibraryCore.csproj" />
<ProjectReference Include="..\SharedLibraryCore\SharedLibraryCore.csproj">
<Private></Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Update="appsettings.json">
<Content Update="WebfrontSettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ProjectExtensions><VisualStudio><UserProperties WebfrontSettings_1json__JSONSchema="http://json.schemastore.org/appsettings" /></VisualStudio></ProjectExtensions>
</Project>

View File

@ -9,9 +9,5 @@
},
"Web": {
"Address": "http://127.0.0.1:5000"
},
"ConnectionStrings": {
"WindowsConnection": "Data Source=|DataDirectory|\\Database.sdf",
"LinuxConnection": "Server=127.0.0.1;User=user;Database=IW4MAdmin;Password=password"
}
}