Former-commit-id: 3e0fd4796988e7e5a7b51e743b3d05b952aa2a6c
TangShanKaiPing
wanggang 5 years ago
parent 65f09bcbfe
commit 5b4e01d943

@ -522,6 +522,10 @@ namespace IoTNode.DeviceServices.FBee
deviceName = "三路开关"; deviceName = "三路开关";
deviceIcon = "switch3"; deviceIcon = "switch3";
} }
else
{
deviceName = null;
}
} }
if (string.IsNullOrEmpty(deviceName)) if (string.IsNullOrEmpty(deviceName))
{ {

@ -1,7 +1,9 @@
using Hangfire; using Application.Domain.Entities;
using Hangfire;
using Hangfire.LiteDB; using Hangfire.LiteDB;
using Infrastructure.Data; using Infrastructure.Data;
using Infrastructure.Email; using Infrastructure.Email;
using Infrastructure.Extensions;
using Infrastructure.Web; using Infrastructure.Web;
using IoT.Shared.Services; using IoT.Shared.Services;
using IoTNode.DeviceServices.FBee; using IoTNode.DeviceServices.FBee;
@ -10,9 +12,11 @@ using IoTNode.DeviceServices.SerialPortManager;
using IoTNode.Services; using IoTNode.Services;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using System.Linq;
namespace IoTNode namespace IoTNode
{ {
@ -47,6 +51,12 @@ namespace IoTNode
public override void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) public override void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
{ {
base.Configure(app, env, loggerFactory); base.Configure(app, env, loggerFactory);
using var scope = app.ApplicationServices.CreateScope();
var services = scope.ServiceProvider;
var context = services.GetService<DbContext>();
var node = context.Set<Node>().FirstOrDefault();
node.Version = Helper.Instance.GetVersion();
context.SaveChanges();
var options = new DashboardOptions var options = new DashboardOptions
{ {

Loading…
Cancel
Save