@@ -36,6 +36,7 @@ import useFunctionCache from "@/hooks/useFunctionCache";
36
36
import useHotKey , { DEFAULT_SHORTCUTS } from "@/hooks/useHotKey" ;
37
37
import useCustomSettingStore from "@/pages/customSetting" ;
38
38
import useGlobalStore from "@/pages/globalStore" ;
39
+ import useSiteSettingStore from "@/pages/siteSetting" ;
39
40
40
41
const HAS_BODY_PARAMS_METHODS : ( TMethod | undefined ) [ ] = [ "POST" , "PUT" , "PATCH" , "DELETE" ] ;
41
42
@@ -45,6 +46,8 @@ export default function DebugPanel(props: { containerRef: any }) {
45
46
useFunctionStore ( ( state : any ) => state ) ;
46
47
const updateDebugFunctionMutation = useUpdateDebugFunctionMutation ( ) ;
47
48
const globalStore = useGlobalStore ( ( state ) => state ) ;
49
+ const siteSettings = useSiteSettingStore ( ( state ) => state . siteSettings ) ;
50
+ console . log ( siteSettings ) ;
48
51
49
52
const functionCache = useFunctionCache ( ) ;
50
53
@@ -71,12 +74,6 @@ export default function DebugPanel(props: { containerRef: any }) {
71
74
} ,
72
75
) ;
73
76
74
- const tabContent = [
75
- { text : t ( "FunctionPanel.InterfaceDebug" ) } ,
76
- { text : "Laf Pilot" } ,
77
- { text : t ( "FunctionPanel.versionHistory" ) } ,
78
- ] ;
79
-
80
77
const methods_tab = [
81
78
{
82
79
label : "Query" ,
@@ -170,18 +167,35 @@ export default function DebugPanel(props: { containerRef: any }) {
170
167
mx = { 3 }
171
168
borderBottom = { darkMode ? "" : "2px solid #F6F8F9" }
172
169
>
173
- { tabContent . map ( ( tab , index ) => (
170
+ < Tab
171
+ _selected = { {
172
+ borderColor : "primary.500" ,
173
+ color : darkMode ? "white !important" : "#262A32 !important" ,
174
+ } }
175
+ style = { { color : "#7B838B" , margin : "-1px 8px" , padding : "0 0" , fontWeight : 500 } }
176
+ >
177
+ { t ( "FunctionPanel.InterfaceDebug" ) }
178
+ </ Tab >
179
+ { ! ! siteSettings . ai_pilot_url ?. value && (
174
180
< Tab
175
- key = { index }
176
181
_selected = { {
177
182
borderColor : "primary.500" ,
178
183
color : darkMode ? "white !important" : "#262A32 !important" ,
179
184
} }
180
185
style = { { color : "#7B838B" , margin : "-1px 8px" , padding : "0 0" , fontWeight : 500 } }
181
186
>
182
- { tab . text }
187
+ Laf Pilot
183
188
</ Tab >
184
- ) ) }
189
+ ) }
190
+ < Tab
191
+ _selected = { {
192
+ borderColor : "primary.500" ,
193
+ color : darkMode ? "white !important" : "#262A32 !important" ,
194
+ } }
195
+ style = { { color : "#7B838B" , margin : "-1px 8px" , padding : "0 0" , fontWeight : 500 } }
196
+ >
197
+ { t ( "FunctionPanel.versionHistory" ) }
198
+ </ Tab >
185
199
</ TabList >
186
200
187
201
< TabPanels flex = { 1 } className = "overflow-hidden" >
@@ -321,9 +335,11 @@ export default function DebugPanel(props: { containerRef: any }) {
321
335
</ Panel >
322
336
</ Row >
323
337
</ TabPanel >
324
- < TabPanel padding = { 0 } h = "full" >
325
- < AIChatPanel />
326
- </ TabPanel >
338
+ { ! ! siteSettings . ai_pilot_url ?. value && (
339
+ < TabPanel padding = { 0 } h = "full" >
340
+ < AIChatPanel />
341
+ </ TabPanel >
342
+ ) }
327
343
< TabPanel padding = { 0 } h = "full" >
328
344
< VersionHistoryPanel />
329
345
</ TabPanel >
0 commit comments