logo Enterprise-level component library based on Bootstrap and Blazor
gitee
oscs
version
license
download
repo
commit
build
coverage

Reconnector

Reflect the connection state in the UI (Blazor Server)

Usage

1. Add code in _Layout.cshtml

@RenderBody()

<div id="blazor-error-ui">
</div>

// add ReconnectorOutlet component
<component type="typeof(ReconnectorOutlet)" param-AutoReconnect="true" render-mode="ServerPrerendered" />

组件参数 AutoReconnect 用于控制是否开启网络重连,默认 true 已开启,可以通过 param-AutoReconnect="false" 关闭

2. Add code in App.razor

<Reconnector>
    <ReconnectingTemplate>
        <p>连接出现了一点小问题,需要重新连接。</p>
        <p>重新连接中,请稍后... 也可以立即 <a href="javascript:location.reload()">重新加载</a></p>
    </ReconnectingTemplate>
    <ReconnectFailedTemplate>
        <p>连接失败了,请确认网络是否正常。</p>
        <p>
            如果网络正常,你可以<a href="javascript:window.Blazor.reconnect()">重新连接</a>
            或者立即 <a href="javascript:location.reload()">重新加载</a>
        </p>
    </ReconnectFailedTemplate>
    <ReconnectRejectedTemplate>
        <p>所有的连接尝试都被拒绝了,这很有可能是由于网络问题或者服务器问题引起的。</p>
        <p>您可以尝试<a href="javascript:location.reload()">重新加载</a>服务器。如果是由于服务器问题引起的失败,重新连接可能不成功</p>
    </ReconnectRejectedTemplate>
</Reconnector>

Template

  • ReconnectingTemplate attempting to reconnect
  • ReconnectFailedTemplate reconnection failed
  • ReconnectRejectedTemplate reconnection rejected

The following table describes the CSS classes applied to the components-reconnect-modal element by the Blazor framework.

CSS class Indicates
components-reconnect-show A lost connection. The client is attempting to reconnect. Show the modal.
components-reconnect-hide An active connection is re-established to the server. Hide the modal.
components-reconnect-failed Reconnection failed, probably due to a network failure. To attempt reconnection, call window.Blazor.reconnect() in JavaScript.
components-reconnect-rejected
Reconnection rejected. The server was reached but refused the connection, and the user's state on the server is lost. To reload the app, call location.reload() in JavaScript. This connection state may result when:
  • A crash in the server-side circuit occurs.
  • The client is disconnected long enough for the server to drop the user's state. Instances of the user's components are disposed.
  • The server is restarted, or the app's worker process is recycled.

Application

本网站使用 Reconnector 已实现三种状态的模板,代码如下:

1. ReconnectingTemplate 模板
Bootstrap Blazor UI 组件库
基于 Bootstrap 样式的 Blazor UI 组件库
适配移动端支持各种主流浏览器,适配 ABP,同时支持 NET5/NET6,交流群 795206915
已提供项目模板方便快速上手 项目模板
Reconnector 组件
正在尝试重新连接服务器
服务器正在更新新版本,稍等一会儿即可提供服务,或者 F12 打开 Developer tools 查看 控制台 是否有错误输出,请加群与管理员联系
<ReconnectingTemplate>
    <div class="connection-mask"></div>
    <div class="connection-body">
        <div class="row g-3">
            <div class="col-12 col-sm-5">
                <h5>Bootstrap Blazor UI 组件库</h5>
                <div class="d-flex">
                    <div class="flex-fill">
                        <div class="mb-2">基于 <b>Bootstrap</b> 样式的 <b>Blazor UI</b> 组件库</div>
                        <div class="mb-2">适配移动端支持各种主流浏览器,适配 <b>ABP</b>,同时支持 <b>NET5/NET6</b>,交流群 <b>795206915</b></div>
                        <div>已提供项目模板方便快速上手 <a class="connection-link" href="https://gitee.com/LongbowEnterprise/BootstrapBlazor/wikis/%E9%A1%B9%E7%9B%AE%E6%A8%A1%E6%9D%BF%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B">项目模板</a></div>
                    </div>
                    <div class="connection-body-tail d-none d-sm-block"></div>
                </div>
            </div>
            <div class="col-12 col-sm-5">
                <h5>Reconnector 组件</h5>
                <div class="mb-2"><b>正在尝试重新连接服务器</b></div>
                <div class="mb-2">服务器正在更新新版本,稍等一会儿即可提供服务,或者 <kbd>F12</kbd> 打开 <b>Developer tools</b> 查看 <b>控制台</b> 是否有错误输出,请加群与管理员联系</div>
            </div>
            <div class="col-12 col-sm-2">
                <div class="d-flex align-items-center justify-content-center h-100">
                    <a href="javascript:window.Blazor.reconnect()" class="btn btn-primary">重新连接</a>
                </div>
            </div>
        </div>
    </div>
