small cosmetic issues
This commit is contained in:
parent
efd7a8a330
commit
defb654022
9 changed files with 135 additions and 29 deletions
|
@ -13,13 +13,11 @@
|
||||||
// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html]
|
// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html]
|
||||||
*@
|
*@
|
||||||
@using Microsoft.AspNetCore.Authorization
|
@using Microsoft.AspNetCore.Authorization
|
||||||
@using Wonky.Client.Helpers
|
|
||||||
@using System.Text.Json
|
|
||||||
@attribute [Authorize(Roles = "Admin")]
|
@attribute [Authorize(Roles = "Admin")]
|
||||||
@page "/system/sms"
|
@page "/system/sms"
|
||||||
|
|
||||||
|
|
||||||
<div id="msg-box" style="display:@(MsgSent ? "none" : "block" )">
|
<div id="msg-box" style="display:@(MsgSent ? "none" : "block")">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="h3 col-sm-10">
|
<div class="h3 col-sm-10">
|
||||||
Drift Meddelelse (SMS)
|
Drift Meddelelse (SMS)
|
||||||
|
@ -55,11 +53,70 @@
|
||||||
</div>
|
</div>
|
||||||
<div id="msg-box" style="display:@(MsgSent ? "block" : "none")">
|
<div id="msg-box" style="display:@(MsgSent ? "block" : "none")">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-2">
|
<div class="col-10">
|
||||||
Status Kode: @SmsResponse.Code
|
<table class="table table-striped">
|
||||||
</div>
|
<tbody>
|
||||||
<div class="col-sm-10">
|
<tr>
|
||||||
Meddelelse: @SmsResponse.Message
|
<th scope="col">Status Kode</th>
|
||||||
|
<td>@SmsResponse.Code</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">Id</th>
|
||||||
|
<td>@ClxMsg.Id</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">Til</th>
|
||||||
|
<td>
|
||||||
|
<div class="row">
|
||||||
|
@if (ClxMsg.To.Any())
|
||||||
|
{
|
||||||
|
@foreach (var to in ClxMsg.To)
|
||||||
|
{
|
||||||
|
@($"{to},")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">Fra</th>
|
||||||
|
<td>@ClxMsg.From</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">Annulleret</th>
|
||||||
|
<td>@ClxMsg.Cancelled</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">Meddelelse</th>
|
||||||
|
<td>@ClxMsg.Body</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">Type</th>
|
||||||
|
<td>@ClxMsg.Type</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">Oprettet</th>
|
||||||
|
<td>@ClxMsg.CreatedAt</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">Ændret</th>
|
||||||
|
<td>@ClxMsg.ModifiedAt</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">Rapport</th>
|
||||||
|
<td>@ClxMsg.DeliveryReport</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">Udløber</th>
|
||||||
|
<td>@ClxMsg.ExpireAt</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">Flash</th>
|
||||||
|
<td>@ClxMsg.FlashMessage</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
|
@ -8,19 +8,20 @@ using Wonky.Entity.DTO;
|
||||||
using Wonky.Entity.Views;
|
using Wonky.Entity.Views;
|
||||||
|
|
||||||
namespace Wonky.Client.Pages;
|
namespace Wonky.Client.Pages;
|
||||||
|
#pragma warning disable CS8618
|
||||||
public partial class SystemMaintenanceMessage
|
public partial class SystemMaintenanceMessagePage : IDisposable
|
||||||
{
|
{
|
||||||
[Inject] public HttpInterceptorService Interceptor { get; set; }
|
[Inject] public HttpInterceptorService Interceptor { get; set; }
|
||||||
[Inject] public ISystemUserRepository UserRepo { get; set; }
|
[Inject] public ISystemUserRepository UserRepo { get; set; }
|
||||||
[Inject] public ISystemSendSmsService SmsService { get; set; }
|
[Inject] public ISystemSendSmsService SmsService { get; set; }
|
||||||
[Inject] public ILogger<SystemMaintenanceMessage> Logger { get; set; }
|
[Inject] public ILogger<SystemMaintenanceMessagePage> Logger { get; set; }
|
||||||
[Inject] public IToastService Toaster { get; set; }
|
[Inject] public IToastService Toaster { get; set; }
|
||||||
|
|
||||||
private List<UserManagerListView> Users { get; set; }
|
private List<UserManagerListView> Users { get; set; } = new();
|
||||||
private ShortMessage Message { get; set; } = new();
|
private ShortMessage Message { get; set; } = new();
|
||||||
private List<Recipient> Recipients { get; set; } = new();
|
private List<Recipient> Recipients { get; set; } = new();
|
||||||
private ApiResponseView SmsResponse { get; set; } = new();
|
private ApiResponseView SmsResponse { get; set; } = new();
|
||||||
|
private ClxMessage? ClxMsg { get; set; } = new();
|
||||||
private bool Working { get; set; } = true;
|
private bool Working { get; set; } = true;
|
||||||
private bool MsgSent { get; set; }
|
private bool MsgSent { get; set; }
|
||||||
|
|
||||||
|
@ -70,16 +71,21 @@ public partial class SystemMaintenanceMessage
|
||||||
SmsResponse = await SmsService.SendSms(Message);
|
SmsResponse = await SmsService.SendSms(Message);
|
||||||
if (SmsResponse.Code == 201)
|
if (SmsResponse.Code == 201)
|
||||||
{
|
{
|
||||||
|
ClxMsg = JsonSerializer.Deserialize<ClxMessage>(SmsResponse.Message);
|
||||||
MsgSent = true;
|
MsgSent = true;
|
||||||
}
|
}
|
||||||
Working = false;
|
Working = false;
|
||||||
|
}
|
||||||
}
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
Interceptor.DisposeEvent();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal sealed class Recipient
|
internal sealed class Recipient
|
||||||
{
|
{
|
||||||
public bool Enabled { get; set; }
|
public bool Enabled { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; init; } = "";
|
||||||
public string Mobile { get; set; }
|
public string Mobile { get; init; } = "";
|
||||||
}
|
}
|
|
@ -114,7 +114,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="alert alert-info">
|
<div class="alert alert-info">
|
||||||
<h4>Password politik</h4>
|
<h4>Password politik</h4>
|
||||||
<p>Mindst 10 tegn bestående af store og små bogstaver samt tal. Du kan teste pasword og danne stærke password på <a href="https://pw.nix.dk">pw.nix.dk</a></p>
|
<p>Mindst 10 tegn bestående af store og små bogstaver samt tal. Password generator <a href="https://pw.nix.dk">pw.nix.dk</a></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<label for="newPasswd" class="col-md-2 col-form-label">Ny</label>
|
<label for="newPasswd" class="col-md-2 col-form-label">Ny</label>
|
||||||
|
|
|
@ -25,7 +25,11 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="text-end">
|
<div class="text-end">
|
||||||
<a class="btn btn-primary" href="/system/users/create"><i class="bi-plus-lg"></i>Opret bruger</a>
|
<div class="busy-signal" style="display:@(Working ? "block" : "none")">
|
||||||
|
<div class="spinner-grow text-info" role="status">
|
||||||
|
<span class="visually-hidden">Loading...</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -36,15 +40,19 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-1">
|
<div class="col-sm-1">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-5">
|
<div class="col-sm-4">
|
||||||
<div class="h4">Navn</div>
|
<div class="h4">Navn</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-3">
|
||||||
<div class="h4">Email</div>
|
<div class="h4">Email</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-2">
|
<div class="col-sm-2">
|
||||||
<div class="h4">Telefon</div>
|
<div class="h4">Telefon</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-sm-2 text-end">
|
||||||
|
<a class="btn btn-primary" href="/system/users/create"><i class="bi-plus-lg"></i>Opret bruger</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -57,15 +65,16 @@
|
||||||
<div class="col-sm-1">
|
<div class="col-sm-1">
|
||||||
@user.CountryCode @user.SalesRep
|
@user.CountryCode @user.SalesRep
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-5">
|
<div class="col-sm-4">
|
||||||
@user.FullName
|
@user.FullName
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-3">
|
||||||
@user.Email
|
@user.Email
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-2">
|
<div class="col-sm-2">
|
||||||
@user.PhoneNumber
|
@user.PhoneNumber
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-sm-2"></div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,12 +28,14 @@ public partial class SystemUserListPage : IDisposable
|
||||||
|
|
||||||
private List<UserManagerListView> UserList { get; set; } = new();
|
private List<UserManagerListView> UserList { get; set; } = new();
|
||||||
|
|
||||||
|
private bool Working { get; set; } = true;
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
Interceptor.RegisterEvent();
|
Interceptor.RegisterEvent();
|
||||||
Interceptor.RegisterBeforeSendEvent();
|
Interceptor.RegisterBeforeSendEvent();
|
||||||
|
|
||||||
UserList = await UserRepo.GetUsers();
|
UserList = await UserRepo.GetUsers();
|
||||||
|
Working = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
|
|
|
@ -77,7 +77,9 @@ public class AuthenticationService : IAuthenticationService
|
||||||
|
|
||||||
// process response content
|
// process response content
|
||||||
var data = JsonSerializer.Deserialize<AuthResponseView>(resContent, _options);
|
var data = JsonSerializer.Deserialize<AuthResponseView>(resContent, _options);
|
||||||
|
|
||||||
|
_logger.LogDebug("Login => {}", JsonSerializer.Serialize(data, _options));
|
||||||
|
|
||||||
await _infoService.SetAccessToken(data.AccessToken);
|
await _infoService.SetAccessToken(data.AccessToken);
|
||||||
await _infoService.SetRefreshToken(data.RefreshToken);
|
await _infoService.SetRefreshToken(data.RefreshToken);
|
||||||
await _infoService.SetExpiration((int)DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds + data.ExpiresIn - 60);
|
await _infoService.SetExpiration((int)DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds + data.ExpiresIn - 60);
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
{
|
{
|
||||||
"appInfo": {
|
"appInfo": {
|
||||||
"name": "Wonky Online",
|
"name": "Wonky Online",
|
||||||
"version": "0.120.0",
|
"version": "0.120.4",
|
||||||
"rc": true,
|
"rc": true,
|
||||||
"sandBox": false,
|
"sandBox": false,
|
||||||
"image": "grumpy-coder.png"
|
"image": "grumpy-coder.png"
|
||||||
},
|
},
|
||||||
"Logging": {
|
"Logging": {
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
"Default": "Debug",
|
"Default": "Information",
|
||||||
"System": "Debug",
|
"System": "Information",
|
||||||
"Microsoft": "Information"
|
"Microsoft": "Information"
|
||||||
},
|
},
|
||||||
"Debug": {
|
"Debug": {
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"apiConfig": {
|
"apiConfig": {
|
||||||
"baseUrl": "https://dev.innotec.dk",
|
"baseUrl": "https://zeta.innotec.dk",
|
||||||
"catalog": "api/v2/catalog/country",
|
"catalog": "api/v2/catalog/country",
|
||||||
"crmCustomers": "api/v2/crm/companies",
|
"crmCustomers": "api/v2/crm/companies",
|
||||||
"crmInventoryExt": "history/inventory",
|
"crmInventoryExt": "history/inventory",
|
||||||
|
|
|
@ -34,5 +34,5 @@ public class UserManagerEditView
|
||||||
[MaxLength(20, ErrorMessage = "Der er afsat 20 tegn til Sælger No.")] public string SalesRep { get; set; } = "";
|
[MaxLength(20, ErrorMessage = "Der er afsat 20 tegn til Sælger No.")] public string SalesRep { get; set; } = "";
|
||||||
public string UserId { get; set; } = "";
|
public string UserId { get; set; } = "";
|
||||||
public List<UserRoleAssignment> AssignedRoles { get; set; } = new();
|
public List<UserRoleAssignment> AssignedRoles { get; set; } = new();
|
||||||
public List<SubjectAssignment> AssignedSubjects { get; set; } = new();
|
public List<SubjectAssignment> Subjects { get; set; } = new();
|
||||||
}
|
}
|
30
Wonky.Entity/Views/ClxMessage.cs
Normal file
30
Wonky.Entity/Views/ClxMessage.cs
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace Wonky.Entity.Views;
|
||||||
|
|
||||||
|
public class ClxMessage
|
||||||
|
{
|
||||||
|
[JsonPropertyName("id")]
|
||||||
|
public string Id { get; set; } = "";
|
||||||
|
[JsonPropertyName("to")]
|
||||||
|
public List<string> To { get; set; } = new();
|
||||||
|
[JsonPropertyName("from")]
|
||||||
|
public string From { get; set; } = "";
|
||||||
|
[JsonPropertyName("cancelled")]
|
||||||
|
public bool Cancelled { get; set; }
|
||||||
|
[JsonPropertyName("body")]
|
||||||
|
public string Body { get; set; } = "";
|
||||||
|
[JsonPropertyName("type")]
|
||||||
|
public string Type { get; set; } = "";
|
||||||
|
[JsonPropertyName("created_at")]
|
||||||
|
public string CreatedAt { get; set; } = "";
|
||||||
|
[JsonPropertyName("modified_at")]
|
||||||
|
public string ModifiedAt { get; set; } = "";
|
||||||
|
[JsonPropertyName("delivery_report")]
|
||||||
|
public string DeliveryReport { get; set; } = "";
|
||||||
|
[JsonPropertyName("expire_at")]
|
||||||
|
public string ExpireAt { get; set; } = "";
|
||||||
|
[JsonPropertyName("flash_message")]
|
||||||
|
public bool FlashMessage { get; set; }
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in a new issue