Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
V
vidai
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
SexHackMe
vidai
Commits
9d7fff40
Commit
9d7fff40
authored
Oct 06, 2025
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Invert content of settings and configuration pages
parent
e16ed66a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
50 deletions
+66
-50
settings.html
templates/admin/settings.html
+23
-7
config.html
templates/config.html
+8
-23
admin.py
vidai/admin.py
+18
-3
web.py
vidai/web.py
+17
-17
No files found.
templates/admin/settings.html
View file @
9d7fff40
...
...
@@ -91,15 +91,31 @@
<form
method=
"post"
action=
"/update_settings"
>
<div
class=
"form-group"
>
<label
for=
"default_model"
>
Default AI Model
</label>
<input
type=
"text"
id=
"default_model"
name=
"default_model"
value=
"Qwen/Qwen2.5-VL-7B-Instruct"
placeholder=
"Model path or HuggingFace ID"
>
<label
for=
"analysis_backend"
>
Analysis Backend:
</label>
<select
name=
"analysis_backend"
id=
"analysis_backend"
>
{% if 'cuda' in available_backends %}
<option
value=
"cuda"
{%
if
current_config
.
get
('
analysis_backend
')
==
'
cuda
'
%}
selected
{%
endif
%}
>
CUDA
</option>
{% endif %}
{% if 'rocm' in available_backends %}
<option
value=
"rocm"
{%
if
current_config
.
get
('
analysis_backend
')
==
'
rocm
'
%}
selected
{%
endif
%}
>
ROCm
</option>
{% endif %}
{% if not available_backends %}
<option
value=
"cpu"
selected
>
CPU (No GPU detected)
</option>
{% endif %}
</select>
</div>
<div
class=
"form-group"
>
<label
for=
"theme"
>
Theme Preference
</label>
<select
id=
"theme"
name=
"theme"
>
<option
value=
"light"
selected
>
Light
</option>
<option
value=
"dark"
>
Dark
</option>
<label
for=
"training_backend"
>
Training Backend:
</label>
<select
name=
"training_backend"
id=
"training_backend"
>
{% if 'cuda' in available_backends %}
<option
value=
"cuda"
{%
if
current_config
.
get
('
training_backend
')
==
'
cuda
'
%}
selected
{%
endif
%}
>
CUDA
</option>
{% endif %}
{% if 'rocm' in available_backends %}
<option
value=
"rocm"
{%
if
current_config
.
get
('
training_backend
')
==
'
rocm
'
%}
selected
{%
endif
%}
>
ROCm
</option>
{% endif %}
{% if not available_backends %}
<option
value=
"cpu"
selected
>
CPU (No GPU detected)
</option>
{% endif %}
</select>
</div>
...
...
templates/config.html
View file @
9d7fff40
...
...
@@ -36,33 +36,18 @@
<h1
class=
"config-title"
>
Configuration
</h1>
<form
method=
"post"
class=
"config-form"
>
<div
class=
"form-group"
>
<label
for=
"analysis_backend"
>
Analysis Backend:
</label>
<select
name=
"analysis_backend"
id=
"analysis_backend"
>
{% if 'cuda' in available_backends %}
<option
value=
"cuda"
{%
if
current_config
.
get
('
analysis_backend
')
==
'
cuda
'
%}
selected
{%
endif
%}
>
CUDA
</option>
{% endif %}
{% if 'rocm' in available_backends %}
<option
value=
"rocm"
{%
if
current_config
.
get
('
analysis_backend
')
==
'
rocm
'
%}
selected
{%
endif
%}
>
ROCm
</option>
{% endif %}
{% if not available_backends %}
<option
value=
"cpu"
selected
>
CPU (No GPU detected)
</option>
{% endif %}
</select>
<label
for=
"default_model"
>
Default AI Model
</label>
<input
type=
"text"
id=
"default_model"
name=
"default_model"
value=
"Qwen/Qwen2.5-VL-7B-Instruct"
placeholder=
"Model path or HuggingFace ID"
>
</div>
<div
class=
"form-group"
>
<label
for=
"training_backend"
>
Training Backend:
</label>
<select
name=
"training_backend"
id=
"training_backend"
>
{% if 'cuda' in available_backends %}
<option
value=
"cuda"
{%
if
current_config
.
get
('
training_backend
')
==
'
cuda
'
%}
selected
{%
endif
%}
>
CUDA
</option>
{% endif %}
{% if 'rocm' in available_backends %}
<option
value=
"rocm"
{%
if
current_config
.
get
('
training_backend
')
==
'
rocm
'
%}
selected
{%
endif
%}
>
ROCm
</option>
{% endif %}
{% if not available_backends %}
<option
value=
"cpu"
selected
>
CPU (No GPU detected)
</option>
{% endif %}
<label
for=
"theme"
>
Theme Preference
</label>
<select
id=
"theme"
name=
"theme"
>
<option
value=
"light"
selected
>
Light
</option>
<option
value=
"dark"
>
Dark
</option>
</select>
</div>
<button
type=
"submit"
class=
"btn-submit"
>
Save Configuration
</button>
</form>
</div>
...
...
vidai/admin.py
View file @
9d7fff40
...
...
@@ -280,18 +280,33 @@ def settings():
"""Admin settings page."""
user
=
get_current_user_session
()
# Get current config
from
.config
import
get_analysis_backend
,
get_training_backend
current_config
=
{
'analysis_backend'
:
get_analysis_backend
(),
'training_backend'
:
get_training_backend
()
}
# Get available backends
from
.compat
import
get_available_backends
available_backends
=
get_available_backends
()
return
render_template
(
'admin/settings.html'
,
user
=
user
,
tokens
=
get_user_tokens
(
user
[
"id"
]),
current_config
=
current_config
,
available_backends
=
available_backends
,
active_page
=
'settings'
)
@
admin_bp
.
route
(
'/update_settings'
,
methods
=
[
'POST'
])
@
admin_required
def
update_settings
():
"""Update admin settings."""
# For now, just flash a success message
# In a real implementation, this would save admin preferences
from
flask
import
flash
from
.config
import
set_analysis_backend
,
set_training_backend
analysis_backend
=
request
.
form
.
get
(
'analysis_backend'
,
'cuda'
)
training_backend
=
request
.
form
.
get
(
'training_backend'
,
'cuda'
)
set_analysis_backend
(
analysis_backend
)
set_training_backend
(
training_backend
)
flash
(
'Settings updated successfully!'
,
'success'
)
return
redirect
(
url_for
(
'admin.settings'
))
...
...
vidai/web.py
View file @
9d7fff40
...
...
@@ -269,24 +269,21 @@ def analyze():
@
app
.
route
(
'/config'
,
methods
=
[
'GET'
,
'POST'
])
def
config
():
if
request
.
method
==
'POST'
:
data
=
{
'analysis_backend'
:
request
.
form
.
get
(
'analysis_backend'
,
'cuda'
),
'training_backend'
:
request
.
form
.
get
(
'training_backend'
,
'cuda'
)
}
msg_id
=
send_to_backend
(
'config_update'
,
data
)
result_data
=
get_result
(
msg_id
)
status
=
result_data
.
get
(
'data'
,
{})
.
get
(
'status'
,
'Error'
)
from
.config
import
set_default_model
,
set_default_model_type
default_model
=
request
.
form
.
get
(
'default_model'
,
'Qwen/Qwen2.5-VL-7B-Instruct'
)
theme
=
request
.
form
.
get
(
'theme'
,
'light'
)
set_default_model
(
default_model
)
# For theme, perhaps store it somewhere, but for now, just flash
flash
(
'Configuration updated successfully!'
,
'success'
)
# Get current config
msg_id
=
send_to_backend
(
'get_config'
,
{})
config_data
=
get_result
(
msg_id
)
current_config
=
config_data
.
get
(
'data'
,
{})
# Get available backends
from
.compat
import
get_available_backends
available_backends
=
get_available_backends
()
from
.config
import
get_default_model
current_config
=
{
'default_model'
:
get_default_model
(),
'theme'
:
'light'
# Default
}
return
render_template
(
'config.html'
,
current_config
=
current_config
,
available_backends
=
available_backends
,
active_page
=
'config'
,
user
=
None
)
return
render_template
(
'config.html'
,
current_config
=
current_config
,
available_backends
=
[]
,
active_page
=
'config'
,
user
=
None
)
@
app
.
route
(
'/history'
)
@
login_required
...
...
@@ -306,8 +303,11 @@ def history():
@
login_required
def
update_settings
():
"""Update user settings."""
# For now, just flash a success message
# In a real implementation, this would save user preferences
from
.config
import
set_analysis_backend
,
set_training_backend
analysis_backend
=
request
.
form
.
get
(
'analysis_backend'
,
'cuda'
)
training_backend
=
request
.
form
.
get
(
'training_backend'
,
'cuda'
)
set_analysis_backend
(
analysis_backend
)
set_training_backend
(
training_backend
)
flash
(
'Settings updated successfully!'
,
'success'
)
return
redirect
(
url_for
(
'settings'
))
...
...
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