Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
51475c80
authored
Jun 13, 2026
by
Seefs
Committed by
GitHub
Jun 13, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: only fetch deployment settings on deployments page (#5466)
parent
15072292
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
47 deletions
+40
-47
web/default/src/features/models/index.tsx
+40
-47
No files found.
web/default/src/features/models/index.tsx
View file @
51475c80
...
@@ -54,7 +54,6 @@ const SECTION_META: Record<ModelsSectionId, { titleKey: string }> = {
...
@@ -54,7 +54,6 @@ const SECTION_META: Record<ModelsSectionId, { titleKey: string }> = {
function
ModelsContent
()
{
function
ModelsContent
()
{
const
{
t
}
=
useTranslation
()
const
{
t
}
=
useTranslation
()
const
navigate
=
useNavigate
()
const
navigate
=
useNavigate
()
const
queryClient
=
useQueryClient
()
const
{
tabCategory
,
setTabCategory
}
=
useModels
()
const
{
tabCategory
,
setTabCategory
}
=
useModels
()
const
params
=
route
.
useParams
()
const
params
=
route
.
useParams
()
const
activeSection
=
(
params
.
section
??
const
activeSection
=
(
params
.
section
??
...
@@ -70,41 +69,6 @@ function ModelsContent() {
...
@@ -70,41 +69,6 @@ function ModelsContent() {
}
}
},
[
activeSection
,
setTabCategory
,
tabCategory
])
},
[
activeSection
,
setTabCategory
,
tabCategory
])
const
{
loading
:
deploymentLoading
,
loadingPhase
,
isIoNetEnabled
,
connectionLoading
,
connectionOk
,
connectionError
,
testConnection
,
refresh
:
refreshDeploymentSettings
,
}
=
useModelDeploymentSettings
()
// Ensure settings are fresh when switching to deployments section
useEffect
(()
=>
{
if
(
activeSection
===
'deployments'
)
{
refreshDeploymentSettings
()
}
},
[
activeSection
,
refreshDeploymentSettings
])
// Prefetch deployments list while connection check is in progress
// This allows the data to be ready as soon as the guard passes
useEffect
(()
=>
{
if
(
activeSection
===
'deployments'
&&
isIoNetEnabled
&&
loadingPhase
===
'connection'
)
{
const
defaultParams
=
{
p
:
1
,
page_size
:
10
}
queryClient
.
prefetchQuery
({
queryKey
:
deploymentsQueryKeys
.
list
(
defaultParams
),
queryFn
:
()
=>
listDeployments
(
defaultParams
),
staleTime
:
30
*
1000
,
// 30 seconds
})
}
},
[
activeSection
,
isIoNetEnabled
,
loadingPhase
,
queryClient
])
const
handleSectionChange
=
useCallback
(
const
handleSectionChange
=
useCallback
(
(
section
:
string
)
=>
{
(
section
:
string
)
=>
{
void
navigate
({
void
navigate
({
...
@@ -146,17 +110,7 @@ function ModelsContent() {
...
@@ -146,17 +110,7 @@ function ModelsContent() {
{
activeSection
===
'metadata'
?
(
{
activeSection
===
'metadata'
?
(
<
ModelsTable
/>
<
ModelsTable
/>
)
:
(
)
:
(
<
DeploymentAccessGuard
<
DeploymentsSection
/>
loading=
{
deploymentLoading
}
loadingPhase=
{
loadingPhase
}
isEnabled=
{
isIoNetEnabled
}
connectionLoading=
{
connectionLoading
}
connectionOk=
{
connectionOk
}
connectionError=
{
connectionError
}
onRetry=
{
testConnection
}
>
<
DeploymentsTable
/>
</
DeploymentAccessGuard
>
)
}
)
}
</
div
>
</
div
>
</
div
>
</
div
>
...
@@ -172,6 +126,45 @@ function ModelsContent() {
...
@@ -172,6 +126,45 @@ function ModelsContent() {
)
)
}
}
function
DeploymentsSection
()
{
const
queryClient
=
useQueryClient
()
const
{
loading
:
deploymentLoading
,
loadingPhase
,
isIoNetEnabled
,
connectionLoading
,
connectionOk
,
connectionError
,
testConnection
,
}
=
useModelDeploymentSettings
()
// Prefetch deployments list while connection check is in progress.
useEffect
(()
=>
{
if
(
isIoNetEnabled
&&
loadingPhase
===
'connection'
)
{
const
defaultParams
=
{
p
:
1
,
page_size
:
10
}
queryClient
.
prefetchQuery
({
queryKey
:
deploymentsQueryKeys
.
list
(
defaultParams
),
queryFn
:
()
=>
listDeployments
(
defaultParams
),
staleTime
:
30
*
1000
,
})
}
},
[
isIoNetEnabled
,
loadingPhase
,
queryClient
])
return
(
<
DeploymentAccessGuard
loading=
{
deploymentLoading
}
loadingPhase=
{
loadingPhase
}
isEnabled=
{
isIoNetEnabled
}
connectionLoading=
{
connectionLoading
}
connectionOk=
{
connectionOk
}
connectionError=
{
connectionError
}
onRetry=
{
testConnection
}
>
<
DeploymentsTable
/>
</
DeploymentAccessGuard
>
)
}
export
function
Models
()
{
export
function
Models
()
{
return
(
return
(
<
ModelsProvider
>
<
ModelsProvider
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment