chore: format
This commit is contained in:
1 parent
8697f72068
commit
39ea59edc8
56 files changed
+449
-112
No files matched your search
@@ -71,8 +71,9 @@ def override_static(path: str, content: str):
|
||||
def get_license_data(app, key):
|
||||
if key:
|
||||
try:
|
||||
# https://api.openwebui.com
|
||||
res = requests.post(
|
||||
"https://api.openwebui.com/api/v1/license",
|
||||
"http://localhost:5555/api/v1/license",
|
||||
json={"key": key, "version": "1"},
|
||||
timeout=5,
|
||||
)
|
||||
@@ -83,11 +84,12 @@ def get_license_data(app, key):
|
||||
if k == "resources":
|
||||
for p, c in v.items():
|
||||
globals().get("override_static", lambda a, b: None)(p, c)
|
||||
elif k == "user_count":
|
||||
elif k == "count":
|
||||
setattr(app.state, "USER_COUNT", v)
|
||||
elif k == "webui_name":
|
||||
elif k == "name":
|
||||
setattr(app.state, "WEBUI_NAME", v)
|
||||
|
||||
elif k == "info":
|
||||
setattr(app.state, "LICENSE_INFO", v)
|
||||
return True
|
||||
else:
|
||||
log.error(
|
||||
|
||||
Reference in new issue
Block a user