Add new detect install script type, restrict script editor to specific types
parent
af265e9d34
commit
e4cf2aabfe
|
@ -56,7 +56,7 @@
|
|||
</FormItem>
|
||||
|
||||
<FormItem Label="Type">
|
||||
<Select @bind-Value="context.Type" TItem="ScriptType" TItemValue="ScriptType" DataSource="Enum.GetValues<ScriptType>()">
|
||||
<Select @bind-Value="context.Type" TItem="ScriptType" TItemValue="ScriptType" DataSource="Enum.GetValues<ScriptType>().Where(st => AllowedTypes == null || AllowedTypes.Contains(st))">
|
||||
<LabelTemplate Context="Value">@Value.GetDisplayName()</LabelTemplate>
|
||||
<ItemTemplate Context="Value">@Value.GetDisplayName()</ItemTemplate>
|
||||
</Select>
|
||||
|
@ -117,6 +117,7 @@
|
|||
[Parameter] public Guid ArchiveId { get; set; }
|
||||
[Parameter] public ICollection<Script> Scripts { get; set; }
|
||||
[Parameter] public EventCallback<ICollection<Script>> ScriptsChanged { get; set; }
|
||||
[Parameter] public IEnumerable<ScriptType> AllowedTypes { get; set; }
|
||||
|
||||
Script Script;
|
||||
|
||||
|
|
|
@ -13,6 +13,8 @@ namespace LANCommander.Data.Enums
|
|||
[Display(Name = "Save Upload")]
|
||||
SaveUpload,
|
||||
[Display(Name = "Save Download")]
|
||||
SaveDownload
|
||||
SaveDownload,
|
||||
[Display(Name = "Detect Install")]
|
||||
DetectInstall
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
@page "/Games/{id:guid}/{panel}"
|
||||
@page "/Games/Add"
|
||||
@using LANCommander.Components.FileManagerComponents;
|
||||
@using LANCommander.Data.Enums;
|
||||
@using LANCommander.Models;
|
||||
@using LANCommander.Pages.Games.Components
|
||||
@using System.IO.Compression;
|
||||
|
@ -125,7 +126,7 @@
|
|||
</div>
|
||||
|
||||
<div data-panel="Scripts">
|
||||
<ScriptEditor @bind-Scripts="Game.Scripts" GameId="Game.Id" ArchiveId="@LatestArchiveId" />
|
||||
<ScriptEditor @bind-Scripts="Game.Scripts" GameId="Game.Id" ArchiveId="@LatestArchiveId" AllowedTypes="new ScriptType[] { ScriptType.Install, ScriptType.Uninstall, ScriptType.NameChange, ScriptType.KeyChange }" />
|
||||
</div>
|
||||
|
||||
<div data-panel="Archives">
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
@page "/Redistributables/{id:guid}"
|
||||
@page "/Redistributables/{id:guid}/{panel}"
|
||||
@page "/Redistributables/Add"
|
||||
@using LANCommander.Data.Enums;
|
||||
@inject RedistributableService RedistributableService
|
||||
@inject IMessageService MessageService
|
||||
@inject NavigationManager NavigationManager
|
||||
|
@ -46,7 +47,7 @@
|
|||
|
||||
@if (Panel == "Scripts")
|
||||
{
|
||||
<ScriptEditor @bind-Scripts="Redistributable.Scripts" RedistributableId="Redistributable.Id" ArchiveId="@LatestArchiveId" />
|
||||
<ScriptEditor @bind-Scripts="Redistributable.Scripts" RedistributableId="Redistributable.Id" ArchiveId="@LatestArchiveId" AllowedTypes="new ScriptType[] { ScriptType.Install, ScriptType.DetectInstall }" />
|
||||
}
|
||||
|
||||
@if (Panel == "Archives")
|
||||
|
|
Loading…
Reference in New Issue