12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- @using WarcViewerBlazorWinForm.Backend.Warc
- @using WarcViewerBlazorWinForm.Library.EventBus
- @implements IDisposable
- @inject IEventBus EventBus
- <BootstrapInputGroup>
- <Tag>Indexer</Tag>
- @if (_event?.IsRunning != true)
- {
- <Tag><Light Color="Color.Dark" class="mt-2"></Light></Tag>
- <Tag>Idle</Tag>
- }
- else
- {
- <Tag><Light Color="Color.Success" class="mt-2"></Light></Tag>
- <Tag>Running</Tag>
- }
- @if (_event?.FileDescriptor != null)
- {
- if (_event.FileDescriptor.IsReadDirectly)
- {
- <Tag>@_event.FileDescriptor.FilePath</Tag>
- }
- else
- {
- <Tag>
- <div>@_event.FileDescriptor.FilePath</div>
- <div>@_event.FileDescriptor.ArchiveEntryKey</div>
- </Tag>
- }
- }
- @if (_event?.Position.HasValue == true)
- {
- <Tag><Progress IsAnimated Value="_event.Position.Value*100" Round="2" IsStriped IsShowValue Height="20"></Progress></Tag>
- }
- else if (_event?.IsRunning == true)
- {
- <Tag>Waiting...</Tag>
- }
- </BootstrapInputGroup>
- @code {
- private WarcIndexerStatusEvent? _event;
- protected override void OnInitialized()
- {
- EventBus.Subscript<WarcIndexerStatusEvent>(UpdateLabel);
- }
- public void Dispose()
- {
- EventBus.UnSubscript<WarcIndexerStatusEvent>(UpdateLabel);
- }
- private void UpdateLabel(WarcIndexerStatusEvent obj)
- {
- _event = obj;
- InvokeAsync(StateHasChanged);
- }
- }
|