Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d6205b7
doc: 更新参数表格
ArgoZhang Jan 18, 2026
aa97c6b
Please provide the file changes to generate a commit message.
j4587698 Jan 19, 2026
a8add04
Merge branch 'main' into doc-comment
ArgoZhang Jan 19, 2026
50376ff
Revert "Please provide the file changes to generate a commit message."
ArgoZhang Jan 19, 2026
1d05aa5
Reapply "Please provide the file changes to generate a commit message."
ArgoZhang Jan 19, 2026
952c00e
refactor: 更新多语言
ArgoZhang Jan 19, 2026
e72df34
doc: 更新资源文件
ArgoZhang Jan 19, 2026
7f495ee
test: 更新单元测试
ArgoZhang Jan 19, 2026
ed2f693
test: 增加文件尾部新行
ArgoZhang Jan 20, 2026
17c4472
feat: 增加支持是否为组件参数
ArgoZhang Jan 20, 2026
dea6a7e
doc: 使用新方法自动生成参数说明
ArgoZhang Jan 20, 2026
da545f8
doc: 更新注释
ArgoZhang Jan 20, 2026
33635db
doc: 删除冗余多语言配置
ArgoZhang Jan 20, 2026
f2ee031
doc: 调整列宽
ArgoZhang Jan 20, 2026
4abbd05
refactor: 重构资源文件检查单元测试
ArgoZhang Jan 20, 2026
e38c7a7
feat: add BootstrapBlazor.Term sample page and menu integration
j4587698 Jan 20, 2026
94ec3a1
Merge branch 'main' into feat-term
ArgoZhang Jan 20, 2026
4a39883
Merge branch 'main' into feat-term
ArgoZhang Jan 23, 2026
2abc1d3
chore: 增加 term 路由配置信息
ArgoZhang Jan 23, 2026
e407a84
doc: 更新示例
ArgoZhang Jan 23, 2026
ae82cfe
doc: 更新项目依赖
ArgoZhang Jan 23, 2026
f631455
wip: 临时提交
ArgoZhang Jan 23, 2026
01a7ba2
Merge branch 'main' into feat-term
ArgoZhang Jan 23, 2026
49f5bde
doc: 更新示例文档
ArgoZhang Jan 23, 2026
573e100
chore: 增加依赖
ArgoZhang Jan 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
<PackageReference Include="BootstrapBlazor.SummerNote" Version="10.0.2" />
<PackageReference Include="BootstrapBlazor.TableExport" Version="10.0.1" />
<PackageReference Include="BootstrapBlazor.Tasks.Dashboard" Version="10.0.0" />
<PackageReference Include="BootstrapBlazor.Term" Version="10.0.0" />
<PackageReference Include="BootstrapBlazor.Topology" Version="10.0.0" />
<PackageReference Include="BootstrapBlazor.UniverIcon" Version="10.0.0" />
<PackageReference Include="BootstrapBlazor.UniverSheet" Version="10.0.8" />
Expand Down
32 changes: 32 additions & 0 deletions src/BootstrapBlazor.Server/Components/Samples/Terms.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
@page "/term"
@using Microsoft.AspNetCore.Components.Sections
@inject IStringLocalizer<Terms> Localizer

<h3>@Localizer["Title"]</h3>
<h4>@Localizer["SubTitle"]</h4>

<Tips>
<p>@((MarkupString)Localizer["Tips"].Value)</p>
</Tips>

<DemoBlock Title="@Localizer["BasicUsageTitle"]" Introduction="@Localizer["BasicUsageIntro"]" Name="Normal">
<section ignore>
<div>@((MarkupString)Localizer["TermDesc"].Value)</div>
</section>
<Term @ref="_term" OnReceivedAsync="OnReceivedAsync" />
<section ignore>
<div class="col-12">
<Button OnClickWithoutRender="OnCheck">@Localizer["CheckText"]</Button>
<Button OnClickWithoutRender="OnTest">@Localizer["TestText"]</Button>
<Button OnClickWithoutRender="OnClean">@Localizer["CleanText"]</Button>
</div>
</section>
</DemoBlock>

<DemoBlock Title="@Localizer["StreamUsageTitle"]" Introduction="@Localizer["StreamUsageIntro"]" Name="Stream">
<Term @ref="_termStream" />
</DemoBlock>

<AttributeTable Type="typeof(Term)"></AttributeTable>

<AttributeTable Type="typeof(TermOptions)"></AttributeTable>
89 changes: 89 additions & 0 deletions src/BootstrapBlazor.Server/Components/Samples/Terms.razor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
using System.Text;

namespace BootstrapBlazor.Server.Components.Samples;

/// <summary>
/// Term 示例
/// </summary>
public partial class Terms : IDisposable
{
private Term _term = default!;
private Term _termStream = default!;
private MemoryStream _ms = new MemoryStream();
private CancellationTokenSource? _cancellationTokenSource;

private async Task OnReceivedAsync(byte[] data)
{
var str = System.Text.Encoding.UTF8.GetString(data);
await _term.Write(str.Replace("\r", "\r\n"));
}

private async Task OnCheck()
{
await _term.WriteLine($"Check\r\n{DateTime.Now}");
}

private async Task OnTest()
{
await _term.WriteLine($"Test\r\n{DateTime.Now}");
}

private async Task OnClean()
{
await _term.Clear();
}

/// <summary>
/// <inheritdoc/>
/// </summary>
/// <param name="firstRender"></param>
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
await _termStream.Open(_ms);

_ = Task.Run(async () =>
{
_cancellationTokenSource ??= new();
while (_cancellationTokenSource is { IsCancellationRequested: false })
{
try
{
// 模拟流内数据变化
_ms.SetLength(0);
await _ms.WriteAsync(Encoding.UTF8.GetBytes($"{DateTime.Now}\r\n"), _cancellationTokenSource.Token);
_ms.Seek(0, SeekOrigin.Begin);
await Task.Delay(2000);
}
catch { }
}
});
}
}

