|
|
|
@ -4,6 +4,7 @@ using Volo.Abp.DependencyInjection;
|
|
|
|
|
|
|
|
|
|
namespace Volo.Abp.AspNetCore.Components.WebAssembly
|
|
|
|
|
{
|
|
|
|
|
//TODO: Implement with sweetalert in a new package
|
|
|
|
|
public class UiMessageService : IUiMessageService, ITransientDependency
|
|
|
|
|
{
|
|
|
|
|
protected IJSRuntime JsRuntime { get; }
|
|
|
|
@ -13,9 +14,28 @@ namespace Volo.Abp.AspNetCore.Components.WebAssembly
|
|
|
|
|
JsRuntime = jsRuntime;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task InfoAsync(string message, string title = null)
|
|
|
|
|
{
|
|
|
|
|
await JsRuntime.InvokeVoidAsync("alert", message);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task SuccessAsync(string message, string title = null)
|
|
|
|
|
{
|
|
|
|
|
await JsRuntime.InvokeVoidAsync("alert", message);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task WarnAsync(string message, string title = null)
|
|
|
|
|
{
|
|
|
|
|
await JsRuntime.InvokeVoidAsync("alert", message);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task ErrorAsync(string message, string title = null)
|
|
|
|
|
{
|
|
|
|
|
await JsRuntime.InvokeVoidAsync("alert", message);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task<bool> ConfirmAsync(string message, string title = null)
|
|
|
|
|
{
|
|
|
|
|
//TODO: Implement with sweetalert in a new package
|
|
|
|
|
return await JsRuntime.InvokeAsync<bool>("confirm", message);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|