Skip to content

Commit 835eefc

Browse files
committed
fix: remove svg image support in upload files
1 parent 49e7bb1 commit 835eefc

9 files changed

Lines changed: 23 additions & 23 deletions

File tree

backend/apps/system/api/assistant.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ async def ui(session: SessionDep, data: str = Form(), files: List[UploadFile] =
130130
file.filename = file_name
131131
if flag_name == 'logo' or flag_name == 'float_icon':
132132
try:
133-
SQLBotFileUtils.check_file(file=file, file_types=[".jpg", ".png", ".svg"],
133+
SQLBotFileUtils.check_file(file=file, file_types=[".jpg", ".jpeg", ".png"],
134134
limit_file_size=(10 * 1024 * 1024))
135135
except ValueError as e:
136136
error_msg = str(e)

backend/apps/system/crud/parameter_manage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ async def get_groups(session: SessionDep, flag: str) -> list[SysArgModel]:
1515

1616
async def save_parameter_args(session: SessionDep, request: Request):
1717
allow_file_mapping = {
18-
""" "test_logo": { "types": [".jpg", ".jpeg", ".png", ".svg"], "size": 5 * 1024 * 1024 } """
18+
""" "test_logo": { "types": [".jpg", ".jpeg", ".png"], "size": 5 * 1024 * 1024 } """
1919
}
2020
form_data = await request.form()
2121
files = form_data.getlist("files")

backend/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ dependencies = [
3939
"pyyaml (>=6.0.2,<7.0.0)",
4040
"fastapi-mcp (>=0.3.4,<0.4.0)",
4141
"tabulate>=0.9.0",
42-
"sqlbot-xpack>=0.0.5.19,<0.0.6.0",
42+
"sqlbot-xpack>=0.0.5.22,<0.0.6.0",
4343
"fastapi-cache2>=0.2.2",
4444
"sqlparse>=0.5.3",
4545
"redis>=6.2.0",

frontend/src/i18n/en.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@
733733
"display_settings": "Display Settings",
734734
"header_text_color": "Header Text Color",
735735
"app_logo": "App Logo",
736-
"maximum_size_10mb": "Recommended size: 32 x 32, supports JPG, PNG, and SVG, maximum size: 10MB",
736+
"maximum_size_10mb": "Recommended size: 32 x 32, supports JPG, PNG, maximum size: 10MB",
737737
"replace": "Replace",
738738
"default_icon_position": "Default Icon Position",
739739
"draggable_position": "Draggable Position",
@@ -846,11 +846,11 @@
846846
"website_logo": "Website Logo",
847847
"tab": "Tab",
848848
"replace_image": "Replace Image",
849-
"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",
849+
"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",
850850
"login_logo": "System Logo",
851-
"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",
851+
"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",
852852
"login_background_image": "Login Background Image",
853-
"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",
853+
"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",
854854
"website_name": "Website Name",
855855
"on_webpage_tabs": "Platform name displayed on webpage tabs",
856856
"welcome_message": "Display a welcome message",

frontend/src/i18n/ko-KR.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@
733733
"display_settings": "표시 설정",
734734
"header_text_color": "헤더 텍스트 색상",
735735
"app_logo": "애플리케이션 로고",
736-
"maximum_size_10mb": "권장 크기 32 x 32, JPG, PNG, SVG 지원, 크기 10MB 이하",
736+
"maximum_size_10mb": "권장 크기 32 x 32, JPG, PNG 지원, 크기 10MB 이하",
737737
"replace": "교체",
738738
"default_icon_position": "아이콘 기본 위치",
739739
"draggable_position": "드래그 가능한 위치",
@@ -846,11 +846,11 @@
846846
"website_logo": "웹사이트 로고",
847847
"tab": "페이지 탭",
848848
"replace_image": "이미지 교체",
849-
"larger_than_200kb": "상단 웹사이트에 표시되는 로고, 권장 크기 48 x 48, JPG, PNG, SVG 지원, 크기 200KB 이하",
849+
"larger_than_200kb": "상단 웹사이트에 표시되는 로고, 권장 크기 48 x 48, JPG, PNG 지원, 크기 200KB 이하",
850850
"login_logo": "시스템 로고",
851-
"larger_than_200kb_de": "로그인 페이지 오른쪽 로고, 권장 크기 204*52, JPG, PNG, SVG 지원, 크기 200KB 이하",
851+
"larger_than_200kb_de": "로그인 페이지 오른쪽 로고, 권장 크기 204*52, JPG, PNG 지원, 크기 200KB 이하",
852852
"login_background_image": "로그인 배경 이미지",
853-
"larger_than_5mb": "왼쪽 배경 이미지, 벡터 이미지 권장 크기 576*900, 비트맵 권장 크기 1152*1800; JPG, PNG, SVG 지원, 크기 5MB 이하",
853+
"larger_than_5mb": "왼쪽 배경 이미지, 벡터 이미지 권장 크기 576*900, 비트맵 권장 크기 1152*1800; JPG, PNG 지원, 크기 5MB 이하",
854854
"website_name": "웹사이트 이름",
855855
"on_webpage_tabs": "웹페이지 탭에 표시되는 플랫폼 이름",
856856
"welcome_message": "환영 메시지 표시",

frontend/src/i18n/zh-CN.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@
733733
"display_settings": "显示设置",
734734
"header_text_color": "头部文本颜色",
735735
"app_logo": "应用 Logo",
736-
"maximum_size_10mb": "建议尺寸 32 x 32,支持 JPG、PNG、SVG,大小不超过 10MB",
736+
"maximum_size_10mb": "建议尺寸 32 x 32,支持 JPG、PNG,大小不超过 10MB",
737737
"replace": "替换",
738738
"default_icon_position": "图标默认位置",
739739
"draggable_position": "可拖拽位置",
@@ -846,11 +846,11 @@
846846
"website_logo": "网站 Logo",
847847
"tab": "页签",
848848
"replace_image": "替换图片",
849-
"larger_than_200kb": "顶部网站显示的 Logo,建议尺寸 48 x 48,支持 JPG、PNG、SVG,大小不超过 200KB",
849+
"larger_than_200kb": "顶部网站显示的 Logo,建议尺寸 48 x 48,支持 JPG、PNG,大小不超过 200KB",
850850
"login_logo": "系统 Logo",
851-
"larger_than_200kb_de": "登录页面右侧 Logo,建议尺寸 204*52,支持 JPG、PNG、SVG,大小不超过 200KB",
851+
"larger_than_200kb_de": "登录页面右侧 Logo,建议尺寸 204*52,支持 JPG、PNG,大小不超过 200KB",
852852
"login_background_image": "登录背景图",
853-
"larger_than_5mb": "左侧背景图,矢量图建议尺寸 576*900,位图建议尺寸 1152*1800;支持 JPG、PNG、SVG,大小不超过 5M",
853+
"larger_than_5mb": "左侧背景图,矢量图建议尺寸 576*900,位图建议尺寸 1152*1800;支持 JPG、PNG,大小不超过 5M",
854854
"website_name": "网站名称",
855855
"on_webpage_tabs": "显示在网页 Tab 的平台名称",
856856
"welcome_message": "显示欢迎语",

frontend/src/i18n/zh-TW.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@
733733
"display_settings": "顯示設定",
734734
"header_text_color": "頭部文字顏色",
735735
"app_logo": "應用 Logo",
736-
"maximum_size_10mb": "建議尺寸 32 x 32,支援 JPG、PNG、SVG,大小不超過 10MB",
736+
"maximum_size_10mb": "建議尺寸 32 x 32,支援 JPG、PNG,大小不超過 10MB",
737737
"replace": "取代",
738738
"default_icon_position": "圖示預設位置",
739739
"draggable_position": "可拖曳位置",
@@ -846,11 +846,11 @@
846846
"website_logo": "網站 Logo",
847847
"tab": "頁籤",
848848
"replace_image": "取代圖片",
849-
"larger_than_200kb": "頂部網站顯示的 Logo,建議尺寸 48 x 48,支援 JPG、PNG、SVG,大小不超過 200KB",
849+
"larger_than_200kb": "頂部網站顯示的 Logo,建議尺寸 48 x 48,支援 JPG、PNG,大小不超過 200KB",
850850
"login_logo": "系統 Logo",
851-
"larger_than_200kb_de": "登入頁面右側 Logo,建議尺寸 204*52,支援 JPG、PNG、SVG,大小不超過 200KB",
851+
"larger_than_200kb_de": "登入頁面右側 Logo,建議尺寸 204*52,支援 JPG、PNG,大小不超過 200KB",
852852
"login_background_image": "登入背景圖",
853-
"larger_than_5mb": "左側背景圖,向量圖建議尺寸 576*900,點陣圖建議尺寸 1152*1800;支援 JPG、PNG、SVG,大小不超過 5M",
853+
"larger_than_5mb": "左側背景圖,向量圖建議尺寸 576*900,點陣圖建議尺寸 1152*1800;支援 JPG、PNG,大小不超過 5M",
854854
"website_name": "網站名稱",
855855
"on_webpage_tabs": "顯示在網頁 Tab 的平台名稱",
856856
"welcome_message": "顯示歡迎語",

frontend/src/views/system/appearance/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
:name="ele.type"
9090
:show-file-list="false"
9191
class="upload-demo"
92-
accept=".jpeg,.jpg,.png,.gif,.svg"
92+
accept=".jpeg,.jpg,.png"
9393
:before-upload="(e: any) => beforeUpload(e, ele)"
9494
:http-request="uploadImg"
9595
>
@@ -378,7 +378,7 @@ const defaultTopForm = {
378378
showDoc: '0',
379379
showAbout: '0',
380380
pc_welcome: t('embedded.i_am_sqlbot'),
381-
pc_welcome_desc: t("qa.hint_description"),
381+
pc_welcome_desc: t('qa.hint_description'),
382382
}
383383
384384
const topForm = reactive<{

frontend/src/views/system/embedded/SetUi.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ defineExpose({
280280
<el-upload
281281
name="logo"
282282
:show-file-list="false"
283-
accept=".jpg,.png,.gif,.svg"
283+
accept=".jpg,.jpeg,.png"
284284
:before-upload="(e: any) => beforeUpload(e, 'logo')"
285285
:http-request="uploadImg"
286286
>
@@ -296,7 +296,7 @@ defineExpose({
296296
<el-upload
297297
name="float_icon"
298298
:show-file-list="false"
299-
accept=".jpg,.png,.gif,.svg"
299+
accept=".jpg,.jpeg,.png"
300300
:before-upload="(e: any) => beforeUpload(e, 'float_icon')"
301301
:http-request="uploadImg"
302302
>

0 commit comments

Comments
 (0)