mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 17:39:47 +00:00
Refactored provider table on settings page
This commit is contained in:
parent
a78c2c8dbc
commit
a2009137f7
@ -41,7 +41,7 @@
|
|||||||
}
|
}
|
||||||
</MudTd>
|
</MudTd>
|
||||||
<MudTd Style="text-align: left;">
|
<MudTd Style="text-align: left;">
|
||||||
<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)">
|
<MudButton Variant="Variant.Filled" Color="Color.Info" StartIcon="@Icons.Material.Filled.OpenInBrowser" Class="ma-2" Href="@this.GetProviderDashboardURL(context.UsedProvider)" Target="_blank" Disabled="@(!this.HasDashboard(context.UsedProvider))">
|
||||||
Open Dashboard
|
Open Dashboard
|
||||||
</MudButton>
|
</MudButton>
|
||||||
<MudButton Variant="Variant.Filled" Color="Color.Info" StartIcon="@Icons.Material.Filled.Edit" Class="ma-2" OnClick="() => this.EditProvider(context)">
|
<MudButton Variant="Variant.Filled" Color="Color.Info" StartIcon="@Icons.Material.Filled.Edit" Class="ma-2" OnClick="() => this.EditProvider(context)">
|
||||||
|
@ -102,11 +102,22 @@ public partial class Settings : ComponentBase
|
|||||||
await this.MessageBus.SendMessage<bool>(this, Event.CONFIGURATION_CHANGED);
|
await this.MessageBus.SendMessage<bool>(this, Event.CONFIGURATION_CHANGED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool HasDashboard(Providers provider) => provider switch
|
||||||
|
{
|
||||||
|
Providers.OPEN_AI => true,
|
||||||
|
Providers.MISTRAL => true,
|
||||||
|
Providers.ANTHROPIC => true,
|
||||||
|
Providers.FIREWORKS => true,
|
||||||
|
|
||||||
|
_ => false,
|
||||||
|
};
|
||||||
|
|
||||||
private string GetProviderDashboardURL(Providers provider) => provider switch
|
private string GetProviderDashboardURL(Providers provider) => provider switch
|
||||||
{
|
{
|
||||||
Providers.OPEN_AI => "https://platform.openai.com/usage",
|
Providers.OPEN_AI => "https://platform.openai.com/usage",
|
||||||
Providers.MISTRAL => "https://console.mistral.ai/usage/",
|
Providers.MISTRAL => "https://console.mistral.ai/usage/",
|
||||||
Providers.ANTHROPIC => "https://console.anthropic.com/settings/plans",
|
Providers.ANTHROPIC => "https://console.anthropic.com/settings/plans",
|
||||||
|
Providers.FIREWORKS => "https://fireworks.ai/account/billing",
|
||||||
|
|
||||||
_ => string.Empty,
|
_ => string.Empty,
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user