Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
797ed9ac
"test/nni_test/vscode:/vscode.git/clone" did not exist on "6c3148c78dbdee1057cc7d7368bbd36670ee515c"
Commit
797ed9ac
authored
Feb 21, 2024
by
Timothy J. Baek
Browse files
feat: allow enabling after url is provided
parent
d863e7e6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
backend/apps/images/main.py
backend/apps/images/main.py
+6
-2
src/lib/components/chat/Settings/Images.svelte
src/lib/components/chat/Settings/Images.svelte
+7
-2
No files found.
backend/apps/images/main.py
View file @
797ed9ac
...
...
@@ -43,8 +43,12 @@ async def get_enable_status(request: Request, user=Depends(get_admin_user)):
@
app
.
get
(
"/enabled/toggle"
,
response_model
=
bool
)
async
def
toggle_enabled
(
request
:
Request
,
user
=
Depends
(
get_admin_user
)):
app
.
state
.
ENABLED
=
not
app
.
state
.
ENABLED
return
app
.
state
.
ENABLED
try
:
r
=
requests
.
head
(
app
.
state
.
AUTOMATIC1111_BASE_URL
)
app
.
state
.
ENABLED
=
not
app
.
state
.
ENABLED
return
app
.
state
.
ENABLED
except
Exception
as
e
:
raise
HTTPException
(
status_code
=
r
.
status_code
,
detail
=
ERROR_MESSAGES
.
DEFAULT
(
e
))
class
UrlUpdateForm
(
BaseModel
):
...
...
src/lib/components/chat/Settings/Images.svelte
View file @
797ed9ac
...
...
@@ -45,8 +45,13 @@
};
const toggleImageGeneration = async () => {
enableImageGeneration = await toggleImageGenerationEnabledStatus(localStorage.token);
config.set(await getBackendConfig(localStorage.token));
if (AUTOMATIC1111_BASE_URL) {
enableImageGeneration = await toggleImageGenerationEnabledStatus(localStorage.token);
config.set(await getBackendConfig(localStorage.token));
} else {
enableImageGeneration = false;
toast.error('AUTOMATIC1111_BASE_URL not provided');
}
};
onMount(async () => {
...
...
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