mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 15:39:46 +00:00
Added links to dashboards
This commit is contained in:
parent
df009cd35d
commit
993e5a14ab
@ -1,4 +1,5 @@
|
|||||||
@page "/settings"
|
@page "/settings"
|
||||||
|
@using AIStudio.Provider
|
||||||
|
|
||||||
<MudText Typo="Typo.h3" Class="mb-12">Settings</MudText>
|
<MudText Typo="Typo.h3" Class="mb-12">Settings</MudText>
|
||||||
|
|
||||||
@ -11,7 +12,7 @@
|
|||||||
<col style="width: 12em;"/>
|
<col style="width: 12em;"/>
|
||||||
<col style="width: 12em;"/>
|
<col style="width: 12em;"/>
|
||||||
<col/>
|
<col/>
|
||||||
<col style="width: 20em;"/>
|
<col style="width: 34em;"/>
|
||||||
</ColGroup>
|
</ColGroup>
|
||||||
<HeaderContent>
|
<HeaderContent>
|
||||||
<MudTh>#</MudTh>
|
<MudTh>#</MudTh>
|
||||||
@ -26,10 +27,13 @@
|
|||||||
<MudTd>@context.UsedProvider</MudTd>
|
<MudTd>@context.UsedProvider</MudTd>
|
||||||
<MudTd>@context.Model</MudTd>
|
<MudTd>@context.Model</MudTd>
|
||||||
<MudTd Style="text-align: left;">
|
<MudTd Style="text-align: left;">
|
||||||
<MudButton Variant="Variant.Filled" Color="Color.Info" StartIcon="@Icons.Material.Filled.Edit" Class="mr-2" OnClick="() => this.EditProvider(context)">
|
<MudButton Variant="Variant.Filled" Color="Color.Info" StartIcon="@Icons.Material.Filled.OpenInBrowser" Class="ma-2" Href="@this.GetProviderDashboardURL(context.UsedProvider)" Target="_blank" Disabled="@(context.UsedProvider is Providers.NONE or Providers.SELF_HOSTED)">
|
||||||
|
Open Dashboard
|
||||||
|
</MudButton>
|
||||||
|
<MudButton Variant="Variant.Filled" Color="Color.Info" StartIcon="@Icons.Material.Filled.Edit" Class="ma-2" OnClick="() => this.EditProvider(context)">
|
||||||
Edit
|
Edit
|
||||||
</MudButton>
|
</MudButton>
|
||||||
<MudButton Variant="Variant.Filled" Color="Color.Error" StartIcon="@Icons.Material.Filled.Delete" Class="mr-2" OnClick="() => this.DeleteProvider(context)">
|
<MudButton Variant="Variant.Filled" Color="Color.Error" StartIcon="@Icons.Material.Filled.Delete" Class="ma-2" OnClick="() => this.DeleteProvider(context)">
|
||||||
Delete
|
Delete
|
||||||
</MudButton>
|
</MudButton>
|
||||||
</MudTd>
|
</MudTd>
|
||||||
|
@ -81,7 +81,7 @@ public partial class Settings : ComponentBase
|
|||||||
if (dialogResult.Canceled)
|
if (dialogResult.Canceled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var providerInstance = provider.UsedProvider.CreateProvider(provider.InstanceName);
|
var providerInstance = provider.UsedProvider.CreateProvider(provider.InstanceName, provider.Hostname);
|
||||||
var deleteSecretResponse = await this.SettingsManager.DeleteAPIKey(this.JsRuntime, providerInstance);
|
var deleteSecretResponse = await this.SettingsManager.DeleteAPIKey(this.JsRuntime, providerInstance);
|
||||||
if(deleteSecretResponse.Success)
|
if(deleteSecretResponse.Success)
|
||||||
{
|
{
|
||||||
@ -90,5 +90,14 @@ public partial class Settings : ComponentBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string GetProviderDashboardURL(Providers provider) => provider switch
|
||||||
|
{
|
||||||
|
Providers.OPEN_AI => "https://platform.openai.com/usage",
|
||||||
|
Providers.MISTRAL => "https://console.mistral.ai/usage/",
|
||||||
|
Providers.ANTHROPIC => "https://console.anthropic.com/settings/plans",
|
||||||
|
|
||||||
|
_ => string.Empty,
|
||||||
|
};
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user