private void Dispose(bool disposing)
{
if (disposing)
{
if (_cancellationTokenSource is { IsCancellationRequested: false })
{
_cancellationTokenSource.Cancel();
_cancellationTokenSource.Dispose();
_cancellationTokenSource = null;
}

_ms.Close();
_ms.Dispose();
}
}

/// <summary>
/// <inheritdoc/>
/// </summary>
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1406,6 +1406,11 @@ void AddNotice(DemoMenuItem item)
Url = "sweet-alert"
},
new()
{
Text = Localizer["Terms"],
Url = "term"
},
new()
{
Text = Localizer["Timer"],
Url = "timer"
Expand Down
14 changes: 14 additions & 0 deletions src/BootstrapBlazor.Server/Locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@
"Tag": "Tag",
"TaskDashBoard": "TaskDashBoard",
"TcpSocketFactory": "ITcpSocketFactory",
"Terms": "Terminal",
"Textarea": "Textarea",
"Theme": "Theme",
"ThemeProvider": "IThemeProvider",
Expand Down Expand Up @@ -5306,6 +5307,19 @@
"TaskBoardNormalTitle": "Basic usage",
"TaskBoardTitle": "Task DashBoard"
},
"BootstrapBlazor.Server.Components.Samples.Terms": {
"BasicUsageIntro": "Output text by calling the <code>Write</code> method",
"BasicUsageTitle": "Basic Usage",
"CheckText": "Check",
"CleanText": "Clean",
"StreamUsageIntro": "Connect various streams by calling the <code>Open</code> method, this example simulates <b>Shell</b> and verifies input characters",
"StreamUsageTitle": "Stream Usage",
"SubTitle": "Terminal Component",
"TermDesc": "The <code>Term</code> component is a terminal component that establishes a connection with the stream via <code>C#</code> code. The <code>Term</code> component is then responsible for displaying interactive content. In this example, after establishing a connection with a simulated <code>Stream</code> instance in the backend, data is automatically displayed within the component when it is written. When the user enters a command within the component and presses Enter, the backend processes it and displays the result in the component.",
"TestText": "Test",
"Tips": "This component depends on the <code>BootstrapBlazor.Term</code> extension package. You need to reference it as follows",
"Title": "Terminal"
},
"BootstrapBlazor.Server.Components.Samples.TextAreas": {
"TextAreaAutoScroll": "Automatic scrolling",
"TextAreaBindWayBindValue": "The binding value",
Expand Down
14 changes: 14 additions & 0 deletions src/BootstrapBlazor.Server/Locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@
"Tag": "标签 Tag",
"TaskDashBoard": "任务管理器 TaskDashBoard",
"TcpSocketFactory": "套接字服务 ITcpSocketFactory",
"Terms": "终端 Terminal",
"Textarea": "多行文本框 Textarea",
"Theme": "组件主题",
"ThemeProvider": "主题服务 IThemeProvider",
Expand Down Expand Up @@ -5306,6 +5307,19 @@
"TaskBoardNormalTitle": "基本用法",
"TaskBoardTitle": "Task DashBoard 任务管理器"
},
"BootstrapBlazor.Server.Components.Samples.Terms": {
"BasicUsageIntro": "通过调用 <code>Write</code> 方法输出文本",
"BasicUsageTitle": "基础用法",
"CheckText": "查询命令(Check)",
"CleanText": "清空",
"StreamUsageIntro": "通过调用 <code>Open</code> 方法连接各种流,本例模拟 <b>Shell</b> 并回显输入字符",
"StreamUsageTitle": "流式处理",
"SubTitle": "命令行终端显示组件",
"TermDesc": "<code>Term</code> 组件是一个终端组件,通过 <code>C#</code> 代码与流建立联系,然后组件 <code>Term</code> 负责显示交互内容;本例中,与后台一个模拟 <code>Stream</code> 实例建立联系后,当有数据写入时自动显示在组件内,用户在组件内录入命令回车后,由后端处理回显在组件中",
"TestText": "测试命令 (Test)",
"Tips": "本组件依赖 <code>BootstrapBlazor.Term</code> 扩展包,需要依照下面步骤进行引用",
"Title": "Term 命令行"
},
"BootstrapBlazor.Server.Components.Samples.TextAreas": {
"TextAreaAutoScroll": "自动滚屏",
"TextAreaBindWayBindValue": "绑定值",
Expand Down
3 changes: 2 additions & 1 deletion src/BootstrapBlazor.Server/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@
"select-city": "SelectCities",
"select-province": "SelectProvinces",
"hik-vision": "HikVisions",
"embed-pdf": "EmbedPDFs"
"embed-pdf": "EmbedPDFs",
"term": "Terms"
},
"video": {
"table": "BV1ap4y1x7Qn?p=1",
Expand Down