@@ -963,18 +963,39 @@ <h3 class="text-lg font-bold mb-4 dark:text-gray-200">
963963 </ h3 >
964964 < form id ="add-tool-form ">
965965 < div class ="grid grid-cols-1 gap-6 ">
966- < div >
967- < label
968- class ="block text-sm font-medium text-gray-700 dark:text-gray-400 "
969- > Name</ label
970- >
971- < input
972- type ="text "
973- name ="name "
974- required
975- class ="mt-1 block w-full rounded-md border border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 dark:bg-gray-900 dark:placeholder-gray-300 dark:text-gray-300 "
976- />
966+ < div class ="grid grid-cols-1 md:grid-cols-2 gap-6 ">
967+ < div >
968+ < label class ="block text-sm font-medium text-gray-700 dark:text-gray-400 ">
969+ Gateway Name
970+ </ label >
971+ < input
972+ type ="text "
973+ name ="gateway_name "
974+ id ="add-tool-gateway-name "
975+ placeholder ="e.g., local-gateway "
976+ class ="mt-1 block w-full rounded-md border border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 dark:bg-gray-900 dark:placeholder-gray-300 dark:text-gray-300 "
977+ />
978+ < p class ="mt-1 text-xs text-gray-500 dark:text-gray-400 ">
979+ Optional for REST tools; populated for MCP-imported tools.
980+ </ p >
981+ </ div >
982+ < div >
983+ < label class ="block text-sm font-medium text-gray-700 dark:text-gray-400 ">
984+ Original Name
985+ </ label >
986+ < input
987+ type ="text "
988+ name ="original_name "
989+ id ="add-tool-original-name "
990+ placeholder ="e.g., list-files "
991+ class ="mt-1 block w-full rounded-md border border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 dark:bg-gray-900 dark:placeholder-gray-300 dark:text-gray-300 "
992+ />
993+ < p class ="mt-1 text-xs text-gray-500 dark:text-gray-400 ">
994+ Tool's name as provided by the gateway.
995+ </ p >
996+ </ div >
977997 </ div >
998+
978999 < div >
9791000 < label
9801001 class ="block text-sm font-medium text-gray-700 dark:text-gray-400 "
@@ -2635,19 +2656,32 @@ <h3 class="text-lg font-medium text-gray-900 dark:text-gray-100">
26352656 < div class ="mt-4 ">
26362657 < form id ="edit-tool-form " method ="POST ">
26372658 < div class ="grid grid-cols-1 gap-6 ">
2638- < div >
2639- < label
2640- class ="block text-sm font-medium text-gray-700 dark:text-gray-300 "
2641- > Name</ label
2642- >
2643- < input
2644- type ="text "
2645- name ="name "
2646- required
2647- id ="edit-tool-name "
2648- class ="mt-1 block w-full rounded-md border border-gray-300 dark:border-gray-600 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 dark:bg-gray-900 dark:placeholder-gray-300 dark:text-gray-300 "
2649- />
2659+
2660+ < div class ="grid grid-cols-1 md:grid-cols-2 gap-4 ">
2661+ < div >
2662+ < label class ="block text-sm font-medium text-gray-700 dark:text-gray-300 ">
2663+ Gateway Name
2664+ </ label >
2665+ < input
2666+ type ="text "
2667+ name ="gateway_name "
2668+ id ="edit-tool-gateway-name "
2669+ class ="mt-1 block w-full rounded-md border border-gray-300 dark:border-gray-600 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 dark:bg-gray-900 dark:placeholder-gray-300 dark:text-gray-300 "
2670+ />
2671+ </ div >
2672+ < div >
2673+ < label class ="block text-sm font-medium text-gray-700 dark:text-gray-300 ">
2674+ Original Name
2675+ </ label >
2676+ < input
2677+ type ="text "
2678+ name ="original_name "
2679+ id ="edit-tool-original-name "
2680+ class ="mt-1 block w-full rounded-md border border-gray-300 dark:border-gray-600 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 dark:bg-gray-900 dark:placeholder-gray-300 dark:text-gray-300 "
2681+ />
2682+ </ div >
26502683 </ div >
2684+
26512685 < div >
26522686 < label
26532687 class ="block text-sm font-medium text-gray-700 dark:text-gray-300 "
@@ -2681,9 +2715,11 @@ <h3 class="text-lg font-medium text-gray-900 dark:text-gray-100">
26812715 name ="integrationType "
26822716 id ="edit-tool-type "
26832717 class ="mt-1 block w-full rounded-md border border-gray-300 dark:border-gray-600 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 dark:bg-gray-900 dark:placeholder-gray-300 dark:text-gray-300 "
2718+ onchange ="handleEditIntegrationTypeChange() "
26842719 >
26852720
26862721 < option value ="REST "> REST</ option >
2722+ < option value ="MCP "> MCP</ option >
26872723 </ select >
26882724 </ div >
26892725 < div >
@@ -2696,7 +2732,7 @@ <h3 class="text-lg font-medium text-gray-900 dark:text-gray-100">
26962732 id ="edit-tool-request-type "
26972733 class ="mt-1 block w-full rounded-md border border-gray-300 dark:border-gray-600 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 dark:bg-gray-900 dark:placeholder-gray-300 dark:text-gray-300 "
26982734 >
2699- <!-- Will be populated dynamically -->
2735+
27002736 </ select >
27012737 </ div >
27022738 < div >
@@ -3846,5 +3882,35 @@ <h3 class="text-lg font-medium text-gray-900 dark:text-gray-100">
38463882 } ) ;
38473883 } ) ;
38483884 </ script >
3885+ < script >
3886+ function handleEditIntegrationTypeChange ( ) {
3887+ const typeSel = document . getElementById ( 'edit-tool-type' ) ;
3888+ const reqSel = document . getElementById ( 'edit-tool-request-type' ) ;
3889+ if ( ! typeSel || ! reqSel ) return ;
3890+
3891+ const isREST = typeSel . value === 'REST' ;
3892+ // For REST tools, enable HTTP verbs; for MCP, disable & clear to avoid bad values.
3893+ reqSel . disabled = ! isREST ;
3894+ if ( ! isREST ) {
3895+ reqSel . value = '' ;
3896+ }
3897+ }
3898+
3899+ // When the Edit modal is shown, re-evaluate enable/disable based on prefilled value.
3900+ ( function ( ) {
3901+ const modal = document . getElementById ( 'tool-edit-modal' ) ;
3902+ if ( ! modal ) return ;
3903+
3904+ const observer = new MutationObserver ( ( ) => {
3905+ const isOpen = ! modal . classList . contains ( 'hidden' ) ;
3906+ if ( isOpen ) {
3907+ // Defer one tick so existing JS can prefill values first.
3908+ setTimeout ( handleEditIntegrationTypeChange , 0 ) ;
3909+ }
3910+ } ) ;
3911+ observer . observe ( modal , { attributes : true , attributeFilter : [ 'class' ] } ) ;
3912+ } ) ( ) ;
3913+ </ script >
3914+
38493915 </ body >
38503916</ html >
0 commit comments