File tree Expand file tree Collapse file tree 1 file changed +21
-15
lines changed
WolfLeash/Components/Pages/Apps/SubComponent Expand file tree Collapse file tree 1 file changed +21
-15
lines changed Original file line number Diff line number Diff line change 88@inject WolfLeashDbContext Context
99@inject EventLogger Event
1010
11- <Offcanvas @ref =" offcanvas"
12- title =" Select Cover" >
13- <BodyTemplate >
14- @foreach ( var file in Directory .GetFiles (" /etc/wolf/covers" ).Where (f => Path .GetExtension (f ) == " .png" ))
15- {
16- <div class =" form-group row mb-3" >
17- <ImageSelector FilePath =" @file" @bind-Value =" Data!.IconPngPath" @bind-Value:after =" () => offcanvas.HideAsync()" />
18- </div >
19- }
20- </BodyTemplate >
21- </Offcanvas >
11+ @if (Directory .Exists (" /etc/wolf/covers" ))
12+ {
13+ <Offcanvas @ref =" offCanvas"
14+ title =" Select Cover" >
15+ <BodyTemplate >
16+ @foreach ( var file in Directory .GetFiles (" /etc/wolf/covers" ).Where (f => Path .GetExtension (f ) == " .png" ))
17+ {
18+ <div class =" form-group row mb-3" >
19+ <ImageSelector FilePath =" @file" @bind-Value =" Data!.IconPngPath" @bind-Value:after =" OnHideOffCanvasClick" />
20+ </div >
21+ }
22+ </BodyTemplate >
23+ </Offcanvas >
24+ }
2225
2326<h3 >New App</h3 >
2427
3639 </div >
3740 </Tooltip >
3841 <ValidationMessage For =" () => Data!.IconPngPath" />
39- <Button Color =" ButtonColor.Primary" @onclick =" OnShowOffcanvasClick" >Select Cover</Button >
42+ @if (Directory .Exists (" /etc/wolf/covers" ))
43+ {
44+ <Button Color =" ButtonColor.Primary" @onclick =" OnShowOffCanvasClick" >Select Cover </Button >
45+ }
4046 </div >
4147
4248 <h5 >Runner Configuration:</h5 >
8389</div >
8490
8591@code {
86- private Offcanvas offcanvas = default ! ;
87- private async Task OnShowOffcanvasClick () => await offcanvas .ShowAsync ();
88- private async Task OnHideOffcanvasClick () => await offcanvas .HideAsync ();
92+ private Offcanvas ? offCanvas = null ! ;
93+ private async Task OnShowOffCanvasClick () => await offCanvas ? .ShowAsync ();
94+ private async Task OnHideOffCanvasClick () => await offCanvas ? .HideAsync ();
8995
9096 [Parameter ]
9197 public EventCallback OnValidSubmit { get ; set ; }
You can’t perform that action at this time.
0 commit comments