Add fallback UI, HTTP warning, and disable Wasm native builds
Added a fallback UI in `App.razor` to handle startup failures, including a message for unsupported browsers and a reload button. Updated `blazor.web.js` to use `autostart="false"` and added JavaScript for error handling. Introduced an HTTP warning in `LoginReceiverPage.razor` to alert users when using an unencrypted connection. Added the `IsSecureRequest` property to determine if the request is secure. Disabled native WebAssembly builds by setting `<WasmBuildNative>` to `false` in `EnvelopeGenerator.Server.Client.csproj` and `publish.bat`. Incremented version numbers in `EnvelopeGenerator.Server.csproj` to `1.11.0-beta`. Added new CSS classes for styling the fallback UI.
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
|
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
|
||||||
<StaticWebAssetProjectMode>Default</StaticWebAssetProjectMode>
|
<StaticWebAssetProjectMode>Default</StaticWebAssetProjectMode>
|
||||||
<WasmBuildNative>true</WasmBuildNative>
|
<WasmBuildNative>false</WasmBuildNative>
|
||||||
<InvariantGlobalization>false</InvariantGlobalization>
|
<InvariantGlobalization>false</InvariantGlobalization>
|
||||||
<BlazorWebAssemblyLoadAllGlobalizationData>true</BlazorWebAssemblyLoadAllGlobalizationData>
|
<BlazorWebAssemblyLoadAllGlobalizationData>true</BlazorWebAssemblyLoadAllGlobalizationData>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
@@ -29,6 +29,13 @@
|
|||||||
<p class="mb-0">@L("ReceiverLogin_InfoStep2", "Darin finden Sie den Zugangscode, den Sie hier eingeben müssen.")</p>
|
<p class="mb-0">@L("ReceiverLogin_InfoStep2", "Darin finden Sie den Zugangscode, den Sie hier eingeben müssen.")</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@if (!IsSecureRequest)
|
||||||
|
{
|
||||||
|
<div class="alert alert-warning py-2" role="alert" style="font-size:0.85rem;">
|
||||||
|
@L("ReceiverLogin_HttpWarning", "Sie verwenden derzeit eine unverschlüsselte HTTP-Verbindung. Bitte geben Sie Zugangsdaten nur in vertrauenswürdigen internen Netzwerken ein.")
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
@if (LoginResult == EnvelopeLoginResult.NotFound)
|
@if (LoginResult == EnvelopeLoginResult.NotFound)
|
||||||
{
|
{
|
||||||
<div class="alert alert-warning d-flex align-items-start gap-2 py-2" role="alert">
|
<div class="alert alert-warning d-flex align-items-start gap-2 py-2" role="alert">
|
||||||
@@ -173,12 +180,15 @@
|
|||||||
bool ShowCode;
|
bool ShowCode;
|
||||||
bool IsLoading;
|
bool IsLoading;
|
||||||
bool IsResending;
|
bool IsResending;
|
||||||
|
bool IsSecureRequest = true;
|
||||||
bool ResendRequestFailed;
|
bool ResendRequestFailed;
|
||||||
EnvelopeLoginResult? LoginResult;
|
EnvelopeLoginResult? LoginResult;
|
||||||
SendAccessCodeResult? ResendResult;
|
SendAccessCodeResult? ResendResult;
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
|
IsSecureRequest = Navigation.Uri.StartsWith("https://", StringComparison.OrdinalIgnoreCase);
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(EnvelopeKey))
|
if (string.IsNullOrWhiteSpace(EnvelopeKey))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -33,13 +33,67 @@
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<Routes />
|
<Routes />
|
||||||
|
<div id="sf-client-startup-fallback" class="sf-startup-fallback" hidden>
|
||||||
|
<div class="sf-startup-fallback__card" role="alert" aria-live="assertive">
|
||||||
|
<h2>Application could not start</h2>
|
||||||
|
<p>
|
||||||
|
Your browser or its current settings don't support required features.
|
||||||
|
Please update the browser or contact IT support.
|
||||||
|
</p>
|
||||||
|
<button type="button" class="btn btn-primary btn-sm" onclick="location.reload()">Reload</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<script src="_content/DevExpress.Blazor.Resources/js/preload-script.js"></script>
|
<script src="_content/DevExpress.Blazor.Resources/js/preload-script.js"></script>
|
||||||
<script src="js/typed.umd.js"></script>
|
<script src="js/typed.umd.js"></script>
|
||||||
<script src="js/receiver-signature.js?v=9"></script>
|
<script src="js/receiver-signature.js?v=9"></script>
|
||||||
<script src="js/signflow-theme.js"></script>
|
<script src="js/signflow-theme.js"></script>
|
||||||
<script src="js/envelope-editor.js"></script>
|
<script src="js/envelope-editor.js"></script>
|
||||||
<script src="_content/MudBlazor/MudBlazor.min.js"></script>
|
<script src="_content/MudBlazor/MudBlazor.min.js"></script>
|
||||||
<script src="_framework/blazor.web.js"></script>
|
<script src="_framework/blazor.web.js" autostart="false"></script>
|
||||||
|
<script>
|
||||||
|
(function () {
|
||||||
|
var started = false;
|
||||||
|
|
||||||
|
function showStartupFallback(reason) {
|
||||||
|
var root = document.getElementById('sf-client-startup-fallback');
|
||||||
|
if (!root) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (reason) {
|
||||||
|
console.error('Blazor startup failed:', reason);
|
||||||
|
}
|
||||||
|
|
||||||
|
root.hidden = false;
|
||||||
|
root.style.display = 'flex';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!window.WebAssembly || !window.Blazor || typeof window.Blazor.start !== 'function') {
|
||||||
|
showStartupFallback('Browser/runtime prerequisites are missing.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener('unhandledrejection', function (event) {
|
||||||
|
if (!started) {
|
||||||
|
showStartupFallback(event.reason);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
window.addEventListener('error', function (event) {
|
||||||
|
if (!started) {
|
||||||
|
showStartupFallback(event.error || event.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
window.Blazor.start({
|
||||||
|
webAssembly: {}
|
||||||
|
}).then(function () {
|
||||||
|
started = true;
|
||||||
|
}).catch(function (error) {
|
||||||
|
showStartupFallback(error);
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -10,9 +10,9 @@
|
|||||||
<Authors>Digital Data GmbH</Authors>
|
<Authors>Digital Data GmbH</Authors>
|
||||||
<Company>Digital Data GmbH</Company>
|
<Company>Digital Data GmbH</Company>
|
||||||
<Product>EnvelopeGenerator.Server</Product>
|
<Product>EnvelopeGenerator.Server</Product>
|
||||||
<Version>1.10.0-beta</Version>
|
<Version>1.11.0-beta</Version>
|
||||||
<FileVersion>1.10.0.0</FileVersion>
|
<FileVersion>1.11.0.0</FileVersion>
|
||||||
<AssemblyVersion>1.10.0.0</AssemblyVersion>
|
<AssemblyVersion>1.11.0.0</AssemblyVersion>
|
||||||
<Copyright>Copyright © 2026 Digital Data GmbH. All rights reserved.</Copyright>
|
<Copyright>Copyright © 2026 Digital Data GmbH. All rights reserved.</Copyright>
|
||||||
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
|
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
@@ -87,6 +87,38 @@ article {
|
|||||||
top: 0.5rem;
|
top: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sf-startup-fallback {
|
||||||
|
position: fixed;
|
||||||
|
inset: 0;
|
||||||
|
display: none;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background: rgba(17, 24, 39, 0.82);
|
||||||
|
padding: 16px;
|
||||||
|
z-index: 2000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sf-startup-fallback__card {
|
||||||
|
width: min(560px, 100%);
|
||||||
|
background: #fff;
|
||||||
|
color: #1f2937;
|
||||||
|
border-radius: 12px;
|
||||||
|
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
|
||||||
|
border: 1px solid rgba(31, 41, 55, 0.12);
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sf-startup-fallback__card h2 {
|
||||||
|
margin: 0 0 10px;
|
||||||
|
font-size: 1.2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sf-startup-fallback__card p {
|
||||||
|
margin: 0 0 14px;
|
||||||
|
color: #4b5563;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
.dx-blazor-reporting-container {
|
.dx-blazor-reporting-container {
|
||||||
height: calc(100vh - 166px) !important;
|
height: calc(100vh - 166px) !important;
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ dotnet publish "%PROJECT%" ^
|
|||||||
-f %FRAMEWORK% ^
|
-f %FRAMEWORK% ^
|
||||||
--self-contained true ^
|
--self-contained true ^
|
||||||
--runtime %RID% ^
|
--runtime %RID% ^
|
||||||
-p:WasmBuildNative=true ^
|
-p:WasmBuildNative=false ^
|
||||||
-m:4 ^
|
-m:4 ^
|
||||||
-o "%OUTPUT%"
|
-o "%OUTPUT%"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user