11<template >
2- <v-dialog v-model =" showDialog" max-width =" 1100px " min-height = " 95% " >
2+ <v-dialog v-model =" showDialog" max-width =" 1000px " >
33 <v-card :title =" tm('dialogs.addProvider.title')" >
44 <v-card-text style =" overflow-y : auto ;" >
55 <v-tabs v-model =" activeProviderTab" grow >
7373import { useModuleI18n } from ' @/i18n/composables' ;
7474import { getProviderIcon , getProviderDescription } from ' @/utils/providerUtils' ;
7575
76+ const AVAILABLE_PROVIDER_TABS = [' agent_runner' , ' speech_to_text' , ' text_to_speech' , ' embedding' , ' rerank' ];
77+
7678export default {
7779 name: ' AddNewProvider' ,
7880 props: {
@@ -83,6 +85,10 @@ export default {
8385 metadata: {
8486 type: Object ,
8587 default : () => ({})
88+ },
89+ currentProviderType: {
90+ type: String ,
91+ default: ' agent_runner'
8692 }
8793 },
8894 emits: [' update:show' , ' select-template' ],
@@ -92,7 +98,7 @@ export default {
9298 },
9399 data () {
94100 return {
95- activeProviderTab: ' chat_completion '
101+ activeProviderTab: ' agent_runner '
96102 };
97103 },
98104 computed: {
@@ -105,7 +111,25 @@ export default {
105111 }
106112 },
107113 },
114+ watch: {
115+ show (value ) {
116+ if (value) {
117+ this .syncActiveProviderTab ();
118+ }
119+ },
120+ currentProviderType () {
121+ if (this .showDialog ) {
122+ this .syncActiveProviderTab ();
123+ }
124+ }
125+ },
108126 methods: {
127+ syncActiveProviderTab () {
128+ this .activeProviderTab = AVAILABLE_PROVIDER_TABS .includes (this .currentProviderType )
129+ ? this .currentProviderType
130+ : ' agent_runner' ;
131+ },
132+
109133 closeDialog () {
110134 this .showDialog = false ;
111135 },
0 commit comments