提交 01b389aa 编写于 作者: 麦壳饼's avatar 麦壳饼

update to vue.js

上级 bcb8b6eb
[submodule "ClientApp"] [submodule "IoTSharp/ClientApp"]
path = ClientApp path = IoTSharp/ClientApp
url = https://github.com/IoTSharp/IoTSharp-UI.git url = https://github.com/IoTSharp/IoTSharp-UI.git
branch = master branch = master
...@@ -12,7 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ...@@ -12,7 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IoTSharp.Test", "IoTSharp.Test\IoTSharp.Test.csproj", "{70DFF66F-6791-4713-81F3-DD7A64B59185}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IoTSharp.Test", "IoTSharp.Test\IoTSharp.Test.csproj", "{70DFF66F-6791-4713-81F3-DD7A64B59185}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IoTSharp", "IoTSharp\IoTSharp.csproj", "{CCD2C255-72D2-4A25-B0E9-E30FBEF774C7}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IoTSharp", "IoTSharp\IoTSharp.csproj", "{CCD2C255-72D2-4A25-B0E9-E30FBEF774C7}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
......
.DS_Store
node_modules/
npm-debug.log
# /Properties/launchSettings.json
package-lock.json
## Ignore Visual Studio temporary files, build results, and ## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons. ## files generated by popular Visual Studio add-ons.
...@@ -17,7 +25,6 @@ ...@@ -17,7 +25,6 @@
[Rr]eleases/ [Rr]eleases/
x64/ x64/
x86/ x86/
build/
bld/ bld/
bin/ bin/
Bin/ Bin/
...@@ -26,6 +33,12 @@ Obj/ ...@@ -26,6 +33,12 @@ Obj/
# Visual Studio 2015 cache/options directory # Visual Studio 2015 cache/options directory
.vs/ .vs/
/wwwroot/dist/**
# Workaround for https://github.com/aspnet/JavaScriptServices/issues/235
!/wwwroot/dist/_placeholder.txt
/yarn.lock
# MSTest test Results # MSTest test Results
[Tt]est[Rr]esult*/ [Tt]est[Rr]esult*/
...@@ -40,6 +53,10 @@ TestResult.xml ...@@ -40,6 +53,10 @@ TestResult.xml
[Rr]eleasePS/ [Rr]eleasePS/
dlldata.c dlldata.c
# DNX
project.lock.json
artifacts/
*_i.c *_i.c
*_p.c *_p.c
*_i.h *_i.h
...@@ -179,7 +196,9 @@ ClientBin/ ...@@ -179,7 +196,9 @@ ClientBin/
*.publishsettings *.publishsettings
orleans.codegen.cs orleans.codegen.cs
/node_modules # Workaround for https://github.com/aspnet/JavaScriptServices/issues/235
/node_modules/**
!/node_modules/_placeholder.txt
# RIA/Silverlight projects # RIA/Silverlight projects
Generated_Code/ Generated_Code/
...@@ -229,3 +248,5 @@ _Pvt_Extensions ...@@ -229,3 +248,5 @@ _Pvt_Extensions
# FAKE - F# Make # FAKE - F# Make
.fake/ .fake/
.vscode/
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes> <DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
<!-- Set this to true if you enable server-side prerendering --> <!-- Set this to true if you enable server-side prerendering -->
<BuildServerSideRenderer>false</BuildServerSideRenderer> <BuildServerSideRenderer>true</BuildServerSideRenderer>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
<None Remove="Migrations\**" /> <None Remove="Migrations\**" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Changwei.AspNetCore.SpaServices.Extensions.VueCli" Version="1.0.0" />
<PackageReference Include="IoTSharp.X509Extensions" Version="1.3.3" /> <PackageReference Include="IoTSharp.X509Extensions" Version="1.3.3" />
<PackageReference Include="LiteDB" Version="4.1.4" /> <PackageReference Include="LiteDB" Version="4.1.4" />
<PackageReference Include="Microsoft.AspNetCore.App" /> <PackageReference Include="Microsoft.AspNetCore.App" />
......
using IoTSharp.Data; using IoTSharp.Data;
using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
...@@ -7,7 +7,9 @@ using Microsoft.AspNetCore.Http; ...@@ -7,7 +7,9 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.HttpOverrides; using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SpaServices.AngularCli; using Microsoft.AspNetCore.ResponseCompression;
using Microsoft.AspNetCore.SpaServices.VueCli;
using Microsoft.AspNetCore.SpaServices.Webpack;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
...@@ -16,6 +18,7 @@ using MQTTnet.AspNetCoreEx; ...@@ -16,6 +18,7 @@ using MQTTnet.AspNetCoreEx;
using MQTTnet.Client; using MQTTnet.Client;
using NSwag.AspNetCore; using NSwag.AspNetCore;
using System; using System;
using System.Configuration;
using System.IdentityModel.Tokens.Jwt; using System.IdentityModel.Tokens.Jwt;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
...@@ -55,6 +58,12 @@ namespace IoTSharp ...@@ -55,6 +58,12 @@ namespace IoTSharp
services.AddLogging(loggingBuilder => loggingBuilder.AddConsole()); services.AddLogging(loggingBuilder => loggingBuilder.AddConsole());
services.AddIoTSharpHub(Configuration); services.AddIoTSharpHub(Configuration);
// Enable the Gzip compression especially for Kestrel
services.Configure<GzipCompressionProviderOptions>(options => options.Level = System.IO.Compression.CompressionLevel.Optimal);
services.AddResponseCompression(options =>
{
options.EnableForHttps = true;
});
services.AddIdentity<IdentityUser, IdentityRole>() services.AddIdentity<IdentityUser, IdentityRole>()
.AddRoles<IdentityRole>() .AddRoles<IdentityRole>()
...@@ -77,11 +86,9 @@ namespace IoTSharp ...@@ -77,11 +86,9 @@ namespace IoTSharp
configure.Description = description?.Description; configure.Description = description?.Description;
}); });
services.AddTransient<ApplicationDBInitializer>(); services.AddTransient<ApplicationDBInitializer>();
services.AddIoTSharpMqttServer(AppSettings.MqttBroker); services.AddIoTSharpMqttServer(AppSettings.MqttBroker);
services.AddMqttClient(AppSettings.MqttClient); services.AddMqttClient(AppSettings.MqttClient);
} }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
...@@ -101,6 +108,7 @@ namespace IoTSharp ...@@ -101,6 +108,7 @@ namespace IoTSharp
app.UseAuthentication(); app.UseAuthentication();
app.UseSwagger(); app.UseSwagger();
app.UseHttpsRedirection();
app.UseIoTSharpMqttClient(); app.UseIoTSharpMqttClient();
app.UseIotSharpMqttServer(); app.UseIotSharpMqttServer();
...@@ -108,8 +116,12 @@ namespace IoTSharp ...@@ -108,8 +116,12 @@ namespace IoTSharp
{ {
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
}); });
app.UseResponseCompression(); // No need if you use IIS, but really something good for Kestrel!
app.UseHttpsRedirection(); // Idea: https://code.msdn.microsoft.com/How-to-fix-the-routing-225ac90f
// This avoid having a real mvc view. You have other way of doing, but this one works
// properly.
app.UseDefaultFiles();
app.UseStaticFiles(); app.UseStaticFiles();
app.UseSpaStaticFiles(); app.UseSpaStaticFiles();
...@@ -126,10 +138,10 @@ namespace IoTSharp ...@@ -126,10 +138,10 @@ namespace IoTSharp
// see https://go.microsoft.com/fwlink/?linkid=864501 // see https://go.microsoft.com/fwlink/?linkid=864501
spa.Options.SourcePath = "ClientApp"; spa.Options.SourcePath = "ClientApp";
spa.Options.StartupTimeout = new TimeSpan(0, 0, 120); spa.Options.StartupTimeout = TimeSpan.FromSeconds(80);
if (env.IsDevelopment()) if (env.IsDevelopment())
{ {
spa.UseAngularCliServer(npmScript: "start"); spa.UseVueCliServer(npmScript: "serve");
} }
}); });
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册