@@ -821,19 +821,60 @@ <h2 class="text-lg font-semibold text-gray-900 dark:text-white">Add Credential</
821821 </ div >
822822 </ div >
823823
824+ <!-- Auth tipine gore bilgilendirme -->
825+ < div class ="rounded-md bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 p-3 ">
826+ < div class ="flex items-start gap-2 ">
827+ < svg class ="h-5 w-5 text-blue-400 dark:text-blue-500 flex-shrink-0 mt-0.5 " xmlns ="http://www.w3.org/2000/svg " viewBox ="0 0 20 20 " fill ="currentColor ">
828+ < path fill-rule ="evenodd " d ="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z " clip-rule ="evenodd " />
829+ </ svg >
830+ < div class ="text-sm text-blue-700 dark:text-blue-300 ">
831+ < template x-if ="PROVIDER_AUTH_TYPE === 'bearer' ">
832+ < span > Bearer auth icin < strong class ="font-mono "> token</ strong > key'i ile Bearer token degerinizi ekleyin.</ span >
833+ </ template >
834+ < template x-if ="PROVIDER_AUTH_TYPE === 'basic' ">
835+ < span > Basic auth icin < strong class ="font-mono "> username</ strong > ve < strong class ="font-mono "> password</ strong > key'leriyle iki ayri credential ekleyin.</ span >
836+ </ template >
837+ < template x-if ="PROVIDER_AUTH_TYPE === 'api_key' ">
838+ < span > API Key auth icin < strong class ="font-mono "> api_key</ strong > key'i ile API anahtarinizi ekleyin.</ span >
839+ </ template >
840+ < template x-if ="PROVIDER_AUTH_TYPE === 'oauth2' ">
841+ < span > OAuth2 auth icin < strong class ="font-mono "> client_id</ strong > ve < strong class ="font-mono "> client_secret</ strong > key'leriyle iki ayri credential ekleyin.</ span >
842+ </ template >
843+ < template x-if ="!PROVIDER_AUTH_TYPE || PROVIDER_AUTH_TYPE === 'none' ">
844+ < span > Bu provider icin auth tipi secilmemis. Gerekirse provider'i duzenleyerek auth tipi secin.</ span >
845+ </ template >
846+ </ div >
847+ </ div >
848+ </ div >
849+
824850 <!-- Anahtar adi -->
825851 < div >
826852 < label for ="cred-key " class ="block text-sm font-medium text-gray-700 dark:text-gray-300 ">
827853 Key Name < span class ="text-red-500 "> *</ span >
828854 </ label >
829- < input
830- type ="text "
831- id ="cred-key "
832- x-model ="credentialForm.key_name "
833- required
834- placeholder ="ornek: api_token "
835- class ="mt-1 block w-full rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-3 py-2 text-sm text-gray-900 dark:text-white shadow-sm placeholder:text-gray-400 dark:placeholder:text-gray-500 focus:border-indigo-500 dark:focus:border-indigo-400 focus:ring-1 focus:ring-indigo-500 dark:focus:ring-indigo-400 focus:outline-none font-mono "
836- >
855+ < template x-if ="credentialKeyOptions.length > 0 ">
856+ < select
857+ id ="cred-key "
858+ x-model ="credentialForm.key_name "
859+ required
860+ class ="mt-1 block w-full rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-3 py-2 text-sm text-gray-900 dark:text-white shadow-sm focus:border-indigo-500 dark:focus:border-indigo-400 focus:ring-1 focus:ring-indigo-500 dark:focus:ring-indigo-400 focus:outline-none font-mono "
861+ >
862+ < option value ="" disabled > Key secin...</ option >
863+ < template x-for ="opt in credentialKeyOptions " :key ="opt ">
864+ < option :value ="opt " x-text ="opt "> </ option >
865+ </ template >
866+ </ select >
867+ </ template >
868+ < template x-if ="credentialKeyOptions.length === 0 ">
869+ < input
870+ type ="text "
871+ id ="cred-key "
872+ x-model ="credentialForm.key_name "
873+ required
874+ placeholder ="ornek: api_token "
875+ class ="mt-1 block w-full rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-3 py-2 text-sm text-gray-900 dark:text-white shadow-sm placeholder:text-gray-400 dark:placeholder:text-gray-500 focus:border-indigo-500 dark:focus:border-indigo-400 focus:ring-1 focus:ring-indigo-500 dark:focus:ring-indigo-400 focus:outline-none font-mono "
876+ >
877+ </ template >
837878 </ div >
838879
839880 <!-- Deger (sifre alani) -->
@@ -846,7 +887,7 @@ <h2 class="text-lg font-semibold text-gray-900 dark:text-white">Add Credential</
846887 id ="cred-value "
847888 x-model ="credentialForm.value "
848889 required
849- placeholder ="Credential degerini girin "
890+ : placeholder ="credentialValuePlaceholder "
850891 class ="mt-1 block w-full rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-3 py-2 text-sm text-gray-900 dark:text-white shadow-sm placeholder:text-gray-400 dark:placeholder:text-gray-500 focus:border-indigo-500 dark:focus:border-indigo-400 focus:ring-1 focus:ring-indigo-500 dark:focus:ring-indigo-400 focus:outline-none font-mono "
851892 >
852893 < p class ="mt-1 text-xs text-gray-400 dark:text-gray-500 "> Deger sifrelenerek kaydedilir. Kaydedildikten sonra goruntulenebilir olmayacaktir.</ p >
@@ -924,6 +965,30 @@ <h2 class="text-lg font-semibold text-gray-900 dark:text-white">Add Credential</
924965 value : ''
925966 } ,
926967
968+ /* Auth tipine gore beklenen credential key'leri */
969+ get credentialKeyOptions ( ) {
970+ const keyMap = {
971+ 'bearer' : [ 'token' ] ,
972+ 'basic' : [ 'username' , 'password' ] ,
973+ 'api_key' : [ 'api_key' ] ,
974+ 'oauth2' : [ 'client_id' , 'client_secret' ]
975+ } ;
976+ return keyMap [ PROVIDER_AUTH_TYPE ] || [ ] ;
977+ } ,
978+
979+ /* Auth tipine gore placeholder metni */
980+ get credentialValuePlaceholder ( ) {
981+ const placeholderMap = {
982+ 'token' : 'Bearer token degerini girin' ,
983+ 'username' : 'Kullanici adini girin' ,
984+ 'password' : 'Sifre degerini girin' ,
985+ 'api_key' : 'API anahtarini girin' ,
986+ 'client_id' : 'OAuth2 client ID girin' ,
987+ 'client_secret' : 'OAuth2 client secret girin'
988+ } ;
989+ return placeholderMap [ this . credentialForm . key_name ] || 'Credential degerini girin' ;
990+ } ,
991+
927992 /* Yukleme ve hata durumlari */
928993 editLoading : false ,
929994 editError : '' ,
0 commit comments