1.0.0.0818d1

Former-commit-id: ea030aff445d0934e0c9b83b55dd3ca3874fc4f7
Former-commit-id: bbb248475858766ca5742047ffe8e28ae04592fd
TSXN
wanggang 5 years ago
parent f4eaf7baab
commit 8dff46b7fc

@ -9,22 +9,21 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.0.0">
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Jint" Version="2.11.58" />
<PackageReference Include="CS-Script.Core" Version="1.4.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.6" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.7" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="4.1.1" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="3.1.6" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="3.1.6" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.6" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="3.1.6" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="3.1.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.6" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="3.1.7" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="3.1.7" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.7" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="3.1.7" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="3.1.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.7" />
<PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.1.0" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="3.1.6" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="3.1.7" />
<PackageReference Include="Minio" Version="3.1.13" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.1.4" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="3.1.2" />

@ -1,32 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<DefaultItemExcludes>$(DefaultItemExcludes);wwwroot\**\*</DefaultItemExcludes>
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Deterministic>false</Deterministic>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<DefaultItemExcludes>$(DefaultItemExcludes);wwwroot\**\*</DefaultItemExcludes>
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Deterministic>false</Deterministic>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="3.1.6" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="3.1.6" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client.Core" Version="3.1.6" />
<PackageReference Include="Microsoft.OpenApi.Readers" Version="1.1.4" />
<PackageReference Include="SSH.NET" Version="2016.1.0" />
<PackageReference Include="Microsoft.OpenApi.Readers" Version="1.2.2" />
<PackageReference Include="System.IO.Ports" Version="4.7.0" />
<PackageReference Include="Vibrant.InfluxDB.Client" Version="4.0.4" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="wwwroot\**\*" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Version.cs" Link="Version.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Infrastructure\Infrastructure.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="3.1.7" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="3.1.7" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client.Core" Version="3.1.7" />
<PackageReference Include="Microsoft.OpenApi.Readers" Version="1.1.4" />
<PackageReference Include="SSH.NET" Version="2016.1.0" />
<PackageReference Include="Microsoft.OpenApi.Readers" Version="1.2.2" />
<PackageReference Include="System.IO.Ports" Version="4.7.0" />
<PackageReference Include="Vibrant.InfluxDB.Client" Version="4.0.4" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="wwwroot\**\*" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Version.cs" Link="Version.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Infrastructure\Infrastructure.csproj" />
</ItemGroup>
</Project>

@ -70,8 +70,12 @@ namespace IoTCenter.Api.Controllers
var hours = Convert.ToInt32(DateTime.Now.ToString("%z"));
using var client = new InfluxClient(new Uri(url), usr, pwd);
var days = Convert.ToInt32(model.Time.TrimEnd('d'));
var group = days == 1 ? "1m" : (days == 7 ? "10m" : "1h");
var query = $"select last({model.Key}) from {measurementName} where time>now() - {days}d and DeviceNumber = '{model.Number}' group by time({group}) fill(none)";
var group = model.Group;
if (string.IsNullOrEmpty(group))
{
group = days == 1 ? "1m" : (days == 7 ? "10m" : "1h");
}
var query = $"select last({model.Key}) from {measurementName} where time>now() - {days}d and DeviceNumber = '{model.Number}' group by time({group}) fill(none) tz('Asia/Shanghai')";
var result = client.ReadAsync<DynamicInfluxRow>(dbName, query).Result;
var rows = result.Results.FirstOrDefault()?
.Series.FirstOrDefault()?

@ -114,5 +114,12 @@ namespace IoTCenter.Controllers
var url = registerUrl.SetParam("returnUrl", fullReturnUrl);
return Redirect(url);
}
[AllowAnonymous]
public IActionResult CasLogin(string ticket)
{
//this._cfg[""]
return Redirect(this._cfg["http://221.194.113.154:8100/"]);
}
}
}

@ -12,5 +12,7 @@ namespace IoTCenter.ViewModels
[Required(ErrorMessage = nameof(RequiredAttribute))]
public string Time { get; set; }
public string Group { get; set; }
}
}

