Skip to content

Commit 92ad268

Browse files
committed
Bugfix: models configuration button is overlapped in small screens
1 parent 8cee889 commit 92ad268

File tree

4 files changed

+101
-32
lines changed

4 files changed

+101
-32
lines changed

frontend/app/[locale]/models/components/modelConfig.tsx

Lines changed: 74 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -846,40 +846,82 @@ export const ModelConfigSection = forwardRef<
846846
justifyContent: "flex-start",
847847
paddingRight: 12,
848848
marginLeft: "4px",
849-
height: LAYOUT_CONFIG.BUTTON_AREA_HEIGHT,
849+
minHeight: LAYOUT_CONFIG.BUTTON_AREA_HEIGHT,
850850
}}
851851
>
852-
<Space size={10}>
853-
<Button type="primary" size="middle" onClick={handleSyncModels}>
854-
<SyncOutlined />{" "}
855-
{t("modelConfig.button.syncModelEngine")}
856-
</Button>
857-
<Button
858-
type="primary"
859-
size="middle"
860-
icon={<PlusOutlined />}
861-
onClick={() => setIsAddModalOpen(true)}
862-
>
863-
{t("modelConfig.button.addCustomModel")}
864-
</Button>
865-
<Button
866-
type="primary"
867-
size="middle"
868-
icon={<EditOutlined />}
869-
onClick={() => setIsDeleteModalOpen(true)}
870-
>
871-
{t("modelConfig.button.editCustomModel")}
872-
</Button>
873-
<Button
874-
type="primary"
875-
size="middle"
876-
icon={<SafetyCertificateOutlined />}
877-
onClick={verifyModels}
878-
loading={isVerifying}
879-
>
880-
{t("modelConfig.button.checkConnectivity")}
881-
</Button>
882-
</Space>
852+
<Row gutter={[8, 8]} style={{ width: "100%" }}>
853+
<Col xs={24} sm={12} md={6} lg={6} xl={6}>
854+
<Button
855+
type="primary"
856+
size="middle"
857+
onClick={handleSyncModels}
858+
style={{ width: "100%" }}
859+
block
860+
>
861+
<SyncOutlined />
862+
<span style={{ marginLeft: 4 }}>
863+
<span className="hidden xl:inline button-text-full">
864+
{t("modelConfig.button.syncModelEngine")}
865+
</span>
866+
<span className="xl:hidden button-text-short">
867+
{t("modelConfig.button.sync")}
868+
</span>
869+
</span>
870+
</Button>
871+
</Col>
872+
<Col xs={24} sm={12} md={6} lg={6} xl={6}>
873+
<Button
874+
type="primary"
875+
size="middle"
876+
icon={<PlusOutlined />}
877+
onClick={() => setIsAddModalOpen(true)}
878+
style={{ width: "100%" }}
879+
block
880+
>
881+
<span className="hidden xl:inline button-text-full">
882+
{t("modelConfig.button.addCustomModel")}
883+
</span>
884+
<span className="xl:hidden button-text-short">
885+
{t("modelConfig.button.add")}
886+
</span>
887+
</Button>
888+
</Col>
889+
<Col xs={24} sm={12} md={6} lg={6} xl={6}>
890+
<Button
891+
type="primary"
892+
size="middle"
893+
icon={<EditOutlined />}
894+
onClick={() => setIsDeleteModalOpen(true)}
895+
style={{ width: "100%" }}
896+
block
897+
>
898+
<span className="hidden xl:inline button-text-full">
899+
{t("modelConfig.button.editCustomModel")}
900+
</span>
901+
<span className="xl:hidden button-text-short">
902+
{t("modelConfig.button.edit")}
903+
</span>
904+
</Button>
905+
</Col>
906+
<Col xs={24} sm={12} md={6} lg={6} xl={6}>
907+
<Button
908+
type="primary"
909+
size="middle"
910+
icon={<SafetyCertificateOutlined />}
911+
onClick={verifyModels}
912+
loading={isVerifying}
913+
style={{ width: "100%" }}
914+
block
915+
>
916+
<span className="hidden xl:inline button-text-full">
917+
{t("modelConfig.button.checkConnectivity")}
918+
</span>
919+
<span className="xl:hidden button-text-short">
920+
{t("modelConfig.button.check")}
921+
</span>
922+
</Button>
923+
</Col>
924+
</Row>
883925
</div>
884926

885927
<div

frontend/public/locales/en/common.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,10 @@
699699
"modelConfig.button.addCustomModel": "Add Model",
700700
"modelConfig.button.editCustomModel": "Edit or Delete Model",
701701
"modelConfig.button.checkConnectivity": "Check Model Connectivity",
702+
"modelConfig.button.sync": "Sync",
703+
"modelConfig.button.add": "Add",
704+
"modelConfig.button.edit": "Edit",
705+
"modelConfig.button.check": "Check",
702706
"modelConfig.slider.chunkingSize": "Chunk Size",
703707
"modelConfig.slider.expectedChunkSize": "Expected Chunk Size",
704708
"modelConfig.slider.maximumChunkSize": "Maximum Chunk Size",

frontend/public/locales/zh/common.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,10 @@
699699
"modelConfig.button.addCustomModel": "添加模型",
700700
"modelConfig.button.editCustomModel": "修改或删除模型",
701701
"modelConfig.button.checkConnectivity": "检查模型连通性",
702+
"modelConfig.button.sync": "同步",
703+
"modelConfig.button.add": "添加",
704+
"modelConfig.button.edit": "修改",
705+
"modelConfig.button.check": "检查",
702706
"modelConfig.slider.chunkingSize": "文档切片大小",
703707
"modelConfig.slider.expectedChunkSize": "期望切片大小",
704708
"modelConfig.slider.maximumChunkSize": "最大切片大小",

frontend/styles/globals.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,4 +305,23 @@
305305
.kb-embedding-warning .ant-modal {
306306
width: max-content;
307307
min-width: 0;
308+
}
309+
310+
/* Responsive button text - global utility */
311+
@media (max-width: 1279px) {
312+
.button-text-full {
313+
display: none !important;
314+
}
315+
.button-text-short {
316+
display: inline !important;
317+
}
318+
}
319+
320+
@media (min-width: 1280px) {
321+
.button-text-full {
322+
display: inline !important;
323+
}
324+
.button-text-short {
325+
display: none !important;
326+
}
308327
}

0 commit comments

Comments
 (0)