| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- @using RackPeek.Domain.Helpers
- @using RackPeek.Domain.Persistence
- @using RackPeek.Web.Components.Pages
- @using Shared.Rcl.Servers
- @inject IResourceCollection Resources
- @if (!_ready)
- {
- <p>Loading…</p>
- }
- else
- {
- <Router AppAssembly="@typeof(App).Assembly"
- AdditionalAssemblies="new[] { typeof(ServersListPage).Assembly }"
- NotFoundPage="typeof(NotFound)">
- <Found Context="routeData">
- <RouteView RouteData="routeData" DefaultLayout="typeof(MainLayout)"/>
- </Found>
- </Router>
- }
- @code {
- private bool _ready;
- protected override async Task OnInitializedAsync()
- {
- try
- {
- await Resources.LoadAsync();
- }
- catch (ConfigLoadException)
- {
- // A damaged config must not leave the app stuck on "Loading…" — the YAML
- // editor is how someone repairs it. Pages that read the inventory surface
- // the failure themselves; they can no longer report it as empty (#337).
- }
- _ready = true;
- }
- }
|