|
1 | 1 | @page "/bridge/{Id:guid}" |
| 2 | +@using HueApi.Models.Clip |
| 3 | +@using HueEntertainmentPro.Client.Services |
| 4 | +@using HueEntertainmentPro.Client.Shared.ResourceExplorerComponents |
2 | 5 | @using HueEntertainmentPro.Shared.Interfaces |
3 | 6 | @using HueEntertainmentPro.Shared.Models |
4 | 7 | @using HueEntertainmentPro.Shared.Models.Requests |
5 | 8 | @using HueLightDJ.Services.Interfaces |
6 | 9 | @using HueLightDJ.Services.Interfaces.Models |
| 10 | +@using System.Text.Json |
7 | 11 | @inject IBridgeDataService BridgeService |
8 | 12 | @inject IHueSetupService HueSetupService |
9 | 13 | @inject NavigationManager Navigation |
10 | 14 | @inject IDialogService DialogService |
11 | 15 | @inject IToastService ToastService |
| 16 | +@inject ResourceExplorerService ResourceExplorerService |
12 | 17 |
|
13 | 18 | <h3>Bridge Details</h3> |
14 | 19 |
|
|
31 | 36 | </FluentStack> |
32 | 37 | </FluentStack> |
33 | 38 |
|
| 39 | + |
34 | 40 | <h4 style="margin-top: 20px;">Entertainment Groups</h4> |
35 | 41 | @if (entertainmentGroups == null) |
36 | 42 | { |
|
47 | 53 | { |
48 | 54 | <FluentLabel>No entertainment groups found for this bridge.</FluentLabel> |
49 | 55 | } |
| 56 | + |
| 57 | + <h4 style="margin-top: 20px;">Bridge Config</h4> |
| 58 | + <p> |
| 59 | + Explore more bridge details on the <a href="/resource-explorer/@Id">Resource Explorer</a>.<br /> |
| 60 | + View <a href="http://@bridge.Ip/description.xml" target="_blank">description.xml</a>.<br /> |
| 61 | + </p> |
| 62 | + @if (bridgeConfig == null) |
| 63 | + { |
| 64 | + <FluentProgressRing>Loading bridge config...</FluentProgressRing> |
| 65 | + } |
| 66 | + else |
| 67 | + { |
| 68 | + <JsonViewer Element="@JsonSerializer.SerializeToElement(bridgeConfig)" Bridge="@bridge" /> |
| 69 | + } |
| 70 | + |
| 71 | + |
50 | 72 | } |
51 | 73 | else |
52 | 74 | { |
|
58 | 80 | public Guid Id { get; set; } |
59 | 81 |
|
60 | 82 | private Bridge? bridge; |
| 83 | + private BridgeConfig? bridgeConfig; |
61 | 84 | private IQueryable<SimpleEntertainmentGroup>? entertainmentGroups; |
62 | 85 | private string? errorMessage; |
63 | 86 |
|
64 | 87 | protected override async Task OnInitializedAsync() |
65 | 88 | { |
66 | 89 | try |
67 | 90 | { |
| 91 | + bridgeConfig = null; |
| 92 | + entertainmentGroups = null; |
| 93 | + |
68 | 94 | // Load bridge details |
69 | 95 | bridge = await BridgeService.GetBridge(new GuidRequest() { Id = Id }); |
70 | 96 | if (bridge == null) |
|
73 | 99 | return; |
74 | 100 | } |
75 | 101 |
|
| 102 | + var localHueClient = ResourceExplorerService.GetHueClient(bridge); |
| 103 | + bridgeConfig = await localHueClient.GetConfigAsync(); |
| 104 | + |
76 | 105 | // Load entertainment groups |
77 | 106 | var result = await HueSetupService.GetEntertainmentGroupsAsync(new HueLightDJ.Services.Interfaces.Models.Requests.HueSetupRequest() |
78 | 107 | { |
|
0 commit comments