Limit the embedding name and type length

This commit is contained in:
Thorsten Sommer 2024-12-27 13:14:49 +01:00
parent 81790b99de
commit 169e1cb601
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 12 additions and 0 deletions

View File

@ -12,6 +12,9 @@
AdornmentIcon="@Icons.Material.Filled.Label" AdornmentIcon="@Icons.Material.Filled.Label"
AdornmentColor="Color.Info" AdornmentColor="Color.Info"
Validation="@this.ValidateName" Validation="@this.ValidateName"
Counter="26"
MaxLength="26"
Immediate="@true"
UserAttributes="@SPELLCHECK_ATTRIBUTES" UserAttributes="@SPELLCHECK_ATTRIBUTES"
/> />
@ -24,7 +27,10 @@
Adornment="Adornment.Start" Adornment="Adornment.Start"
AdornmentIcon="@Icons.Material.Filled.Extension" AdornmentIcon="@Icons.Material.Filled.Extension"
AdornmentColor="Color.Info" AdornmentColor="Color.Info"
Counter="56"
MaxLength="56"
Validation="@this.ValidateType" Validation="@this.ValidateType"
Immediate="@true"
UserAttributes="@SPELLCHECK_ATTRIBUTES" UserAttributes="@SPELLCHECK_ATTRIBUTES"
/> />

View File

@ -86,6 +86,9 @@ public partial class EmbeddingMethodDialog : ComponentBase
if (string.IsNullOrWhiteSpace(name)) if (string.IsNullOrWhiteSpace(name))
return "The embedding name must not be empty. Please name the embedding."; return "The embedding name must not be empty. Please name the embedding.";
if (name.Length > 26)
return "The embedding name must not be longer than 26 characters.";
return null; return null;
} }
@ -94,6 +97,9 @@ public partial class EmbeddingMethodDialog : ComponentBase
if (string.IsNullOrWhiteSpace(type)) if (string.IsNullOrWhiteSpace(type))
return "The embedding type must not be empty. Please specify the embedding type."; return "The embedding type must not be empty. Please specify the embedding type.";
if (type.Length > 56)
return "The embedding type must not be longer than 56 characters.";
return null; return null;
} }