diff --git a/.vs/IoTGateway/DesignTimeBuild/.dtbcache.v2 b/.vs/IoTGateway/DesignTimeBuild/.dtbcache.v2 index 7e72ed9..1975894 100644 Binary files a/.vs/IoTGateway/DesignTimeBuild/.dtbcache.v2 and b/.vs/IoTGateway/DesignTimeBuild/.dtbcache.v2 differ diff --git a/.vs/IoTGateway/project-colors.json b/.vs/IoTGateway/project-colors.json index aba7690..1ae7f3b 100644 --- a/.vs/IoTGateway/project-colors.json +++ b/.vs/IoTGateway/project-colors.json @@ -145,7 +145,12 @@ "ProjectGuid": "44619988-9f09-4714-9532-a44faf8275fe", "DisplayName": "IoTGateway.Model", "ColorIndex": 11 + }, + "27ff2d65-0bba-4c69-9dd7-311a4f21541e": { + "ProjectGuid": "27ff2d65-0bba-4c69-9dd7-311a4f21541e", + "DisplayName": "IoTGateway.DataAccess", + "ColorIndex": 12 } }, - "NextColorIndex": 12 + "NextColorIndex": 13 } \ No newline at end of file diff --git a/.vs/IoTGateway/v17/.futdcache.v1 b/.vs/IoTGateway/v17/.futdcache.v1 index f436e5a..7707981 100644 Binary files a/.vs/IoTGateway/v17/.futdcache.v1 and b/.vs/IoTGateway/v17/.futdcache.v1 differ diff --git a/.vs/IoTGateway/v17/.suo b/.vs/IoTGateway/v17/.suo index de2649d..ff962f4 100644 Binary files a/.vs/IoTGateway/v17/.suo and b/.vs/IoTGateway/v17/.suo differ diff --git a/.vs/IoTGateway/v17/fileList.bin b/.vs/IoTGateway/v17/fileList.bin index 1a24094..c8f2853 100644 Binary files a/.vs/IoTGateway/v17/fileList.bin and b/.vs/IoTGateway/v17/fileList.bin differ diff --git a/IoTGateway.Model/Common.cs b/IoTGateway.Model/Common.cs index 91952c9..10596fa 100644 --- a/IoTGateway.Model/Common.cs +++ b/IoTGateway.Model/Common.cs @@ -20,8 +20,10 @@ namespace IoTGateway.Model public enum DataSide { + [Display(Name ="共享属性")] AnySide=0, //ServerSide=1, - ClientSide=2, + [Display(Name = "客户端属性")] + ClientSide =2, } } \ No newline at end of file diff --git a/IoTGateway.ViewModel/Rpc/RpcLogVMs/RpcLogListVM.cs b/IoTGateway.ViewModel/Rpc/RpcLogVMs/RpcLogListVM.cs index 364b8f6..8e6d762 100644 --- a/IoTGateway.ViewModel/Rpc/RpcLogVMs/RpcLogListVM.cs +++ b/IoTGateway.ViewModel/Rpc/RpcLogVMs/RpcLogListVM.cs @@ -19,10 +19,10 @@ namespace IoTGateway.ViewModel.Rpc.RpcLogVMs { //this.MakeStandardAction("RpcLog", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"Rpc", dialogWidth: 800), //this.MakeStandardAction("RpcLog", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "Rpc", dialogWidth: 800), - //this.MakeStandardAction("RpcLog", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "Rpc", dialogWidth: 800), - //this.MakeStandardAction("RpcLog", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "Rpc", dialogWidth: 800), + this.MakeStandardAction("RpcLog", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "Rpc", dialogWidth: 800), + this.MakeStandardAction("RpcLog", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "Rpc", dialogWidth: 800), //this.MakeStandardAction("RpcLog", GridActionStandardTypesEnum.BatchEdit, Localizer["Sys.BatchEdit"], "Rpc", dialogWidth: 800), - //this.MakeStandardAction("RpcLog", GridActionStandardTypesEnum.BatchDelete, Localizer["Sys.BatchDelete"], "Rpc", dialogWidth: 800), + this.MakeStandardAction("RpcLog", GridActionStandardTypesEnum.BatchDelete, Localizer["Sys.BatchDelete"], "Rpc", dialogWidth: 800), //this.MakeStandardAction("RpcLog", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "Rpc", dialogWidth: 800), this.MakeStandardAction("RpcLog", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "Rpc"), }; @@ -33,12 +33,12 @@ namespace IoTGateway.ViewModel.Rpc.RpcLogVMs { return new List>{ this.MakeGridHeader(x => x.RpcSide), - this.MakeGridHeader(x => x.StartTime), + this.MakeGridHeader(x => x.StartTime).SetWidth(150), + this.MakeGridHeader(x => x.Duration), this.MakeGridHeader(x => x.DeviceName_view), this.MakeGridHeader(x => x.Method), this.MakeGridHeader(x => x.Params), - this.MakeGridHeader(x => x.EndTime), - this.MakeGridHeader(x => x.IsSuccess), + this.MakeGridHeader(x => x.IsSuccess).SetHeader("是否成功"), this.MakeGridHeader(x => x.Description), this.MakeGridHeaderAction(width: 200) }; @@ -68,13 +68,34 @@ namespace IoTGateway.ViewModel.Rpc.RpcLogVMs .OrderByDescending(x => x.StartTime); return query; } + public override void AfterDoSearcher() + { + foreach (var entity in EntityList) + { + try + { + TimeSpan ts1 = new TimeSpan(((DateTime)entity.StartTime).Ticks); + TimeSpan ts2 = new TimeSpan(((DateTime)entity.EndTime).Ticks); + TimeSpan ts = ts1.Subtract(ts2).Duration(); + entity.Duration = Math.Round(ts.TotalMilliseconds, 2); + } + catch (Exception) + { + + } + } + base.AfterDoSearcher(); + } } + public class RpcLog_View : RpcLog { [Display(Name = "设备名")] public String DeviceName_view { get; set; } + [Display(Name = "持续时间(ms)")] + public double Duration { get; set; } } } diff --git a/IoTGateway/Areas/Config/Views/SystemConfig/Index.cshtml b/IoTGateway/Areas/Config/Views/SystemConfig/Index.cshtml index cdc3ba1..527b61c 100644 --- a/IoTGateway/Areas/Config/Views/SystemConfig/Index.cshtml +++ b/IoTGateway/Areas/Config/Views/SystemConfig/Index.cshtml @@ -5,5 +5,5 @@ -注意:目前只实现了iotsharp和tb的遥测数据上传 +注意:目前实现了iotsharp和tb的遥测、属性上传以及RPC功能 diff --git a/IoTGateway/Areas/Rpc/Views/RpcLog/Index.cshtml b/IoTGateway/Areas/Rpc/Views/RpcLog/Index.cshtml index 2387d9c..907c677 100644 --- a/IoTGateway/Areas/Rpc/Views/RpcLog/Index.cshtml +++ b/IoTGateway/Areas/Rpc/Views/RpcLog/Index.cshtml @@ -11,4 +11,5 @@ +注意:不同平台的rpc的topic和payload均不同,后期教程会更新到http://iotgateway.net/ diff --git a/IoTGateway/IoTGateway.csproj b/IoTGateway/IoTGateway.csproj index c14d9b7..3c06bb9 100644 --- a/IoTGateway/IoTGateway.csproj +++ b/IoTGateway/IoTGateway.csproj @@ -27,6 +27,8 @@ + + diff --git a/IoTGateway/Views/Login/Login.cshtml b/IoTGateway/Views/Login/Login.cshtml index cd26215..759e23e 100644 --- a/IoTGateway/Views/Login/Login.cshtml +++ b/IoTGateway/Views/Login/Login.cshtml @@ -68,6 +68,10 @@
  • + + @*
  • diff --git a/IoTGateway/iotgateway.db b/IoTGateway/iotgateway.db index e856c9b..6ed324d 100644 Binary files a/IoTGateway/iotgateway.db and b/IoTGateway/iotgateway.db differ diff --git a/iotgateway.db b/iotgateway.db index e856c9b..6ed324d 100644 Binary files a/iotgateway.db and b/iotgateway.db differ