|
3 | 3 | @using Admin.Shared.Enums |
4 | 4 | @using Microsoft.AspNetCore.Components.Forms |
5 | 5 | @using System.Text.Json |
| 6 | +@using Microsoft.FluentUI.AspNetCore.Components |
| 7 | +@using ButtonType = Microsoft.FluentUI.AspNetCore.Components.ButtonType |
| 8 | +@using Orientation = Microsoft.FluentUI.AspNetCore.Components.Orientation |
6 | 9 | @inject HttpClient Http |
7 | 10 | @inject IConfiguration Config |
8 | 11 | @inject NavigationManager Navigation |
|
13 | 16 | <FluentStack Orientation="Orientation.Vertical" Width="100%"> |
14 | 17 | <h2>Upload New Update</h2> |
15 | 18 |
|
16 | | - <EditForm Model="@model" OnValidSubmit="@HandleSubmit"> |
| 19 | + <EditForm Model="@model" OnValidSubmit="@HandleSubmit" class="w-100"> |
17 | 20 | <FluentCard Style="max-width: 800px;"> |
18 | 21 | <FluentStack Orientation="Orientation.Vertical"> |
19 | | - <div class="form-group"> |
| 22 | + <div class="form-group w-100"> |
20 | 23 | <label>Version *</label> |
21 | 24 | <input type="text" class="form-control" @bind="model.Version" placeholder="1.0.0" required /> |
22 | 25 | </div> |
23 | 26 |
|
24 | | - <div class="form-group"> |
| 27 | + <div class="form-group w-100"> |
25 | 28 | <label>Title *</label> |
26 | 29 | <input type="text" class="form-control" @bind="model.Title" placeholder="Security Patch" required /> |
27 | 30 | </div> |
28 | 31 |
|
29 | | - <div class="form-group"> |
| 32 | + <div class="form-group w-100"> |
30 | 33 | <label>Description</label> |
31 | 34 | <textarea class="form-control" @bind="model.Description" placeholder="Brief description of the update..." rows="3"></textarea> |
32 | 35 | </div> |
33 | 36 |
|
34 | | - <div class="form-group"> |
| 37 | + <div class="form-group w-100"> |
35 | 38 | <label>Change Log</label> |
36 | 39 | <textarea class="form-control" @bind="model.ChangeLog" placeholder="- Fixed bug XYZ - Added feature ABC" rows="5"></textarea> |
37 | 40 | </div> |
38 | 41 |
|
39 | | - <div class="form-group"> |
| 42 | + <div class="form-group w-100"> |
40 | 43 | <label>Update Type</label> |
41 | 44 | <select class="form-control" @bind="model.UpdateType"> |
42 | 45 | <option value="@UpdateType.Security">Security</option> |
|
46 | 49 | </select> |
47 | 50 | </div> |
48 | 51 |
|
49 | | - <div class="form-group"> |
| 52 | + <div class="form-group w-100"> |
50 | 53 | <label>Severity</label> |
51 | 54 | <select class="form-control" @bind="model.Severity"> |
52 | 55 | <option value="@UpdateSeverity.Critical">Critical</option> |
|
56 | 59 | </select> |
57 | 60 | </div> |
58 | 61 |
|
59 | | - <div class="form-check"> |
| 62 | + <div class="form-check w-100"> |
60 | 63 | <input type="checkbox" class="form-check-input" @bind="model.IsSecurityUpdate" id="securityCheck" /> |
61 | 64 | <label class="form-check-label" for="securityCheck">Is Security Update</label> |
62 | 65 | </div> |
63 | 66 |
|
64 | | - <div class="form-group"> |
65 | | - <label>Security Fixes (one per line, e.g., CVE-2024-1234)</label> |
66 | | - <textarea class="form-control" @bind="securityFixesInput" placeholder="CVE-2024-1234 CVE-2024-5678" rows="3"></textarea> |
67 | | - <small class="form-text text-muted">Enter CVE IDs or vulnerability descriptions, one per line</small> |
68 | | - </div> |
| 67 | + @if (model.IsSecurityUpdate) |
| 68 | + { |
| 69 | + <div class="form-group w-100"> |
| 70 | + <label>Security Fixes (one per line, e.g., CVE-2024-1234)</label> |
| 71 | + <textarea class="form-control" @bind="securityFixesInput" placeholder="CVE-2024-1234 CVE-2024-5678" rows="3"></textarea> |
| 72 | + <small class="form-text text-muted">Enter CVE IDs or vulnerability descriptions, one per line</small> |
| 73 | + </div> |
| 74 | + } |
69 | 75 |
|
70 | | - <div class="form-group"> |
| 76 | + <div class="form-group w-100 d-none"> |
71 | 77 | <label>Target Device Types (one per line)</label> |
72 | 78 | <textarea class="form-control" @bind="targetDeviceTypesInput" placeholder="PackagingMachine QualityControlStation" rows="3"></textarea> |
73 | 79 | <small class="form-text text-muted">Enter device type names, one per line</small> |
|
0 commit comments