@ -7,8 +7,8 @@
"mysql": "Server=172.172.0.30;Port=3306;Database=iotcenter;Uid=root;Pwd=root;",
"redis": "redis:6379,allowAdmin=true",
"srs": "http://172.172.0.60:1985",
"JobServer": "http://172.172.0.10/JobServer",
"JobCallBack": "http://172.172.0.10/IoTCenter/api/v1/Api/ExecTimer"
"JobServer": "http://172.172.0.12/JobServer",
"JobCallBack": "http://172.172.0.12/IoTCenter/api/v1/Api/ExecTimer"
},
"influxdb": {
"url": "http://172.172.0.50:8086",

@ -0,0 +1,18 @@
*.bak
*.suo
*.db
*.db-shm
*.db-wal
*.user
.vs
obj
Obj
bin
Bin
debug
Debug
release
Release
Logs
logs
node_modules

@ -0,0 +1,37 @@
using Microsoft.AspNetCore.Mvc;
using Nwc.XmlRpc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
namespace IoTDameon.Controllers
{
public class HomeController : Controller
{
private IHttpClientFactory _httpClientFactory;
public HomeController(IHttpClientFactory httpClientFactory)
{
_httpClientFactory = httpClientFactory;
}
public IActionResult Index()
{
var client = new XmlRpcRequest();
client.MethodName = "supervisor.getState";
try
{
Console.WriteLine("Request: " + client);
var response = client.Send("http://usr:pwd@iot.edusoa.com:9001/RPC2");
Console.WriteLine("Response: " + response);
}
catch (Exception ex)
{
return Content(ex.ToString());
}
return Content("");
}
}
}

@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.1.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="XmlRpcCore" Version="3.1.2.77" />
<PackageReference Include="XmlRpcCS" Version="2.1.1.2" />
</ItemGroup>
</Project>

@ -0,0 +1,35 @@
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Serilog;
using System;
using System.IO;
using System.Text;
namespace IoTDameon
{
public class Program
{
public static void Main(string[] args)
{
Console.OutputEncoding = Encoding.UTF8;
var config = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json", optional: true)
.Build();
WebHost.CreateDefaultBuilder(args)
.UseConfiguration(config)
.ConfigureLogging((c, o) =>
{
Log.Logger = new LoggerConfiguration()
.ReadFrom.Configuration(config)
.WriteTo.Console()
.WriteTo.File("logs/log.txt", rollOnFileSizeLimit: true, fileSizeLimitBytes: 100 * 1024 * 1024, rollingInterval: RollingInterval.Infinite)
.CreateLogger();
o.AddSerilog();
})
.UseStartup<Startup>()
.Build()
.Run();
}
}
}

@ -0,0 +1,27 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:8003",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IoTDameon": {
"commandName": "Project",
"launchBrowser": true,
"applicationUrl": "http://localhost:8003",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

@ -0,0 +1,63 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System;
namespace IoTDameon
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
private readonly string _origins = "AllowAllHeaders";
public IConfiguration Configuration { get; }
public void ConfigureServices(IServiceCollection services)
{
services.AddCors(options => options.AddPolicy(_origins,
builder =>
{
builder.SetIsOriginAllowed(o => true).AllowAnyMethod().AllowAnyHeader().AllowCredentials();
})
);
services.AddHttpClient();
services.AddControllersWithViews();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Error");
}
string basePath = this.Configuration.GetValue<String>("BasePath", "");
app.UsePathBase(basePath);
app.UseCors(_origins);
app.UseStaticFiles();
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
});
}
}
}

@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
}
}

@ -0,0 +1,11 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"server.urls": "http://*:8003"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

@ -13,7 +13,7 @@
<PackageReference Include="Hangfire.Core" Version="1.7.12" />
<PackageReference Include="Hangfire.AspNetCore" Version="1.7.12" />
<PackageReference Include="Hangfire.LiteDB" Version="0.3.1" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="3.1.6" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="3.1.7" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Infrastructure\Infrastructure.csproj" />

@ -1,4 +1,4 @@
using System.Reflection;
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0814d1")]
[assembly: AssemblyInformationalVersion("1.0.0.0818d1")]

@ -6,6 +6,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="3.1.6" />
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="3.1.7" />
</ItemGroup>
</Project>

@ -6,6 +6,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="3.1.6" />
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="3.1.7" />
</ItemGroup>
</Project>

