mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 12:21:13 -05:00
Fixes
This commit is contained in:
@@ -44,6 +44,7 @@ const ApiOptions = ({ showModelOptions, apiErrorMessage, modelIdErrorMessage }:
|
|||||||
const [ollamaModels, setOllamaModels] = useState<string[]>([])
|
const [ollamaModels, setOllamaModels] = useState<string[]>([])
|
||||||
const [anthropicBaseUrlSelected, setAnthropicBaseUrlSelected] = useState(!!apiConfiguration?.anthropicBaseUrl)
|
const [anthropicBaseUrlSelected, setAnthropicBaseUrlSelected] = useState(!!apiConfiguration?.anthropicBaseUrl)
|
||||||
const [azureApiVersionSelected, setAzureApiVersionSelected] = useState(!!apiConfiguration?.azureApiVersion)
|
const [azureApiVersionSelected, setAzureApiVersionSelected] = useState(!!apiConfiguration?.azureApiVersion)
|
||||||
|
const [isDescriptionExpanded, setIsDescriptionExpanded] = useState(false)
|
||||||
|
|
||||||
const handleInputChange = (field: keyof ApiConfiguration) => (event: any) => {
|
const handleInputChange = (field: keyof ApiConfiguration) => (event: any) => {
|
||||||
setApiConfiguration({ ...apiConfiguration, [field]: event.target.value })
|
setApiConfiguration({ ...apiConfiguration, [field]: event.target.value })
|
||||||
@@ -542,7 +543,12 @@ const ApiOptions = ({ showModelOptions, apiErrorMessage, modelIdErrorMessage }:
|
|||||||
{selectedProvider === "openai-native" && createDropdown(openAiNativeModels)}
|
{selectedProvider === "openai-native" && createDropdown(openAiNativeModels)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ModelInfoView selectedModelId={selectedModelId} modelInfo={selectedModelInfo} />
|
<ModelInfoView
|
||||||
|
selectedModelId={selectedModelId}
|
||||||
|
modelInfo={selectedModelInfo}
|
||||||
|
isDescriptionExpanded={isDescriptionExpanded}
|
||||||
|
setIsDescriptionExpanded={setIsDescriptionExpanded}
|
||||||
|
/>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@@ -573,8 +579,17 @@ export const formatPrice = (price: number) => {
|
|||||||
}).format(price)
|
}).format(price)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ModelInfoView = ({ selectedModelId, modelInfo }: { selectedModelId: string; modelInfo: ModelInfo }) => {
|
export const ModelInfoView = ({
|
||||||
const [isDescriptionExpanded, setIsDescriptionExpanded] = useState(false)
|
selectedModelId,
|
||||||
|
modelInfo,
|
||||||
|
isDescriptionExpanded,
|
||||||
|
setIsDescriptionExpanded,
|
||||||
|
}: {
|
||||||
|
selectedModelId: string
|
||||||
|
modelInfo: ModelInfo
|
||||||
|
isDescriptionExpanded: boolean
|
||||||
|
setIsDescriptionExpanded: (isExpanded: boolean) => void
|
||||||
|
}) => {
|
||||||
const isGemini = Object.keys(geminiModels).includes(selectedModelId)
|
const isGemini = Object.keys(geminiModels).includes(selectedModelId)
|
||||||
|
|
||||||
const infoItems = [
|
const infoItems = [
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ const OpenRouterModelPicker: React.FC = () => {
|
|||||||
const [selectedIndex, setSelectedIndex] = useState(-1)
|
const [selectedIndex, setSelectedIndex] = useState(-1)
|
||||||
const dropdownRef = useRef<HTMLDivElement>(null)
|
const dropdownRef = useRef<HTMLDivElement>(null)
|
||||||
const itemRefs = useRef<(HTMLDivElement | null)[]>([])
|
const itemRefs = useRef<(HTMLDivElement | null)[]>([])
|
||||||
|
const [isDescriptionExpanded, setIsDescriptionExpanded] = useState(false)
|
||||||
|
|
||||||
const handleModelChange = (newModelId: string) => {
|
const handleModelChange = (newModelId: string) => {
|
||||||
setApiConfiguration({
|
setApiConfiguration({
|
||||||
@@ -187,7 +188,12 @@ const OpenRouterModelPicker: React.FC = () => {
|
|||||||
</DropdownWrapper>
|
</DropdownWrapper>
|
||||||
|
|
||||||
{hasInfo ? (
|
{hasInfo ? (
|
||||||
<ModelInfoView selectedModelId={selectedModelId} modelInfo={selectedModelInfo} />
|
<ModelInfoView
|
||||||
|
selectedModelId={selectedModelId}
|
||||||
|
modelInfo={selectedModelInfo}
|
||||||
|
isDescriptionExpanded={isDescriptionExpanded}
|
||||||
|
setIsDescriptionExpanded={setIsDescriptionExpanded}
|
||||||
|
/>
|
||||||
) : (
|
) : (
|
||||||
<p
|
<p
|
||||||
style={{
|
style={{
|
||||||
|
|||||||
Reference in New Issue
Block a user