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
b2aba87a
Commit
b2aba87a
authored
May 12, 2026
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reordering and analytics issues
parent
feaa37fd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
7 deletions
+34
-7
analytics.py
aisbf/analytics.py
+2
-2
providers.py
aisbf/routes/dashboard/providers.py
+30
-1
providers.html
templates/dashboard/providers.html
+1
-2
user_providers.html
templates/dashboard/user_providers.html
+1
-2
No files found.
aisbf/analytics.py
View file @
b2aba87a
...
@@ -541,7 +541,7 @@ class Analytics:
...
@@ -541,7 +541,7 @@ class Analytics:
conditions
.
append
(
f
"autoselect_id = {placeholder}"
)
conditions
.
append
(
f
"autoselect_id = {placeholder}"
)
params
.
append
(
autoselect_filter
)
params
.
append
(
autoselect_filter
)
if
analytics_kind
:
if
analytics_kind
:
conditions
.
append
(
f
"
analytics_kind = {placeholder}
"
)
conditions
.
append
(
f
"
(analytics_kind = {placeholder} OR analytics_kind IS NULL)
"
)
params
.
append
(
analytics_kind
)
params
.
append
(
analytics_kind
)
return
conditions
,
params
return
conditions
,
params
...
@@ -986,7 +986,7 @@ class Analytics:
...
@@ -986,7 +986,7 @@ class Analytics:
elif
user_filter
is
not
None
:
elif
user_filter
is
not
None
:
query
+=
f
' AND user_id = {placeholder}'
query
+=
f
' AND user_id = {placeholder}'
params
.
append
(
user_filter
)
params
.
append
(
user_filter
)
query
+=
f
' AND
analytics_kind = {placeholder}
'
query
+=
f
' AND
(analytics_kind = {placeholder} OR analytics_kind IS NULL)
'
params
.
append
(
'execution'
)
params
.
append
(
'execution'
)
if
provider_filter
:
if
provider_filter
:
query
+=
f
' AND provider_id = {placeholder}'
query
+=
f
' AND provider_id = {placeholder}'
...
...
aisbf/routes/dashboard/providers.py
View file @
b2aba87a
...
@@ -818,7 +818,9 @@ async def dashboard_providers_save(request: Request, config: str = Form(...)):
...
@@ -818,7 +818,9 @@ async def dashboard_providers_save(request: Request, config: str = Form(...)):
# Read existing config to preserve condensation settings
# Read existing config to preserve condensation settings
with
open
(
config_path
)
as
f
:
with
open
(
config_path
)
as
f
:
full_config
=
json
.
load
(
f
)
full_config
=
json
.
load
(
f
)
providers_data
=
_reorder_dict
(
providers_data
,
list
(
providers_data
.
keys
()))
# Update providers section while preserving other keys
# Update providers section while preserving other keys
full_config
[
'providers'
]
=
providers_data
full_config
[
'providers'
]
=
providers_data
...
@@ -845,6 +847,11 @@ async def dashboard_providers_save(request: Request, config: str = Form(...)):
...
@@ -845,6 +847,11 @@ async def dashboard_providers_save(request: Request, config: str = Form(...)):
# Save each provider to database
# Save each provider to database
for
provider_key
,
provider_config
in
providers_data
.
items
():
for
provider_key
,
provider_config
in
providers_data
.
items
():
db
.
save_user_provider
(
current_user_id
,
provider_key
,
provider_config
)
db
.
save_user_provider
(
current_user_id
,
provider_key
,
provider_config
)
providers_data
=
_ordered_resource_map
(
providers_data
,
db
.
get_sort_order
(
current_user_id
,
'provider'
)
)
logger
.
info
(
f
"Saved {len(providers_data)} provider(s) to database for user {current_user_id}"
)
logger
.
info
(
f
"Saved {len(providers_data)} provider(s) to database for user {current_user_id}"
)
...
@@ -1364,6 +1371,10 @@ async def dashboard_rotations_save(request: Request, config: str = Form(...)):
...
@@ -1364,6 +1371,10 @@ async def dashboard_rotations_save(request: Request, config: str = Form(...)):
# Config admin: save to JSON files
# Config admin: save to JSON files
config_path
=
Path
.
home
()
/
'.aisbf'
/
'rotations.json'
config_path
=
Path
.
home
()
/
'.aisbf'
/
'rotations.json'
config_path
.
parent
.
mkdir
(
parents
=
True
,
exist_ok
=
True
)
config_path
.
parent
.
mkdir
(
parents
=
True
,
exist_ok
=
True
)
rotations_data
[
'rotations'
]
=
_reorder_dict
(
rotations_data
.
get
(
'rotations'
,
{}),
list
(
rotations_data
.
get
(
'rotations'
,
{})
.
keys
())
)
with
open
(
config_path
,
'w'
)
as
f
:
with
open
(
config_path
,
'w'
)
as
f
:
json
.
dump
(
rotations_data
,
f
,
indent
=
2
)
json
.
dump
(
rotations_data
,
f
,
indent
=
2
)
_reload_global_config
()
_reload_global_config
()
...
@@ -1384,6 +1395,11 @@ async def dashboard_rotations_save(request: Request, config: str = Form(...)):
...
@@ -1384,6 +1395,11 @@ async def dashboard_rotations_save(request: Request, config: str = Form(...)):
for
rotation_key
,
rotation_config
in
rotations
.
items
():
for
rotation_key
,
rotation_config
in
rotations
.
items
():
db
.
save_user_rotation
(
current_user_id
,
rotation_key
,
rotation_config
)
db
.
save_user_rotation
(
current_user_id
,
rotation_key
,
rotation_config
)
rotations_data
[
'rotations'
]
=
_ordered_resource_map
(
rotations_data
.
get
(
'rotations'
,
{}),
db
.
get_sort_order
(
current_user_id
,
'rotation'
)
)
logger
.
info
(
f
"Saved {len(rotations)} rotation(s) to database for user {current_user_id}"
)
logger
.
info
(
f
"Saved {len(rotations)} rotation(s) to database for user {current_user_id}"
)
if
is_config_admin
:
if
is_config_admin
:
...
@@ -1656,6 +1672,7 @@ async def dashboard_autoselect_save(request: Request, config: str = Form(...)):
...
@@ -1656,6 +1672,7 @@ async def dashboard_autoselect_save(request: Request, config: str = Form(...)):
# Config admin: save to JSON files
# Config admin: save to JSON files
config_path
=
Path
.
home
()
/
'.aisbf'
/
'autoselect.json'
config_path
=
Path
.
home
()
/
'.aisbf'
/
'autoselect.json'
config_path
.
parent
.
mkdir
(
parents
=
True
,
exist_ok
=
True
)
config_path
.
parent
.
mkdir
(
parents
=
True
,
exist_ok
=
True
)
autoselect_data
=
_reorder_dict
(
autoselect_data
,
list
(
autoselect_data
.
keys
()))
with
open
(
config_path
,
'w'
)
as
f
:
with
open
(
config_path
,
'w'
)
as
f
:
json
.
dump
(
autoselect_data
,
f
,
indent
=
2
)
json
.
dump
(
autoselect_data
,
f
,
indent
=
2
)
_reload_global_config
()
_reload_global_config
()
...
@@ -1674,6 +1691,11 @@ async def dashboard_autoselect_save(request: Request, config: str = Form(...)):
...
@@ -1674,6 +1691,11 @@ async def dashboard_autoselect_save(request: Request, config: str = Form(...)):
for
autoselect_key
,
autoselect_config
in
autoselect_data
.
items
():
for
autoselect_key
,
autoselect_config
in
autoselect_data
.
items
():
db
.
save_user_autoselect
(
current_user_id
,
autoselect_key
,
autoselect_config
)
db
.
save_user_autoselect
(
current_user_id
,
autoselect_key
,
autoselect_config
)
autoselect_data
=
_ordered_resource_map
(
autoselect_data
,
db
.
get_sort_order
(
current_user_id
,
'autoselect'
)
)
logger
.
info
(
f
"Saved {len(autoselect_data)} autoselect(s) to database for user {current_user_id}"
)
logger
.
info
(
f
"Saved {len(autoselect_data)} autoselect(s) to database for user {current_user_id}"
)
if
is_config_admin
:
if
is_config_admin
:
...
@@ -2253,6 +2275,13 @@ def _reorder_dict(d: dict, order: list) -> dict:
...
@@ -2253,6 +2275,13 @@ def _reorder_dict(d: dict, order: list) -> dict:
return
result
return
result
def
_ordered_resource_map
(
resource_map
:
dict
,
saved_order
:
list
|
None
)
->
dict
:
"""Apply a saved order to a resource map while keeping unknown keys appended."""
if
not
saved_order
:
return
resource_map
return
_reorder_dict
(
resource_map
,
saved_order
)
@
router
.
get
(
"/dashboard/analytics"
,
response_class
=
HTMLResponse
)
@
router
.
get
(
"/dashboard/analytics"
,
response_class
=
HTMLResponse
)
async
def
dashboard_analytics
(
async
def
dashboard_analytics
(
request
:
Request
,
request
:
Request
,
...
...
templates/dashboard/providers.html
View file @
b2aba87a
...
@@ -2861,8 +2861,7 @@ async function confirmAddProvider() {
...
@@ -2861,8 +2861,7 @@ async function confirmAddProvider() {
discovery_enabled
:
true
,
discovery_enabled
:
true
,
client_id
:
key
,
client_id
:
key
,
bridge_path
:
'/coderai/ws'
,
bridge_path
:
'/coderai/ws'
,
registration_path
:
'/coderai/register'
,
registration_path
:
'/coderai/register'
registration_token
:
''
};
};
}
else
if
(
type
===
'runpod'
)
{
}
else
if
(
type
===
'runpod'
)
{
providersData
[
key
].
runpod_config
=
{
providersData
[
key
].
runpod_config
=
{
...
...
templates/dashboard/user_providers.html
View file @
b2aba87a
...
@@ -2577,8 +2577,7 @@ async function confirmAddProvider() {
...
@@ -2577,8 +2577,7 @@ async function confirmAddProvider() {
discovery_enabled
:
true
,
discovery_enabled
:
true
,
client_id
:
key
,
client_id
:
key
,
bridge_path
:
'/coderai/ws'
,
bridge_path
:
'/coderai/ws'
,
registration_path
:
'/coderai/register'
,
registration_path
:
'/coderai/register'
registration_token
:
''
};
};
}
}
...
...
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