@@ -188,6 +188,7 @@ export default function ByokManager() {
188188 const [ error , setError ] = useState < string | null > ( null ) ;
189189 const [ expandedModel , setExpandedModel ] = useState < number | null > ( null ) ;
190190 const [ copiedModel , setCopiedModel ] = useState < number | null > ( null ) ;
191+ const [ copiedAll , setCopiedAll ] = useState ( false ) ;
191192 const [ modelToDelete , setModelToDelete ] = useState < number | null > ( null ) ;
192193 const [ showApiKeys , setShowApiKeys ] = useState < Set < number > > ( new Set ( ) ) ;
193194
@@ -227,6 +228,14 @@ export default function ByokManager() {
227228 setTimeout ( ( ) => setCopiedModel ( null ) , 2000 ) ;
228229 } ;
229230
231+ const handleCopyAll = async ( ) => {
232+ if ( models . length === 0 ) return ;
233+ const allConfigs = JSON . stringify ( { custom_models : models } , null , 2 ) ;
234+ await navigator . clipboard . writeText ( allConfigs ) ;
235+ setCopiedAll ( true ) ;
236+ setTimeout ( ( ) => setCopiedAll ( false ) , 2000 ) ;
237+ } ;
238+
230239 const openAddDialog = ( ) => {
231240 setForm ( DEFAULT_FORM ) ;
232241 setEditingIndex ( null ) ;
@@ -336,6 +345,11 @@ export default function ByokManager() {
336345 </ div >
337346
338347 < div className = "flex items-center gap-1.5 ml-auto" >
348+ { models . length > 0 && (
349+ < Button variant = "outline" size = "icon" onClick = { handleCopyAll } className = "h-8 w-8" title = "Copy all configs" >
350+ { copiedAll ? < Check className = "h-3.5 w-3.5 text-green-500" /> : < Copy className = "h-3.5 w-3.5" /> }
351+ </ Button >
352+ ) }
339353 < Button variant = "outline" size = "icon" onClick = { loadModels } className = "h-8 w-8" title = "Refresh" >
340354 < RefreshCw className = "h-3.5 w-3.5" />
341355 </ Button >
0 commit comments