From 4534d4dbf5f5071fa71c5dec4444bf4b2bbd040c Mon Sep 17 00:00:00 2001 From: Rory& Date: Sun, 14 Dec 2025 23:18:35 +0100 Subject: admin api packaging --- .../Spacebar.AdminAPI.TestClient/Pages/Home.razor | 107 --------------------- 1 file changed, 107 deletions(-) delete mode 100644 extra/admin-api/Utilities/Spacebar.AdminAPI.TestClient/Pages/Home.razor (limited to 'extra/admin-api/Utilities/Spacebar.AdminAPI.TestClient/Pages/Home.razor') diff --git a/extra/admin-api/Utilities/Spacebar.AdminAPI.TestClient/Pages/Home.razor b/extra/admin-api/Utilities/Spacebar.AdminAPI.TestClient/Pages/Home.razor deleted file mode 100644 index 812a61521..000000000 --- a/extra/admin-api/Utilities/Spacebar.AdminAPI.TestClient/Pages/Home.razor +++ /dev/null @@ -1,107 +0,0 @@ -@page "/" -@using System.Net.Http.Headers -@using Spacebar.AdminAPI.TestClient.Services -@inject Config Config -@inject ILocalStorageService LocalStorage - -Home - -Spacebar API URL: - -
- - - - - -Spacebar CDN URL: - -
- -Spacebar Admin API URL: - -
- -Access Token: - -New access token -
- -@code { - - private bool IsApiUrlValid { get; set; } - - // private bool IsGatewayUrlValid { get; set; } - private bool IsCdnUrlValid { get; set; } - private bool IsAdminApiUrlValid { get; set; } - private bool IsAccessTokenValid { get; set; } - - protected override async Task OnInitializedAsync() { - await ValidateAndSaveConfig(); - } - - private async Task ValidateAndSaveConfig() { - await LocalStorage.SetItemAsync("sb_admin_tc_config", Config); - - using var hc = new HttpClient(); - HttpResponseMessage response; - try { - response = await hc.GetAsync(Config.ApiUrl + "/api/v9/policies/instance/domains"); - IsApiUrlValid = response.IsSuccessStatusCode; - } - catch { - IsApiUrlValid = false; - } - - StateHasChanged(); - - // response = await hc.GetAsync(Config.GatewayUrl + "/api/v9/policies/instance"); - // IsGatewayUrlValid = response.IsSuccessStatusCode; - // StateHasChanged(); - - try { - response = await hc.GetAsync(Config.CdnUrl + "/ping"); - IsCdnUrlValid = response.IsSuccessStatusCode; - } - catch { - IsCdnUrlValid = false; - } - - StateHasChanged(); - - try { - response = await hc.GetAsync(Config.AdminUrl + "/_spacebar/admin/ping"); - IsAdminApiUrlValid = response.IsSuccessStatusCode; - } - catch { - IsAdminApiUrlValid = false; - } - - StateHasChanged(); - - try { - var request = new HttpRequestMessage(HttpMethod.Get, Config.AdminUrl + "/_spacebar/admin/whoami"); - request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Config.AccessToken); - response = await hc.SendAsync(request); - IsAccessTokenValid = response.IsSuccessStatusCode; - } - catch { - IsAccessTokenValid = false; - } - - StateHasChanged(); - } - -} \ No newline at end of file -- cgit 1.5.1