cx-chat 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cx-chat.css +1 -0
- package/dist/cx-chat.es.js +97326 -0
- package/dist/cx-chat.umd.js +734 -0
- package/package.json +21 -1
- package/.cursor/rules/i18n-cn-gloss-comments.mdc +0 -31
- package/.cursor/rules/list-page-view-pageconfig.mdc +0 -32
- package/.cursor/rules/no-over-defensive-programming.mdc +0 -90
- package/.cursor/rules/requirement-description-for-agent.mdc +0 -33
- package/.cursor/rules/use-showToast-not-antd-message.mdc +0 -28
- package/.docker/Dockerfile +0 -7
- package/.env +0 -9
- package/.env.development +0 -7
- package/.env.production +0 -7
- package/.gitlab-ci/docker-build.yaml +0 -28
- package/.gitlab-ci/k8s-deploy-dev-master.yaml +0 -42
- package/.gitlab-ci/npm-build.yaml +0 -17
- package/.gitlab-ci.yml +0 -8
- package/.k8s/0-namespace.yaml +0 -6
- package/.k8s/1-configmap-web.yaml +0 -7
- package/.k8s/1-nginx-conf-dev.yaml +0 -110
- package/.k8s/2-deployment.yaml +0 -27
- package/.k8s/3-service.yaml +0 -16
- package/.k8s/4-ingress-dev.yaml +0 -30
- package/.lingma/rules/use-showToast-not-antd-message.md +0 -34
- package/.nginx/nginx.conf +0 -52
- package/.prettierrc +0 -9
- package/eslint.config.js +0 -32
- package/index.html +0 -13
- package/postcss.config.js +0 -6
- package/src/App.tsx +0 -96
- package/src/_doc/0.docs-overview.md +0 -28
- package/src/_doc/cx-ui/0.docs-overview.md +0 -30
- package/src/_doc/cx-ui/comp.1.cx-ui-overview.md +0 -82
- package/src/_doc/cx-ui/comp.2.cx-modal.md +0 -82
- package/src/_doc/cx-ui/comp.3.cx-button.md +0 -89
- package/src/_doc/cx-ui/comp.4.cx-form.md +0 -72
- package/src/_doc/cx-ui/comp.5.cx-fields.md +0 -76
- package/src/_doc/cx-ui/comp.6.cx-tag.md +0 -57
- package/src/_doc/cx-ui/comp.7.cx-empty-state.md +0 -29
- package/src/_doc/meta/0.docs-overview.md +0 -24
- package/src/_doc/meta/comp.1.enum-runtime.md +0 -33
- package/src/_doc/meta/comp.2.dict-runtime.md +0 -39
- package/src/_doc/router/0.docs-overview.md +0 -14
- package/src/_doc/router/guide.1.menu-component-config.md +0 -181
- package/src/_doc/router/guide.2.router-auto-registration.md +0 -114
- package/src/_doc/table-view/0.docs-overview.md +0 -30
- package/src/_doc/table-view/comp.1.table-view.md +0 -542
- package/src/_doc/table-view/props.1.create-table-view-config.md +0 -193
- package/src/_doc/table-view/props.2.table-view-search-fields.md +0 -106
- package/src/api/_mock/README.md +0 -340
- package/src/api/_mock/api.ts +0 -1642
- package/src/api/_mock/bundle-shim.ts +0 -16
- package/src/api/_mock/handler-shim.ts +0 -6
- package/src/api/_mock/handler.ts +0 -458
- package/src/api/_mock/index.ts +0 -711
- package/src/api/_mock/interceptor.ts +0 -15
- package/src/api/_mock/mod.ts +0 -12
- package/src/api/_mock/utils.ts +0 -65
- package/src/api/base/memory.js +0 -24
- package/src/api/chat.js +0 -210
- package/src/api/common/auth.js +0 -70
- package/src/api/menus/business-rules.js +0 -76
- package/src/api/menus/feedback.js +0 -102
- package/src/api/menus/knowledge.js +0 -159
- package/src/api/menus/model-metadata/manage.js +0 -70
- package/src/api/menus/model-metadata/role.js +0 -50
- package/src/api/menus/model-metadata/training-detail-mock-data.js +0 -569
- package/src/api/menus/model-metadata/training.js +0 -28
- package/src/api/menus/skill.js +0 -40
- package/src/api/system/agent-config.js +0 -16
- package/src/api/system/department.js +0 -94
- package/src/api/system/dict.js +0 -86
- package/src/api/system/menu.js +0 -37
- package/src/api/system/permission.js +0 -26
- package/src/api/system/role.js +0 -34
- package/src/api/system/sys-config.js +0 -16
- package/src/api/system/sys-log.js +0 -17
- package/src/api/system/user.js +0 -75
- package/src/api/upload.js +0 -39
- package/src/assets/react.svg +0 -1
- package/src/components/auth/current-user-avatar.tsx +0 -77
- package/src/components/common/code-view.tsx +0 -149
- package/src/components/common/detail-link.tsx +0 -67
- package/src/components/common/error-boundary.tsx +0 -98
- package/src/components/common/language-switcher.tsx +0 -91
- package/src/components/common/lite-table/index.tsx +0 -135
- package/src/components/common/md-editor.tsx +0 -126
- package/src/components/common/modal/confirm-dialog.tsx +0 -113
- package/src/components/common/modal/dep-user-select-multi.tsx +0 -324
- package/src/components/common/modal/dep-user-select.tsx +0 -249
- package/src/components/common/modal/user-select-multi.tsx +0 -266
- package/src/components/common/pagination.tsx +0 -472
- package/src/components/common/path.tsx +0 -175
- package/src/components/common/system-logo-mark.tsx +0 -48
- package/src/components/cx-ui/button/index.less +0 -208
- package/src/components/cx-ui/button/index.tsx +0 -611
- package/src/components/cx-ui/checkbox/index.tsx +0 -78
- package/src/components/cx-ui/date-picker/index.less +0 -17
- package/src/components/cx-ui/date-picker/index.tsx +0 -193
- package/src/components/cx-ui/drawer/index.tsx +0 -47
- package/src/components/cx-ui/empty-state/index.tsx +0 -20
- package/src/components/cx-ui/floating-shell/CxFloatingShell.tsx +0 -89
- package/src/components/cx-ui/floating-shell/cx-floating-shell.less +0 -283
- package/src/components/cx-ui/floating-shell/has-floating-value.ts +0 -41
- package/src/components/cx-ui/form/CxForm.tsx +0 -15
- package/src/components/cx-ui/form/index.tsx +0 -20
- package/src/components/cx-ui/form-item/index.less +0 -26
- package/src/components/cx-ui/form-item/index.tsx +0 -36
- package/src/components/cx-ui/index.ts +0 -70
- package/src/components/cx-ui/input/auto-complete.tsx +0 -134
- package/src/components/cx-ui/input/index.tsx +0 -259
- package/src/components/cx-ui/input-number/index.jsx +0 -66
- package/src/components/cx-ui/modal/index.jsx +0 -212
- package/src/components/cx-ui/modal/index.less +0 -144
- package/src/components/cx-ui/modal/useCxModal.ts +0 -125
- package/src/components/cx-ui/multi-select/index.jsx +0 -74
- package/src/components/cx-ui/multi-select/index.less +0 -40
- package/src/components/cx-ui/multi-select/index2.tsx +0 -361
- package/src/components/cx-ui/radio/index.tsx +0 -33
- package/src/components/cx-ui/range-picker/index.less +0 -65
- package/src/components/cx-ui/range-picker/index.tsx +0 -219
- package/src/components/cx-ui/select/index.less +0 -34
- package/src/components/cx-ui/select/index.tsx +0 -196
- package/src/components/cx-ui/skeleton/index.tsx +0 -12
- package/src/components/cx-ui/steps/index.tsx +0 -14
- package/src/components/cx-ui/styles/_tokens.less +0 -79
- package/src/components/cx-ui/styles/index.less +0 -246
- package/src/components/cx-ui/switch/index.less +0 -106
- package/src/components/cx-ui/switch/index.tsx +0 -120
- package/src/components/cx-ui/table/index.less +0 -160
- package/src/components/cx-ui/table/index.tsx +0 -152
- package/src/components/cx-ui/tabs/index.less +0 -15
- package/src/components/cx-ui/tabs/index.tsx +0 -34
- package/src/components/cx-ui/tag/index.less +0 -51
- package/src/components/cx-ui/tag/index.tsx +0 -140
- package/src/components/cx-ui/timeline/index.tsx +0 -14
- package/src/components/cx-ui/tooltip/index.tsx +0 -67
- package/src/components/cx-ui/tree/index.tsx +0 -193
- package/src/components/cx-ui/tree-select/index.jsx +0 -91
- package/src/components/cx-ui/tree-select/index.less +0 -27
- package/src/components/cx-ui/upload-file/index.less +0 -223
- package/src/components/cx-ui/upload-file/index.tsx +0 -640
- package/src/components/cx-ui/upload-img/index.tsx +0 -291
- package/src/components/layout/components/Header.tsx +0 -216
- package/src/components/layout/components/Sidebar.tsx +0 -717
- package/src/components/layout/index.tsx +0 -95
- package/src/components/table-view/components/search-area.tsx +0 -411
- package/src/components/table-view/components/table-view-config.tsx +0 -528
- package/src/components/table-view/components/table-view.types.ts +0 -478
- package/src/components/table-view/components/tree-api-normalize.ts +0 -38
- package/src/components/table-view/components/tree-data-annotate.ts +0 -31
- package/src/components/table-view/components/tree-sidebar.tsx +0 -74
- package/src/components/table-view/index.tsx +0 -61
- package/src/components/table-view/list-page-view.tsx +0 -1049
- package/src/components/table-view/select-table-view.tsx +0 -1094
- package/src/components/table-view/styles/select-table-view.less +0 -51
- package/src/config/default-system-name.ts +0 -9
- package/src/config/system.ts +0 -165
- package/src/constants/countryCodes.ts +0 -3
- package/src/contexts/AuthContext.tsx +0 -256
- package/src/contexts/ChatContext.tsx +0 -839
- package/src/contexts/MenuContext.tsx +0 -62
- package/src/contexts/ToastContext.tsx +0 -181
- package/src/hooks/useCopyToClipboard.ts +0 -47
- package/src/hooks/useModalSubmit.ts +0 -104
- package/src/hooks/useRouter.ts +0 -240
- package/src/hooks/useStepForm.ts +0 -46
- package/src/hooks/useStickyHeader.ts +0 -42
- package/src/hooks/useThreadActions.ts +0 -105
- package/src/hooks/useUserPreferences.ts +0 -101
- package/src/http/axios.js +0 -372
- package/src/http/mock.interceptor.ts +0 -9
- package/src/http/obfuscationKey.ts +0 -41
- package/src/i18n.ts +0 -60
- package/src/index.js +0 -1
- package/src/index.less +0 -169
- package/src/locales/en/auth.ts +0 -70
- package/src/locales/en/base/memory.ts +0 -28
- package/src/locales/en/base/settings.ts +0 -41
- package/src/locales/en/chat.ts +0 -40
- package/src/locales/en/common.ts +0 -173
- package/src/locales/en/enum.ts +0 -27
- package/src/locales/en/menus/business-rules.ts +0 -48
- package/src/locales/en/menus/feedback.ts +0 -62
- package/src/locales/en/menus/knowledge.ts +0 -120
- package/src/locales/en/menus/model-metadata/index.ts +0 -10
- package/src/locales/en/menus/model-metadata/manage.ts +0 -151
- package/src/locales/en/menus/model-metadata/role.ts +0 -48
- package/src/locales/en/menus/model-metadata/training.ts +0 -65
- package/src/locales/en/menus/skill.ts +0 -34
- package/src/locales/en/system/agent-config.ts +0 -34
- package/src/locales/en/system/department.ts +0 -68
- package/src/locales/en/system/dict.ts +0 -44
- package/src/locales/en/system/menu.ts +0 -45
- package/src/locales/en/system/permission.ts +0 -89
- package/src/locales/en/system/role.ts +0 -25
- package/src/locales/en/system/sys-config.ts +0 -33
- package/src/locales/en/system/sys-log.ts +0 -38
- package/src/locales/en/system/user.ts +0 -113
- package/src/locales/en.ts +0 -68
- package/src/locales/zh/auth.ts +0 -70
- package/src/locales/zh/base/memory.ts +0 -29
- package/src/locales/zh/base/settings.ts +0 -41
- package/src/locales/zh/chat.ts +0 -47
- package/src/locales/zh/common.ts +0 -178
- package/src/locales/zh/enum.ts +0 -28
- package/src/locales/zh/menus/business-rules.ts +0 -47
- package/src/locales/zh/menus/feedback.ts +0 -62
- package/src/locales/zh/menus/knowledge.ts +0 -117
- package/src/locales/zh/menus/model-metadata/index.ts +0 -10
- package/src/locales/zh/menus/model-metadata/manage.ts +0 -151
- package/src/locales/zh/menus/model-metadata/role.ts +0 -47
- package/src/locales/zh/menus/model-metadata/training.ts +0 -64
- package/src/locales/zh/menus/skill.ts +0 -34
- package/src/locales/zh/system/agent-config.ts +0 -33
- package/src/locales/zh/system/department.ts +0 -69
- package/src/locales/zh/system/dict.ts +0 -44
- package/src/locales/zh/system/menu.ts +0 -47
- package/src/locales/zh/system/permission.ts +0 -94
- package/src/locales/zh/system/role.ts +0 -25
- package/src/locales/zh/system/sys-config.ts +0 -32
- package/src/locales/zh/system/sys-log.ts +0 -38
- package/src/locales/zh/system/user.ts +0 -114
- package/src/locales/zh.ts +0 -67
- package/src/main.tsx +0 -50
- package/src/meta/const/index.ts +0 -40
- package/src/meta/index-dict.ts +0 -56
- package/src/meta/index-enum.ts +0 -95
- package/src/meta/index.ts +0 -14
- package/src/meta/module/dict-data/runtime.ts +0 -199
- package/src/meta/module/dict-data/types.ts +0 -17
- package/src/meta/module/enum-data/runtime.ts +0 -75
- package/src/meta/module/enum-data/types.ts +0 -18
- package/src/router/index.tsx +0 -312
- package/src/styles/AntdThemeProvider.tsx +0 -40
- package/src/styles/antd-theme.ts +0 -20
- package/src/styles/global.less +0 -107
- package/src/styles/variable.less +0 -103
- package/src/types/feedback.ts +0 -43
- package/src/types/index.ts +0 -85
- package/src/types/menu.ts +0 -43
- package/src/utils/aesUtil.ts +0 -123
- package/src/utils/chatUtils.ts +0 -524
- package/src/utils/cn.ts +0 -6
- package/src/utils/crypto.ts +0 -164
- package/src/utils/date.ts +0 -72
- package/src/utils/file-icons.tsx +0 -79
- package/src/utils/index.ts +0 -168
- package/src/utils/markdown-math-plugins.ts +0 -21
- package/src/utils/menuI18n.ts +0 -305
- package/src/utils/menuRouteRegistry.ts +0 -78
- package/src/utils/permission-crud.ts +0 -147
- package/src/utils/routeConfig.ts +0 -350
- package/src/utils/storage.ts +0 -135
- package/src/utils/toastBridge.ts +0 -26
- package/src/utils/url.ts +0 -38
- package/src/utils/validation.ts +0 -16
- package/src/views/auth/auth-code/index.less +0 -169
- package/src/views/auth/auth-code/index.module.less +0 -174
- package/src/views/auth/auth-code/index.tsx +0 -233
- package/src/views/auth/login.tsx +0 -498
- package/src/views/auth/register.tsx +0 -388
- package/src/views/base/memory/index.tsx +0 -136
- package/src/views/base/memory/modal/detail-modal.tsx +0 -89
- package/src/views/base/memory/modal/submit-modal.tsx +0 -134
- package/src/views/base/settings/index.tsx +0 -657
- package/src/views/chat/chat.less +0 -323
- package/src/views/chat/components/chat-input.tsx +0 -298
- package/src/views/chat/components/header-thread-title.tsx +0 -210
- package/src/views/chat/components/message-list/content-answer.tsx +0 -100
- package/src/views/chat/components/message-list/content-question.tsx +0 -18
- package/src/views/chat/components/message-list/index.tsx +0 -520
- package/src/views/chat/components/message-list/message-item.tsx +0 -199
- package/src/views/chat/components/message-list/preparation-demo-items.ts +0 -147
- package/src/views/chat/components/message-list/preparation-steps.tsx +0 -506
- package/src/views/chat/components/message-list/suggestion-list.tsx +0 -36
- package/src/views/chat/components/message-list/thinking-process.tsx +0 -49
- package/src/views/chat/components/message-list/toolbar.tsx +0 -224
- package/src/views/chat/components/message-list/use-message-list-scroll.ts +0 -214
- package/src/views/chat/components/references-knowledge/context.tsx +0 -57
- package/src/views/chat/components/references-knowledge/index.ts +0 -9
- package/src/views/chat/components/references-knowledge/modal/knowledge-detail-drawer.tsx +0 -556
- package/src/views/chat/components/references-knowledge/modal/knowledge-doc-detail-drawer.tsx +0 -529
- package/src/views/chat/components/references-knowledge/panel.tsx +0 -115
- package/src/views/chat/hooks/use-chat-common.ts +0 -19
- package/src/views/chat/index-session.tsx +0 -647
- package/src/views/chat/index.tsx +0 -127
- package/src/views/page-error/401.tsx +0 -56
- package/src/views/page-error/404.tsx +0 -56
- package/src/views/page-menus/business-rules/index.tsx +0 -376
- package/src/views/page-menus/business-rules/modal/detail-modal.tsx +0 -186
- package/src/views/page-menus/business-rules/modal/scope-modal.tsx +0 -272
- package/src/views/page-menus/business-rules/modal/submit-modal.tsx +0 -142
- package/src/views/page-menus/feedback/components/feedback-dataset-list.tsx +0 -471
- package/src/views/page-menus/feedback/index.tsx +0 -166
- package/src/views/page-menus/feedback/modal/export-feedback-modal.tsx +0 -367
- package/src/views/page-menus/knowledge/components/doc-editor-by-type.tsx +0 -32
- package/src/views/page-menus/knowledge/components/doc-editor-type-file.tsx +0 -330
- package/src/views/page-menus/knowledge/detail.tsx +0 -600
- package/src/views/page-menus/knowledge/index.tsx +0 -337
- package/src/views/page-menus/knowledge/modal/detail-modal.tsx +0 -618
- package/src/views/page-menus/knowledge/modal/doc-detail-modal.tsx +0 -550
- package/src/views/page-menus/knowledge/modal/doc-parse.ts +0 -99
- package/src/views/page-menus/knowledge/modal/doc-submit-modal.tsx +0 -349
- package/src/views/page-menus/knowledge/modal/doc-type-picker-modal.tsx +0 -88
- package/src/views/page-menus/knowledge/modal/knowledge-user-select-modal.tsx +0 -283
- package/src/views/page-menus/knowledge/modal/submit-modal.tsx +0 -179
- package/src/views/page-menus/model-metadata/manage/components/metadata-detail-schema-tab.tsx +0 -114
- package/src/views/page-menus/model-metadata/manage/components/step1-basic-info.tsx +0 -232
- package/src/views/page-menus/model-metadata/manage/components/step2-schema.tsx +0 -316
- package/src/views/page-menus/model-metadata/manage/components/step3-permissions.tsx +0 -134
- package/src/views/page-menus/model-metadata/manage/components/step4-documents.tsx +0 -134
- package/src/views/page-menus/model-metadata/manage/components/step5-example-sql.tsx +0 -101
- package/src/views/page-menus/model-metadata/manage/components/submit-add.tsx +0 -338
- package/src/views/page-menus/model-metadata/manage/components/submit-edit.tsx +0 -276
- package/src/views/page-menus/model-metadata/manage/detail.tsx +0 -298
- package/src/views/page-menus/model-metadata/manage/hooks/model-metadata-submit-shared.ts +0 -113
- package/src/views/page-menus/model-metadata/manage/hooks/use-model-metadata-item-state.ts +0 -20
- package/src/views/page-menus/model-metadata/manage/index.tsx +0 -304
- package/src/views/page-menus/model-metadata/manage/modal/components/table-schema.ts +0 -374
- package/src/views/page-menus/model-metadata/manage/modal/components/use-table-detail-tabs.tsx +0 -151
- package/src/views/page-menus/model-metadata/manage/modal/components/use-table-submit-tabs.tsx +0 -423
- package/src/views/page-menus/model-metadata/manage/modal/detail-modal.tsx +0 -218
- package/src/views/page-menus/model-metadata/manage/modal/submit-modal.tsx +0 -261
- package/src/views/page-menus/model-metadata/manage/modal/table-detail-modal.tsx +0 -196
- package/src/views/page-menus/model-metadata/manage/modal/table-submit-modal.tsx +0 -229
- package/src/views/page-menus/model-metadata/manage/submit.tsx +0 -31
- package/src/views/page-menus/model-metadata/role/index.tsx +0 -207
- package/src/views/page-menus/model-metadata/role/modal/detail-modal.tsx +0 -97
- package/src/views/page-menus/model-metadata/role/modal/role-assign-users-modal.tsx +0 -254
- package/src/views/page-menus/model-metadata/role/modal/role-assign-users-panel.tsx +0 -393
- package/src/views/page-menus/model-metadata/role/modal/role-assign-users-utils.ts +0 -120
- package/src/views/page-menus/model-metadata/role/modal/role-permission-assign-panel.tsx +0 -698
- package/src/views/page-menus/model-metadata/role/modal/role-permission-modal.tsx +0 -237
- package/src/views/page-menus/model-metadata/role/modal/submit-modal.tsx +0 -135
- package/src/views/page-menus/model-metadata/training/components/detail-records/index.ts +0 -4
- package/src/views/page-menus/model-metadata/training/components/detail-records/node-card.tsx +0 -72
- package/src/views/page-menus/model-metadata/training/components/detail-records/summary-lines.ts +0 -196
- package/src/views/page-menus/model-metadata/training/components/detail-records/summary-list.tsx +0 -153
- package/src/views/page-menus/model-metadata/training/components/detail-records/timeline.tsx +0 -103
- package/src/views/page-menus/model-metadata/training/components/detail-records/types.ts +0 -82
- package/src/views/page-menus/model-metadata/training/detail.tsx +0 -159
- package/src/views/page-menus/model-metadata/training/index.tsx +0 -236
- package/src/views/page-menus/model-metadata/training/modal/update-detail-modal.tsx +0 -154
- package/src/views/page-menus/skill/index.tsx +0 -201
- package/src/views/page-menus/skill/modal/detail-modal.tsx +0 -156
- package/src/views/page-menus/skill/modal/submit-modal.tsx +0 -214
- package/src/views/page-system/agent-config/index.tsx +0 -370
- package/src/views/page-system/department/departmentFormShared.ts +0 -36
- package/src/views/page-system/department/index.tsx +0 -541
- package/src/views/page-system/department/modal/detail-modal.tsx +0 -94
- package/src/views/page-system/department/modal/member-role-modal.tsx +0 -128
- package/src/views/page-system/department/modal/submit-modal.tsx +0 -265
- package/src/views/page-system/dict/index.tsx +0 -440
- package/src/views/page-system/dict/modal/cate-submit-modal.tsx +0 -315
- package/src/views/page-system/dict/modal/submit-modal.tsx +0 -184
- package/src/views/page-system/logs/components/index.ts +0 -3
- package/src/views/page-system/logs/components/log-message-demo.tsx +0 -30
- package/src/views/page-system/logs/components/log-message-stream.ts +0 -184
- package/src/views/page-system/logs/components/message-list/content-answer.tsx +0 -100
- package/src/views/page-system/logs/components/message-list/content-question.tsx +0 -18
- package/src/views/page-system/logs/components/message-list/index.tsx +0 -515
- package/src/views/page-system/logs/components/message-list/message-item.tsx +0 -193
- package/src/views/page-system/logs/components/message-list/preparation-demo-items.ts +0 -147
- package/src/views/page-system/logs/components/message-list/preparation-steps.tsx +0 -506
- package/src/views/page-system/logs/components/message-list/suggestion-list.tsx +0 -36
- package/src/views/page-system/logs/components/message-list/thinking-process.tsx +0 -49
- package/src/views/page-system/logs/components/message-list/toolbar.tsx +0 -134
- package/src/views/page-system/logs/components/message-list/use-message-list-scroll.ts +0 -214
- package/src/views/page-system/logs/components/message-modal.tsx +0 -239
- package/src/views/page-system/logs/index.tsx +0 -132
- package/src/views/page-system/logs/modal/detail-modal.tsx +0 -157
- package/src/views/page-system/menu/components/menuFormShared.ts +0 -283
- package/src/views/page-system/menu/index.less +0 -12
- package/src/views/page-system/menu/index.tsx +0 -410
- package/src/views/page-system/menu/modal/icon-modal.less +0 -51
- package/src/views/page-system/menu/modal/icon-modal.tsx +0 -87
- package/src/views/page-system/menu/modal/submit-modal.tsx +0 -263
- package/src/views/page-system/permission/index.tsx +0 -562
- package/src/views/page-system/permission/modal/detail-modal.tsx +0 -179
- package/src/views/page-system/permission/modal/submit-modal.less +0 -146
- package/src/views/page-system/permission/modal/submit-modal.tsx +0 -650
- package/src/views/page-system/role/index.tsx +0 -163
- package/src/views/page-system/role/modal/detail-modal.tsx +0 -127
- package/src/views/page-system/role/modal/permission-assign-group-rules.ts +0 -86
- package/src/views/page-system/role/modal/permission-modal.tsx +0 -111
- package/src/views/page-system/role/modal/role-modal-shell-styles.ts +0 -21
- package/src/views/page-system/role/modal/role-permission-assign-panel.tsx +0 -916
- package/src/views/page-system/role/modal/role-permission-assign-shared.ts +0 -1047
- package/src/views/page-system/role/modal/submit-modal.tsx +0 -193
- package/src/views/page-system/sys-config/index.tsx +0 -294
- package/src/views/page-system/user/components/user-role-column.tsx +0 -87
- package/src/views/page-system/user/index.tsx +0 -439
- package/src/views/page-system/user/modal/assign-roles-modal.tsx +0 -389
- package/src/views/page-system/user/modal/detail-modal.tsx +0 -72
- package/src/views/page-system/user/modal/modal-style/submit-modal.less +0 -40
- package/src/views/page-system/user/modal/submit-modal.less +0 -40
- package/src/views/page-system/user/modal/submit-modal.tsx +0 -287
- package/src/views/page-system/user/userFormShared.ts +0 -51
- package/tailwind.config.js +0 -17
- package/tsconfig.app.json +0 -48
- package/tsconfig.json +0 -11
- package/tsconfig.node.json +0 -26
- package/vite.config.ts +0 -272
- /package/{public → dist}/favicon.ico +0 -0
- /package/{public → dist}/vite.svg +0 -0
package/package.json
CHANGED
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cx-chat",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"description": "对话消息浮层组件 CxChat",
|
|
4
5
|
"type": "module",
|
|
6
|
+
"main": "./dist/cx-chat.umd.js",
|
|
7
|
+
"module": "./dist/cx-chat.es.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/cx-chat.es.js",
|
|
11
|
+
"require": "./dist/cx-chat.umd.js",
|
|
12
|
+
"default": "./dist/cx-chat.es.js"
|
|
13
|
+
},
|
|
14
|
+
"./style.css": "./dist/cx-chat.css",
|
|
15
|
+
"./dist/cx-chat.css": "./dist/cx-chat.css"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"sideEffects": [
|
|
21
|
+
"**/*.css",
|
|
22
|
+
"**/*.less"
|
|
23
|
+
],
|
|
5
24
|
"scripts": {
|
|
6
25
|
"dev": "vite",
|
|
7
26
|
"build": "tsc -b && vite build",
|
|
27
|
+
"prepublishOnly": "npm run build",
|
|
8
28
|
"lint": "eslint .",
|
|
9
29
|
"preview": "vite preview"
|
|
10
30
|
},
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: 使用 i18n(t() 或业务 locale 键)时在源码旁写中文对照注释,便于维护
|
|
3
|
-
alwaysApply: true
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# i18n 中文对照注释
|
|
7
|
-
|
|
8
|
-
在 **含国际化** 的 TS/TSX 中生成或修改代码时,**顺手写上中文对照**,方便后人不用翻 locale 也能懂键对应什么文案。
|
|
9
|
-
|
|
10
|
-
## 写法约定
|
|
11
|
-
|
|
12
|
-
1. **可安全用行尾 `//` 的地方**(对象字面量、列配置、`showToast(t(...))` 等,行尾不会被截断)
|
|
13
|
-
- 在 `t('namespace.key')` 或配置里的 `'namespace.key'` **同一行末尾**加 `// 中文简述` 或 `// 键语义`。
|
|
14
|
-
- 例:`title: t('menus.xxx.fields.foo'), // 表名`
|
|
15
|
-
- 例:`showToast(t('menus.xxx.preview_failed'), 'error') // 结构预览失败`
|
|
16
|
-
- 动态键:`t(\`menus.xxx.rules.${err}\`)` 旁注释 `// 校验文案,键见 locales/zh/.../rules` 等。
|
|
17
|
-
|
|
18
|
-
2. **JSX 里**(多属性、`label={t(...)}` 等,行尾 `//` 容易误注释后续属性)
|
|
19
|
-
- 在对应表单项/区块 **上一行** 用 **`{/* 中文 · 或字段说明 */}`**。
|
|
20
|
-
- 例:`{/* 主题 */}` 下一行 `<CxFormItem label={t('...fields.subject')} ...>`。
|
|
21
|
-
|
|
22
|
-
3. **文件头(可选但推荐)**
|
|
23
|
-
- 同一文件大量 `menus.*` 等键时,在模块顶部加一行 **`// i18n 中文:locales/zh/对应路径.ts(namespace)`**,避免每行重复写长路径。
|
|
24
|
-
|
|
25
|
-
4. **与 `common.*` 混用时**
|
|
26
|
-
- `common.no_data`、`common.actions` 等可在注释里写「暂无数据」「操作」,或注明 `common → zh/common.ts`。
|
|
27
|
-
|
|
28
|
-
## 不要求
|
|
29
|
-
|
|
30
|
-
- 不在**无 i18n** 的纯逻辑文件强行加注释。
|
|
31
|
-
- 不为了注释拆成过度冗长的结构;**一行能写完优先一行**(与现有「属性紧凑」风格一致时可同行)。
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: ListPageView 与 createListPageConfig 必须用同一 pageConfig 引用(与角色页一致)
|
|
3
|
-
globs: src/pages/**/index.tsx
|
|
4
|
-
alwaysApply: false
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# ListPageView + `pageConfig` 约定
|
|
8
|
-
|
|
9
|
-
`ListPageView` 在 `useLayoutEffect` 里会把 **`onDelete`、`onStatusToggle`**(以及包装后的 **`onEdit`**)挂到**传入的 `pageConfig` 对象本身**上。
|
|
10
|
-
|
|
11
|
-
## 必须遵守
|
|
12
|
-
|
|
13
|
-
- 使用 **`const pageConfig = useListPageConfig()`**(工厂 hook 返回的那一个对象)。
|
|
14
|
-
- 表格列:**`pageConfig.columns = useMemo(() => [...], [pageConfig, …])`**,操作列里只调用 **`pageConfig.onDelete` / `pageConfig.onStatusToggle` / `pageConfig.onEdit`**。
|
|
15
|
-
- 传给列表:**`<ListPageView pageConfig={pageConfig} />`**,不要再包一层 `{ ...pageConfig, columns }` 作为另一个变量传入。
|
|
16
|
-
- 树重载等扩展字段:写在同一对象上,例如 **`pageConfig.treeReloadSignal = treeReloadSignal`**(每轮渲染赋值即可),不要为 `treeReloadSignal` 再 `useMemo` 出一个新对象替代 `pageConfig`。
|
|
17
|
-
- 自定义编辑:每轮渲染先 **`pageConfig.onEdit = handleDataEdit`**(在 `ListPageView` 包装逻辑之前由父组件写回),编辑按钮 payload 与角色页一致:`{ type: 'edit', data, record }`。
|
|
18
|
-
|
|
19
|
-
## 反面示例(禁止)
|
|
20
|
-
|
|
21
|
-
```tsx
|
|
22
|
-
// ❌ 注入挂在 listPageConfig,列里却用 pageConfig
|
|
23
|
-
const pageConfig = useMemo(() => ({ ...base, treeReload }), [...])
|
|
24
|
-
const listPageConfig = useMemo(() => ({ ...pageConfig, columns }), [...])
|
|
25
|
-
<ListPageView pageConfig={listPageConfig} />
|
|
26
|
-
// 列里:pageConfig.onDelete // 永远是 undefined
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## 参考实现
|
|
30
|
-
|
|
31
|
-
- `src/pages/page-system/role/index.tsx`
|
|
32
|
-
- `src/pages/page-system/dict/index.tsx`(树 + 自定义 onEdit 时同上)
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: 禁止过度防御性编程,TypeScript 类型约束要宽松,删除多余守卫代码
|
|
3
|
-
globs: **/*.{ts,tsx}
|
|
4
|
-
alwaysApply: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# 禁止过度防御性编程规范
|
|
8
|
-
|
|
9
|
-
## 核心原则
|
|
10
|
-
**不要写无意义的防御性代码**,避免为了"类型安全"而添加大量冗余判断和严格类型约束。
|
|
11
|
-
|
|
12
|
-
## 具体规范
|
|
13
|
-
|
|
14
|
-
### 1. TypeScript 类型定义要宽松
|
|
15
|
-
- ❌ 不要用严格的联合类型限制(如 `'add' | 'edit'`)
|
|
16
|
-
- ✅ 改用 `string` 或 `(string & {})`,让运行时逻辑处理错误值
|
|
17
|
-
|
|
18
|
-
```typescript
|
|
19
|
-
// ❌ 错误示例 - 过度严格的类型
|
|
20
|
-
type ModalMode = 'add' | 'edit' | 'detail'
|
|
21
|
-
type SubmitMode = 'add' | 'edit'
|
|
22
|
-
|
|
23
|
-
// ✅ 正确示例 - 宽松类型
|
|
24
|
-
type ModalMode = string
|
|
25
|
-
type SubmitMode = string
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### 2. 删除多余的守卫判断
|
|
29
|
-
- 如果函数只在特定场景调用,不要添加不可能触发的条件判断
|
|
30
|
-
- 信任调用方传参,参数错误应该在调用处修复
|
|
31
|
-
|
|
32
|
-
```typescript
|
|
33
|
-
// ❌ 错误示例 - 多余的守卫
|
|
34
|
-
const handleSubmit = async ({ opeType }) => {
|
|
35
|
-
if (opeType === 'detail') return // 详情模式不会调用提交,这个判断多余
|
|
36
|
-
if (opeType === 'edit') {
|
|
37
|
-
result = await editAPI(payload)
|
|
38
|
-
} else {
|
|
39
|
-
result = await addAPI(payload)
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// ✅ 正确示例 - 简洁直接
|
|
44
|
-
const handleSubmit = async ({ opeType }) => {
|
|
45
|
-
if (opeType === 'edit') {
|
|
46
|
-
result = await editAPI(payload)
|
|
47
|
-
} else {
|
|
48
|
-
result = await addAPI(payload)
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
### 3. 避免冗余的状态管理
|
|
54
|
-
- 不要创建与父组件/Hook 重复的 state
|
|
55
|
-
- 直接从父级解构使用,保持单一数据源
|
|
56
|
-
|
|
57
|
-
```typescript
|
|
58
|
-
// ❌ 错误示例 - 重复声明 opeId
|
|
59
|
-
const [opeId, setOpeId] = useState<string | undefined>(undefined)
|
|
60
|
-
const modal = useCxModal({
|
|
61
|
-
onOpen: (payload) => {
|
|
62
|
-
setOpeId(payload.opeId)
|
|
63
|
-
},
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
// ✅ 正确示例 - 从 modal 解构
|
|
67
|
-
const modal = useCxModal({
|
|
68
|
-
onOpen: (payload) => {
|
|
69
|
-
const { setOpeId } = modal
|
|
70
|
-
setOpeId(payload.opeId)
|
|
71
|
-
},
|
|
72
|
-
})
|
|
73
|
-
const { opeId } = modal // 直接使用 modal 提供的
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
### 4. Build 报错优先简化类型
|
|
77
|
-
- 遇到 TypeScript 编译错误时,优先考虑放宽类型约束
|
|
78
|
-
- 不要为了通过编译而添加大量防御性代码
|
|
79
|
-
- 配置错了该报错就行了,不需要在 build 阶段卡死
|
|
80
|
-
|
|
81
|
-
## 反面案例总结
|
|
82
|
-
|
|
83
|
-
以下情况都属于**过度防御**,应该避免:
|
|
84
|
-
1. 为不可能出现的值添加类型约束
|
|
85
|
-
2. 在函数内部重复校验调用方应该保证的参数
|
|
86
|
-
3. 创建与父级重复的 state 变量
|
|
87
|
-
4. 添加永远不会触发的条件分支
|
|
88
|
-
5. 为了过编译而写的类型断言和守卫代码
|
|
89
|
-
|
|
90
|
-
**记住**: 代码应该简洁直观,错了自然会有人改,不要瞎操心。
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: 需求与接口示例的默认理解方式;UI「不可操作」默认不展示入口
|
|
3
|
-
alwaysApply: true
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# 需求与接口描述 — Agent 默认约定
|
|
7
|
-
|
|
8
|
-
用户未单独说明时,Agent **按下述方式理解并执行**,避免过度推断或扩大改动范围。
|
|
9
|
-
|
|
10
|
-
## 接口 / JSON 示例
|
|
11
|
-
|
|
12
|
-
- 用户给出响应 JSON 且**未**写「要改拦截器 / 统一 `code`」时:视为**仅说明 `data` 或内层字段形状**,用于对接列表、详情、类型;**不**因示例里的 `code`(如 0 / 200)去改 `src/http/axios` 等全局逻辑。
|
|
13
|
-
- 若需动请求层或全局 `code` 约定,须用户**明确写出**;否则不改。
|
|
14
|
-
|
|
15
|
-
## UI:「不能再操作」类需求
|
|
16
|
-
|
|
17
|
-
- 表述如「已 x 不能再 y」且**未**要求保留占位时:**默认不渲染该操作入口**(不显示按钮/项),**不**默认做成 `disabled` + 灰显。
|
|
18
|
-
- 仅当用户明确要求「保留入口但禁用 / 要 tooltip / 要占位」时,才用禁用态。
|
|
19
|
-
|
|
20
|
-
## 范围与禁忌
|
|
21
|
-
|
|
22
|
-
- 用户指定了文件或模块时,**不**顺带重构无关代码。
|
|
23
|
-
- 用户写出「不要 xxx」(如不要单独命名转换函数、不要读路由参数)时,**严格遵守**。
|
|
24
|
-
|
|
25
|
-
## 重构与数据对齐
|
|
26
|
-
|
|
27
|
-
- 用户描述「目标行为 / 目标数据来源」(如「只认行上的 `metadataId`」)时,按目标改调用链,**不**在未要求时保留旧路径兜底(除非用户要求兼容)。
|
|
28
|
-
|
|
29
|
-
## 用户可选用的一行模板
|
|
30
|
-
|
|
31
|
-
用户可在复杂需求末尾附上:
|
|
32
|
-
|
|
33
|
-
`在【页面】:【行为】。数据按【字段/示例】。不要【动 axios / 禁用占位 等】。`
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: 全局提示统一 useToast/showToast,禁止 antd message API
|
|
3
|
-
alwaysApply: true
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# 全局提示(Toast)
|
|
7
|
-
|
|
8
|
-
- **必须**使用 `useToast`(`@/contexts/ToastContext`)的 `showToast`,与 settings、chat、元数据等页面一致。
|
|
9
|
-
- **禁止**使用 antd 的 `message.success` / `message.error` / `message.warning` / `message.info`,以及 `import { message } from 'antd'` 仅为弹全局提示。
|
|
10
|
-
|
|
11
|
-
```tsx
|
|
12
|
-
// ✅
|
|
13
|
-
import { useToast } from '@/contexts/ToastContext'
|
|
14
|
-
|
|
15
|
-
const { showToast } = useToast()
|
|
16
|
-
showToast(t('common.operation_success'), 'success')
|
|
17
|
-
showToast(err?.message || t('common.operation_failed'), 'error')
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
```tsx
|
|
21
|
-
// ❌
|
|
22
|
-
import { message } from 'antd'
|
|
23
|
-
message.success('...')
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
- **非 React 上下文**(如 axios 拦截器、纯工具函数)不可用 hook 时,使用 `@/utils/toastBridge` 的 `showGlobalToast`(由 `ToastProvider` 挂载时注册)。
|
|
27
|
-
|
|
28
|
-
- **例外**:antd `Form` / `Form.Item` 的校验规则对象里的字段 **`message:`** 表示校验失败文案,**不是** antd 全局 `message` API,应继续按 antd 规则写法保留。
|
package/.docker/Dockerfile
DELETED
package/.env
DELETED
package/.env.development
DELETED
package/.env.production
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
docker-build:
|
|
2
|
-
only:
|
|
3
|
-
- master
|
|
4
|
-
stage: docker-build
|
|
5
|
-
image: 10.101.1.128:16666/gitlab-runner/docker:24.0.5-dind-cx-harbor
|
|
6
|
-
artifacts:
|
|
7
|
-
when: always
|
|
8
|
-
paths:
|
|
9
|
-
- ${CI_PROJECT_DIR}/image_tag
|
|
10
|
-
script:
|
|
11
|
-
- export DOCKER_HOST=$(ip route | grep default | awk '{print $3}')
|
|
12
|
-
|
|
13
|
-
# 生成一个时间戳
|
|
14
|
-
- export CI_TIMESTAMP=`TZ='Asia/Shanghai' date "+%Y%m%d%H%M%S"`
|
|
15
|
-
# 保存镜像 tag 通过 gitlab-ci 的 artifacts 功能传递给后续所有 job
|
|
16
|
-
- echo ${CI_TIMESTAMP}${CI_COMMIT_SHORT_SHA} > image_tag
|
|
17
|
-
|
|
18
|
-
# 唯一 tag 的镜像名称
|
|
19
|
-
- IMAGE_NAME=${CI_REGISTRY}/cxinternet/${CI_PROJECT_PATH}:${CI_TIMESTAMP}${CI_COMMIT_SHORT_SHA}
|
|
20
|
-
# 生成唯一 tag 镜像
|
|
21
|
-
- docker build -f ./.docker/Dockerfile -t ${IMAGE_NAME} .
|
|
22
|
-
# 生成 latest 镜像
|
|
23
|
-
- docker tag ${IMAGE_NAME} ${CI_REGISTRY}/cxinternet/${CI_PROJECT_PATH}:latest
|
|
24
|
-
|
|
25
|
-
# 推送镜像
|
|
26
|
-
- docker push ${IMAGE_NAME}
|
|
27
|
-
- docker push ${CI_REGISTRY}/cxinternet/${CI_PROJECT_PATH}:latest
|
|
28
|
-
- echo "push image success:"${IMAGE_NAME}" "${CI_REGISTRY}/cxinternet/${CI_PROJECT_PATH}:latest
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
k8s-deploy-dev-master:
|
|
2
|
-
only:
|
|
3
|
-
- master
|
|
4
|
-
stage: k8s-deploy
|
|
5
|
-
image: 10.101.1.128:16666/kubernetes/kubectl:1.27.4-dev-kvm
|
|
6
|
-
script:
|
|
7
|
-
- |
|
|
8
|
-
# 前端应用名称
|
|
9
|
-
APP_NAME="agent-web"
|
|
10
|
-
# 前端应用端口 后台网关端口 20788
|
|
11
|
-
APP_PORT=20790
|
|
12
|
-
# 镜像仓库的命名空间
|
|
13
|
-
IMAGE_NAMESPACE="cxinternet"
|
|
14
|
-
|
|
15
|
-
PROJECT_PATH=${CI_PROJECT_PATH}
|
|
16
|
-
IMAGE_TAG=$(cat image_tag)
|
|
17
|
-
cd ./.k8s/
|
|
18
|
-
mkdir deployment
|
|
19
|
-
mkdir service
|
|
20
|
-
|
|
21
|
-
kubectl apply -f 0-namespace.yaml
|
|
22
|
-
more ./0-namespace.yaml
|
|
23
|
-
|
|
24
|
-
kubectl apply -f 1-configmap-web.yaml
|
|
25
|
-
more ./1-configmap-web.yaml
|
|
26
|
-
kubectl apply -f 1-nginx-conf-dev.yaml
|
|
27
|
-
more ./1-nginx-conf-dev.yaml
|
|
28
|
-
|
|
29
|
-
image_name=$CI_REGISTRY"/"$IMAGE_NAMESPACE"/"$PROJECT_PATH":"$IMAGE_TAG
|
|
30
|
-
deployment="{\"metadata\":{\"name\":\""$APP_NAME"\",\"labels\":{\"app\":\""$APP_NAME"\"}},\"spec\":{\"selector\":{\"matchLabels\":{\"app\":\""$APP_NAME"\"}},\"template\":{\"metadata\":{\"labels\":{\"app\":\""$APP_NAME"\"}},\"spec\":{\"containers\":[{\"name\":\""$APP_NAME"\",\"image\":\""$image_name"\",\"imagePullPolicy\":\"Always\",\"ports\":[{\"name\":\"http\",\"containerPort\":8080,\"protocol\":\"TCP\"}],\"envFrom\":[{\"configMapRef\":{\"name\":\"agent-web-configmap\"}}],\"volumeMounts\":[{\"name\":\"agent-nginx-conf\",\"mountPath\":\"/etc/nginx/nginx.conf\",\"subPath\":\"nginx.conf\"}]}]}}}}"
|
|
31
|
-
service="{\"metadata\":{\"name\":\""$APP_NAME"\",\"labels\":{\"app\":\""$APP_NAME"\"}},\"spec\":{\"selector\":{\"app\":\""$APP_NAME"\"},\"ports\":[{\"name\":\"http\",\"port\":8080,\"protocol\":\"TCP\",\"targetPort\":8080,\"nodePort\":"$APP_PORT"}],\"type\":\"NodePort\"}}"
|
|
32
|
-
kubectl patch -f 2-deployment.yaml --dry-run=true --local=true -p $deployment -o yaml >./deployment/$APP_NAME-deployment.yaml
|
|
33
|
-
kubectl patch -f 3-service.yaml --dry-run=true --local=true -p $service -o yaml >./service/$APP_NAME-service.yaml
|
|
34
|
-
|
|
35
|
-
more ./deployment/$APP_NAME-deployment.yaml
|
|
36
|
-
more ./service/$APP_NAME-service.yaml
|
|
37
|
-
|
|
38
|
-
kubectl apply -f ./deployment
|
|
39
|
-
kubectl apply -f ./service
|
|
40
|
-
|
|
41
|
-
kubectl apply -f 4-ingress-dev.yaml
|
|
42
|
-
more ./4-ingress-dev.yaml
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
npm-build:
|
|
2
|
-
only:
|
|
3
|
-
- master
|
|
4
|
-
stage: npm-build
|
|
5
|
-
image: 10.101.1.128:16666/gitlab-runner/node:20.19.2-alpine
|
|
6
|
-
artifacts:
|
|
7
|
-
paths:
|
|
8
|
-
- ${CI_PROJECT_DIR}/dist
|
|
9
|
-
script:
|
|
10
|
-
- npm config set prefix /cache${CI_PROJECT_DIR}/node_global
|
|
11
|
-
- npm config set cache /cache${CI_PROJECT_DIR}/node_cache
|
|
12
|
-
- npm config set registry http://registry.npm.taobao.org/
|
|
13
|
-
# - npm install @rollup/rollup-linux-x64-musl --save-optional
|
|
14
|
-
# - npm install --force
|
|
15
|
-
- npm ci --prefer-offline --no-audit
|
|
16
|
-
- export VITE_API_BASE_URL=agent-server
|
|
17
|
-
- npm run build
|
package/.gitlab-ci.yml
DELETED
package/.k8s/0-namespace.yaml
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
apiVersion: v1
|
|
2
|
-
data:
|
|
3
|
-
nginx.conf: |+
|
|
4
|
-
# For more information on configuration, see:
|
|
5
|
-
# * Official English Documentation: http://nginx.org/en/docs/
|
|
6
|
-
# * Official Russian Documentation: http://nginx.org/ru/docs/
|
|
7
|
-
|
|
8
|
-
user nginx;
|
|
9
|
-
worker_processes auto;
|
|
10
|
-
error_log /var/log/nginx/error.log;
|
|
11
|
-
pid /run/nginx.pid;
|
|
12
|
-
|
|
13
|
-
# Load dynamic modules. See /usr/share/nginx/README.dynamic.
|
|
14
|
-
include /usr/share/nginx/modules/*.conf;
|
|
15
|
-
|
|
16
|
-
events {
|
|
17
|
-
worker_connections 1024;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
http {
|
|
21
|
-
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
|
22
|
-
'$status $body_bytes_sent "$http_referer" '
|
|
23
|
-
'"$http_user_agent" "$http_x_forwarded_for"';
|
|
24
|
-
|
|
25
|
-
access_log /var/log/nginx/access.log main;
|
|
26
|
-
|
|
27
|
-
gzip on;
|
|
28
|
-
gzip_comp_level 8;
|
|
29
|
-
gzip_min_length 256;
|
|
30
|
-
gzip_proxied any;
|
|
31
|
-
gzip_vary on;
|
|
32
|
-
gzip_types application/javascript text/css;
|
|
33
|
-
|
|
34
|
-
sendfile on;
|
|
35
|
-
tcp_nopush on;
|
|
36
|
-
tcp_nodelay on;
|
|
37
|
-
underscores_in_headers on;
|
|
38
|
-
keepalive_timeout 65;
|
|
39
|
-
types_hash_max_size 2048;
|
|
40
|
-
client_max_body_size 100M;
|
|
41
|
-
|
|
42
|
-
include /etc/nginx/mime.types;
|
|
43
|
-
default_type application/octet-stream;
|
|
44
|
-
|
|
45
|
-
# Load modular configuration files from the /etc/nginx/conf.d directory.
|
|
46
|
-
# See http://nginx.org/en/docs/ngx_core_module.html#include
|
|
47
|
-
# for more information.
|
|
48
|
-
|
|
49
|
-
server {
|
|
50
|
-
listen 8080 default_server;
|
|
51
|
-
listen [::]:8080 default_server;
|
|
52
|
-
|
|
53
|
-
server_name _;
|
|
54
|
-
root /app/dist;
|
|
55
|
-
|
|
56
|
-
location /dev/agent/agent-server/chat/stream {
|
|
57
|
-
proxy_buffering off;
|
|
58
|
-
proxy_cache off;
|
|
59
|
-
gzip off;
|
|
60
|
-
proxy_http_version 1.1;
|
|
61
|
-
|
|
62
|
-
proxy_connect_timeout 10s;
|
|
63
|
-
proxy_send_timeout 600s;
|
|
64
|
-
proxy_read_timeout 600s;
|
|
65
|
-
|
|
66
|
-
add_header 'Access-Control-Allow-Origin' '*';
|
|
67
|
-
add_header 'Access-Control-Allow-Credentials' 'true';
|
|
68
|
-
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
|
69
|
-
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
|
|
70
|
-
proxy_set_header Cookie $http_cookie;
|
|
71
|
-
proxy_pass http://agent-server:8080/chat/stream;
|
|
72
|
-
|
|
73
|
-
proxy_cookie_path / /dev/agent/agent-server/chat/stream;
|
|
74
|
-
proxy_cookie_domain domino.server nginx.server;
|
|
75
|
-
proxy_redirect off;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
location / {
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
error_page 404 /404.html;
|
|
82
|
-
location = /40x.html {
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
error_page 500 502 503 504 /50x.html;
|
|
86
|
-
location = /50x.html {
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
location /dev/agent {
|
|
90
|
-
proxy_pass http://agent-web:8080/;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
location /agent-server/ {
|
|
94
|
-
add_header 'Access-Control-Allow-Origin' '*';
|
|
95
|
-
add_header 'Access-Control-Allow-Credentials' 'true';
|
|
96
|
-
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
|
97
|
-
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
|
|
98
|
-
proxy_set_header Cookie $http_cookie;
|
|
99
|
-
proxy_pass http://agent-server:8080/;
|
|
100
|
-
|
|
101
|
-
proxy_cookie_path / /agent-server/;
|
|
102
|
-
proxy_cookie_domain domino.server nginx.server;
|
|
103
|
-
proxy_redirect off;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
kind: ConfigMap
|
|
108
|
-
metadata:
|
|
109
|
-
name: agent-nginx-conf
|
|
110
|
-
namespace: agent
|
package/.k8s/2-deployment.yaml
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
apiVersion: apps/v1
|
|
2
|
-
kind: Deployment
|
|
3
|
-
metadata:
|
|
4
|
-
name: deployment-name
|
|
5
|
-
namespace: agent
|
|
6
|
-
labels:
|
|
7
|
-
app: label-app
|
|
8
|
-
spec:
|
|
9
|
-
replicas: 1
|
|
10
|
-
selector:
|
|
11
|
-
matchLabels:
|
|
12
|
-
app: selector-name
|
|
13
|
-
strategy:
|
|
14
|
-
type: RollingUpdate
|
|
15
|
-
rollingUpdate:
|
|
16
|
-
maxSurge: 1
|
|
17
|
-
maxUnavailable: 1
|
|
18
|
-
template:
|
|
19
|
-
metadata:
|
|
20
|
-
labels:
|
|
21
|
-
app: pod-template
|
|
22
|
-
spec:
|
|
23
|
-
containers: container
|
|
24
|
-
volumes:
|
|
25
|
-
- configMap:
|
|
26
|
-
name: agent-nginx-conf
|
|
27
|
-
name: agent-nginx-conf
|
package/.k8s/3-service.yaml
DELETED
package/.k8s/4-ingress-dev.yaml
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
apiVersion: networking.k8s.io/v1
|
|
2
|
-
kind: Ingress
|
|
3
|
-
metadata:
|
|
4
|
-
annotations:
|
|
5
|
-
kubernetes.io/ingress.class: nginx
|
|
6
|
-
nginx.ingress.kubernetes.io/proxy-body-size: "50m"
|
|
7
|
-
nginx.ingress.kubernetes.io/client-max-body-size: "50m"
|
|
8
|
-
nginx.ingress.kubernetes.io/proxy-buffering: "off"
|
|
9
|
-
nginx.ingress.kubernetes.io/proxy-http-version: "1.1"
|
|
10
|
-
nginx.ingress.kubernetes.io/configuration-snippet: |
|
|
11
|
-
proxy_cache off;
|
|
12
|
-
gzip off;
|
|
13
|
-
nginx.ingress.kubernetes.io/use-regex: "true"
|
|
14
|
-
nginx.ingress.kubernetes.io/proxy-connect-timeout: "10"
|
|
15
|
-
nginx.ingress.kubernetes.io/proxy-read-timeout: "600"
|
|
16
|
-
nginx.ingress.kubernetes.io/proxy-send-timeout: "600"
|
|
17
|
-
name: agent-web-dev-irs101-cn
|
|
18
|
-
namespace: agent
|
|
19
|
-
spec:
|
|
20
|
-
rules:
|
|
21
|
-
- host: cx.dev.irs101.cn
|
|
22
|
-
http:
|
|
23
|
-
paths:
|
|
24
|
-
- path: /dev/agent(/|$)(.*)
|
|
25
|
-
pathType: Prefix
|
|
26
|
-
backend:
|
|
27
|
-
service:
|
|
28
|
-
name: agent-web
|
|
29
|
-
port:
|
|
30
|
-
number: 8080
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# 全局提示:使用 showToast,禁止 antd message
|
|
2
|
-
|
|
3
|
-
**规则类型(请在灵码 IDE / 插件中将本规则设为「始终生效」)**:项目内所有智能会话与行间生成代码均应遵守。
|
|
4
|
-
|
|
5
|
-
## 要求
|
|
6
|
-
|
|
7
|
-
1. React 组件中需要全局气泡提示时:
|
|
8
|
-
- 从 `@/contexts/ToastContext` 引入 `useToast`。
|
|
9
|
-
- 使用 `const { showToast } = useToast()`。
|
|
10
|
-
- 调用:`showToast(文案字符串, 类型)`,类型为 `'success' | 'error' | 'info' | 'warning'`,可选第三个参数为停留毫秒数。
|
|
11
|
-
|
|
12
|
-
2. **不要**为全局提示引入或使用 antd 的 `message`(如 `message.success`、`message.error`)。
|
|
13
|
-
|
|
14
|
-
3. 不在组件树内、无法使用 hook 的代码(例如 axios 拦截器、独立工具模块):使用 `@/utils/toastBridge` 的 `showGlobalToast`(与 `ToastProvider` 配套)。
|
|
15
|
-
|
|
16
|
-
## 例外
|
|
17
|
-
|
|
18
|
-
- antd `Form` 校验规则里的 **`message:`** 字段表示**校验错误提示文案**,属于规则配置,**必须保留**,与全局 `message` API 无关。
|
|
19
|
-
|
|
20
|
-
## 示例
|
|
21
|
-
|
|
22
|
-
```tsx
|
|
23
|
-
// 正确
|
|
24
|
-
import { useToast } from '@/contexts/ToastContext'
|
|
25
|
-
const { showToast } = useToast()
|
|
26
|
-
showToast(t('menus.xxx.saved'), 'success')
|
|
27
|
-
showToast(error?.message || t('common.operation_failed'), 'error')
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
```tsx
|
|
31
|
-
// 错误 — 不要用 antd 全局 message
|
|
32
|
-
import { message } from 'antd'
|
|
33
|
-
message.success('保存成功')
|
|
34
|
-
```
|