Skip to content

Commit 0941dbf

Browse files
committed
doc: 增加菜单
1 parent fc90832 commit 0941dbf

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

src/BootstrapBlazor.Server/Extensions/MenusLocalizerExtensions.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// See the LICENSE file in the project root for more information.
44
// Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone
55

6+
using Longbow.SerialPorts;
67
using Microsoft.AspNetCore.Components.Routing;
78

89
namespace BootstrapBlazor.Server.Extensions;
@@ -97,6 +98,13 @@ public static List<MenuItem> GenerateMenus(this IStringLocalizer<NavMenu> Locali
9798
};
9899
AddModbus(item);
99100

101+
item = new DemoMenuItem()
102+
{
103+
Text = Localizer["SerialPortComponents"],
104+
Icon = "fa-fw fa-solid fa-satellite-dish text-danger"
105+
};
106+
AddSerialPort(item);
107+
100108
item = new DemoMenuItem()
101109
{
102110
Text = Localizer["Services"],
@@ -266,6 +274,21 @@ void AddModbus(DemoMenuItem item)
266274
AddBadge(item, count: 2);
267275
}
268276

277+
void AddSerialPort(DemoMenuItem item)
278+
{
279+
item.Items = new List<DemoMenuItem>
280+
{
281+
new()
282+
{
283+
IsNew = true,
284+
Text = Localizer["SerialPortFactory"],
285+
Url = "serial-port-factory"
286+
}
287+
};
288+
289+
AddBadge(item, count: 2);
290+
}
291+
269292
void AddQuickStar(DemoMenuItem item)
270293
{
271294
item.Items = new List<DemoMenuItem>

src/BootstrapBlazor.Server/Locales/en-US.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4862,7 +4862,9 @@
48624862
"SocketAutoConnect": "Reconnect",
48634863
"SocketDataEntity": "DataEntity",
48644864
"ModbusComponents": "Modbus Services",
4865+
"SerialPortComponents": "SerialPort Services",
48654866
"ModbusFactory": "IModbusFactory",
4867+
"SerialPortFactory": "ISerialPortFactory",
48664868
"NetworkMonitor": "Network Monitor",
48674869
"Toolbar": "Toolbar",
48684870
"OpcDaService": "OpcDaServer",

src/BootstrapBlazor.Server/Locales/zh-CN.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4860,9 +4860,11 @@
48604860
"SocketManualReceive": "手动接收数据",
48614861
"DataPackageAdapter": "数据适配器",
48624862
"SocketAutoConnect": "自动重连",
4863-
"SocketDataEntity": "通讯数据转实体类",
4863+
"SocketDataEntity": "通信数据转实体类",
48644864
"ModbusComponents": "串行通信协议 Modbus",
4865-
"ModbusFactory": "通讯服务 IModbusFactory",
4865+
"SerialPortComponents": "串行通信协议 SerialPort",
4866+
"ModbusFactory": "通信服务 IModbusFactory",
4867+
"SerialPortFactory": "通信服务 ISerialPortFactory",
48664868
"NetworkMonitor": "网络状态 NetworkMonitor",
48674869
"Toolbar": "工具栏 Toolbar",
48684870
"OpcDaService": "OpcDaServer 服务",

0 commit comments

Comments
 (0)