Improved the configured provider table: long model names are now truncated

This commit is contained in:
Thorsten Sommer 2024-07-24 19:25:17 +02:00
parent f6f207cffb
commit fd38a71d5d
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
3 changed files with 14 additions and 2 deletions

View File

@ -29,11 +29,11 @@
<MudTd> <MudTd>
@if (context.UsedProvider is not Providers.SELF_HOSTED) @if (context.UsedProvider is not Providers.SELF_HOSTED)
{ {
@context.Model @this.GetProviderModelName(context)
} }
else if (context.UsedProvider is Providers.SELF_HOSTED && context.Host is not Host.LLAMACPP) else if (context.UsedProvider is Providers.SELF_HOSTED && context.Host is not Host.LLAMACPP)
{ {
@context.Model @this.GetProviderModelName(context)
} }
else else
{ {

View File

@ -111,5 +111,12 @@ public partial class Settings : ComponentBase
_ => string.Empty, _ => string.Empty,
}; };
private string GetProviderModelName(AIStudio.Settings.Provider provider)
{
const int MAX_LENGTH = 36;
var modelName = provider.Model.ToString();
return modelName.Length > MAX_LENGTH ? "[...] " + modelName[^Math.Min(MAX_LENGTH, modelName.Length)..] : modelName;
}
#endregion #endregion
} }

View File

@ -0,0 +1,5 @@
# v0.8.3 (WIP)
- Migrated UI framework from MudBlazor v6.x.x to v7.x.x
- Added an option to configure the behavior of the navigation bar in the settings
- Improved the handling of self-hosted provider hostnames
- Improved the configured provider table: long model names are now truncated