| ... | ... | @@ -426,18 +426,26 @@ export function ProviderInstanceCard({ |
| 426 | 426 | onRunUpdate, |
| 427 | 427 | isUpdating = false, |
| 428 | 428 | }: ProviderInstanceCardProps) { |
| 429 | | const [activeTab, setActiveTab] = useState<"models" | "configuration">("configuration"); |
| 429 | const [activeTab, setActiveTab] = useState<"configuration" | "models">("configuration"); |
| 430 | 430 | const enabled = resolveProviderInstanceEnabled(instance); |
| 431 | | // A locally disabled provider stays neutral even if its last server status |
| 432 | | // is stale. Enabled providers use the server status when one is available. |
| 431 | // A locally disabled provider reads "Disabled" with a muted dot even if its |
| 432 | // last server status is stale. Enabled providers use the server status. |
| 433 | 433 | const statusKey: ProviderStatusKey = enabled |
| 434 | 434 | ? ((liveProvider?.status as ProviderStatusKey | undefined) ?? "warning") |
| 435 | 435 | : "disabled"; |
| 436 | 436 | const statusStyle = PROVIDER_STATUS_STYLES[statusKey]; |
| 437 | | const rawSummary = getProviderSummary(liveProvider); |
| 438 | | const summary = enabled ? rawSummary : { headline: "Disabled", detail: null }; |
| 439 | | const authEmail = liveProvider?.auth.email; |
| 440 | | const showEditorStatus = enabled && (statusKey === "warning" || statusKey === "error"); |
| 437 | const summary = enabled |
| 438 | ? getProviderSummary(liveProvider) |
| 439 | : { headline: "Disabled", detail: null }; |
| 440 | const authEmail = liveProvider?.auth.email?.trim(); |
| 441 | // The editor header folds the account email into the status line — |
| 442 | // "Authenticated as <email> · <plan>" — with the email redacted until its |
| 443 | // reveal toggle is clicked. |
| 444 | const isAuthenticated = enabled && liveProvider?.auth.status === "authenticated"; |
| 445 | const authLabel = |
| 446 | enabled && liveProvider?.auth.status === "authenticated" |
| 447 | ? (liveProvider.auth.label ?? liveProvider.auth.type ?? null) |
| 448 | : null; |
| 441 | 449 | const versionLabel = getProviderVersionLabel(liveProvider?.version); |
| 442 | 450 | const versionAdvisory = getProviderVersionAdvisoryPresentation(liveProvider?.versionAdvisory); |
| 443 | 451 | const updateCommand = versionAdvisory?.updateCommand ?? null; |
| ... | ... | @@ -607,19 +615,34 @@ export function ProviderInstanceCard({ |
| 607 | 615 | <code className="text-xs text-muted-foreground">{versionLabel}</code> |
| 608 | 616 | ) : null; |
| 609 | 617 | |
| 618 | // Healthy and disabled rows read fine from their text; only trouble gets a dot. |
| 619 | const statusDotNode = |
| 620 | statusKey === "warning" || statusKey === "error" ? ( |
| 621 | <span className={cn("size-1.5 shrink-0 rounded-full", statusStyle.dot)} aria-hidden /> |
| 622 | ) : null; |
| 623 | const statusHeadlineNode = <span>{summary.headline}</span>; |
| 624 | // Trouble states carry the server's explanation (a failed probe, a shadow |
| 625 | // home entry that is not a symlink, a missing binary). Show it wherever the |
| 626 | // headline shows so the user can act without opening the editor. |
| 627 | const needsAttention = statusKey === "warning" || statusKey === "error"; |
| 628 | const statusLineClassName = |
| 629 | "flex min-w-0 flex-wrap items-center gap-x-1.5 text-[13px] leading-[1.45] text-muted-foreground/80"; |
| 630 | |
| 610 | 631 | if (mode === "list") { |
| 611 | 632 | return ( |
| 612 | 633 | <div |
| 613 | 634 | className={cn( |
| 614 | | "group relative flex min-h-16 items-center gap-3 border-b border-border/60 px-3 py-2.5 transition-colors last:border-b-0", |
| 615 | | selected ? "bg-muted/50" : "hover:bg-muted/25", |
| 635 | // Sidebar-style selection with a fixed row height so the list stays |
| 636 | // even; the status line clamps to two lines instead of growing. |
| 637 | "group flex h-19 items-start gap-3 rounded-md px-3 py-2 transition-colors", |
| 638 | // Foreground-alpha tint so the fill reads the same in light and dark themes. |
| 639 | selected ? "bg-foreground/8" : "hover:bg-foreground/4", |
| 616 | 640 | )} |
| 617 | 641 | > |
| 618 | | {selected ? <span className="absolute inset-y-0 left-0 w-0.5 bg-primary" /> : null} |
| 619 | 642 | <button |
| 620 | 643 | type="button" |
| 621 | 644 | className={cn( |
| 622 | | "flex min-w-0 flex-1 cursor-pointer items-center gap-3 rounded-sm text-left outline-none transition-opacity focus-visible:ring-2 focus-visible:ring-ring", |
| 645 | "flex min-w-0 flex-1 cursor-pointer items-start gap-3 rounded-sm text-left outline-none transition-opacity focus-visible:ring-2 focus-visible:ring-ring", |
| 623 | 646 | !enabled && !selected && "opacity-60 group-hover:opacity-100", |
| 624 | 647 | )} |
| 625 | 648 | onClick={onSelect} |
| ... | ... | @@ -629,150 +652,185 @@ export function ProviderInstanceCard({ |
| 629 | 652 | <span className="min-w-0 flex-1"> |
| 630 | 653 | <span className="flex min-w-0 items-center gap-2"> |
| 631 | 654 | <span className="truncate text-sm font-medium text-foreground">{displayName}</span> |
| 655 | {String(instanceId) !== String(instance.driver) ? ( |
| 656 | <code className="min-w-0 truncate rounded bg-muted/60 px-1 py-0.5 text-[10px] text-muted-foreground"> |
| 657 | {instanceId} |
| 658 | </code> |
| 659 | ) : null} |
| 632 | 660 | {versionCodeNode} |
| 661 | {versionAdvisory ? ( |
| 662 | <span role="img" aria-label="Update available" className="inline-flex shrink-0"> |
| 663 | <ArrowUpCircleIcon className="size-3.5 text-update-foreground" /> |
| 664 | </span> |
| 665 | ) : null} |
| 633 | 666 | </span> |
| 634 | | <span className="mt-0.5 flex items-center gap-1.5 text-[11px] text-muted-foreground"> |
| 635 | | <span className={cn("size-1.5 shrink-0 rounded-full", statusStyle.dot)} /> |
| 636 | | <span className="truncate">{summary.headline}</span> |
| 667 | <span className="mt-0.5 flex items-start gap-1.5 text-[13px] leading-[1.45] text-muted-foreground/80"> |
| 668 | {statusDotNode ? ( |
| 669 | <span className="flex h-[1.45em] shrink-0 items-center">{statusDotNode}</span> |
| 670 | ) : null} |
| 671 | <span className="line-clamp-2 [overflow-wrap:anywhere]"> |
| 672 | {summary.headline} |
| 673 | {needsAttention && summary.detail ? ` · ${summary.detail}` : null} |
| 674 | </span> |
| 637 | 675 | </span> |
| 638 | | {String(instanceId) !== String(instance.driver) ? ( |
| 639 | | <code className="mt-0.5 block truncate text-[10px] text-muted-foreground/70"> |
| 640 | | {instanceId} |
| 641 | | </code> |
| 642 | | ) : null} |
| 643 | 676 | </span> |
| 644 | 677 | </button> |
| 645 | | <Switch |
| 646 | | checked={enabled} |
| 647 | | disabled={readOnly} |
| 648 | | onCheckedChange={(checked) => updateEnabled(Boolean(checked))} |
| 649 | | aria-label={`Enable ${displayName}`} |
| 650 | | /> |
| 678 | <span className="flex h-5 shrink-0 items-center"> |
| 679 | <Switch |
| 680 | checked={enabled} |
| 681 | disabled={readOnly} |
| 682 | onCheckedChange={(checked) => updateEnabled(Boolean(checked))} |
| 683 | aria-label={`Enable ${displayName}`} |
| 684 | /> |
| 685 | </span> |
| 651 | 686 | </div> |
| 652 | 687 | ); |
| 653 | 688 | } |
| 654 | 689 | |
| 655 | 690 | return ( |
| 656 | 691 | <div className="min-w-0 lg:flex lg:h-full lg:min-h-0 lg:flex-col"> |
| 657 | | <div |
| 658 | | inert={readOnly} |
| 659 | | aria-disabled={readOnly || undefined} |
| 660 | | className={cn( |
| 661 | | "flex min-h-16 shrink-0 items-center justify-between gap-3 border-b border-border/70 px-4 py-3", |
| 662 | | readOnly && "opacity-50 select-none", |
| 663 | | )} |
| 664 | | > |
| 692 | <div className="flex min-h-16 shrink-0 items-start justify-between gap-3 border-b border-border/70 px-4 py-3"> |
| 665 | 693 | <div className="min-w-0 flex-1 space-y-1"> |
| 666 | 694 | <div className="flex min-w-0 flex-wrap items-center gap-2"> |
| 667 | 695 | {titleHeadNode} |
| 668 | 696 | {versionCodeNode} |
| 669 | | {versionAdvisory ? ( |
| 670 | | <Popover> |
| 671 | | <PopoverTrigger |
| 672 | | render={ |
| 673 | | <Button |
| 674 | | type="button" |
| 675 | | size="icon-xs" |
| 676 | | variant="ghost" |
| 677 | | className={cn( |
| 678 | | "size-5 rounded-sm p-0", |
| 679 | | versionAdvisory.emphasis === "strong" |
| 680 | | ? "text-warning hover:text-warning" |
| 681 | | : "text-update-foreground hover:text-update-foreground", |
| 682 | | )} |
| 683 | | aria-label="Update available — view details" |
| 684 | | > |
| 685 | | <ArrowUpCircleIcon className="size-3.5" /> |
| 686 | | </Button> |
| 687 | | } |
| 688 | | /> |
| 689 | | <PopoverPopup |
| 690 | | side="bottom" |
| 691 | | align="start" |
| 692 | | className="w-[min(21rem,calc(100vw-1.5rem))] [--popup-width:min(21rem,calc(100vw-1.5rem))]" |
| 693 | | > |
| 694 | | <div className="grid min-w-0 gap-3"> |
| 695 | | <div className="grid gap-0.5"> |
| 696 | | <p className="text-[13px] font-semibold leading-tight text-foreground"> |
| 697 | | Update available |
| 698 | | </p> |
| 699 | | <p |
| 697 | {/* |
| 698 | Only the write actions go inert on read-only sessions; the |
| 699 | status line below keeps its email reveal clickable. |
| 700 | */} |
| 701 | <span |
| 702 | inert={readOnly} |
| 703 | aria-disabled={readOnly || undefined} |
| 704 | className={cn("inline-flex items-center gap-2", readOnly && "opacity-50")} |
| 705 | > |
| 706 | {versionAdvisory ? ( |
| 707 | <Popover> |
| 708 | <PopoverTrigger |
| 709 | render={ |
| 710 | <Button |
| 711 | type="button" |
| 712 | size="icon-xs" |
| 713 | variant="ghost" |
| 700 | 714 | className={cn( |
| 701 | | "text-xs leading-snug", |
| 715 | "size-5 rounded-sm p-0", |
| 702 | 716 | versionAdvisory.emphasis === "strong" |
| 703 | | ? "text-warning" |
| 704 | | : "text-muted-foreground", |
| 717 | ? "text-warning hover:text-warning" |
| 718 | : "text-update-foreground hover:text-update-foreground", |
| 705 | 719 | )} |
| 720 | aria-label="Update available — view details" |
| 706 | 721 | > |
| 707 | | {versionAdvisory.detail} |
| 708 | | </p> |
| 709 | | </div> |
| 710 | | {onRunUpdate ? ( |
| 711 | | <Button |
| 712 | | type="button" |
| 713 | | size="xs" |
| 714 | | variant="default" |
| 715 | | className="w-full" |
| 716 | | disabled={isUpdating} |
| 717 | | onClick={onRunUpdate} |
| 718 | | > |
| 719 | | {isUpdating ? <LoaderIcon className="animate-spin" /> : <DownloadIcon />} |
| 720 | | {isUpdating ? "Updating" : "Update now"} |
| 722 | <ArrowUpCircleIcon className="size-3.5" /> |
| 721 | 723 | </Button> |
| 722 | | ) : null} |
| 723 | | {onRunUpdate && updateCommand ? ( |
| 724 | | <div className="flex items-center gap-2 text-[10px] font-medium uppercase tracking-wider text-muted-foreground"> |
| 725 | | <span aria-hidden className="h-px flex-1 bg-border" /> |
| 726 | | or, update manually using |
| 727 | | <span aria-hidden className="h-px flex-1 bg-border" /> |
| 728 | | </div> |
| 729 | | ) : null} |
| 730 | | {updateCommand ? ( |
| 731 | | <div className="flex min-w-0 items-center gap-1 rounded-md border border-border/70 bg-muted/40 py-0.5 pr-0.5 pl-2"> |
| 732 | | <ScrollArea scrollFade className="h-8 min-w-0 flex-1 rounded-none"> |
| 733 | | <code className="flex h-full w-max items-center whitespace-nowrap pr-3 font-mono text-[11px] text-foreground"> |
| 734 | | {updateCommand} |
| 735 | | </code> |
| 736 | | </ScrollArea> |
| 737 | | <Tooltip> |
| 738 | | <TooltipTrigger |
| 739 | | render={ |
| 740 | | <Button |
| 741 | | type="button" |
| 742 | | size="icon-xs" |
| 743 | | variant="ghost" |
| 744 | | className="size-6 shrink-0 rounded-sm p-0 text-muted-foreground hover:text-foreground" |
| 745 | | onClick={() => |
| 746 | | copyToClipboard(updateCommand, { |
| 747 | | providerName: displayName, |
| 748 | | }) |
| 749 | | } |
| 750 | | aria-label="Copy update command" |
| 751 | | > |
| 752 | | <CopyIcon className="size-3" /> |
| 753 | | </Button> |
| 754 | | } |
| 755 | | /> |
| 756 | | <TooltipPopup side="top">Copy command</TooltipPopup> |
| 757 | | </Tooltip> |
| 724 | } |
| 725 | /> |
| 726 | <PopoverPopup |
| 727 | side="bottom" |
| 728 | align="start" |
| 729 | className="w-[min(21rem,calc(100vw-1.5rem))] [--popup-width:min(21rem,calc(100vw-1.5rem))]" |
| 730 | > |
| 731 | <div className="grid min-w-0 gap-3"> |
| 732 | <div className="grid gap-0.5"> |
| 733 | <p className="text-[13px] font-semibold leading-tight text-foreground"> |
| 734 | Update available |
| 735 | </p> |
| 736 | <p |
| 737 | className={cn( |
| 738 | "text-xs leading-snug", |
| 739 | versionAdvisory.emphasis === "strong" |
| 740 | ? "text-warning" |
| 741 | : "text-muted-foreground", |
| 742 | )} |
| 743 | > |
| 744 | {versionAdvisory.detail} |
| 745 | </p> |
| 758 | 746 | </div> |
| 759 | | ) : null} |
| 760 | | </div> |
| 761 | | </PopoverPopup> |
| 762 | | </Popover> |
| 763 | | ) : null} |
| 764 | | {titleTailNode} |
| 747 | {onRunUpdate ? ( |
| 748 | <Button |
| 749 | type="button" |
| 750 | size="xs" |
| 751 | variant="default" |
| 752 | className="w-full" |
| 753 | disabled={isUpdating} |
| 754 | onClick={onRunUpdate} |
| 755 | > |
| 756 | {isUpdating ? <LoaderIcon className="animate-spin" /> : <DownloadIcon />} |
| 757 | {isUpdating ? "Updating" : "Update now"} |
| 758 | </Button> |
| 759 | ) : null} |
| 760 | {onRunUpdate && updateCommand ? ( |
| 761 | <div className="flex items-center gap-2 text-[10px] font-medium uppercase tracking-wider text-muted-foreground"> |
| 762 | <span aria-hidden className="h-px flex-1 bg-border" /> |
| 763 | or, update manually using |
| 764 | <span aria-hidden className="h-px flex-1 bg-border" /> |
| 765 | </div> |
| 766 | ) : null} |
| 767 | {updateCommand ? ( |
| 768 | <div className="flex min-w-0 items-center gap-1 rounded-md border border-border/70 bg-muted/40 py-0.5 pr-0.5 pl-2"> |
| 769 | <ScrollArea scrollFade className="h-8 min-w-0 flex-1 rounded-none"> |
| 770 | <code className="flex h-full w-max items-center whitespace-nowrap pr-3 font-mono text-[11px] text-foreground"> |
| 771 | {updateCommand} |
| 772 | </code> |
| 773 | </ScrollArea> |
| 774 | <Tooltip> |
| 775 | <TooltipTrigger |
| 776 | render={ |
| 777 | <Button |
| 778 | type="button" |
| 779 | size="icon-xs" |
| 780 | variant="ghost" |
| 781 | className="size-6 shrink-0 rounded-sm p-0 text-muted-foreground hover:text-foreground" |
| 782 | onClick={() => |
| 783 | copyToClipboard(updateCommand, { |
| 784 | providerName: displayName, |
| 785 | }) |
| 786 | } |
| 787 | aria-label="Copy update command" |
| 788 | > |
| 789 | <CopyIcon className="size-3" /> |
| 790 | </Button> |
| 791 | } |
| 792 | /> |
| 793 | <TooltipPopup side="top">Copy command</TooltipPopup> |
| 794 | </Tooltip> |
| 795 | </div> |
| 796 | ) : null} |
| 797 | </div> |
| 798 | </PopoverPopup> |
| 799 | </Popover> |
| 800 | ) : null} |
| 801 | {titleTailNode} |
| 802 | </span> |
| 765 | 803 | </div> |
| 766 | | {showEditorStatus ? ( |
| 767 | | <p className="flex min-w-0 flex-wrap items-center gap-x-1.5 text-xs text-muted-foreground"> |
| 768 | | <span>{summary.headline}</span> |
| 769 | | {summary.detail ? <span>· {summary.detail}</span> : null} |
| 804 | <p className={statusLineClassName}> |
| 805 | {statusDotNode} |
| 806 | {isAuthenticated && authEmail ? ( |
| 807 | <> |
| 808 | <span>Authenticated as</span> |
| 809 | <ProviderAuthEmail email={authEmail} /> |
| 810 | {authLabel ? <span>· {authLabel}</span> : null} |
| 811 | </> |
| 812 | ) : ( |
| 813 | statusHeadlineNode |
| 814 | )} |
| 815 | {summary.detail && !needsAttention ? <span>· {summary.detail}</span> : null} |
| 816 | </p> |
| 817 | {summary.detail && needsAttention ? ( |
| 818 | <p className="text-[13px] leading-[1.45] text-muted-foreground/80 [overflow-wrap:anywhere]"> |
| 819 | {summary.detail} |
| 770 | 820 | </p> |
| 771 | 821 | ) : null} |
| 772 | 822 | </div> |
| 773 | 823 | </div> |
| 774 | 824 | |
| 775 | 825 | <div className="flex h-11 shrink-0 border-b border-border/70 px-1"> |
| 826 | <button |
| 827 | type="button" |
| 828 | aria-pressed={visibleTab === "configuration"} |
| 829 | className={providerSettingsTabClassName(visibleTab === "configuration")} |
| 830 | onClick={() => setActiveTab("configuration")} |
| 831 | > |
| 832 | Configuration |
| 833 | </button> |
| 776 | 834 | {driverOption !== undefined ? ( |
| 777 | 835 | <button |
| 778 | 836 | type="button" |
| ... | ... | @@ -783,91 +841,83 @@ export function ProviderInstanceCard({ |
| 783 | 841 | Models |
| 784 | 842 | </button> |
| 785 | 843 | ) : null} |
| 786 | | <button |
| 787 | | type="button" |
| 788 | | aria-pressed={visibleTab === "configuration"} |
| 789 | | className={providerSettingsTabClassName(visibleTab === "configuration")} |
| 790 | | onClick={() => setActiveTab("configuration")} |
| 791 | | > |
| 792 | | Configuration |
| 793 | | </button> |
| 794 | 844 | </div> |
| 795 | 845 | |
| 796 | | <div |
| 797 | | inert={readOnly} |
| 798 | | aria-disabled={readOnly || undefined} |
| 799 | | className={cn("lg:min-h-0 lg:flex-1", readOnly && "opacity-50 select-none")} |
| 800 | | > |
| 801 | | <div |
| 802 | | className="space-y-5 px-4 py-5 lg:h-full lg:overflow-y-auto" |
| 846 | <div className="lg:min-h-0 lg:flex-1"> |
| 847 | <ScrollArea |
| 848 | scrollFade |
| 849 | chainVerticalScroll |
| 850 | className="lg:h-full" |
| 803 | 851 | hidden={visibleTab !== "configuration"} |
| 804 | 852 | > |
| 805 | | {authEmail?.trim() ? ( |
| 806 | | <div className="min-w-0"> |
| 807 | | <div className="text-xs font-medium text-foreground">Account email</div> |
| 808 | | <div className="mt-1.5 flex min-h-8 min-w-0 items-center"> |
| 809 | | <ProviderAuthEmail email={authEmail} /> |
| 810 | | </div> |
| 853 | <div |
| 854 | inert={readOnly} |
| 855 | aria-disabled={readOnly || undefined} |
| 856 | className={cn("space-y-5 px-4 py-5", readOnly && "opacity-50 select-none")} |
| 857 | > |
| 858 | <div> |
| 859 | <label htmlFor={`provider-instance-${instanceId}-display-name`} className="block"> |
| 860 | <span className="text-xs font-medium text-foreground">Display name</span> |
| 861 | <DraftInput |
| 862 | id={`provider-instance-${instanceId}-display-name`} |
| 863 | className="mt-1.5" |
| 864 | value={instance.displayName ?? ""} |
| 865 | onCommit={updateDisplayName} |
| 866 | placeholder={driverOption?.label ?? "Instance label"} |
| 867 | spellCheck={false} |
| 868 | /> |
| 869 | <span className="mt-1 block text-xs text-muted-foreground"> |
| 870 | Optional label shown in the provider list. |
| 871 | </span> |
| 872 | </label> |
| 811 | 873 | </div> |
| 812 | | ) : null} |
| 813 | 874 | |
| 814 | | <div> |
| 815 | | <label htmlFor={`provider-instance-${instanceId}-display-name`} className="block"> |
| 816 | | <span className="text-xs font-medium text-foreground">Display name</span> |
| 817 | | <DraftInput |
| 818 | | id={`provider-instance-${instanceId}-display-name`} |
| 819 | | className="mt-1.5" |
| 820 | | value={instance.displayName ?? ""} |
| 821 | | onCommit={updateDisplayName} |
| 822 | | placeholder={driverOption?.label ?? "Instance label"} |
| 823 | | spellCheck={false} |
| 875 | <div> |
| 876 | <ProviderAccentColorPicker |
| 877 | displayName={displayName} |
| 878 | value={accentColor} |
| 879 | onCommit={updateAccentColor} |
| 880 | commitDelayMs={120} |
| 881 | description="Used to distinguish this instance in picker rails and model lists." |
| 824 | 882 | /> |
| 825 | | <span className="mt-1 block text-xs text-muted-foreground"> |
| 826 | | Optional label shown in the provider list. |
| 827 | | </span> |
| 828 | | </label> |
| 829 | | </div> |
| 830 | | |
| 831 | | <div> |
| 832 | | <ProviderAccentColorPicker |
| 833 | | displayName={displayName} |
| 834 | | value={accentColor} |
| 835 | | onCommit={updateAccentColor} |
| 836 | | commitDelayMs={120} |
| 837 | | description="Used to distinguish this instance in picker rails and model lists." |
| 838 | | /> |
| 839 | | </div> |
| 840 | | |
| 841 | | <div> |
| 842 | | <ProviderEnvironmentSection |
| 843 | | environment={instance.environment ?? []} |
| 844 | | onChange={updateEnvironment} |
| 845 | | /> |
| 846 | | </div> |
| 847 | | |
| 848 | | {driverOption ? ( |
| 849 | | <ProviderSettingsForm |
| 850 | | definition={driverOption} |
| 851 | | value={instance.config} |
| 852 | | idPrefix={`provider-instance-${instanceId}`} |
| 853 | | variant="card" |
| 854 | | onChange={updateConfig} |
| 855 | | /> |
| 856 | | ) : null} |
| 883 | </div> |
| 857 | 884 | |
| 858 | | {driverOption === undefined ? ( |
| 859 | 885 | <div> |
| 860 | | <p className="text-xs text-muted-foreground"> |
| 861 | | This instance uses a driver ( |
| 862 | | <code className="text-foreground">{String(instance.driver)}</code>) that is not |
| 863 | | shipped with the current build. Configuration values are preserved but cannot be |
| 864 | | edited from this surface. |
| 865 | | </p> |
| 886 | <ProviderEnvironmentSection |
| 887 | environment={instance.environment ?? []} |
| 888 | onChange={updateEnvironment} |
| 889 | /> |
| 866 | 890 | </div> |
| 867 | | ) : null} |
| 868 | | </div> |
| 891 | |
| 892 | {driverOption ? ( |
| 893 | <ProviderSettingsForm |
| 894 | definition={driverOption} |
| 895 | value={instance.config} |
| 896 | idPrefix={`provider-instance-${instanceId}`} |
| 897 | variant="card" |
| 898 | onChange={updateConfig} |
| 899 | /> |
| 900 | ) : null} |
| 901 | |
| 902 | {driverOption === undefined ? ( |
| 903 | <div> |
| 904 | <p className="text-xs text-muted-foreground"> |
| 905 | This instance uses a driver ( |
| 906 | <code className="text-foreground">{String(instance.driver)}</code>) that is not |
| 907 | shipped with the current build. Configuration values are preserved but cannot be |
| 908 | edited from this surface. |
| 909 | </p> |
| 910 | </div> |
| 911 | ) : null} |
| 912 | </div> |
| 913 | </ScrollArea> |
| 869 | 914 | {driverOption !== undefined ? ( |
| 870 | | <div className="px-4 py-5 lg:h-full lg:min-h-0" hidden={visibleTab !== "models"}> |
| 915 | <div |
| 916 | inert={readOnly} |
| 917 | aria-disabled={readOnly || undefined} |
| 918 | className={cn("px-4 py-5 lg:h-full lg:min-h-0", readOnly && "opacity-50 select-none")} |
| 919 | hidden={visibleTab !== "models"} |
| 920 | > |
| 871 | 921 | <ProviderModelsSection |
| 872 | 922 | instanceId={instanceId} |
| 873 | 923 | driverKind={driverKind} |