Skip to content

Commit

Permalink
优化rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
iioter committed Apr 13, 2022
1 parent 050ef66 commit 1c01495
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 9 deletions.
Binary file modified .vs/IoTGateway/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
7 changes: 6 additions & 1 deletion .vs/IoTGateway/project-colors.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Binary file modified .vs/IoTGateway/v17/.futdcache.v1
Binary file not shown.
Binary file modified .vs/IoTGateway/v17/.suo
Binary file not shown.
Binary file modified .vs/IoTGateway/v17/fileList.bin
Binary file not shown.
4 changes: 3 additions & 1 deletion IoTGateway.Model/Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ public enum AccessEnum

public enum DataSide
{
[Display(Name ="共享属性")]
AnySide=0,
//ServerSide=1,
ClientSide=2,
[Display(Name = "客户端属性")]
ClientSide =2,
}
}
33 changes: 27 additions & 6 deletions IoTGateway.ViewModel/Rpc/RpcLogVMs/RpcLogListVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ protected override List<GridAction> InitGridAction()
{
//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"),
};
Expand All @@ -33,12 +33,12 @@ protected override IEnumerable<IGridColumn<RpcLog_View>> InitGridHeader()
{
return new List<GridColumn<RpcLog_View>>{
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)
};
Expand Down Expand Up @@ -68,13 +68,34 @@ public override IOrderedQueryable<RpcLog_View> GetSearchQuery()
.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; }

}
}
2 changes: 1 addition & 1 deletion IoTGateway/Areas/Config/Views/SystemConfig/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
<wt:row items-per-row="ItemsPerRowEnum.Three">
</wt:row>
</wt:searchpanel>
<wt:quote>注意:目前只实现了iotsharp和tb的遥测数据上传</wt:quote>
<wt:quote>注意:目前实现了iotsharp和tb的遥测、属性上传以及RPC功能</wt:quote>
<wt:grid vm="@Model" url="/Config/SystemConfig/Search" />
1 change: 1 addition & 0 deletions IoTGateway/Areas/Rpc/Views/RpcLog/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
<wt:combobox field="Searcher.IsSuccess" empty-text="@Localizer["Sys.All"]" />
</wt:row>
</wt:searchpanel>
<wt:quote>注意:不同平台的rpc的topic和payload均不同,后期教程会更新到<a href="http://iotgateway.net/" target="_blank">http://iotgateway.net/</a></wt:quote>
<wt:grid vm="@Model" url="/Rpc/RpcLog/Search" hidden-checkbox="true" hidden-grid-index="true" />
2 changes: 2 additions & 0 deletions IoTGateway/IoTGateway.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
<ProjectReference Include="..\WalkingTec.Mvvm\WalkingTec.Mvvm.Mvc\WalkingTec.Mvvm.Mvc.csproj" />
<ProjectReference Include="..\WalkingTec.Mvvm\WalkingTec.Mvvm.TagHelpers.LayUI\WalkingTec.Mvvm.TagHelpers.LayUI.csproj" />
</ItemGroup>

<ProjectExtensions><VisualStudio><UserProperties appsettings_1json__JsonSchema="" /></VisualStudio></ProjectExtensions>
</Project>


4 changes: 4 additions & 0 deletions IoTGateway/Views/Login/Login.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@
<li>
<span class="login-error">@Model.MSD.GetFirstError()</span>
<button type="submit" class="login-button" style="cursor:pointer">@Model.Localizer["Login.Login"]</button>
<div class="login-button" style="cursor:pointer">
<a href="http://iotgateway.net/" target="_blank">跳转教程文档,持续更新,收藏不迷路</a>
</div>

@*<wt:linkbutton window-title="@Model.Localizer["Login.Register"]" class="login-button" style="cursor:pointer" target="ButtonTargetEnum.Layer" window-width="500" window-height="500" url="/Login/Reg" text="@Model.Localizer["Login.Register"]" />*@
</li>
</ul>
Expand Down
Binary file modified IoTGateway/iotgateway.db
Binary file not shown.
Binary file modified iotgateway.db
Binary file not shown.

0 comments on commit 1c01495

Please sign in to comment.