mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Add custom images for logos
This commit is contained in:
parent
d145dd595b
commit
78c6e7950a
1
.gitignore
vendored
1
.gitignore
vendored
@ -21,6 +21,7 @@ venv.bak/
|
||||
/import/
|
||||
/imports/
|
||||
/servers/
|
||||
/app/frontend/static/assets/images/custom/
|
||||
/app/frontend/static/assets/images/auth/custom/
|
||||
/backups/
|
||||
/temp/
|
||||
|
@ -905,13 +905,13 @@ class PanelHandler(BaseHandler):
|
||||
self.helper.ensure_dir_exists(
|
||||
os.path.join(
|
||||
self.controller.project_root,
|
||||
"app/frontend/static/assets/images/auth/custom",
|
||||
"app/frontend/static/assets/images/custom",
|
||||
)
|
||||
)
|
||||
for item in os.listdir(
|
||||
os.path.join(
|
||||
self.controller.project_root,
|
||||
"app/frontend/static/assets/images/auth/custom",
|
||||
"app/frontend/static/assets/images/custom",
|
||||
)
|
||||
):
|
||||
if item not in page_data["backgrounds"]:
|
||||
|
@ -39,8 +39,10 @@ config_json_schema = {
|
||||
customize_json_schema = {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"photo": {"type": "string"},
|
||||
"opacity": {"type": "string"},
|
||||
"bg_photo": {"type": "string"},
|
||||
"bg_opacity": {"type": "string"},
|
||||
"logo_long": {"type": "string"},
|
||||
"logo_square": {"type" "string"},
|
||||
},
|
||||
"additionalProperties": False,
|
||||
"minProperties": 1,
|
||||
@ -302,7 +304,7 @@ class ApiCraftyCustomizeIndexHandler(BaseApiHandler):
|
||||
FileHelpers.del_file(
|
||||
os.path.join(
|
||||
self.controller.project_root,
|
||||
f"app/frontend/static/assets/images/auth/custom/{data['photo']}",
|
||||
f"app/frontend/static/assets/images/custom/{data['photo']}",
|
||||
)
|
||||
)
|
||||
current = self.controller.cached_login
|
||||
|
@ -69,7 +69,7 @@ class ApiFilesUploadHandler(BaseApiHandler):
|
||||
u_type = "admin_config"
|
||||
self.upload_dir = os.path.join(
|
||||
self.controller.project_root,
|
||||
"app/frontend/static/assets/images/auth/custom",
|
||||
"app/frontend/static/assets/images/custom",
|
||||
)
|
||||
accepted_types = IMAGE_MIME_TYPES
|
||||
elif upload_type == "import":
|
||||
|
@ -377,7 +377,7 @@
|
||||
var src_path = "../../static/assets/images/auth/".concat($("#photo").val());
|
||||
}
|
||||
else {
|
||||
var src_path = "../../static/assets/images/auth/custom/".concat($("#photo").val());
|
||||
var src_path = "../../static/assets/images/custom/".concat($("#photo").val());
|
||||
}
|
||||
img.src = src_path;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user