</ReconnectingTemplate>
2. ReconnectFailedTemplate 模板
Bootstrap Blazor UI 组件库
基于 Bootstrap 样式的 Blazor UI 组件库
适配移动端支持各种主流浏览器,适配 ABP,同时支持 NET5/NET6,交流群 795206915
已提供项目模板方便快速上手 项目模板
Reconnector 组件
与服务器连接失败
请确认网络是否正常,或者 F12 打开 Developer tools 查看 控制台 是否有错误输出,请加群与管理员联系
<ReconnectFailedTemplate>
    <div class="connection-mask"></div>
    <div class="connection-body">
        <div class="row g-3">
            <div class="col-12 col-sm-5">
                <h5>Bootstrap Blazor UI 组件库</h5>
                <div class="d-flex">
                    <div class="flex-fill">
                        <div class="mb-2">基于 <b>Bootstrap</b> 样式的 <b>Blazor UI</b> 组件库</div>
                        <div class="mb-2">适配移动端支持各种主流浏览器,适配 <b>ABP</b>,同时支持 <b>NET5/NET6</b>,交流群 <b>795206915</b></div>
                        <div>已提供项目模板方便快速上手 <a class="connection-link" href="https://gitee.com/LongbowEnterprise/BootstrapBlazor/wikis/%E9%A1%B9%E7%9B%AE%E6%A8%A1%E6%9D%BF%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B">项目模板</a></div>
                    </div>
                    <div class="connection-body-tail d-none d-sm-block"></div>
                </div>
            </div>
            <div class="col-12 col-sm-5">
                <h5>Reconnector 组件</h5>
                <div class="mb-2"><b>与服务器连接失败</b></div>
                <div class="mb-2">请确认网络是否正常,或者 <kbd>F12</kbd> 打开 <b>Developer tools</b> 查看 <b>控制台</b> 是否有错误输出,请加群与管理员联系</div>
            </div>
            <div class="col-12 col-sm-2">
                <div class="d-flex flex-column align-items-center justify-content-center h-100">
                    <a href="javascript:window.Blazor.reconnect()" class="btn btn-primary mb-2">重新连接</a>
                    <a href="javascript:location.reload()" class="btn btn-info">重新加载</a>
                </div>
            </div>
        </div>
    </div>
</ReconnectFailedTemplate>
3. ReconnectRejectedTemplate 模板
Bootstrap Blazor UI 组件库
基于 Bootstrap 样式的 Blazor UI 组件库
适配移动端支持各种主流浏览器,适配 ABP,同时支持 NET5/NET6,交流群 795206915
已提供项目模板方便快速上手 项目模板
Reconnector 组件
服务器拒绝连接
所有的连接尝试都被拒绝了,这很有可能是由于网络问题或者服务器问题引起的,请加群与管理员联系
<ReconnectRejectedTemplate>
    <div class="connection-mask"></div>
    <div class="connection-body">
        <div class="row g-3">
            <div class="col-12 col-sm-5">
                <h5>Bootstrap Blazor UI 组件库</h5>
                <div class="d-flex">
                    <div class="flex-fill">
                        <div class="mb-2">基于 <b>Bootstrap</b> 样式的 <b>Blazor UI</b> 组件库</div>
                        <div class="mb-2">适配移动端支持各种主流浏览器,适配 <b>ABP</b>,同时支持 <b>NET5/NET6</b>,交流群 <b>795206915</b></div>
                        <div>已提供项目模板方便快速上手 <a class="connection-link" href="https://gitee.com/LongbowEnterprise/BootstrapBlazor/wikis/%E9%A1%B9%E7%9B%AE%E6%A8%A1%E6%9D%BF%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B">项目模板</a></div>
                    </div>
                    <div class="connection-body-tail d-none d-sm-block"></div>
                </div>
            </div>
            <div class="col-12 col-sm-5">
                <h5>Reconnector 组件</h5>
                <div class="mb-2"><b>服务器拒绝连接</b></div>
                <div class="mb-2">所有的连接尝试都被拒绝了,这很有可能是由于网络问题或者服务器问题引起的,请加群与管理员联系</div>
            </div>
            <div class="col-12 col-sm-2">
                <div class="d-flex flex-column align-items-center justify-content-center h-100">
                    <a href="javascript:location.reload()" class="btn btn-info">重新加载</a>
                </div>
            </div>
        </div>
    </div>
</ReconnectRejectedTemplate>

Attributes

Loading...

B station related video link

交流群

QQ Group:BootstrapAdmin & Blazor 795206915 675147445 Welcome to join the group discussion
img
Themes
Bootstrap
Motronic
Ant Design (完善中)
DevUI (制作中)
LayUI (完善中)
An error has occurred. This application may no longer respond until reloaded. Reload
Seems like the connection with the server has been lost. It can be due to poor or broken network. Please hang on while we're trying to reconnect...
Oh snap! Failed to reconnect with the server. This is typically caused by a longer network outage, or if the server has been taken down. You can try to reconnect, but if that does not work, you need to reload the page.
Oh man! The server rejected the attempt to reconnect. The only option now is to reload the page, but be prepared that it won't work, since this is typically caused by a failure on the server.
Bootstrap Blazor Component library updated to 7.4.4-beta01

Bootstrap Blazor at present has more than 120 components. This component is based on Bootstrap Blazor An enterprise-level component library that provides several types of common components such as layout, navigation, form, data, notification, icon, voice, etc. Each component has been carefully designed with modularity, responsiveness and excellent performance. Starting from more practical scenarios, meeting the needs of various scenarios, greatly reducing the time cost of developers, greatly shortening the development cycle, greatly improving development efficiency, and providing a set of General Rights Management System Example project。Bootstrap Blazor Products are maintained by a professional full-time technical team, with efficient response speed, diversified solutions, long-term support, and enterprise-level support. At present, it has been used in many well-known state-owned enterprises, and the project is running stably with a maximum of 1200 people online. On the right is the QR code of the Chinese Blazor QQ community with the largest number of people in China, welcome to scan and join the group.

component updated to 6.6.0 Change log [portal] If the component brings you convenience, please help to light up the project Star github gitee

QQGroup
QQ 795206915