mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
fix: remove svg image support in upload files
This commit is contained in:
@@ -130,7 +130,7 @@ async def ui(session: SessionDep, data: str = Form(), files: List[UploadFile] =
|
||||
file.filename = file_name
|
||||
if flag_name == 'logo' or flag_name == 'float_icon':
|
||||
try:
|
||||
SQLBotFileUtils.check_file(file=file, file_types=[".jpg", ".png", ".svg"],
|
||||
SQLBotFileUtils.check_file(file=file, file_types=[".jpg", ".jpeg", ".png"],
|
||||
limit_file_size=(10 * 1024 * 1024))
|
||||
except ValueError as e:
|
||||
error_msg = str(e)
|
||||
|
||||
@@ -15,7 +15,7 @@ async def get_groups(session: SessionDep, flag: str) -> list[SysArgModel]:
|
||||
|
||||
async def save_parameter_args(session: SessionDep, request: Request):
|
||||
allow_file_mapping = {
|
||||
""" "test_logo": { "types": [".jpg", ".jpeg", ".png", ".svg"], "size": 5 * 1024 * 1024 } """
|
||||
""" "test_logo": { "types": [".jpg", ".jpeg", ".png"], "size": 5 * 1024 * 1024 } """
|
||||
}
|
||||
form_data = await request.form()
|
||||
files = form_data.getlist("files")
|
||||
|
||||
@@ -39,7 +39,7 @@ dependencies = [
|
||||
"pyyaml (>=6.0.2,<7.0.0)",
|
||||
"fastapi-mcp (>=0.3.4,<0.4.0)",
|
||||
"tabulate>=0.9.0",
|
||||
"sqlbot-xpack>=0.0.5.19,<0.0.6.0",
|
||||
"sqlbot-xpack>=0.0.5.22,<0.0.6.0",
|
||||
"fastapi-cache2>=0.2.2",
|
||||
"sqlparse>=0.5.3",
|
||||
"redis>=6.2.0",
|
||||
|
||||
@@ -733,7 +733,7 @@
|
||||
"display_settings": "Display Settings",
|
||||
"header_text_color": "Header Text Color",
|
||||
"app_logo": "App Logo",
|
||||
"maximum_size_10mb": "Recommended size: 32 x 32, supports JPG, PNG, and SVG, maximum size: 10MB",
|
||||
"maximum_size_10mb": "Recommended size: 32 x 32, supports JPG, PNG, maximum size: 10MB",
|
||||
"replace": "Replace",
|
||||
"default_icon_position": "Default Icon Position",
|
||||
"draggable_position": "Draggable Position",
|
||||
@@ -846,11 +846,11 @@
|
||||
"website_logo": "Website Logo",
|
||||
"tab": "Tab",
|
||||
"replace_image": "Replace Image",
|
||||
"larger_than_200kb": "Logo displayed at the top of the website: Recommended size: 48 x 48 pixels, supports JPG, PNG, and SVG, and no larger than 200KB",
|
||||
"larger_than_200kb": "Logo displayed at the top of the website: Recommended size: 48 x 48 pixels, supports JPG, PNG, and no larger than 200KB",
|
||||
"login_logo": "System Logo",
|
||||
"larger_than_200kb_de": "Logo on the right side of the login page: Recommended size: 204 x 52 pixels, supports JPG, PNG, and SVG, and no larger than 200KB",
|
||||
"larger_than_200kb_de": "Logo on the right side of the login page: Recommended size: 204 x 52 pixels, supports JPG, PNG, and no larger than 200KB",
|
||||
"login_background_image": "Login Background Image",
|
||||
"larger_than_5mb": "Background image on the left: Recommended size: 576 x 900 for vector images, 1152 x 1800 for bitmap images, supports JPG, PNG, and SVG, and no larger than 5MB",
|
||||
"larger_than_5mb": "Background image on the left: Recommended size: 576 x 900 for vector images, 1152 x 1800 for bitmap images, supports JPG, PNG, and no larger than 5MB",
|
||||
"website_name": "Website Name",
|
||||
"on_webpage_tabs": "Platform name displayed on webpage tabs",
|
||||
"welcome_message": "Display a welcome message",
|
||||
|
||||
@@ -733,7 +733,7 @@
|
||||
"display_settings": "표시 설정",
|
||||
"header_text_color": "헤더 텍스트 색상",
|
||||
"app_logo": "애플리케이션 로고",
|
||||
"maximum_size_10mb": "권장 크기 32 x 32, JPG, PNG, SVG 지원, 크기 10MB 이하",
|
||||
"maximum_size_10mb": "권장 크기 32 x 32, JPG, PNG 지원, 크기 10MB 이하",
|
||||
"replace": "교체",
|
||||
"default_icon_position": "아이콘 기본 위치",
|
||||
"draggable_position": "드래그 가능한 위치",
|
||||
@@ -846,11 +846,11 @@
|
||||
"website_logo": "웹사이트 로고",
|
||||
"tab": "페이지 탭",
|
||||
"replace_image": "이미지 교체",
|
||||
"larger_than_200kb": "상단 웹사이트에 표시되는 로고, 권장 크기 48 x 48, JPG, PNG, SVG 지원, 크기 200KB 이하",
|
||||
"larger_than_200kb": "상단 웹사이트에 표시되는 로고, 권장 크기 48 x 48, JPG, PNG 지원, 크기 200KB 이하",
|
||||
"login_logo": "시스템 로고",
|
||||
"larger_than_200kb_de": "로그인 페이지 오른쪽 로고, 권장 크기 204*52, JPG, PNG, SVG 지원, 크기 200KB 이하",
|
||||
"larger_than_200kb_de": "로그인 페이지 오른쪽 로고, 권장 크기 204*52, JPG, PNG 지원, 크기 200KB 이하",
|
||||
"login_background_image": "로그인 배경 이미지",
|
||||
"larger_than_5mb": "왼쪽 배경 이미지, 벡터 이미지 권장 크기 576*900, 비트맵 권장 크기 1152*1800; JPG, PNG, SVG 지원, 크기 5MB 이하",
|
||||
"larger_than_5mb": "왼쪽 배경 이미지, 벡터 이미지 권장 크기 576*900, 비트맵 권장 크기 1152*1800; JPG, PNG 지원, 크기 5MB 이하",
|
||||
"website_name": "웹사이트 이름",
|
||||
"on_webpage_tabs": "웹페이지 탭에 표시되는 플랫폼 이름",
|
||||
"welcome_message": "환영 메시지 표시",
|
||||
|
||||
@@ -733,7 +733,7 @@
|
||||
"display_settings": "显示设置",
|
||||
"header_text_color": "头部文本颜色",
|
||||
"app_logo": "应用 Logo",
|
||||
"maximum_size_10mb": "建议尺寸 32 x 32,支持 JPG、PNG、SVG,大小不超过 10MB",
|
||||
"maximum_size_10mb": "建议尺寸 32 x 32,支持 JPG、PNG,大小不超过 10MB",
|
||||
"replace": "替换",
|
||||
"default_icon_position": "图标默认位置",
|
||||
"draggable_position": "可拖拽位置",
|
||||
@@ -846,11 +846,11 @@
|
||||
"website_logo": "网站 Logo",
|
||||
"tab": "页签",
|
||||
"replace_image": "替换图片",
|
||||
"larger_than_200kb": "顶部网站显示的 Logo,建议尺寸 48 x 48,支持 JPG、PNG、SVG,大小不超过 200KB",
|
||||
"larger_than_200kb": "顶部网站显示的 Logo,建议尺寸 48 x 48,支持 JPG、PNG,大小不超过 200KB",
|
||||
"login_logo": "系统 Logo",
|
||||
"larger_than_200kb_de": "登录页面右侧 Logo,建议尺寸 204*52,支持 JPG、PNG、SVG,大小不超过 200KB",
|
||||
"larger_than_200kb_de": "登录页面右侧 Logo,建议尺寸 204*52,支持 JPG、PNG,大小不超过 200KB",
|
||||
"login_background_image": "登录背景图",
|
||||
"larger_than_5mb": "左侧背景图,矢量图建议尺寸 576*900,位图建议尺寸 1152*1800;支持 JPG、PNG、SVG,大小不超过 5M",
|
||||
"larger_than_5mb": "左侧背景图,矢量图建议尺寸 576*900,位图建议尺寸 1152*1800;支持 JPG、PNG,大小不超过 5M",
|
||||
"website_name": "网站名称",
|
||||
"on_webpage_tabs": "显示在网页 Tab 的平台名称",
|
||||
"welcome_message": "显示欢迎语",
|
||||
|
||||
@@ -733,7 +733,7 @@
|
||||
"display_settings": "顯示設定",
|
||||
"header_text_color": "頭部文字顏色",
|
||||
"app_logo": "應用 Logo",
|
||||
"maximum_size_10mb": "建議尺寸 32 x 32,支援 JPG、PNG、SVG,大小不超過 10MB",
|
||||
"maximum_size_10mb": "建議尺寸 32 x 32,支援 JPG、PNG,大小不超過 10MB",
|
||||
"replace": "取代",
|
||||
"default_icon_position": "圖示預設位置",
|
||||
"draggable_position": "可拖曳位置",
|
||||
@@ -846,11 +846,11 @@
|
||||
"website_logo": "網站 Logo",
|
||||
"tab": "頁籤",
|
||||
"replace_image": "取代圖片",
|
||||
"larger_than_200kb": "頂部網站顯示的 Logo,建議尺寸 48 x 48,支援 JPG、PNG、SVG,大小不超過 200KB",
|
||||
"larger_than_200kb": "頂部網站顯示的 Logo,建議尺寸 48 x 48,支援 JPG、PNG,大小不超過 200KB",
|
||||
"login_logo": "系統 Logo",
|
||||
"larger_than_200kb_de": "登入頁面右側 Logo,建議尺寸 204*52,支援 JPG、PNG、SVG,大小不超過 200KB",
|
||||
"larger_than_200kb_de": "登入頁面右側 Logo,建議尺寸 204*52,支援 JPG、PNG,大小不超過 200KB",
|
||||
"login_background_image": "登入背景圖",
|
||||
"larger_than_5mb": "左側背景圖,向量圖建議尺寸 576*900,點陣圖建議尺寸 1152*1800;支援 JPG、PNG、SVG,大小不超過 5M",
|
||||
"larger_than_5mb": "左側背景圖,向量圖建議尺寸 576*900,點陣圖建議尺寸 1152*1800;支援 JPG、PNG,大小不超過 5M",
|
||||
"website_name": "網站名稱",
|
||||
"on_webpage_tabs": "顯示在網頁 Tab 的平台名稱",
|
||||
"welcome_message": "顯示歡迎語",
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
:name="ele.type"
|
||||
:show-file-list="false"
|
||||
class="upload-demo"
|
||||
accept=".jpeg,.jpg,.png,.gif,.svg"
|
||||
accept=".jpeg,.jpg,.png"
|
||||
:before-upload="(e: any) => beforeUpload(e, ele)"
|
||||
:http-request="uploadImg"
|
||||
>
|
||||
@@ -378,7 +378,7 @@ const defaultTopForm = {
|
||||
showDoc: '0',
|
||||
showAbout: '0',
|
||||
pc_welcome: t('embedded.i_am_sqlbot'),
|
||||
pc_welcome_desc: t("qa.hint_description"),
|
||||
pc_welcome_desc: t('qa.hint_description'),
|
||||
}
|
||||
|
||||
const topForm = reactive<{
|
||||
|
||||
@@ -280,7 +280,7 @@ defineExpose({
|
||||
<el-upload
|
||||
name="logo"
|
||||
:show-file-list="false"
|
||||
accept=".jpg,.png,.gif,.svg"
|
||||
accept=".jpg,.jpeg,.png"
|
||||
:before-upload="(e: any) => beforeUpload(e, 'logo')"
|
||||
:http-request="uploadImg"
|
||||
>
|
||||
@@ -296,7 +296,7 @@ defineExpose({
|
||||
<el-upload
|
||||
name="float_icon"
|
||||
:show-file-list="false"
|
||||
accept=".jpg,.png,.gif,.svg"
|
||||
accept=".jpg,.jpeg,.png"
|
||||
:before-upload="(e: any) => beforeUpload(e, 'float_icon')"
|
||||
:http-request="uploadImg"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user