@ -42,6 +42,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebSPA", "WebSPA\WebSPA.csp
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JobServer", "JobServer\JobServer.csproj", "{6E2766D8-9ECF-469E-8662-A20F673E52CC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IoTDameon", "IoTDameon\IoTDameon.csproj", "{60596088-3C4E-4EA2-933A-B66CD269845B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -160,6 +162,18 @@ Global
{6E2766D8-9ECF-469E-8662-A20F673E52CC}.Release|iPhone.Build.0 = Release|Any CPU
{6E2766D8-9ECF-469E-8662-A20F673E52CC}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{6E2766D8-9ECF-469E-8662-A20F673E52CC}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{60596088-3C4E-4EA2-933A-B66CD269845B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{60596088-3C4E-4EA2-933A-B66CD269845B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{60596088-3C4E-4EA2-933A-B66CD269845B}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{60596088-3C4E-4EA2-933A-B66CD269845B}.Debug|iPhone.Build.0 = Debug|Any CPU
{60596088-3C4E-4EA2-933A-B66CD269845B}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{60596088-3C4E-4EA2-933A-B66CD269845B}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{60596088-3C4E-4EA2-933A-B66CD269845B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{60596088-3C4E-4EA2-933A-B66CD269845B}.Release|Any CPU.Build.0 = Release|Any CPU
{60596088-3C4E-4EA2-933A-B66CD269845B}.Release|iPhone.ActiveCfg = Release|Any CPU
{60596088-3C4E-4EA2-933A-B66CD269845B}.Release|iPhone.Build.0 = Release|Any CPU
{60596088-3C4E-4EA2-933A-B66CD269845B}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{60596088-3C4E-4EA2-933A-B66CD269845B}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -174,9 +188,10 @@ Global
{C66B39B3-D863-4651-99CD-74104CA65C47} = {11BCB5F9-0020-463A-92FB-BC25E2A0BF75}
{6F839910-580D-4CD1-A0C0-6FAF542B4480} = {11BCB5F9-0020-463A-92FB-BC25E2A0BF75}
{6E2766D8-9ECF-469E-8662-A20F673E52CC} = {E1681DC3-9AC2-4FF6-B3DE-37EF826E6F8A}
{60596088-3C4E-4EA2-933A-B66CD269845B} = {AE34E06D-C5C7-44BC-B168-85808318516C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0B7095FB-5E70-4EF8-805A-CB4A91AE4B0A}
BuildVersion_StartDate = 2000/1/1
SolutionGuid = {0B7095FB-5E70-4EF8-805A-CB4A91AE4B0A}
EndGlobalSection
EndGlobal

@ -11,8 +11,8 @@ Remove-Item ./dist/linux-x64/publish/apps/srs/objs/nginx/html/live/*.png -recurs
Remove-Item ./dist/linux-x64/publish/apps/srs/objs/nginx/html/live/*.m3u8 -recurse -force
Remove-Item ./dist/linux-x64/publish/apps/srs/objs/nginx/html/live/*.ts -recurse -force
Copy-Item ../projects/WebMVC/wwwroot ./dist/linux-x64/publish/apps/WebMVC/wwwroot -recurse
Copy-Item ../projects/WebSPA/wwwroot ./dist/linux-x64/publish/apps/WebSPA/wwwroot -recurse
Copy-Item ../projects/WebMVC/wwwroot/* ./dist/linux-x64/publish/apps/WebMVC/wwwroot -recurse
Copy-Item ../projects/WebSPA/wwwroot/* ./dist/linux-x64/publish/apps/WebSPA/wwwroot -recurse
dotnet publish ../projects/UserCenter/UserCenter.csproj -c Release -r linux-x64 -o ../publish/dist/linux-x64/publish/apps/UserCenter
dotnet publish ../projects/JobServer/JobServer.csproj -c Release -r linux-x64 -o ../publish/dist/linux-x64/publish/apps/JobServer

@ -30,8 +30,8 @@ services:
volumes:
- ./docker/conf/website/nginx.conf:/etc/nginx/nginx.conf
- ./docker/log/website:/var/log/nginx
- ./apps/WebMVC/wwwroot:/usr/share/nginx/html/desktop
- ./apps/WebSPA/wwwroot:/usr/share/nginx/html/mobile
- ./apps/WebMVC/wwwroot:/root/nginx/html/desktop
- ./apps/WebSPA/wwwroot:/root/nginx/html/mobile
networks:
default:
ipv4_address: 172.172.0.10

@ -24,9 +24,9 @@ http {
server_name localhost;
location / {
root /usr/share/nginx/html/desktop;
root /root/nginx/html/desktop;
if ($http_user_agent ~* "(mobile|android|ipad|iphone|ipod|tablet)") {
root /usr/share/nginx/html/mobile;
root /root/nginx/html/mobile;
}
index index.html;
}

Loading…
Cancel
Save