|
9 | 9 | @inject IEventMediator EventMediator |
10 | 10 |
|
11 | 11 | @if (AppRoleHandler != null && Display) |
12 | | -{ |
13 | | - @if(!workInProgress) |
14 | | - { |
15 | | - <PopUp Title="@(AppRoleHandler.ReadOnly ? "" : (AppRoleHandler.AddMode ? userConfig.GetText("add_app_role") : userConfig.GetText("edit_app_role")))" |
16 | | - Size="@(AppRoleHandler.ReadOnly? PopupSize.Medium: PopupSize.Large)" Show="@Display" OnClose="Close"> |
17 | | - <Body> |
18 | | - <div class="row mt-2"> |
19 | | - @if (!AppRoleHandler.ReadOnly) |
20 | | - { |
21 | | - <div class="col-sm-6"> |
22 | | - <EditAppRoleLeftSide @bind-Container="Container" @bind-Width="sidebarLeftWidth" @bind-AppRoleHandler="AppRoleHandler" /> |
23 | | - </div> |
24 | | - } |
25 | | - <div class="@(AppRoleHandler.ReadOnly ? "h-90 col-sm-12" : "col-sm-6")"> |
26 | | - <h3>@(userConfig.GetText("app_role"))</h3> |
27 | | - <div class="border rounded m-2 p-2"> |
28 | | - @if (AppRoleHandler.NamingConvention.NetworkAreaRequired) |
29 | | - { |
30 | | - <div class="form-group row"> |
31 | | - <label class="col-sm-3 col-form-label col-form-label-sm">@(userConfig.GetText("area"))*:</label> |
32 | | - @if (AppRoleHandler.AddMode && !AppRoleHandler.ReadOnly) |
33 | | - { |
34 | | - <div class="col-sm-8"> |
35 | | - <Dropdown ElementType="ModellingNetworkArea" SelectedElement="AppRoleHandler.ActAppRole.Area" ElementToString="@(a => a.Display() + DisplayObjectCount(a))" |
36 | | - SelectedElementChanged="OnSelectedAreaChanged" Elements="areas" Nullable="true"> |
37 | | - <ElementTemplate Context="area"> |
38 | | - @((MarkupString)DisplayAreaWithObjectCount(area)) |
39 | | - </ElementTemplate> |
40 | | - </Dropdown> |
41 | | - </div> |
42 | | - } |
43 | | - else |
44 | | - { |
45 | | - <label class="col-sm-8 bg-secondary">@AppRoleHandler.ActAppRole.Area?.Display()</label> |
46 | | - } |
47 | | - </div> |
48 | | - } |
49 | | - <div class="form-group row mt-2"> |
50 | | - <label class="col-sm-3 col-form-label col-form-label-sm">@(userConfig.GetText("id"))*:</label> |
51 | | - @if (AppRoleHandler.ReadOnly) |
52 | | - { |
53 | | - <label class="col-sm-8">@AppRoleHandler.ActAppRole.IdString</label> |
54 | | - } |
55 | | - else if (AppRoleHandler.NamingConvention.NetworkAreaRequired) |
56 | | - { |
57 | | - <input type="text" class="col-sm-4" readonly @bind="AppRoleHandler.ActAppRole.ManagedIdString.CombinedFixPart" /> |
58 | | - <span class="col-sm-1">@AppRoleHandler.ActAppRole.ManagedIdString.Separator</span> |
59 | | - <input type="text" class="col-sm-3" @bind="AppRoleHandler.ActAppRole.ManagedIdString.FreePart" /> |
60 | | - } |
61 | | - else |
62 | | - { |
63 | | - <input type="text" class=" col-sm-8" @bind="AppRoleHandler.ActAppRole.IdString" /> |
64 | | - } |
65 | | - </div> |
66 | | - <div class="form-group row mt-2"> |
67 | | - <label class="col-sm-3 col-form-label col-form-label-sm">@(userConfig.GetText("name"))*:</label> |
68 | | - @if (AppRoleHandler.ReadOnly) |
69 | | - { |
70 | | - <label class="col-sm-8">@AppRoleHandler.ActAppRole.Name</label> |
71 | | - } |
72 | | - else |
73 | | - { |
74 | | - <input type="text" class="col-sm-8" @bind="AppRoleHandler.ActAppRole.Name" /> |
75 | | - } |
76 | | - </div> |
77 | | - <div class="form-group row mt-2"> |
78 | | - <label class="col-sm-3 col-form-label col-form-label-sm">@(userConfig.GetText("comment")):</label> |
79 | | - @if (AppRoleHandler.ReadOnly) |
| 12 | +{ |
| 13 | + <PopUp Title="@(AppRoleHandler.ReadOnly ? "" : (AppRoleHandler.AddMode ? userConfig.GetText("add_app_role") : userConfig.GetText("edit_app_role")))" |
| 14 | + Size="@(AppRoleHandler.ReadOnly? PopupSize.Medium: PopupSize.Large)" Show="@Display" OnClose="Close"> |
| 15 | + <Body> |
| 16 | + <div class="row mt-2"> |
| 17 | + @if (!AppRoleHandler.ReadOnly) |
| 18 | + { |
| 19 | + <div class="col-sm-6"> |
| 20 | + <EditAppRoleLeftSide @bind-Container="Container" @bind-Width="sidebarLeftWidth" @bind-AppRoleHandler="AppRoleHandler" /> |
| 21 | + </div> |
| 22 | + } |
| 23 | + <div class="@(AppRoleHandler.ReadOnly ? "h-90 col-sm-12" : "col-sm-6")"> |
| 24 | + <h3>@(userConfig.GetText("app_role"))</h3> |
| 25 | + <div class="border rounded m-2 p-2"> |
| 26 | + @if (AppRoleHandler.NamingConvention.NetworkAreaRequired) |
| 27 | + { |
| 28 | + <div class="form-group row"> |
| 29 | + <label class="col-sm-3 col-form-label col-form-label-sm">@(userConfig.GetText("area"))*:</label> |
| 30 | + @if (AppRoleHandler.AddMode && !AppRoleHandler.ReadOnly) |
80 | 31 | { |
81 | | - <label class="col-sm-8">@AppRoleHandler.ActAppRole.Comment</label> |
| 32 | + <div class="col-sm-8"> |
| 33 | + <Dropdown ElementType="ModellingNetworkArea" SelectedElement="AppRoleHandler.ActAppRole.Area" ElementToString="@(a => a.Display() + DisplayObjectCount(a))" |
| 34 | + SelectedElementChanged="OnSelectedAreaChanged" Elements="areas" Nullable="true"> |
| 35 | + <ElementTemplate Context="area"> |
| 36 | + @((MarkupString)DisplayAreaWithObjectCount(area)) |
| 37 | + </ElementTemplate> |
| 38 | + </Dropdown> |
| 39 | + </div> |
82 | 40 | } |
83 | 41 | else |
84 | 42 | { |
85 | | - <input type="text" class="col-sm-8" @bind="AppRoleHandler.ActAppRole.Comment" /> |
| 43 | + <label class="col-sm-8 bg-secondary">@AppRoleHandler.ActAppRole.Area?.Display()</label> |
86 | 44 | } |
87 | 45 | </div> |
88 | | - <br> |
89 | | - <div class="col-sm-12"> |
90 | | - <h6>@(userConfig.GetText("app_server"))</h6> |
91 | | - @if (AppRoleHandler.ReadOnly) |
92 | | - { |
93 | | - foreach (var appserver in ModellingAppServerWrapper.Resolve(AppRoleHandler.ActAppRole.AppServers)) |
94 | | - { |
95 | | - <div class="mh-13 col-sm-11 mt-1 border bg-transparent">@((MarkupString)appserver.DisplayWithIcon())</div> |
96 | | - } |
97 | | - } |
98 | | - else |
| 46 | + } |
| 47 | + <div class="form-group row mt-2"> |
| 48 | + <label class="col-sm-3 col-form-label col-form-label-sm">@(userConfig.GetText("id"))*:</label> |
| 49 | + @if (AppRoleHandler.ReadOnly) |
| 50 | + { |
| 51 | + <label class="col-sm-8">@AppRoleHandler.ActAppRole.IdString</label> |
| 52 | + } |
| 53 | + else if (AppRoleHandler.NamingConvention.NetworkAreaRequired) |
| 54 | + { |
| 55 | + <input type="text" class="col-sm-4" readonly @bind="AppRoleHandler.ActAppRole.ManagedIdString.CombinedFixPart" /> |
| 56 | + <span class="col-sm-1">@AppRoleHandler.ActAppRole.ManagedIdString.Separator</span> |
| 57 | + <input type="text" class="col-sm-3" @bind="AppRoleHandler.ActAppRole.ManagedIdString.FreePart" /> |
| 58 | + } |
| 59 | + else |
| 60 | + { |
| 61 | + <input type="text" class=" col-sm-8" @bind="AppRoleHandler.ActAppRole.IdString" /> |
| 62 | + } |
| 63 | + </div> |
| 64 | + <div class="form-group row mt-2"> |
| 65 | + <label class="col-sm-3 col-form-label col-form-label-sm">@(userConfig.GetText("name"))*:</label> |
| 66 | + @if (AppRoleHandler.ReadOnly) |
| 67 | + { |
| 68 | + <label class="col-sm-8">@AppRoleHandler.ActAppRole.Name</label> |
| 69 | + } |
| 70 | + else |
| 71 | + { |
| 72 | + <input type="text" class="col-sm-8" @bind="AppRoleHandler.ActAppRole.Name" /> |
| 73 | + } |
| 74 | + </div> |
| 75 | + <div class="form-group row mt-2"> |
| 76 | + <label class="col-sm-3 col-form-label col-form-label-sm">@(userConfig.GetText("comment")):</label> |
| 77 | + @if (AppRoleHandler.ReadOnly) |
| 78 | + { |
| 79 | + <label class="col-sm-8">@AppRoleHandler.ActAppRole.Comment</label> |
| 80 | + } |
| 81 | + else |
| 82 | + { |
| 83 | + <input type="text" class="col-sm-8" @bind="AppRoleHandler.ActAppRole.Comment" /> |
| 84 | + } |
| 85 | + </div> |
| 86 | + <br> |
| 87 | + <div class="col-sm-12"> |
| 88 | + <h6>@(userConfig.GetText("app_server"))</h6> |
| 89 | + @if (AppRoleHandler.ReadOnly) |
| 90 | + { |
| 91 | + foreach (var appserver in ModellingAppServerWrapper.Resolve(AppRoleHandler.ActAppRole.AppServers)) |
99 | 92 | { |
100 | | - <OrderByDropdown CssClass="bg-secondary" @ref="orderByDropdown" TCollectionItem="ModellingAppServer" CollectionReordered="OnCollectionReordered" ElementProperties="orderByDropdownProperties" CustomSort="true" /> |
101 | | - <div class="dropzone-scrollable dropzone bg-secondary" |
102 | | - ondragover="event.preventDefault();" |
103 | | - ondragstart="event.dataTransfer.setData('', event.target.id);" |
104 | | - @ondrop="HandleServerDrop"> |
105 | | - <EditList ElementType="ModellingAppServer" Elements="ModellingAppServerWrapper.Resolve(AppRoleHandler.ActAppRole.AppServers)" ElementsToAdd="AppRoleHandler.AppServerToAdd" ElementsToDelete="AppRoleHandler.AppServerToDelete" StdLayout="false" ElementsRemoved="OnAppServerRemovedFromEditList"> |
106 | | - <Display> |
107 | | - <div class="row"> |
108 | | - <div class="col-sm-12 ms-2 bg-transparent">@((MarkupString)context.DisplayWithIcon())</div> |
109 | | - </div> |
110 | | - </Display> |
111 | | - </EditList> |
112 | | - </div> |
| 93 | + <div class="mh-13 col-sm-11 mt-1 border bg-transparent">@((MarkupString)appserver.DisplayWithIcon())</div> |
113 | 94 | } |
114 | | - </div> |
115 | | - @if (!AppRoleHandler.AddMode) |
| 95 | + } |
| 96 | + else |
116 | 97 | { |
117 | | - <label class="col-sm-12 small mt-2">@(userConfig.GetText("created_by")): @(AppRoleHandler.ActAppRole.Creator), @(userConfig.GetText("creation_date")): @(AppRoleHandler.ActAppRole.CreationDate)</label> |
| 98 | + <OrderByDropdown CssClass="bg-secondary" @ref="orderByDropdown" TCollectionItem="ModellingAppServer" CollectionReordered="OnCollectionReordered" ElementProperties="orderByDropdownProperties" CustomSort="true" /> |
| 99 | + <div class="dropzone-scrollable dropzone bg-secondary" |
| 100 | + ondragover="event.preventDefault();" |
| 101 | + ondragstart="event.dataTransfer.setData('', event.target.id);" |
| 102 | + @ondrop="HandleServerDrop"> |
| 103 | + <EditList ElementType="ModellingAppServer" Elements="ModellingAppServerWrapper.Resolve(AppRoleHandler.ActAppRole.AppServers)" ElementsToAdd="AppRoleHandler.AppServerToAdd" ElementsToDelete="AppRoleHandler.AppServerToDelete" StdLayout="false" ElementsRemoved="OnAppServerRemovedFromEditList"> |
| 104 | + <Display> |
| 105 | + <div class="row"> |
| 106 | + <div class="col-sm-12 ms-2 bg-transparent">@((MarkupString)context.DisplayWithIcon())</div> |
| 107 | + </div> |
| 108 | + </Display> |
| 109 | + </EditList> |
| 110 | + </div> |
118 | 111 | } |
119 | 112 | </div> |
| 113 | + @if (!AppRoleHandler.AddMode) |
| 114 | + { |
| 115 | + <label class="col-sm-12 small mt-2">@(userConfig.GetText("created_by")): @(AppRoleHandler.ActAppRole.Creator), @(userConfig.GetText("creation_date")): @(AppRoleHandler.ActAppRole.CreationDate)</label> |
| 116 | + } |
120 | 117 | </div> |
121 | 118 | </div> |
122 | | - </Body> |
123 | | - <Footer> |
124 | | - <div class="btn-group"> |
125 | | - @if (AppRoleHandler.ReadOnly) |
| 119 | + </div> |
| 120 | + </Body> |
| 121 | + <Footer> |
| 122 | + <div class="btn-group"> |
| 123 | + @if (AppRoleHandler.ReadOnly) |
| 124 | + { |
| 125 | + <button type="button" class="btn btn-sm btn-primary" @onclick="Close">@(userConfig.GetText("ok"))</button> |
| 126 | + } |
| 127 | + else |
| 128 | + { |
| 129 | + @if (AppRoleHandler.IsOwner) |
126 | 130 | { |
127 | | - <button type="button" class="btn btn-sm btn-primary" @onclick="Close">@(userConfig.GetText("ok"))</button> |
| 131 | + <button type="button" class="btn btn-sm btn-primary" @onclick="Save">@(userConfig.GetText("save"))</button> |
128 | 132 | } |
129 | 133 | else |
130 | 134 | { |
131 | | - @if (AppRoleHandler.IsOwner) |
132 | | - { |
133 | | - <button type="button" class="btn btn-sm btn-primary" @onclick="Save">@(userConfig.GetText("save"))</button> |
134 | | - } |
135 | | - else |
136 | | - { |
137 | | - <button type="button" class="btn btn-sm btn-primary" disabled>@(userConfig.GetText("save"))</button> |
138 | | - } |
139 | | - <button type="button" class="btn btn-sm btn-secondary" @onclick="Close">@(userConfig.GetText("cancel"))</button> |
| 135 | + <button type="button" class="btn btn-sm btn-primary" disabled>@(userConfig.GetText("save"))</button> |
140 | 136 | } |
141 | | - </div> |
142 | | - </Footer> |
143 | | - </PopUp> |
144 | | - } |
| 137 | + <button type="button" class="btn btn-sm btn-secondary" @onclick="Close">@(userConfig.GetText("cancel"))</button> |
| 138 | + } |
| 139 | + </div> |
| 140 | + </Footer> |
| 141 | + </PopUp> |
145 | 142 | <InProgress Display="workInProgress" /> |
146 | 143 | <Confirm @bind-Display="ShowAreaChangeConfirmation" AllowedRoles="@Roles.Modeller" RenderMessageAsHtml="true" |
147 | 144 | Message="@(userConfig.GetText("nwareachange_clear_app_servers"))" PerformAction="AreaChangeConfirmation" Title="@(userConfig.GetText("confirm"))" /> |
|
0 commit comments