mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-23 19:24:11 +08:00
refactor: Center truncate deployment provider URL (#12579)
* changed Deployment Provider URL to truncate in the center * fix: center-truncate deployment provider URL using provider_data.url --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Jordan Frazier <122494242+jordanrfrazier@users.noreply.github.com>
This commit is contained in:
@ -24,6 +24,12 @@ interface ProvidersTableProps {
|
||||
onDeleteProvider?: (provider: ProviderAccount) => void;
|
||||
}
|
||||
|
||||
function truncateMiddle(text: string, maxLength = 50): string {
|
||||
if (text.length <= maxLength) return text;
|
||||
const half = Math.floor((maxLength - 3) / 2);
|
||||
return `${text.slice(0, half)}...${text.slice(-half)}`;
|
||||
}
|
||||
|
||||
function formatDate(iso: string | null) {
|
||||
if (!iso) return "—";
|
||||
return new Date(iso).toLocaleDateString(undefined, {
|
||||
@ -62,9 +68,9 @@ export default function ProvidersTable({
|
||||
<span className="font-medium">{provider.name}</span>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<span className="max-w-[300px] truncate text-sm text-muted-foreground">
|
||||
<span className="text-sm text-muted-foreground">
|
||||
{typeof provider.provider_data?.url === "string"
|
||||
? provider.provider_data.url
|
||||
? truncateMiddle(provider.provider_data.url)
|
||||
: "—"}
|
||||
</span>
|
||||
</TableCell>
|
||||
|
||||
Reference in New Issue
Block a user