DiscDialogTrackSetTable.razor 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. @code {
  2. [Parameter, Required] public FeTrackSet TrackSet { get; set; }
  3. [Parameter, Required] public bool ShowDetail { get; set; }
  4. }
  5. <div class="table-responsive">
  6. <table class="table">
  7. <thead>
  8. <tr class="table-primary">
  9. <th scope="col" class="p-1 text-center">
  10. <i class="bi bi-file-earmark-music"></i>
  11. </th>
  12. <th scope="col" class="p-1">
  13. <a href="@TrackSet?.M3U8Path" target="@FnzConst.PlayPageTarget" onclick="return fnz.blockDownloadAndOpenHtmlPage(this)">Play all</a>
  14. </th>
  15. <th scope="col" class="p-1 text-center">@TrackSet?.TotalDuration.SecondToDur()</th>
  16. <th scope="col" class="p-1 text-center">@TrackSet?.TotalBytes.BytesToFileSize()</th>
  17. <th scope="col" class="p-1 text-center">
  18. <i class="bi bi-list-ul"></i>
  19. </th>
  20. </tr>
  21. </thead>
  22. <tbody>
  23. @foreach (var t in (TrackSet?.Tracks).KeepNoEmpty().WithIndex())
  24. {
  25. <tr class="@(t.index % 2 == 0 ? "" : "table-primary") mouse-hilight">
  26. <td scope="col" class="p-1 text-center">
  27. <FileIcon Track="@t.item"></FileIcon>
  28. </td>
  29. <td scope="row" class="p-0 text-nowrap">
  30. <a @onclick="() => App.Instance.PlayTrack(t.item)" @onclick:preventDefault href="@t.item?.Path" target="@FnzConst.PlayPageTarget">@t.item?.GetTitleOrFilename()</a>
  31. </td>
  32. <td class="p-0 text-center">@(t.item?.Tag?.Duration.SecondToDur() ?? "?")</td>
  33. <td class="p-0 text-center">@(t.item?.Tag?.Length.BytesToFileSize() ?? "?")</td>
  34. <td class="p-0 text-center">
  35. <button type="button" class="btn btn-link" style="padding:0.1rem" @onclick="() => App.Instance.ShowAddTrackToPlaylistDialog(t.item)">
  36. <i class="bi bi-folder-plus"></i>
  37. </button>
  38. </td>
  39. </tr>
  40. }
  41. </tbody>
  42. </table>
  43. </div>