Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
aisbf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexlab
aisbf
Commits
9539a032
Commit
9539a032
authored
Apr 21, 2026
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix duplicate cacheSettings variable declaration
parent
1e016cb9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
55 deletions
+0
-55
user_providers.html
templates/dashboard/user_providers.html
+0
-55
No files found.
templates/dashboard/user_providers.html
View file @
9539a032
...
...
@@ -1047,62 +1047,7 @@ function renderModels(providerKey) {
});
}
async
function
setCacheSetting
(
provider_id
,
model_name
,
enabled
)
{
try
{
const
response
=
await
fetch
(
'{{ url_for(request, "/api/user/cache-settings") }}'
,
{
method
:
'POST'
,
headers
:
{
'Content-Type'
:
'application/json'
},
body
:
JSON
.
stringify
({
provider_id
:
provider_id
||
null
,
model_name
:
model_name
||
null
,
cache_enabled
:
enabled
})
});
if
(
response
.
ok
)
{
showToast
(
'Cache setting updated'
,
'success'
);
// Refresh cache settings
await
loadCacheSettings
();
}
else
{
showToast
(
'Failed to update cache setting'
,
'danger'
);
}
}
catch
(
error
)
{
console
.
error
(
'Error updating cache setting:'
,
error
);
showToast
(
'Error updating cache setting'
,
'danger'
);
}
}
// Global cache settings cache (pun intended)
let
cacheSettings
=
[];
async
function
loadCacheSettings
()
{
try
{
const
response
=
await
fetch
(
'{{ url_for(request, "/api/user/cache-settings") }}'
);
const
data
=
await
response
.
json
();
cacheSettings
=
data
.
settings
||
[];
}
catch
(
error
)
{
console
.
error
(
'Error loading cache settings:'
,
error
);
}
}
// Check if cache is enabled for a provider/model
function
isCacheEnabled
(
provider_id
,
model_name
=
null
)
{
// Check model-level setting first
if
(
model_name
)
{
const
modelSetting
=
cacheSettings
.
find
(
s
=>
s
.
provider_id
===
provider_id
&&
s
.
model_name
===
model_name
);
if
(
modelSetting
)
return
modelSetting
.
cache_enabled
;
}
// Check provider-level setting
const
providerSetting
=
cacheSettings
.
find
(
s
=>
s
.
provider_id
===
provider_id
&&
s
.
model_name
===
null
);
if
(
providerSetting
)
return
providerSetting
.
cache_enabled
;
// Check global setting
const
globalSetting
=
cacheSettings
.
find
(
s
=>
s
.
provider_id
===
null
&&
s
.
model_name
===
null
);
if
(
globalSetting
)
return
globalSetting
.
cache_enabled
;
// Default: enabled
return
true
;
}
function
showAddProviderForm
()
{
document
.
getElementById
(
'new-provider-form'
).
style
.
display
=
'block'
;
...
...
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