42 lines
1.1 KiB
Plaintext
42 lines
1.1 KiB
Plaintext
@implements IDisposable
|
|
|
|
<MudDialog>
|
|
<DialogContent>
|
|
<MudContainer Class="mb-6">
|
|
<MudText>
|
|
Edit the playout's YAML file
|
|
</MudText>
|
|
</MudContainer>
|
|
<MudTextField Label="YAML File" @bind-Value="_yamlFile"/>
|
|
</DialogContent>
|
|
<DialogActions>
|
|
<MudButton OnClick="Cancel" ButtonType="ButtonType.Reset">Cancel</MudButton>
|
|
<MudButton Color="Color.Primary" Variant="Variant.Filled" Disabled="@(string.IsNullOrWhiteSpace(_yamlFile))" OnClick="Submit">
|
|
Save Changes
|
|
</MudButton>
|
|
</DialogActions>
|
|
</MudDialog>
|
|
|
|
@code {
|
|
private readonly CancellationTokenSource _cts = new();
|
|
|
|
[Parameter]
|
|
public string YamlFile { get; set; }
|
|
|
|
[CascadingParameter]
|
|
IMudDialogInstance MudDialog { get; set; }
|
|
|
|
private string _yamlFile;
|
|
|
|
public void Dispose()
|
|
{
|
|
_cts.Cancel();
|
|
_cts.Dispose();
|
|
}
|
|
|
|
protected override void OnParametersSet() => _yamlFile = YamlFile;
|
|
|
|
private void Submit() => MudDialog.Close(DialogResult.Ok(_yamlFile));
|
|
|
|
private void Cancel() => MudDialog.Cancel();
|
|
} |