From b5bbf9d0bbf00a80cb5ad7af17b5c11e9790bd4a Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Wed, 25 Jun 2025 21:58:01 +0800 Subject: [PATCH] feat: layout --- ui/src/components/app-icon/icons/common.ts | 132 ---------- ui/src/components/app-icon/icons/menu.ts | 50 +++- ui/src/components/dynamics-form/index.vue | 33 +-- ui/src/components/folder-tree/index.vue | 2 +- ui/src/locales/lang/en-US/common.ts | 8 +- .../locales/lang/en-US/views/application.ts | 2 - ui/src/locales/lang/en-US/views/document.ts | 1 - ui/src/locales/lang/en-US/views/index.ts | 50 ++-- ui/src/locales/lang/en-US/views/shared.ts | 8 + ui/src/locales/lang/en-US/views/system.ts | 79 ------ ui/src/locales/lang/zh-CN/common.ts | 8 +- .../locales/lang/zh-CN/views/application.ts | 2 - ui/src/locales/lang/zh-CN/views/document.ts | 1 - ui/src/locales/lang/zh-CN/views/index.ts | 8 +- .../zh-CN/views/resource-authorization.ts | 2 - ui/src/locales/lang/zh-CN/views/shared.ts | 8 + ui/src/locales/lang/zh-CN/views/system.ts | 76 ------ ui/src/locales/lang/zh-Hant/common.ts | 8 +- ui/src/locales/lang/zh-Hant/views/404.ts | 5 - .../locales/lang/zh-Hant/views/application.ts | 1 - ui/src/locales/lang/zh-Hant/views/document.ts | 1 - ui/src/locales/lang/zh-Hant/views/index.ts | 6 +- ui/src/locales/lang/zh-Hant/views/shared.ts | 8 + ui/src/locales/lang/zh-Hant/views/system.ts | 9 +- ui/src/router/modules/system.ts | 16 +- ui/src/styles/component.scss | 7 + ui/src/views/404/index.vue | 4 +- .../views/application/ApplicationSetting.vue | 17 +- .../component/AddKnowledgeDialog.vue | 4 +- .../component/TTSModeParamSettingDialog.vue | 4 +- ui/src/views/document/index.vue | 2 +- .../component/KnowledgeListContainer.vue | 4 +- ui/src/views/knowledge/index.vue | 2 +- ui/src/views/login/ForgotPassword.vue | 2 +- ui/src/views/model/component/ModelCard.vue | 4 +- ui/src/views/model/component/Provider.vue | 6 +- ui/src/views/paragraph/index.vue | 2 +- ui/src/views/system-setting/theme/index.vue | 80 +++--- .../AuthorizedWorkspaceDialog.vue | 247 +++++------------- .../system-shared/KnowLedgeSharedIndex.vue | 2 +- .../views/system-shared/ModelSharedIndex.vue | 2 +- .../views/system-shared/ToolSharedIndex.vue | 2 +- .../tool/component/ToolListContainer.vue | 4 +- ui/src/views/tool/index.vue | 2 +- ui/src/workflow/common/edge.ts | 35 ++- ui/src/workflow/nodes/ai-chat-node/index.vue | 12 +- .../workflow/nodes/application-node/index.vue | 152 +++++------ .../workflow/nodes/image-generate/index.vue | 13 +- .../workflow/nodes/image-understand/index.vue | 13 +- ui/src/workflow/nodes/mcp-node/index.vue | 58 ++-- ui/src/workflow/nodes/question-node/index.vue | 13 +- ui/src/workflow/nodes/reranker-node/index.vue | 13 +- .../nodes/speech-to-text-node/index.vue | 14 +- .../nodes/text-to-speech-node/index.vue | 13 +- 54 files changed, 428 insertions(+), 829 deletions(-) create mode 100644 ui/src/locales/lang/en-US/views/shared.ts create mode 100644 ui/src/locales/lang/zh-CN/views/shared.ts delete mode 100644 ui/src/locales/lang/zh-Hant/views/404.ts create mode 100644 ui/src/locales/lang/zh-Hant/views/shared.ts diff --git a/ui/src/components/app-icon/icons/common.ts b/ui/src/components/app-icon/icons/common.ts index 97bbb40e9..9c324b444 100644 --- a/ui/src/components/app-icon/icons/common.ts +++ b/ui/src/components/app-icon/icons/common.ts @@ -25,46 +25,6 @@ export default { ]) }, }, - 'app-setting': { - iconReader: () => { - return h('i', [ - h( - 'svg', - { - viewBox: '0 0 20 20', - version: '1.1', - xmlns: 'http://www.w3.org/2000/svg', - }, - [ - h('path', { - d: 'M3.60734 16.4448L3.34807 16.1624C2.44036 15.1737 1.75935 13.9944 1.36011 12.7066L1.24756 12.3435L2.95427 10.0001L1.24756 7.65668L1.36011 7.29361C1.75935 6.00574 2.44036 4.82649 3.34807 3.83779L3.60734 3.55539L6.47552 3.86889L7.64049 1.21319L8.01405 1.12909C8.66134 0.983366 9.32633 0.90918 10.0004 0.90918C10.6744 0.90918 11.3394 0.983366 11.9867 1.12909L12.3603 1.21319L13.5252 3.86889L16.3934 3.55539L16.6527 3.83779C17.5604 4.82649 18.2414 6.00574 18.6406 7.29361L18.7532 7.65668L17.0465 10.0001L18.7532 12.3435L18.6406 12.7066C18.2414 13.9944 17.5604 15.1737 16.6527 16.1624L16.3934 16.4448L13.5252 16.1313L12.3603 18.787L11.9867 18.8711C11.3394 19.0168 10.6744 19.091 10.0004 19.091C9.32633 19.091 8.66134 19.0168 8.01405 18.8711L7.64049 18.787L6.47552 16.1313L3.60734 16.4448ZM6.51159 14.6031C7.05002 14.5443 7.56436 14.8417 7.78194 15.3377L8.71565 17.4662C9.13677 17.5389 9.56603 17.5758 10.0004 17.5758C10.4347 17.5758 10.864 17.5389 11.2851 17.4662L12.2188 15.3377C12.4364 14.8417 12.9507 14.5443 13.4892 14.6031L15.7844 14.854C16.3387 14.1868 16.7757 13.4286 17.0741 12.6116L15.7038 10.7301C15.3869 10.295 15.3869 9.70511 15.7038 9.26999L17.0741 7.38847C16.7757 6.57146 16.3387 5.81331 15.7844 5.14609L13.4892 5.39696C12.9507 5.45581 12.4364 5.1584 12.2188 4.66238L11.2851 2.53389C10.864 2.46117 10.4347 2.42429 10.0004 2.42429C9.56603 2.42429 9.13677 2.46117 8.71565 2.53389L7.78194 4.66238C7.56436 5.1584 7.05002 5.45581 6.51159 5.39696L4.21641 5.14609C3.66208 5.81331 3.22502 6.57146 2.92666 7.38847L4.29697 9.26999C4.61387 9.70511 4.61387 10.295 4.29697 10.7301L2.92666 12.6116C3.22502 13.4286 3.66208 14.1868 4.21641 14.854L6.51159 14.6031ZM10.0004 13.788C7.91555 13.788 6.22693 12.0913 6.22693 10.0001C6.22693 7.9089 7.91555 6.2122 10.0004 6.2122C12.0852 6.2122 13.7738 7.9089 13.7738 10.0001C13.7738 12.0913 12.0852 13.788 10.0004 13.788ZM10.0004 12.2729C11.2468 12.2729 12.2587 11.2561 12.2587 10.0001C12.2587 8.74413 11.2468 7.72741 10.0004 7.72741C8.75397 7.72741 7.74208 8.74413 7.74208 10.0001C7.74208 11.2561 8.75397 12.2729 10.0004 12.2729Z', - fill: 'currentColor', - }), - ], - ), - ]) - }, - }, - 'app-setting-active': { - iconReader: () => { - return h('i', [ - h( - 'svg', - { - viewBox: '0 0 20 20', - version: '1.1', - xmlns: 'http://www.w3.org/2000/svg', - }, - [ - h('path', { - d: 'M3.26425 16.2151C2.35478 15.2292 1.65887 14.0432 1.25 12.7305L2.70785 10.7384C3.02952 10.2988 3.02952 9.70154 2.70785 9.26197L1.25 7.26979C1.65887 5.95714 2.35478 4.77112 3.26425 3.78522L5.71416 4.05172C6.25589 4.11065 6.77338 3.81185 6.99316 3.31321L7.98848 1.05505C8.63579 0.910018 9.30896 0.833496 10 0.833496C10.691 0.833496 11.3642 0.910018 12.0115 1.05505L13.0068 3.31321C13.2266 3.81185 13.7441 4.11065 14.2858 4.05172L16.7357 3.78522C17.6452 4.77112 18.3411 5.95714 18.75 7.26979L17.2921 9.26197C16.9705 9.70154 16.9705 10.2988 17.2921 10.7384L18.75 12.7305C18.3411 14.0432 17.6452 15.2292 16.7357 16.2151L14.2858 15.9486C13.7441 15.8897 13.2266 16.1885 13.0068 16.6871L12.0115 18.9453C11.3642 19.0903 10.691 19.1668 10 19.1668C9.30896 19.1668 8.63579 19.0903 7.98848 18.9453L6.99316 16.6871C6.77338 16.1885 6.25589 15.8897 5.71416 15.9486L3.26425 16.2151ZM10 13.3335C11.8409 13.3335 13.3333 11.8411 13.3333 10.0002C13.3333 8.15921 11.8409 6.66683 10 6.66683C8.15905 6.66683 6.66667 8.15921 6.66667 10.0002C6.66667 11.8411 8.15905 13.3335 10 13.3335Z', - fill: 'currentColor', - }), - ], - ), - ]) - }, - }, 'right-outlined': { iconReader: () => { return h('i', [ @@ -85,96 +45,4 @@ export default { ]) }, }, - 'app-folder-share-active': { - iconReader: () => { - return h('i', [ - h( - 'svg', - { - viewBox: '0 0 20 20', - version: '1.1', - xmlns: 'http://www.w3.org/2000/svg', - }, - [ - h('path', { - d: 'M0.833334 3.33333C0.833334 2.8731 1.20643 2.5 1.66667 2.5H8.65164C8.96728 2.5 9.25583 2.67834 9.39699 2.96066L10 4.16667H18.3333C18.7936 4.16667 19.1667 4.53976 19.1667 5V16.6667C19.1667 17.1269 18.7936 17.5 18.3333 17.5H1.66667C1.20643 17.5 0.833334 17.1269 0.833334 16.6667V3.33333Z', - fill: '#3370FF', - }), - h('path', { - d: 'M10.5403 9.27428C10.505 9.15191 10.4861 9.02261 10.4861 8.88889C10.4861 8.12183 11.1079 7.5 11.875 7.5C12.6421 7.5 13.2639 8.12183 13.2639 8.88889C13.2639 9.65595 12.6421 10.2778 11.875 10.2778C11.492 10.2778 11.1451 10.1227 10.8939 9.87195L9.39028 10.7604C9.42555 10.8828 9.44444 11.0121 9.44444 11.1458C9.44444 11.2379 9.43549 11.3278 9.41841 11.4149L11.3337 12.3342C11.5885 12.0321 11.9697 11.8403 12.3958 11.8403C13.1629 11.8403 13.7847 12.4621 13.7847 13.2292C13.7847 13.9962 13.1629 14.6181 12.3958 14.6181C11.6288 14.6181 11.0069 13.9962 11.0069 13.2292C11.0069 13.1371 11.0159 13.0472 11.033 12.9601L9.11769 12.0408C8.86291 12.3429 8.48164 12.5347 8.05556 12.5347C7.28849 12.5347 6.66667 11.9129 6.66667 11.1458C6.66667 10.3788 7.28849 9.75694 8.05556 9.75694C8.43859 9.75694 8.78541 9.912 9.03667 10.1628L10.5403 9.27428Z', - fill: 'white', - }), - ], - ), - ]) - }, - }, - 'app-folder-share': { - iconReader: () => { - return h('i', [ - h( - 'svg', - { - viewBox: '0 0 20 20', - version: '1.1', - xmlns: 'http://www.w3.org/2000/svg', - }, - [ - h('path', { - d: 'M10.4015 9.13532C10.3663 9.01295 10.3474 8.88365 10.3474 8.74993C10.3474 7.98287 10.9692 7.36104 11.7363 7.36104C12.5033 7.36104 13.1251 7.98287 13.1251 8.74993C13.1251 9.51699 12.5033 10.1388 11.7363 10.1388C11.3532 10.1388 11.0064 9.98377 10.7551 9.733L9.25154 10.6215C9.2868 10.7439 9.3057 10.8732 9.3057 11.0069C9.3057 11.0989 9.29675 11.1889 9.27967 11.2759L11.195 12.1952C11.4497 11.8932 11.831 11.7013 12.2571 11.7013C13.0242 11.7013 13.646 12.3231 13.646 13.0902C13.646 13.8573 13.0242 14.4791 12.2571 14.4791C11.49 14.4791 10.8682 13.8573 10.8682 13.0902C10.8682 12.9982 10.8772 12.9082 10.8942 12.8212L8.97894 11.9019C8.72417 12.2039 8.3429 12.3958 7.91681 12.3958C7.14975 12.3958 6.52792 11.7739 6.52792 11.0069C6.52792 10.2398 7.14975 9.61799 7.91681 9.61799C8.29985 9.61799 8.64667 9.77304 8.89793 10.0238L10.4015 9.13532Z', - fill: '#1F2329', - }), - h('path', { - d: 'M0.833344 3.33333V16.6667C0.833344 17.1269 1.22421 17.5 1.70636 17.5H18.2937C18.7758 17.5 19.1667 17.1269 19.1667 16.6667V5C19.1667 4.53976 18.7758 4.16667 18.2937 4.16667H10L9.397 2.96066C9.25584 2.67834 8.96729 2.5 8.65165 2.5H1.66668C1.20644 2.5 0.833344 2.8731 0.833344 3.33333ZM2.50001 15.8333V5.83333H17.5V15.8333H2.50001Z', - fill: '#1F2329', - }), - ], - ), - ]) - }, - }, - 'moments-categories': { - iconReader: () => { - return h('i', [ - h( - 'svg', - { - viewBox: '0 0 20 20', - version: '1.1', - xmlns: 'http://www.w3.org/2000/svg', - }, - [ - h('path', { - d: 'M10.2239 2.22566L18.6144 7.56512C18.8717 7.72885 18.8717 8.10444 18.6144 8.26817L10.2239 13.6076C10.0874 13.6945 9.91296 13.6945 9.77647 13.6076L1.3859 8.26817C1.12861 8.10444 1.12861 7.72885 1.3859 7.56512L9.77647 2.22566C9.91296 2.13881 10.0874 2.13881 10.2239 2.22566ZM3.93789 7.91664L10.0002 11.7745L16.0625 7.91664L10.0002 4.05883L3.93789 7.91664Z', - fill: '#1F2329', - }), - h('path', { - d: 'M2.16387 11.5717C1.96769 11.4515 1.71114 11.513 1.59086 11.7092L1.15526 12.4196C1.03498 12.6158 1.0965 12.8723 1.29268 12.9926L8.92197 17.6705C9.45728 17.9987 10.1264 17.9987 10.6617 17.6705L18.291 12.9926C18.4871 12.8723 18.5487 12.6158 18.4284 12.4196L17.9928 11.7092C17.8725 11.513 17.6159 11.4515 17.4198 11.5717L9.90072 16.182C9.8339 16.223 9.74974 16.223 9.68292 16.182L2.16387 11.5717Z', - fill: '#1F2329', - }), - ], - ), - ]) - }, - }, - 'close-outlined': { - iconReader: () => { - return h('i', [ - h( - 'svg', - { - viewBox: '0 0 16 16', - version: '1.1', - xmlns: 'http://www.w3.org/2000/svg', - }, - [ - h('path', { - d: 'M8.00023 7.05718L12.4786 2.57883C12.6087 2.44866 12.8198 2.44866 12.95 2.57883L13.4214 3.05024C13.5516 3.18041 13.5516 3.39147 13.4214 3.52164L8.94304 7.99998L13.4214 12.4783C13.5516 12.6085 13.5516 12.8196 13.4214 12.9497L12.95 13.4211C12.8198 13.5513 12.6087 13.5513 12.4786 13.4211L8.00023 8.94279L3.52189 13.4211C3.39171 13.5513 3.18066 13.5513 3.05048 13.4211L2.57908 12.9497C2.4489 12.8196 2.4489 12.6085 2.57908 12.4783L7.05742 7.99998L2.57908 3.52164C2.4489 3.39147 2.4489 3.18041 2.57908 3.05024L3.05048 2.57883C3.18066 2.44866 3.39171 2.44866 3.52189 2.57883L8.00023 7.05718Z', - fill: '#8F959E', - }), - ], - ), - ]) - }, - }, } diff --git a/ui/src/components/app-icon/icons/menu.ts b/ui/src/components/app-icon/icons/menu.ts index a2882279c..40eea6d54 100644 --- a/ui/src/components/app-icon/icons/menu.ts +++ b/ui/src/components/app-icon/icons/menu.ts @@ -54,6 +54,54 @@ export default { ]) }, }, + 'app-shared-active': { + iconReader: () => { + return h('i', [ + h( + 'svg', + { + viewBox: '0 0 20 20', + version: '1.1', + xmlns: 'http://www.w3.org/2000/svg', + }, + [ + h('path', { + d: 'M0.833334 3.33333C0.833334 2.8731 1.20643 2.5 1.66667 2.5H8.65164C8.96728 2.5 9.25583 2.67834 9.39699 2.96066L10 4.16667H18.3333C18.7936 4.16667 19.1667 4.53976 19.1667 5V16.6667C19.1667 17.1269 18.7936 17.5 18.3333 17.5H1.66667C1.20643 17.5 0.833334 17.1269 0.833334 16.6667V3.33333Z', + fill: 'currentColor', + }), + h('path', { + d: 'M10.5403 9.27428C10.505 9.15191 10.4861 9.02261 10.4861 8.88889C10.4861 8.12183 11.1079 7.5 11.875 7.5C12.6421 7.5 13.2639 8.12183 13.2639 8.88889C13.2639 9.65595 12.6421 10.2778 11.875 10.2778C11.492 10.2778 11.1451 10.1227 10.8939 9.87195L9.39028 10.7604C9.42555 10.8828 9.44444 11.0121 9.44444 11.1458C9.44444 11.2379 9.43549 11.3278 9.41841 11.4149L11.3337 12.3342C11.5885 12.0321 11.9697 11.8403 12.3958 11.8403C13.1629 11.8403 13.7847 12.4621 13.7847 13.2292C13.7847 13.9962 13.1629 14.6181 12.3958 14.6181C11.6288 14.6181 11.0069 13.9962 11.0069 13.2292C11.0069 13.1371 11.0159 13.0472 11.033 12.9601L9.11769 12.0408C8.86291 12.3429 8.48164 12.5347 8.05556 12.5347C7.28849 12.5347 6.66667 11.9129 6.66667 11.1458C6.66667 10.3788 7.28849 9.75694 8.05556 9.75694C8.43859 9.75694 8.78541 9.912 9.03667 10.1628L10.5403 9.27428Z', + fill: 'currentColor', + }), + ], + ), + ]) + }, + }, + 'app-shared': { + iconReader: () => { + return h('i', [ + h( + 'svg', + { + viewBox: '0 0 20 20', + version: '1.1', + xmlns: 'http://www.w3.org/2000/svg', + }, + [ + h('path', { + d: 'M10.4015 9.13532C10.3663 9.01295 10.3474 8.88365 10.3474 8.74993C10.3474 7.98287 10.9692 7.36104 11.7363 7.36104C12.5033 7.36104 13.1251 7.98287 13.1251 8.74993C13.1251 9.51699 12.5033 10.1388 11.7363 10.1388C11.3532 10.1388 11.0064 9.98377 10.7551 9.733L9.25154 10.6215C9.2868 10.7439 9.3057 10.8732 9.3057 11.0069C9.3057 11.0989 9.29675 11.1889 9.27967 11.2759L11.195 12.1952C11.4497 11.8932 11.831 11.7013 12.2571 11.7013C13.0242 11.7013 13.646 12.3231 13.646 13.0902C13.646 13.8573 13.0242 14.4791 12.2571 14.4791C11.49 14.4791 10.8682 13.8573 10.8682 13.0902C10.8682 12.9982 10.8772 12.9082 10.8942 12.8212L8.97894 11.9019C8.72417 12.2039 8.3429 12.3958 7.91681 12.3958C7.14975 12.3958 6.52792 11.7739 6.52792 11.0069C6.52792 10.2398 7.14975 9.61799 7.91681 9.61799C8.29985 9.61799 8.64667 9.77304 8.89793 10.0238L10.4015 9.13532Z', + fill: 'currentColor', + }), + h('path', { + d: 'M0.833344 3.33333V16.6667C0.833344 17.1269 1.22421 17.5 1.70636 17.5H18.2937C18.7758 17.5 19.1667 17.1269 19.1667 16.6667V5C19.1667 4.53976 18.7758 4.16667 18.2937 4.16667H10L9.397 2.96066C9.25584 2.67834 8.96729 2.5 8.65165 2.5H1.66668C1.20644 2.5 0.833344 2.8731 0.833344 3.33333ZM2.50001 15.8333V5.83333H17.5V15.8333H2.50001Z', + fill: 'currentColor', + }), + ], + ), + ]) + }, + }, 'app-setting': { iconReader: () => { return h('i', [ @@ -93,5 +141,5 @@ export default { ), ]) }, - } + }, } diff --git a/ui/src/components/dynamics-form/index.vue b/ui/src/components/dynamics-form/index.vue index e0c5a0d2b..290e392ec 100644 --- a/ui/src/components/dynamics-form/index.vue +++ b/ui/src/components/dynamics-form/index.vue @@ -35,7 +35,7 @@ import FormItem from '@/components/dynamics-form/FormItem.vue' import type { FormField } from '@/components/dynamics-form/type' import { ref, onBeforeMount, watch, type Ref } from 'vue' import type { FormInstance } from 'element-plus' -import triggerApi from '@/api/model/provider' +import { get } from '@/request/index' import type Result from '@/request/Result' import _ from 'lodash' @@ -56,7 +56,7 @@ const props = withDefaults( modelValue?: Dict }>(), - { view: false, defaultItemWidth: '75%', otherParams: () => {} } + { view: false, defaultItemWidth: '75%', otherParams: () => {} }, ) const formValue = ref>({}) @@ -108,7 +108,7 @@ watch( () => { emit('update:modelValue', formValue.value) }, - { deep: true } + { deep: true }, ) /** @@ -117,25 +117,6 @@ watch( * @param loading */ const trigger = (field: FormField, loading: Ref) => { - if (field.provider && field.method) { - return triggerApi - .trigger( - field.provider, - field.method, - { - ...props.otherParams, - ...formValue.value - }, - loading - ) - .then((ok) => { - if (field.trigger_type === 'CHILD_FORMS') { - field.children = ok.data as Array - } else { - field.option_list = ok.data as Array - } - }) - } return Promise.resolve([]) } /** @@ -161,10 +142,10 @@ onBeforeMount(() => { const render = ( render_data: string | Array | Promise>>, - data?: Dict + data?: Dict, ) => { if (typeof render_data == 'string') { - triggerApi.get(render_data, {}, loading).then((ok) => { + get(render_data, {}, loading).then((ok) => { formFieldList.value = ok.data }) } else if (render_data instanceof Array) { @@ -213,7 +194,7 @@ const render = ( const validate = () => { return Promise.all([ ...formFieldRef.value.map((item) => item.validate()), - ruleFormRef.value ? ruleFormRef.value.validate() : Promise.resolve() + ruleFormRef.value ? ruleFormRef.value.validate() : Promise.resolve(), ]) } @@ -222,7 +203,7 @@ defineExpose({ initDefaultData, validate, render, - ruleFormRef + ruleFormRef, }) diff --git a/ui/src/components/folder-tree/index.vue b/ui/src/components/folder-tree/index.vue index e9e401739..28d5b7a11 100644 --- a/ui/src/components/folder-tree/index.vue +++ b/ui/src/components/folder-tree/index.vue @@ -13,7 +13,7 @@ class="shared-button flex cursor" :class="currentNodeKey === 'share' && 'active'" > - + {{ shareTitle }}
diff --git a/ui/src/locales/lang/en-US/common.ts b/ui/src/locales/lang/en-US/common.ts index 9cc52a369..033c73a53 100644 --- a/ui/src/locales/lang/en-US/common.ts +++ b/ui/src/locales/lang/en-US/common.ts @@ -89,5 +89,11 @@ export default { otherSetting: 'Other Settings', username: 'username', importCreate: 'Import Create', - detail: 'Detail' + detail: 'Detail', + selected: 'Selected', + notFound: { + title: '404', + message: 'Unable to Access APP', + operate: 'Back to Home', + }, } diff --git a/ui/src/locales/lang/en-US/views/application.ts b/ui/src/locales/lang/en-US/views/application.ts index 008e569c9..4e07dc0b5 100644 --- a/ui/src/locales/lang/en-US/views/application.ts +++ b/ui/src/locales/lang/en-US/views/application.ts @@ -130,8 +130,6 @@ export default { dialog: { addKnowledge: 'Add Related Knowledge', addKnowledgePlaceholder: 'The selected knowledge must use the same embedding model', - selected: 'Selected', - selectSearchMode: 'Retrieval Mode', vectorSearch: 'Vector Search', vectorSearchTooltip: diff --git a/ui/src/locales/lang/en-US/views/document.ts b/ui/src/locales/lang/en-US/views/document.ts index b9ee6647f..320ce187a 100644 --- a/ui/src/locales/lang/en-US/views/document.ts +++ b/ui/src/locales/lang/en-US/views/document.ts @@ -2,7 +2,6 @@ export default { uploadDocument: 'Upload Document', importDocument: 'Import Document', syncDocument: 'Sync Document', - selected: 'Selected', items: 'Items', migrateDocument: 'Migrate to', searchBar: { diff --git a/ui/src/locales/lang/en-US/views/index.ts b/ui/src/locales/lang/en-US/views/index.ts index 6095336ea..3f2f38f5b 100644 --- a/ui/src/locales/lang/en-US/views/index.ts +++ b/ui/src/locales/lang/en-US/views/index.ts @@ -1,40 +1,40 @@ -import notFound from './404' -import application from './application' -import role from './role' -import workspace from './workspace' -import applicationOverview from './application-overview' +import login from './login' +import model from './model' import knowledge from './knowledge' -import system from './system' import tool from './tool' +import document from './document' +import system from './system' import userManage from './user-manage' import resourceAuthorization from './resource-authorization' -import model from './model' -import document from './document' -import paragraph from './paragraph' +import role from './role' +import workspace from './workspace' +import application from './application' import problem from './problem' +import applicationOverview from './application-overview' +import applicationWorkflow from './application-workflow' +import paragraph from './paragraph' import chatLog from './chat-log' import chatUser from './chat-user' -import applicationWorkflow from './application-workflow' -import login from './login' import operateLog from './operate-log' +import shared from './shared' export default { - notFound, - application, - applicationOverview, - system, - tool, - userManage, - resourceAuthorization, + login, model, knowledge, - applicationWorkflow, + tool, document, - paragraph, - problem, - chatLog, - login, - operateLog, + system, + userManage, + resourceAuthorization, role, workspace, - chatUser + application, + problem, + applicationOverview, + applicationWorkflow, + paragraph, + chatLog, + chatUser, + operateLog, + shared } diff --git a/ui/src/locales/lang/en-US/views/shared.ts b/ui/src/locales/lang/en-US/views/shared.ts new file mode 100644 index 000000000..ed0b40ed4 --- /dev/null +++ b/ui/src/locales/lang/en-US/views/shared.ts @@ -0,0 +1,8 @@ +export default { + title: 'Shared', + shared_resources: 'Shared Resources', + shared_tool: 'Shared Tool', + shared_model: 'Shared Model', + shared_knowledge: 'Shared Knowledge', + authorized_workspace: 'Authorize Workspace', +} diff --git a/ui/src/locales/lang/en-US/views/system.ts b/ui/src/locales/lang/en-US/views/system.ts index 52ff18e87..9c0b156a1 100644 --- a/ui/src/locales/lang/en-US/views/system.ts +++ b/ui/src/locales/lang/en-US/views/system.ts @@ -94,48 +94,6 @@ export default { access: 'Access', }, }, - theme: { - title: 'Appearance Settings', - platformDisplayTheme: 'Platform Display Theme', - customTheme: 'Custom Theme', - platformLoginSettings: 'Platform Login Settings', - custom: 'Custom', - pagePreview: 'Page Preview', - default: 'Default', - restoreDefaults: 'Restore Defaults', - orange: 'Orange', - green: 'Green', - purple: 'Purole', - red: 'Red', - loginBackground: 'Login Background', - loginLogo: 'Login Logo', - websiteLogo: 'Website Logo', - replacePicture: 'Replace Picture', - websiteLogoTip: - 'The logo displayed on the top of the website. The recommended size is 48*48. It supports JPG, PNG, and GIF formats, with a size not exceeding 10MB.', - loginLogoTip: - 'Login page right-side logo. Recommended size is 204*52. Supports JPG, PNG, GIF formats, with a maximum file size of 10 MB.', - loginBackgroundTip: - 'Left background image, vector image recommended size 576 * 900, bitmap recommended size 1152 * 1800; Supports JPG, PNG, GIF, with a size not exceeding 10 MB.', - websiteName: 'Website Name', - websiteNamePlaceholder: 'Please enter the WebsiteName', - websiteNameTip: 'The platform name displayed on the web page tab.', - websiteSlogan: 'Welcome Slogan', - websiteSloganPlaceholder: 'Please enter the Welcome Slogan', - websiteSloganTip: 'Welcome message under the product logo', - defaultSlogan: 'Welcome to MaxKB Open Source AI Assistant', - logoDefaultTip: 'Default is MaxKB login interface, supports custom settings', - defaultTip: 'Default is MaxKB platform interface, supports custom settings', - platformSetting: 'Platform Setting', - showUserManual: 'Show User Manual', - showForum: 'Show Forum', - showProject: 'Show Project Address', - urlPlaceholder: 'Please enter URL address', - abandonUpdate: 'Abandon Update', - saveAndApply: 'Save and Apply', - fileMessageError: 'The file size exceeds 10M', - saveSuccess: 'Appearance setting successful', - }, email: { title: 'Email Settings', smtpHost: 'SMTP Host', @@ -151,43 +109,6 @@ export default { enableSSL: 'Enable SSL (if the SMTP port is 465, you usually need to enable SSL)', enableTLS: 'Enable TLS (if the SMTP port is 587, you usually need to enable TLS)', }, - group: { - title: 'Team Member', - member: 'Member', - manage: 'Owner', - permissionSetting: 'Permission Setting', - addMember: 'Add Member', - addSubTitle: 'Members can access the data authorized by you after logging in', - searchBar: { - placeholder: 'Please enter username to search', - }, - delete: { - button: 'Remove', - confirmTitle: 'Wheather to remove the member:', - confirmMessage: - "After removal, the member's knowledge base and application permissions will be revoked.", - }, - setting: { - management: 'manegement', - check: 'check', - }, - - form: { - userName: { - label: 'Username/Email', - placeholder: "Please enter the member's username or email", - requiredMessage: 'Please enter Username/Email', - }, - }, - }, - shared: { - label: 'Shared', - shared_resources: 'Shared Resources', - shared_tool: 'Shared Tool', - shared_model: 'Shared Model', - shared_knowledge: 'Shared Knowledge', - authorized_workspace: 'Authorize Workspace', - }, resource_management: { label: 'Resource Management', }, diff --git a/ui/src/locales/lang/zh-CN/common.ts b/ui/src/locales/lang/zh-CN/common.ts index 3b947062d..5adc26797 100644 --- a/ui/src/locales/lang/zh-CN/common.ts +++ b/ui/src/locales/lang/zh-CN/common.ts @@ -93,5 +93,11 @@ export default { otherSetting: '其他设置', username: '用户名', importCreate: '导入创建', - detail: '详情' + detail: '详情', + selected: '已选', + notFound: { + title: '404', + message: '无法访问应用', + operate: '返回首页', + }, } diff --git a/ui/src/locales/lang/zh-CN/views/application.ts b/ui/src/locales/lang/zh-CN/views/application.ts index 615821a4d..a9d309a67 100644 --- a/ui/src/locales/lang/zh-CN/views/application.ts +++ b/ui/src/locales/lang/zh-CN/views/application.ts @@ -121,8 +121,6 @@ export default { dialog: { addKnowledge: '添加关联知识库', addKnowledgePlaceholder: '所选知识库必须使用相同的 Embedding 模型', - selected: '已选', - selectSearchMode: '检索模式', vectorSearch: '向量检索', vectorSearchTooltip: '向量检索是一种基于向量相似度的检索方式,适用于知识库中的大数据量场景。', diff --git a/ui/src/locales/lang/zh-CN/views/document.ts b/ui/src/locales/lang/zh-CN/views/document.ts index deca555ad..aa19ba790 100644 --- a/ui/src/locales/lang/zh-CN/views/document.ts +++ b/ui/src/locales/lang/zh-CN/views/document.ts @@ -2,7 +2,6 @@ export default { uploadDocument: '上传文档', importDocument: '导入文档', syncDocument: '同步文档', - selected: '已选', items: '项', migrateDocument: '文档迁移到', searchBar: { diff --git a/ui/src/locales/lang/zh-CN/views/index.ts b/ui/src/locales/lang/zh-CN/views/index.ts index a6a7afb4b..3f2f38f5b 100644 --- a/ui/src/locales/lang/zh-CN/views/index.ts +++ b/ui/src/locales/lang/zh-CN/views/index.ts @@ -15,9 +15,8 @@ import applicationWorkflow from './application-workflow' import paragraph from './paragraph' import chatLog from './chat-log' import chatUser from './chat-user' -// import notFound from './404' - import operateLog from './operate-log' +import shared from './shared' export default { login, model, @@ -36,7 +35,6 @@ export default { paragraph, chatLog, chatUser, - // notFound, - - operateLog + operateLog, + shared } diff --git a/ui/src/locales/lang/zh-CN/views/resource-authorization.ts b/ui/src/locales/lang/zh-CN/views/resource-authorization.ts index 644c790e1..f7a7cfa0d 100644 --- a/ui/src/locales/lang/zh-CN/views/resource-authorization.ts +++ b/ui/src/locales/lang/zh-CN/views/resource-authorization.ts @@ -1,5 +1,3 @@ -import role from './role' - export default { title: '资源授权', member: '成员', diff --git a/ui/src/locales/lang/zh-CN/views/shared.ts b/ui/src/locales/lang/zh-CN/views/shared.ts new file mode 100644 index 000000000..05269a94b --- /dev/null +++ b/ui/src/locales/lang/zh-CN/views/shared.ts @@ -0,0 +1,8 @@ +export default { + title: '共享', + shared_resources: '共享资源', + shared_tool: '共享工具', + shared_model: '共享模型', + shared_knowledge: '共享知识库', + authorized_workspace: '授权工作空间', +} diff --git a/ui/src/locales/lang/zh-CN/views/system.ts b/ui/src/locales/lang/zh-CN/views/system.ts index 9e5f4d8b7..2a901bde5 100644 --- a/ui/src/locales/lang/zh-CN/views/system.ts +++ b/ui/src/locales/lang/zh-CN/views/system.ts @@ -94,46 +94,6 @@ export default { access: '接入', }, }, - theme: { - title: '外观设置', - platformDisplayTheme: '平台显示主题', - customTheme: '自定义主题', - platformLoginSettings: '平台登录设置', - custom: '自定义', - pagePreview: '页面预览', - default: '默认', - restoreDefaults: '恢复默认', - orange: '活力橙', - green: '松石绿', - purple: '神秘紫', - red: '胭脂红', - loginBackground: '登录背景图', - loginLogo: '登录 Logo', - websiteLogo: '网站 Logo', - replacePicture: '替换图片', - websiteLogoTip: '顶部网站显示的 Logo,建议尺寸 48*48,支持 JPG、PNG、GIF,大小不超过 10MB', - loginLogoTip: '登录页面右侧 Logo,建议尺寸 204*52,支持 JPG、PNG、GIF,大小不超过 10 MB', - loginBackgroundTip: - '左侧背景图,矢量图建议尺寸 576*900,位图建议尺寸 1152*1800;支持 JPG、PNG、GIF,大小不超过 10 MB', - websiteName: '网站名称', - websiteNamePlaceholder: '请输入网站名称', - websiteNameTip: '显示在网页 Tab 的平台名称', - websiteSlogan: '欢迎语', - websiteSloganPlaceholder: '请输入欢迎语', - websiteSloganTip: '产品 Logo 下的欢迎语', - defaultSlogan: '欢迎使用 MaxKB 开源 AI 助手', - logoDefaultTip: '默认为 MaxKB 登录界面,支持自定义设置', - defaultTip: '默认为 MaxKB 平台界面,支持自定义设置', - platformSetting: '平台设置', - showUserManual: '显示用户手册', - showForum: '显示论坛求助', - showProject: '显示项目地址', - urlPlaceholder: '请输入 URL 地址', - abandonUpdate: '放弃更新', - saveAndApply: '保存并应用', - fileMessageError: '文件大小超过 10M', - saveSuccess: '外观设置成功', - }, email: { title: '邮箱设置', smtpHost: 'SMTP Host', @@ -149,42 +109,6 @@ export default { enableSSL: '启用 SSL(如果 SMTP 端口是 465,通常需要启用 SSL)', enableTLS: '启用 TLS(如果 SMTP 端口是 587,通常需要启用 TLS)', }, - group: { - title: '团队成员', - member: '成员', - manage: '所有者', - permissionSetting: '权限设置', - addMember: '添加成员', - addSubTitle: '成员登录后可以访问到您授权的数据。', - searchBar: { - placeholder: '请输入用户名搜索', - }, - delete: { - button: '移除', - confirmTitle: '是否移除成员:', - confirmMessage: '移除后将会取消成员拥有的知识库和应用权限。', - }, - setting: { - management: '管理', - check: '查看', - }, - - form: { - userName: { - label: '用户名/邮箱', - placeholder: '请输入成员的用户名或邮箱', - requiredMessage: '请输入用户名/邮箱', - }, - }, - }, - shared: { - label: '共享', - shared_resources: '共享资源', - shared_tool: '共享工具', - shared_model: '共享模型', - shared_knowledge: '共享知识库', - authorized_workspace: '授权工作空间', - }, resource_management: { label: '资源管理', }, diff --git a/ui/src/locales/lang/zh-Hant/common.ts b/ui/src/locales/lang/zh-Hant/common.ts index 7876abf7f..219959220 100644 --- a/ui/src/locales/lang/zh-Hant/common.ts +++ b/ui/src/locales/lang/zh-Hant/common.ts @@ -89,5 +89,11 @@ export default { otherSetting: '其他設定', username: '用戶名', importCreate: '導入創建', - detail: '详情' + detail: '详情', + selected: '已選', + notFound: { + title: '404', + message: '無法訪問應用', + operate: '返回首頁', + }, } diff --git a/ui/src/locales/lang/zh-Hant/views/404.ts b/ui/src/locales/lang/zh-Hant/views/404.ts deleted file mode 100644 index e85fc2206..000000000 --- a/ui/src/locales/lang/zh-Hant/views/404.ts +++ /dev/null @@ -1,5 +0,0 @@ -export default { - title: '404', - message: '無法訪問應用', - operate: '返回首頁' -} diff --git a/ui/src/locales/lang/zh-Hant/views/application.ts b/ui/src/locales/lang/zh-Hant/views/application.ts index f1dec8256..373d0ec99 100644 --- a/ui/src/locales/lang/zh-Hant/views/application.ts +++ b/ui/src/locales/lang/zh-Hant/views/application.ts @@ -121,7 +121,6 @@ export default { dialog: { addKnowledge: '新增關聯知識庫', addKnowledgePlaceholder: '所選知識庫必須使用相同的 Embedding 模型', - selected: '已選', selectSearchMode: '檢索模式', vectorSearch: '向量檢索', diff --git a/ui/src/locales/lang/zh-Hant/views/document.ts b/ui/src/locales/lang/zh-Hant/views/document.ts index 5cf58bf40..08445f131 100644 --- a/ui/src/locales/lang/zh-Hant/views/document.ts +++ b/ui/src/locales/lang/zh-Hant/views/document.ts @@ -2,7 +2,6 @@ export default { uploadDocument: '上傳文檔', importDocument: '導入文檔', syncDocument: '同步文檔', - selected: '已選', items: '項', migrateDocument: '文檔遷移到', searchBar: { diff --git a/ui/src/locales/lang/zh-Hant/views/index.ts b/ui/src/locales/lang/zh-Hant/views/index.ts index 6095336ea..a83760845 100644 --- a/ui/src/locales/lang/zh-Hant/views/index.ts +++ b/ui/src/locales/lang/zh-Hant/views/index.ts @@ -1,4 +1,3 @@ -import notFound from './404' import application from './application' import role from './role' import workspace from './workspace' @@ -17,8 +16,8 @@ import chatUser from './chat-user' import applicationWorkflow from './application-workflow' import login from './login' import operateLog from './operate-log' +import shared from './shared' export default { - notFound, application, applicationOverview, system, @@ -36,5 +35,6 @@ export default { operateLog, role, workspace, - chatUser + chatUser, + shared } diff --git a/ui/src/locales/lang/zh-Hant/views/shared.ts b/ui/src/locales/lang/zh-Hant/views/shared.ts new file mode 100644 index 000000000..80b2a6619 --- /dev/null +++ b/ui/src/locales/lang/zh-Hant/views/shared.ts @@ -0,0 +1,8 @@ +export default { + title: '共享', + shared_resources: '共享资源', + shared_tool: '共享工具', + shared_model: '共享模型', + shared_knowledge: '共享知识库', + authorized_workspace: '授权工作区', +} diff --git a/ui/src/locales/lang/zh-Hant/views/system.ts b/ui/src/locales/lang/zh-Hant/views/system.ts index 18bfc42df..9b856bd2a 100644 --- a/ui/src/locales/lang/zh-Hant/views/system.ts +++ b/ui/src/locales/lang/zh-Hant/views/system.ts @@ -110,14 +110,7 @@ export default { enableSSL: '啟用 SSL(如果 SMTP 端口是 465,通常需要啟用 SSL)', enableTLS: '啟用 TLS(如果 SMTP 端口是 587,通常需要啟用 TLS)', }, - shared: { - label: '共享', - shared_resources: '共享资源', - shared_tool: '共享工具', - shared_model: '共享模型', - shared_knowledge: '共享知识库', - authorized_workspace: '授权工作区', - }, + resource_management: { label: '资源管理', }, diff --git a/ui/src/router/modules/system.ts b/ui/src/router/modules/system.ts index 7ecda5350..c5051a650 100644 --- a/ui/src/router/modules/system.ts +++ b/ui/src/router/modules/system.ts @@ -75,8 +75,8 @@ const systemRouter = { // path: '/system/resource-management', // name: 'resourceManagement', // meta: { - // icon: 'app-folder-share', - // iconActive: 'app-folder-share-active', + // icon: 'app-shared', + // iconActive: 'app-shared-active', // title: 'views.system.resource_management.label', // activeMenu: '/system', // parentPath: '/system', @@ -124,9 +124,9 @@ const systemRouter = { path: '/system/shared', name: 'shared', meta: { - icon: 'app-folder-share', - iconActive: 'app-folder-share-active', - title: 'views.system.shared.shared_resources', + icon: 'app-shared', + iconActive: 'app-shared-active', + title: 'views.shared.shared_resources', activeMenu: '/system', parentPath: '/system', parentName: 'system', @@ -196,8 +196,8 @@ const systemRouter = { path: '/system/chat', name: 'SystemChat', meta: { - icon: 'app-folder-share', - iconActive: 'app-folder-share-active', + icon: 'app-shared', + iconActive: 'app-shared-active', title: 'views.chatUser.title', activeMenu: '/system', parentPath: '/system', @@ -287,7 +287,7 @@ const systemRouter = { path: '/system/setting/theme', name: 'theme', meta: { - title: 'views.system.theme.title', + title: 'theme.title', activeMenu: '/system', parentPath: '/system', parentName: 'system', diff --git a/ui/src/styles/component.scss b/ui/src/styles/component.scss index 55e463ea2..72b755137 100644 --- a/ui/src/styles/component.scss +++ b/ui/src/styles/component.scss @@ -202,3 +202,10 @@ content: ''; } } + +// checkbox 一行一个样式 +.checkbox-group-block { + .el-checkbox { + display: block; + } +} diff --git a/ui/src/views/404/index.vue b/ui/src/views/404/index.vue index ce3e42e72..cf9c44719 100644 --- a/ui/src/views/404/index.vue +++ b/ui/src/views/404/index.vue @@ -2,8 +2,8 @@ -
{{ $t('views.notFound.title') }}
-
{{ $t('views.notFound.message') }}
+
{{ $t('views.common.notFound.title') }}
+
{{ $t('views.common.notFound.message') }}
diff --git a/ui/src/views/application/ApplicationSetting.vue b/ui/src/views/application/ApplicationSetting.vue index 0f77a1049..28739d6e7 100644 --- a/ui/src/views/application/ApplicationSetting.vue +++ b/ui/src/views/application/ApplicationSetting.vue @@ -435,7 +435,6 @@ import AIModeParamSettingDialog from './component/AIModeParamSettingDialog.vue' import ParamSettingDialog from './component/ParamSettingDialog.vue' import AddKnowledgeDialog from './component/AddKnowledgeDialog.vue' import EditAvatarDialog from '@/views/application-overview/component/EditAvatarDialog.vue' -import modelAPI from '@/api/model/model.ts' import type { FormInstance, FormRules } from 'element-plus' import type { ApplicationFormType } from '@/api/type/application' import { relatedObject } from '@/utils/utils' @@ -444,14 +443,12 @@ import useStore from '@/stores' import { t } from '@/locales' import TTSModeParamSettingDialog from './component/TTSModeParamSettingDialog.vue' import ReasoningParamSettingDialog from './component/ReasoningParamSettingDialog.vue' -import { PermissionConst, RoleConst } from '@/utils/permission/data' -import { hasPermission } from '@/utils/permission/index' import permissionMap from '@/permission' const route = useRoute() const apiType = computed<'workspace'>(() => { - return 'workspace' + return 'workspace' }) const permissionPrecise = computed(() => { return permissionMap['application'][apiType.value] @@ -652,8 +649,8 @@ function getKnowledge() { function getSelectModel() { loading.value = true - modelAPI - .getSelectModelList({ model_type: 'LLM' }) + model + .asyncGetSelectModel({ model_type: 'LLM' }) .then((res: any) => { modelOptions.value = groupBy(res?.data, 'provider') loading.value = false @@ -665,8 +662,8 @@ function getSelectModel() { function getSTTModel() { loading.value = true - modelAPI - .getSelectModelList({ model_type: 'STT' }) + model + .asyncGetSelectModel({ model_type: 'STT' }) .then((res: any) => { sttModelOptions.value = groupBy(res?.data, 'provider') loading.value = false @@ -678,8 +675,8 @@ function getSTTModel() { function getTTSModel() { loading.value = true - modelAPI - .getSelectModelList({ model_type: 'TTS' }) + model + .asyncGetSelectModel({ model_type: 'TTS' }) .then((res: any) => { ttsModelOptions.value = groupBy(res?.data, 'provider') loading.value = false diff --git a/ui/src/views/application/component/AddKnowledgeDialog.vue b/ui/src/views/application/component/AddKnowledgeDialog.vue index 27db08c4f..99baf4696 100644 --- a/ui/src/views/application/component/AddKnowledgeDialog.vue +++ b/ui/src/views/application/component/AddKnowledgeDialog.vue @@ -45,7 +45,7 @@ v-loading="folderLoading" :canOperation="false" showShared - :shareTitle="$t('views.system.shared.shared_knowledge')" + :shareTitle="$t('views.shared.shared_knowledge')" :treeStyle="{ height: 'calc(100vh - 320px)' }" /> @@ -78,7 +78,7 @@
- {{ $t('views.application.dialog.selected') }} {{ checkList.length }} + {{ $t('common.selected') }} {{ checkList.length }} {{ $t('common.clear') }} diff --git a/ui/src/views/application/component/TTSModeParamSettingDialog.vue b/ui/src/views/application/component/TTSModeParamSettingDialog.vue index 8381d1fcd..c32322563 100644 --- a/ui/src/views/application/component/TTSModeParamSettingDialog.vue +++ b/ui/src/views/application/component/TTSModeParamSettingDialog.vue @@ -43,7 +43,7 @@ diff --git a/ui/src/views/system-shared/KnowLedgeSharedIndex.vue b/ui/src/views/system-shared/KnowLedgeSharedIndex.vue index 20f0f2b70..61d273641 100644 --- a/ui/src/views/system-shared/KnowLedgeSharedIndex.vue +++ b/ui/src/views/system-shared/KnowLedgeSharedIndex.vue @@ -3,7 +3,7 @@