-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added authentification over buttons: create, load, send, copy, delete in DataExchangeView
- Loading branch information
blazej.kuhajda
committed
Dec 10, 2024
1 parent
b62822f
commit 27497b2
Showing
12 changed files
with
276 additions
and
73 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Devices: | ||
- Name: plc_line | ||
Modules: | ||
- Apply: | ||
TemplateName: 6ES7516-3AP03-0AB0_v3_1 | ||
Arguments: | ||
PLCName: plc_line | ||
IpAddress_X1: 10.10.10.120/24 | ||
ProfinetDeviceName_X1: plc_line_x1 | ||
IoSystems: | ||
- Name: profinet_plc_line | ||
ControllerInterfaces: | ||
- Ref: plc_line/plc_line/profinet_x1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
@using librarytemplate.blazor.hmi.Shared; | ||
<Router AppAssembly="@typeof(App).Assembly"> | ||
<Found Context="routeData"> | ||
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" /> | ||
<FocusOnNavigate RouteData="@routeData" Selector="h1" /> | ||
</Found> | ||
<NotFound> | ||
<PageTitle>Not found</PageTitle> | ||
<LayoutView Layout="@typeof(MainLayout)"> | ||
<p role="alert">Sorry, there's nothing at this address.</p> | ||
</LayoutView> | ||
</NotFound> | ||
</Router> | ||
@using AxOpen.Security.Service | ||
@using librarytemplate.blazor.hmi.Shared; | ||
|
||
|
||
<CascadingAuthenticationState> | ||
<Router AppAssembly="@typeof(App).Assembly" | ||
AdditionalAssemblies="new[] { typeof(BlazorSecurity).Assembly}"> | ||
<Found Context="routeData"> | ||
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" /> | ||
<FocusOnNavigate RouteData="@routeData" Selector="h1" /> | ||
</Found> | ||
<NotFound> | ||
<PageTitle>Not found</PageTitle> | ||
<LayoutView Layout="@typeof(MainLayout)"> | ||
<p role="alert">Sorry, there's nothing at this address.</p> | ||
</LayoutView> | ||
</NotFound> | ||
</Router> | ||
</CascadingAuthenticationState> |
4 changes: 4 additions & 0 deletions
4
src/data/app/ix-blazor/librarytemplate.blazor/Pages/UserAdministration.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@page "/Security/UserAdministration" | ||
<div class="ms-5"> | ||
<AxOpen.Security.Views.SecurityManagementView /> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/data/app/ix-blazor/librarytemplate.blazor/Shared/MainLayout.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/data/app/ix-blazor/librarytemplate.blazor/Shared/TopRow.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
@using System.Globalization | ||
@inject NavigationManager NavigationManager | ||
|
||
<div class="top-row px-2"> | ||
<a href=""> | ||
<img src="logo-no-background.svg" width="50" /> | ||
</a> | ||
|
||
|
||
<div class="ms-auto"> | ||
<select class="form-control" @bind="Culture" @bind:event="oninput"> | ||
@foreach (var culture in supportedCultures) | ||
{ | ||
<option data value="@culture">@culture.NativeName</option> | ||
} | ||
</select> | ||
</div> | ||
<div class="ms-5"> | ||
<AxOpen.Security.Views.LoginDisplay /> | ||
</div> | ||
</div> | ||
|
||
@code { | ||
private CultureInfo[] supportedCultures = new[] | ||
{ | ||
new CultureInfo("en-US"), | ||
new CultureInfo("sk-SK"), | ||
new CultureInfo("es-ES") | ||
}; | ||
|
||
private CultureInfo Culture | ||
{ | ||
get => CultureInfo.CurrentCulture; | ||
set | ||
{ | ||
// Prevent unnecessary navigation | ||
if (!Equals(CultureInfo.CurrentCulture, value) && !Equals(CultureInfo.CurrentUICulture, value)) | ||
{ | ||
var cultureEscaped = Uri.EscapeDataString(value.Name); | ||
NavigationManager.NavigateTo($"/culture?culture={cultureEscaped}", true); | ||
} | ||
} | ||
} | ||
|
||
protected override void OnInitialized() | ||
{ | ||
Culture = CultureInfo.CurrentCulture; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/data/app/ix-blazor/librarytemplate.blazor/Shared/TopRow.razor.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.top-row { | ||
background-color: #f7f7f7; | ||
border-bottom: 1px solid #d6d5d5; | ||
height: 3.5rem; | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
@media (max-width: 769px) { | ||
.IAmHereIndicator { | ||
display: none; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/data/src/AXOpen.Data.Blazor/AxoDataExchange/DataExchangeRoleNames.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace AXOpen.Data | ||
{ | ||
public static class DataExchangeRoleNames | ||
{ | ||
public const string can_data_item_create = nameof(can_data_item_create); | ||
public const string can_data_item_edit = nameof(can_data_item_edit); | ||
public const string can_data_item_copy = nameof(can_data_item_copy); | ||
public const string can_data_item_delete = nameof(can_data_item_delete); | ||
|
||
public const string can_data_send_to_plc = nameof(can_data_send_to_plc); | ||
public const string can_data_load_from_plc = nameof(can_data_send_to_plc); | ||
|
||
public const string can_data_export = nameof(can_data_export); | ||
public const string can_data_import = nameof(can_data_import); | ||
|
||
} | ||
} |
Oops, something went wrong.