From fcd09fa688dda07defa6391077cadcee749255fa Mon Sep 17 00:00:00 2001 From: Scarqin Date: Wed, 15 Feb 2023 17:34:10 +0800 Subject: [PATCH] feat: action watch (#237) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: action watch * feat: move gio * feat: split multiple page * feat: update * feat: env trace * feat: trace extension * refactor: tips if groupList empty * feat: workspace trace * feat: trace api test * fix(table-pro): change width error in test page * fix: fix some trace bug * feat: trace login * style: ui update * fix: some style bug * feat: translate * fix: some bug * fix: some bug * fix: resize handle bar width * style: ui * fix: list spin style in dark bg * feat: translate * fix: hostUri concat issue * feat: update * feat: update * chore: merge code * fix: envList style * docs: update * docs: ignore log * fix(api-test): query params lack --------- Co-authored-by: 夜鹰 <17kungfuboy@gmail.com> Co-authored-by: bqy_fe <1743369777@qq.com> --- src/workbench/browser/locale/messages.xlf | 1006 ++++++++------- src/workbench/browser/locale/messages.zh.xlf | 1138 +++++++++-------- .../services/electron/electron.service.ts | 2 +- .../breadcrumb/nav-breadcrumb.component.html | 2 +- .../navbar/btn-user/btn-user.component.ts | 4 +- .../navbar/get-share-link.component.ts | 6 +- .../help-dropdown/help-dropdown.component.ts | 4 +- .../app/layouts/navbar/navbar.component.html | 12 +- .../modules/api-shared/api-table.service.ts | 2 + .../api-test-form/api-test-form.component.ts | 3 +- .../download-client.component.ts | 4 +- .../download-client/download-client.module.ts | 3 +- .../modules/eo-ui/tab/tab-operate.service.ts | 1 - .../app/modules/eo-ui/tab/tab.component.ts | 6 +- .../eo-ui/table-pro/table-pro.component.ts | 7 +- .../export-api/export-api.component.ts | 12 +- .../extension-select.module.ts | 4 +- .../sync-api/sync-api.component.ts | 6 +- .../member-list/member-list.component.ts | 40 +- .../system-setting/common/about.component.ts | 6 +- .../common/account.component.ts | 2 +- .../third-login}/third-login.component.scss | 0 .../third-login}/third-login.component.ts | 6 +- .../user-modal}/user-modal.component.ts | 51 +- .../detail/extension-detail.component.html | 3 + .../detail/extension-detail.component.ts | 6 +- .../app/pages/extension/extension.model.ts | 4 +- .../list/extension-list.component.html | 3 + .../browser/src/app/pages/pages.module.ts | 4 +- .../member/workspace-member.component.ts | 157 ++- .../member/workspace-member.service.ts | 5 +- .../project-list/project-list.component.html | 15 +- .../project-list/project-list.component.ts | 62 +- .../project-list/project-list.module.ts | 17 +- .../project-list/project-list.service.ts | 68 + .../workspace-overview.component.html | 53 +- .../workspace-overview.component.scss | 16 +- .../overview/workspace-overview.component.ts | 36 +- .../overview/workspace-overview.module.ts | 23 +- .../workspace/project/api/api.component.html | 1 + .../workspace/project/api/api.component.ts | 5 +- .../group/tree/api-group-tree.component.html | 4 +- .../group/tree/api-group-tree.component.ts | 6 + .../history/eo-history.component.html | 2 + .../api/env/env-edit/env-edit.component.ts | 67 +- .../api/env/env-list/env-list.component.html | 2 +- .../env/env-select/env-select.component.scss | 16 +- .../env/env-select/env-select.component.ts | 41 +- .../api/http/detail/api-detail.component.html | 2 +- .../api/http/detail/api-detail.component.ts | 9 + .../api/http/edit/api-edit.component.ts | 16 +- .../api/http/mock/api-mock.component.html | 6 +- .../api/http/mock/api-mock.component.ts | 8 +- .../api/http/test/api-test.component.html | 14 +- .../api/http/test/api-test.component.ts | 18 +- .../test/body/api-test-body.component.html | 3 +- .../http/test/body/api-test-body.component.ts | 3 +- .../api/service/api-test-util.service.ts | 7 +- .../api/service/store/api-effect.service.ts | 4 + .../api/websocket/websocket.component.html | 4 + .../member/project-member.component.ts | 9 +- .../setting/project-setting.component.html | 15 +- .../setting/project-setting.component.ts | 14 +- .../components/download-client.component.ts | 2 +- .../shared/models/extension-manager/module.ts | 6 +- .../services/storage/db/initData/apiData.ts | 2 +- .../app/shared/services/trace.directive.ts | 30 + .../src/app/shared/services/trace.service.ts | 27 + .../browser/src/app/shared/shared.module.ts | 4 +- .../src/app/shared/store/effect.service.ts | 20 +- .../src/app/shared/store/state.service.ts | 11 + src/workbench/browser/src/index.html | 43 +- src/workbench/browser/src/styles/antd.less | 21 +- 73 files changed, 1889 insertions(+), 1352 deletions(-) rename src/workbench/browser/src/app/pages/{ => components/third-login}/third-login.component.scss (100%) rename src/workbench/browser/src/app/pages/{ => components/third-login}/third-login.component.ts (96%) rename src/workbench/browser/src/app/pages/{ => components/user-modal}/user-modal.component.ts (91%) create mode 100644 src/workbench/browser/src/app/pages/workspace/components/project-list/project-list.service.ts create mode 100644 src/workbench/browser/src/app/shared/services/trace.directive.ts create mode 100644 src/workbench/browser/src/app/shared/services/trace.service.ts diff --git a/src/workbench/browser/locale/messages.xlf b/src/workbench/browser/locale/messages.xlf index 256e82abc..cd08c4a35 100644 --- a/src/workbench/browser/locale/messages.xlf +++ b/src/workbench/browser/locale/messages.xlf @@ -10,7 +10,7 @@ src/app/pages/extension/detail/extension-detail.component.html - 88 + 93 @@ -158,11 +158,11 @@ src/app/pages/workspace/components/member/workspace-member.component.ts - 23,22 + 31,30 src/app/pages/workspace/project/member/project-member.component.ts - 32,31 + 33,32 @@ -171,6 +171,10 @@ src/app/layouts/navbar/breadcrumb/select-workspace/select-workspace.component.ts 30 + + src/app/pages/components/user-modal/user-modal.component.ts + 125 + LOCAL @@ -197,56 +201,56 @@ Sign in/Up src/app/layouts/navbar/btn-user/btn-user.component.ts - 15 + 16 Account Setting src/app/layouts/navbar/btn-user/btn-user.component.ts - 32 + 34 Sign Out src/app/layouts/navbar/btn-user/btn-user.component.ts - 33 + 35 Successfully logged out ! src/app/layouts/navbar/btn-user/btn-user.component.ts - 58 + 60 Share src/app/layouts/navbar/get-share-link.component.ts - 25,26 + 27,28 Share via link src/app/layouts/navbar/get-share-link.component.ts - 29 + 31 This link will be updated with the API content. Everyone can access it without logging in src/app/layouts/navbar/get-share-link.component.ts - 31,32 + 33,34 Copied src/app/layouts/navbar/get-share-link.component.ts - 65 + 69 src/app/modules/api-shared/api-mock-table.component.ts @@ -258,7 +262,7 @@ src/app/pages/workspace/project/api/http/detail/api-detail.component.ts - 42 + 44 src/app/utils/index.utils.ts @@ -273,18 +277,18 @@ src/app/layouts/navbar/help-dropdown/help-dropdown.component.ts - 29 + 31 Report Issue src/app/layouts/navbar/help-dropdown/help-dropdown.component.ts - 20 + 22 src/app/layouts/navbar/help-dropdown/help-dropdown.component.ts - 34 + 36 @@ -316,28 +320,28 @@ src/app/modules/member-list/member-list.component.ts - 38 + 39 Extensions src/app/layouts/navbar/navbar.component.html - 22 + 28 Extensions src/app/layouts/navbar/navbar.component.html - 26,27 + 34,35 Open Settings src/app/layouts/navbar/navbar.component.html - 41 + 49 @@ -369,11 +373,7 @@ src/app/pages/extension/list/extension-list.component.html - 50 - - - src/app/pages/workspace/overview/workspace-overview.component.html - 42 + 53 @@ -395,7 +395,7 @@ src/app/pages/workspace/project/api/env/env-select/env-select.component.ts - 74 + 77 @@ -431,7 +431,7 @@ src/app/pages/extension/detail/extension-detail.component.html - 69 + 74 @@ -449,7 +449,7 @@ src/app/modules/api-shared/api-table.service.ts - 232 + 233 src/app/pages/workspace/project/api/env/env-edit/env-edit.component.html @@ -457,15 +457,15 @@ src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts - 31 + 32 src/app/pages/workspace/project/api/env/env-select/env-select.component.ts - 37 + 38 src/app/pages/workspace/project/api/env/env-select/env-select.component.ts - 54 + 56 @@ -518,11 +518,11 @@ src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts - 100 + 110 src/app/pages/workspace/project/api/http/edit/api-edit.component.ts - 155 + 157 src/app/pages/workspace/project/setting/project-setting.component.ts @@ -537,7 +537,7 @@ src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts - 106 + 93 @@ -548,11 +548,11 @@ src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts - 105 + 97 src/app/pages/workspace/project/api/http/edit/api-edit.component.ts - 155 + 157 @@ -582,11 +582,11 @@ src/app/modules/eo-ui/tab/tab.component.ts - 95 + 99 - src/app/pages/user-modal.component.ts - 477 + src/app/pages/components/user-modal/user-modal.component.ts + 515 src/app/pages/workspace/project/api/websocket/websocket.component.ts @@ -623,7 +623,7 @@ src/app/modules/api-shared/api-table.service.ts - 240 + 241 src/app/pages/workspace/project/api/http/edit/extra-setting/api-params-extra-setting.component.ts @@ -649,7 +649,7 @@ src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts - 33 + 34 src/app/pages/workspace/project/api/http/edit/extra-setting/api-params-extra-setting.component.ts @@ -671,19 +671,19 @@ Value src/app/modules/api-shared/api-table.service.ts - 252 + 253 src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts - 32 + 33 src/app/pages/workspace/project/api/env/env-select/env-select.component.ts - 38 + 39 src/app/pages/workspace/project/api/env/env-select/env-select.component.ts - 55 + 57 @@ -708,7 +708,7 @@ src/app/pages/workspace/project/setting/project-setting.component.ts - 42 + 40 @@ -796,7 +796,7 @@ Download src/app/modules/download-client/download-client.component.ts - 26 + 28 @@ -839,7 +839,7 @@ Program will not close unsaved tabs src/app/modules/eo-ui/tab/tab-operate.service.ts - 361 + 360 @@ -874,28 +874,28 @@ Do you want to save the changes? src/app/modules/eo-ui/tab/tab.component.ts - 89 + 93 Your changes will be lost if you don't save them. src/app/modules/eo-ui/tab/tab.component.ts - 90 + 94 Don't Save src/app/modules/eo-ui/tab/tab.component.ts - 102 + 106 Save src/app/modules/eo-ui/tab/tab.component.ts - 110 + 114 src/app/pages/workspace/project/api/env/env-edit/env-edit.component.html @@ -953,23 +953,23 @@ src/app/pages/workspace/components/project-list/project-list.component.html - 19 + 20 src/app/pages/workspace/components/project-list/project-list.component.html - 47 + 48 src/app/pages/workspace/project/api/api.component.ts - 64 + 65 src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 44 + 45 src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 66 + 67 @@ -984,19 +984,19 @@ src/app/pages/workspace/components/project-list/project-list.component.html - 20 + 21 src/app/pages/workspace/components/project-list/project-list.component.html - 48 + 49 src/app/pages/workspace/components/project-list/project-list.component.ts - 70 + 60 src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 52 + 53 src/app/pages/workspace/project/api/components/history/eo-history.component.html @@ -1048,7 +1048,7 @@ src/app/pages/workspace/project/api/http/test/body/api-test-body.component.html - 65 + 66 @@ -1080,49 +1080,49 @@ Set Editor src/app/modules/member-list/member-list.component.ts - 33,34 + 34,35 Set Owner src/app/modules/member-list/member-list.component.ts - 35 + 36 Remove src/app/modules/member-list/member-list.component.ts - 36 + 37 Change role successfully src/app/modules/member-list/member-list.component.ts - 77 + 92 Change role Failed src/app/modules/member-list/member-list.component.ts - 81 + 97 Change role error src/app/modules/member-list/member-list.component.ts - 86 + 102 Remove Member successfully src/app/modules/member-list/member-list.component.ts - 89 + 105 @@ -1146,6 +1146,13 @@ 17 + + Please input your new password + + src/app/modules/system-setting/common/account.component.ts + 18 + + Confirm new password @@ -1174,7 +1181,7 @@ 32 - src/app/pages/user-modal.component.ts + src/app/pages/components/user-modal/user-modal.component.ts 81 @@ -1294,489 +1301,478 @@ 41 - - Please Enter + + or - src/app/pages/extension/detail/components/extensions-settings.component.ts - 24 + src/app/pages/components/third-login/third-login.component.ts + 21 - - + + Sign In/Up with Github - src/app/pages/extension/detail/components/extensions-settings.component.ts - 33 + src/app/pages/components/third-login/third-login.component.ts + 40,41 + + + Check your connection - src/app/pages/workspace/overview/workspace-overview.component.html - 4 + src/app/pages/components/user-modal/user-modal.component.ts + 26 + + + Can't connect right now, click to retry or - src/app/pages/workspace/project/api/http/mock/api-mock.component.html - 3,4 + src/app/pages/components/user-modal/user-modal.component.ts + 30 + + + config in the configuration - src/app/pages/workspace/project/api/http/test/body/api-test-body.component.html - 40 + src/app/pages/components/user-modal/user-modal.component.ts + 31 - - Save Success + + Cancel - src/app/pages/extension/detail/components/extensions-settings.component.ts - 119 + src/app/pages/components/user-modal/user-modal.component.ts + 35,36 - - - Enable - src/app/pages/extension/detail/extension-detail.component.html - 42 + src/app/pages/components/user-modal/user-modal.component.ts + 156,157 - - Disable + + Retry - src/app/pages/extension/detail/extension-detail.component.html - 43 + src/app/pages/components/user-modal/user-modal.component.ts + 38,39 - - Uninstall + + Please input your email - src/app/pages/extension/detail/extension-detail.component.html - 53 + src/app/pages/components/user-modal/user-modal.component.ts + 55 - - Install + + Enter Email - src/app/pages/extension/detail/extension-detail.component.html - 54 + src/app/pages/components/user-modal/user-modal.component.ts + 63 - - Details + + Enter password - src/app/pages/extension/detail/extension-detail.component.html - 77 + src/app/pages/components/user-modal/user-modal.component.ts + 76 + + + Please input your password - src/app/pages/extension/list/extension-list.component.html - 54 + src/app/pages/components/user-modal/user-modal.component.ts + 80 - - Support + + Sign In/Up - src/app/pages/extension/detail/extension-detail.component.html - 85 + src/app/pages/components/user-modal/user-modal.component.ts + 99,100 - - Author + + Open setting - src/app/pages/extension/detail/extension-detail.component.html - 87 + src/app/pages/components/user-modal/user-modal.component.ts + 112 - - Repository + + If you want to collaborate, please - src/app/pages/extension/detail/extension-detail.component.html - 89 + src/app/pages/components/user-modal/user-modal.component.ts + 116 - - Homepage + + open the settings - src/app/pages/extension/detail/extension-detail.component.html - 94 + src/app/pages/components/user-modal/user-modal.component.ts + 117 - - BugReport + + and fill in the configuration - src/app/pages/extension/detail/extension-detail.component.html - 97 + src/app/pages/components/user-modal/user-modal.component.ts + 118 - - ChangeLog + + Workspace Name - src/app/pages/extension/detail/extension-detail.component.html - 103 + src/app/pages/components/user-modal/user-modal.component.ts + 131 - - - Changelog failed to load - src/app/pages/extension/detail/extension-detail.component.html - 106 + src/app/pages/components/user-modal/user-modal.component.ts + 139 - - - Reacquire - src/app/pages/extension/detail/extension-detail.component.html - 108 + src/app/pages/workspace/components/edit/workspace-edit.component.ts + 15 - - - Need Client - src/app/pages/extension/detail/extension-detail.component.html - 116 + src/app/pages/workspace/components/edit/workspace-edit.component.ts + 17 - - Postcat Client is required to use this extension. + + Please input your new workspace name - src/app/pages/extension/detail/extension-detail.component.ts - 40 + src/app/pages/components/user-modal/user-modal.component.ts + 132 - - This plugin has no documentation yet. + + Confirm - src/app/pages/extension/detail/extension-detail.component.ts - 68 + src/app/pages/components/user-modal/user-modal.component.ts + 159,160 - - All + + Oops, server fail - src/app/pages/extension/extension.component.ts - 25 + src/app/pages/components/user-modal/user-modal.component.ts + 236 - - Official + + Connect failed - src/app/pages/extension/extension.component.ts - 31 + src/app/pages/components/user-modal/user-modal.component.ts + 241 - - Installed + + Connect success - src/app/pages/extension/extension.component.ts - 37 - - - src/app/pages/extension/list/extension-list.component.html - 27 + src/app/pages/components/user-modal/user-modal.component.ts + 248 - - format - - src/app/pages/extension/extension.model.ts - 25 - - - src/app/pages/extension/extension.model.ts - 29 - + + Please check you username or password - src/app/pages/extension/extension.model.ts - 33 + src/app/pages/components/user-modal/user-modal.component.ts + 405 - src/app/pages/extension/extension.model.ts - 37 + src/app/pages/components/user-modal/user-modal.component.ts + 418 + + + Username must a email - src/app/pages/extension/extension.model.ts - 48 + src/app/pages/components/user-modal/user-modal.component.ts + 415 + + + New workspace Failed ! - src/app/pages/extension/extension.model.ts - 60 + src/app/pages/components/user-modal/user-modal.component.ts + 495 - - themes + + New workspace successfully ! - src/app/pages/extension/extension.model.ts - 52 + src/app/pages/components/user-modal/user-modal.component.ts + 498 - - extensions + + Upload local data to the cloud - src/app/pages/extension/extension.model.ts - 56 + src/app/pages/components/user-modal/user-modal.component.ts + 510 - - Data Migration + + You have created a cloud workspace, do you need to upload the local data to the new workspace to facilitate team collaboration?<br> + If you do not upload it now, you can also manually export the project data and import it into a new workspace later. - src/app/pages/extension/extension.model.ts - 75 + src/app/pages/components/user-modal/user-modal.component.ts + 511,512 - - Themes + + Upload - src/app/pages/extension/extension.model.ts - 80 + src/app/pages/components/user-modal/user-modal.component.ts + 521 - - API Security + + Create Project Failed ! - src/app/pages/extension/extension.model.ts - 85 + src/app/pages/components/user-modal/user-modal.component.ts + 566 - - - Other - src/app/pages/extension/extension.model.ts - 90 + src/app/shared/store/effect.service.ts + 221 - - or + + Please Enter - src/app/pages/third-login.component.ts - 21 + src/app/pages/extension/detail/components/extensions-settings.component.ts + 24 - - Sign In/Up with Github + + - src/app/pages/third-login.component.ts - 38,39 + src/app/pages/extension/detail/components/extensions-settings.component.ts + 33 - - - Check your connection - src/app/pages/user-modal.component.ts - 26 + src/app/pages/workspace/overview/workspace-overview.component.html + 4,6 - - - Can't connect right now, click to retry or - src/app/pages/user-modal.component.ts - 30 + src/app/pages/workspace/project/api/http/mock/api-mock.component.html + 4,6 - - config in the configuration + + Save Success - src/app/pages/user-modal.component.ts - 31 + src/app/pages/extension/detail/components/extensions-settings.component.ts + 119 - - Cancel + + Enable - src/app/pages/user-modal.component.ts - 35,36 + src/app/pages/extension/detail/extension-detail.component.html + 44 + + + Disable - src/app/pages/user-modal.component.ts - 156,157 + src/app/pages/extension/detail/extension-detail.component.html + 45 - - Retry + + Uninstall - src/app/pages/user-modal.component.ts - 38,39 + src/app/pages/extension/detail/extension-detail.component.html + 58 - - Sign In/Up + + Install - src/app/pages/user-modal.component.ts - 48 + src/app/pages/extension/detail/extension-detail.component.html + 59 - - Please input your email + + Details - src/app/pages/user-modal.component.ts - 55 + src/app/pages/extension/detail/extension-detail.component.html + 82 - - - Enter Email - src/app/pages/user-modal.component.ts - 63 + src/app/pages/extension/list/extension-list.component.html + 57 - - Enter password + + Support - src/app/pages/user-modal.component.ts - 76 + src/app/pages/extension/detail/extension-detail.component.html + 90 - - Please input your password + + Author - src/app/pages/user-modal.component.ts - 80 + src/app/pages/extension/detail/extension-detail.component.html + 92 - - Sign In/Up + + Repository - src/app/pages/user-modal.component.ts - 99,100 + src/app/pages/extension/detail/extension-detail.component.html + 94 - - Open setting + + Homepage - src/app/pages/user-modal.component.ts - 112 + src/app/pages/extension/detail/extension-detail.component.html + 99 - - If you want to collaborate, please + + BugReport - src/app/pages/user-modal.component.ts - 116 + src/app/pages/extension/detail/extension-detail.component.html + 102 - - open the settings + + ChangeLog - src/app/pages/user-modal.component.ts - 117 + src/app/pages/extension/detail/extension-detail.component.html + 108 - - and fill in the configuration + + Changelog failed to load - src/app/pages/user-modal.component.ts - 118 + src/app/pages/extension/detail/extension-detail.component.html + 111 - - Add Workspace + + Reacquire - src/app/pages/user-modal.component.ts - 125 + src/app/pages/extension/detail/extension-detail.component.html + 113 - - Workspace Name + + Need Client - src/app/pages/user-modal.component.ts - 131 + src/app/pages/extension/detail/extension-detail.component.html + 121 + + + Postcat Client is required to use this extension. - src/app/pages/user-modal.component.ts - 139 + src/app/pages/extension/detail/extension-detail.component.ts + 42 + + + This plugin has no documentation yet. - src/app/pages/workspace/components/edit/workspace-edit.component.ts - 15 + src/app/pages/extension/detail/extension-detail.component.ts + 70 + + + All - src/app/pages/workspace/components/edit/workspace-edit.component.ts - 17 + src/app/pages/extension/extension.component.ts + 25 - - Confirm + + Official - src/app/pages/user-modal.component.ts - 159,160 + src/app/pages/extension/extension.component.ts + 31 - - Oops, server fail + + Installed - src/app/pages/user-modal.component.ts - 232 + src/app/pages/extension/extension.component.ts + 37 - - - Connect failed - src/app/pages/user-modal.component.ts - 237 + src/app/pages/extension/list/extension-list.component.html + 30 - - Connect success + + format - src/app/pages/user-modal.component.ts - 244 + src/app/pages/extension/extension.model.ts + 25 - - - Please check you username or password - src/app/pages/user-modal.component.ts - 380 + src/app/pages/extension/extension.model.ts + 29 - src/app/pages/user-modal.component.ts - 393 + src/app/pages/extension/extension.model.ts + 33 - - - Username must a email - src/app/pages/user-modal.component.ts - 390 + src/app/pages/extension/extension.model.ts + 37 + + + src/app/pages/extension/extension.model.ts + 48 - - - New workspace Failed ! - src/app/pages/user-modal.component.ts - 459 + src/app/pages/extension/extension.model.ts + 60 - - New workspace successfully ! + + themes - src/app/pages/user-modal.component.ts - 462 + src/app/pages/extension/extension.model.ts + 52 - - Upload local data to the cloud + + extensions - src/app/pages/user-modal.component.ts - 472 + src/app/pages/extension/extension.model.ts + 56 - - You have created a cloud workspace, do you need to upload the local data to the new workspace to facilitate team collaboration?<br> - If you do not upload it now, you can also manually export the project data and import it into a new workspace later. + + Data Migration - src/app/pages/user-modal.component.ts - 473,474 + src/app/pages/extension/extension.model.ts + 75 - - Upload + + Themes - src/app/pages/user-modal.component.ts - 483 + src/app/pages/extension/extension.model.ts + 80 - - Create Project Failed ! + + API Security - src/app/pages/user-modal.component.ts - 528 + src/app/pages/extension/extension.model.ts + 85 + + + Other - src/app/shared/store/effect.service.ts - 219 + src/app/pages/extension/extension.model.ts + 90 @@ -1839,51 +1835,101 @@ 118 - - Add + + Add Member To Workspace src/app/pages/workspace/components/member/workspace-member.component.ts - 33 + 19 + + + + Add + + src/app/pages/workspace/components/member/workspace-member.component.ts + 59,60 src/app/pages/workspace/project/member/project-member.component.ts - 67 + 61,62 - - You can create a cloud workspace and invite members to collaborate. + + Currently using local workspace, unable to invite members. src/app/pages/workspace/components/member/workspace-member.component.ts - 100 + 71 + + + src/app/pages/workspace/project/member/project-member.component.ts + 82 + + + + You cancreate a cloud workspaceand invite members to collaborate. + + src/app/pages/workspace/components/member/workspace-member.component.ts + 73,75 + + + src/app/pages/workspace/project/member/project-member.component.ts + 84,86 + + + + Please select a member + + src/app/pages/workspace/components/member/workspace-member.component.ts + 151 + + + src/app/pages/workspace/project/member/project-member.component.ts + 156 Add member failed src/app/pages/workspace/components/member/workspace-member.component.ts - 105 + 157 + + + src/app/pages/workspace/components/member/workspace-member.component.ts + 179 src/app/pages/workspace/project/member/project-member.component.ts - 158 + 162 Add member successfully src/app/pages/workspace/components/member/workspace-member.component.ts - 108 + 161 + + + src/app/pages/workspace/components/member/workspace-member.component.ts + 183 src/app/pages/workspace/project/member/project-member.component.ts - 161 + 166 + + + + You can create a cloud workspace and invite members to collaborate. + + src/app/pages/workspace/components/member/workspace-member.component.ts + 174 Workspace Owner src/app/pages/workspace/components/member/workspace-member.service.ts - 40 + 39 src/app/pages/workspace/project/member/project-member.service.ts @@ -1898,7 +1944,7 @@ Quit Failed src/app/pages/workspace/components/member/workspace-member.service.ts - 79 + 78 src/app/pages/workspace/project/member/project-member.service.ts @@ -1909,7 +1955,7 @@ Quit successfully src/app/pages/workspace/components/member/workspace-member.service.ts - 82 + 81 src/app/pages/workspace/project/member/project-member.service.ts @@ -1920,14 +1966,14 @@ Edit Project src/app/pages/workspace/components/project-list/project-list.component.ts - 52 + 42 Are you sure delete this project? src/app/pages/workspace/components/project-list/project-list.component.ts - 69 + 59 src/app/pages/workspace/project/setting/project-setting.component.ts @@ -1937,8 +1983,8 @@ New Project - src/app/pages/workspace/components/project-list/project-list.component.ts - 94 + src/app/pages/workspace/components/project-list/project-list.service.ts + 45 src/app/pages/workspace/overview/workspace-overview.component.html @@ -1956,45 +2002,21 @@ Project src/app/pages/workspace/overview/workspace-overview.component.html - 19 + 20 Members src/app/pages/workspace/overview/workspace-overview.component.html - 22 - - - - Currently using local workspace, unable to invite members. - - src/app/pages/workspace/overview/workspace-overview.component.html - 32 - - - src/app/pages/workspace/project/member/project-member.component.ts - 79 + 23 - - You cancreate a cloud workspaceand invite members to collaborate. + + Setting src/app/pages/workspace/overview/workspace-overview.component.html - 34,36 - - - src/app/pages/workspace/project/member/project-member.component.ts - 81,83 - - - - You has already selected members tab, you can operate now. - - src/app/pages/workspace/overview/workspace-overview.component.ts - 28 + 27,29 @@ -2066,14 +2088,14 @@ Preview src/app/pages/workspace/project/api/api.component.ts - 59 + 60 Test src/app/pages/workspace/project/api/api.component.ts - 70 + 71 @@ -2119,7 +2141,7 @@ - Data from will be deleted. This cannot be undone. Are you sure you want to delete? + Data from will be deleted. This cannot be undone. Are you sure you want to delete? src/app/pages/workspace/project/api/components/group/edit/api-group-edit.component.html @@ -2130,28 +2152,28 @@ New API src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.html - 23 + 25 New Group src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.html - 26 + 28 Import API src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.html - 30 + 32 Copy src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 48 + 49 @Copy @@ -2159,70 +2181,70 @@ Add API src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 58 + 59 Add Subgroup src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 62 + 63 Delete src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 70 + 71 Edit Group src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 155 + 157 Delete Group src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 164 + 166 Deletion Confirmation? src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 177 + 179 Are you sure you want to delete the data <strong title=""></strong> ? You cannot restore it once deleted! src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 178,180 + 180,182 Add Group src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 196 + 198 Import API src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 206 + 208 Failed to ,Please upgrade extension or try again later src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 216 + 218 src/app/pages/workspace/project/setting/project-setting.component.ts @@ -2233,7 +2255,7 @@ successfully src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 222 + 224 src/app/pages/workspace/project/setting/project-setting.component.ts @@ -2272,28 +2294,40 @@ {{Variable Name}} src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts - 28 + 29 Operate src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts - 35 + 36 - - Failed to edit + + Environment name length needs to be less than 32 + + src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts + 93 + src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts - 101 + 107 + + + src/app/shared/services/storage/db/services/environment.service.ts + 15 + + + src/app/shared/services/storage/db/services/environment.service.ts + 23 - - Environment name length needs to be less than 32 + + Failed to edit src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts - 115 + 107 @@ -2307,42 +2341,42 @@ Environment Quick Look src/app/pages/workspace/project/api/env/env-select/env-select.component.ts - 22 + 23 Global variable src/app/pages/workspace/project/api/env/env-select/env-select.component.ts - 35 + 36 No Global variables src/app/pages/workspace/project/api/env/env-select/env-select.component.ts - 44 + 45 Environment Host src/app/pages/workspace/project/api/env/env-select/env-select.component.ts - 47 + 48 Environment Global variable src/app/pages/workspace/project/api/env/env-select/env-select.component.ts - 52 + 54 Manage Environment src/app/pages/workspace/project/api/env/env-select/env-select.component.ts - 80 + 83 @@ -2357,7 +2391,7 @@ src/app/pages/workspace/project/api/http/test/api-test.component.html - 175 + 187 @@ -2372,7 +2406,7 @@ src/app/pages/workspace/project/api/http/test/api-test.component.html - 87 + 98 @@ -2387,7 +2421,7 @@ src/app/pages/workspace/project/api/http/test/api-test.component.html - 99 + 110 @@ -2402,11 +2436,11 @@ src/app/pages/workspace/project/api/http/test/api-test.component.html - 61 + 72 src/app/pages/workspace/project/api/http/test/api-test.component.html - 167,166 + 179,178 @@ -2429,7 +2463,7 @@ src/app/pages/workspace/project/api/http/test/api-test.component.html - 158 + 170 @@ -2444,7 +2478,7 @@ src/app/pages/workspace/project/api/http/test/api-test.component.html - 162 + 174 @@ -2486,7 +2520,7 @@ Failed Operation src/app/pages/workspace/project/api/http/edit/api-edit.component.ts - 160 + 162 src/app/pages/workspace/project/setting/project-setting.component.ts @@ -2582,25 +2616,25 @@ New Mock src/app/pages/workspace/project/api/http/mock/api-mock.component.html - 9 + 11 src/app/pages/workspace/project/api/http/mock/api-mock.component.ts - 64 + 68 Postcat Client is required to use local mock. src/app/pages/workspace/project/api/http/mock/api-mock.component.ts - 36 + 38 Use Client src/app/pages/workspace/project/api/http/mock/api-mock.component.ts - 37 + 39 @@ -2820,39 +2854,39 @@ Save as API src/app/pages/workspace/project/api/http/test/api-test.component.html - 42 + 52,53 Headers src/app/pages/workspace/project/api/http/test/api-test.component.html - 49 + 60 src/app/pages/workspace/project/api/websocket/websocket.component.html - 65 + 69 Pre-request Script src/app/pages/workspace/project/api/http/test/api-test.component.html - 111 + 122 After-response Script src/app/pages/workspace/project/api/http/test/api-test.component.html - 125 + 136 Save As File src/app/pages/workspace/project/api/http/test/api-test.component.html - 188 + 200 @@ -2862,6 +2896,20 @@ 39 + + files selected + + src/app/pages/workspace/project/api/http/test/body/api-test-body.component.html + 40 + + + + No file chosen + + src/app/pages/workspace/project/api/http/test/body/api-test-body.component.html + 41 + + The file is too large and needs to be less than 5 MB @@ -2926,7 +2974,7 @@ Root Group src/app/pages/workspace/project/api/service/store/api-effect.service.ts - 73 + 77 src/app/shared/services/storage/db/services/project.service.ts @@ -2937,49 +2985,49 @@ Connect src/app/pages/workspace/project/api/websocket/websocket.component.html - 28,29 + 30,31 Connecting src/app/pages/workspace/project/api/websocket/websocket.component.html - 30 + 32 Disconnect src/app/pages/workspace/project/api/websocket/websocket.component.html - 40,41 + 44,45 Query Params src/app/pages/workspace/project/api/websocket/websocket.component.html - 82 + 86 Message src/app/pages/workspace/project/api/websocket/websocket.component.html - 96 + 100 Send src/app/pages/workspace/project/api/websocket/websocket.component.html - 120,121 + 124,125 Messages src/app/pages/workspace/project/api/websocket/websocket.component.html - 134 + 138 @@ -3025,49 +3073,49 @@ Add Member To Project src/app/pages/workspace/project/member/project-member.component.ts - 20 + 21 - - Add + + Project Members src/app/pages/workspace/project/member/project-member.component.ts - 58,59 + 68 - - Project Members + + Add src/app/pages/workspace/project/member/project-member.component.ts - 65 + 70 - - Please select a member + + Please input your projectName - src/app/pages/workspace/project/member/project-member.component.ts - 152 + src/app/pages/workspace/project/setting/project-setting.component.html + 6 Import data from other products src/app/pages/workspace/project/setting/project-setting.component.ts - 44 + 42 Export src/app/pages/workspace/project/setting/project-setting.component.ts - 48 + 47 Export Postcat project data src/app/pages/workspace/project/setting/project-setting.component.ts - 50 + 49 diff --git a/src/workbench/browser/locale/messages.zh.xlf b/src/workbench/browser/locale/messages.zh.xlf index 2e4fe24d0..83f53b9b9 100644 --- a/src/workbench/browser/locale/messages.zh.xlf +++ b/src/workbench/browser/locale/messages.zh.xlf @@ -10,7 +10,7 @@ src/app/pages/extension/detail/extension-detail.component.html - 88 + 93 版本 @@ -178,11 +178,11 @@ src/app/pages/workspace/components/member/workspace-member.component.ts - 23,22 + 31,30 src/app/pages/workspace/project/member/project-member.component.ts - 32,31 + 33,32 搜索 @@ -192,6 +192,10 @@ src/app/layouts/navbar/breadcrumb/select-workspace/select-workspace.component.ts 30 + + src/app/pages/components/user-modal/user-modal.component.ts + 125 + 新建空间 @@ -222,7 +226,7 @@ Sign in/Up src/app/layouts/navbar/btn-user/btn-user.component.ts - 15 + 16 登录/注册 @@ -230,7 +234,7 @@ Account Setting src/app/layouts/navbar/btn-user/btn-user.component.ts - 32 + 34 账号设置 @@ -238,7 +242,7 @@ Sign Out src/app/layouts/navbar/btn-user/btn-user.component.ts - 33 + 35 退出登录 @@ -246,7 +250,7 @@ Successfully logged out ! src/app/layouts/navbar/btn-user/btn-user.component.ts - 58 + 60 退出登录成功 @@ -254,7 +258,7 @@ Share src/app/layouts/navbar/get-share-link.component.ts - 25,26 + 27,28 分享 @@ -262,7 +266,7 @@ Share via link src/app/layouts/navbar/get-share-link.component.ts - 29 + 31 通过链接分享 @@ -270,7 +274,7 @@ This link will be updated with the API content. Everyone can access it without logging in src/app/layouts/navbar/get-share-link.component.ts - 31,32 + 33,34 每个人都可以在没有登录的情况下查看最新的 API 文档 @@ -278,7 +282,7 @@ Copied src/app/layouts/navbar/get-share-link.component.ts - 65 + 69 src/app/modules/api-shared/api-mock-table.component.ts @@ -290,7 +294,7 @@ src/app/pages/workspace/project/api/http/detail/api-detail.component.ts - 42 + 44 src/app/utils/index.utils.ts @@ -306,7 +310,7 @@ src/app/layouts/navbar/help-dropdown/help-dropdown.component.ts - 29 + 31 文档 @@ -314,11 +318,11 @@ Report Issue src/app/layouts/navbar/help-dropdown/help-dropdown.component.ts - 20 + 22 src/app/layouts/navbar/help-dropdown/help-dropdown.component.ts - 34 + 36 问题反馈 @@ -354,7 +358,7 @@ src/app/modules/member-list/member-list.component.ts - 38 + 39 退出 @@ -362,7 +366,7 @@ Extensions src/app/layouts/navbar/navbar.component.html - 22 + 28 插件广场 @@ -370,7 +374,7 @@ Extensions src/app/layouts/navbar/navbar.component.html - 26,27 + 34,35 插件 @@ -378,7 +382,7 @@ Open Settings src/app/layouts/navbar/navbar.component.html - 41 + 49 打开设置 @@ -414,11 +418,7 @@ src/app/pages/extension/list/extension-list.component.html - 50 - - - src/app/pages/workspace/overview/workspace-overview.component.html - 42 + 53 设置 @@ -442,7 +442,7 @@ src/app/pages/workspace/project/api/env/env-select/env-select.component.ts - 74 + 77 环境 @@ -482,7 +482,7 @@ src/app/pages/extension/detail/extension-detail.component.html - 69 + 74 设置 @@ -502,7 +502,7 @@ src/app/modules/api-shared/api-table.service.ts - 232 + 233 src/app/pages/workspace/project/api/env/env-edit/env-edit.component.html @@ -510,15 +510,15 @@ src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts - 31 + 32 src/app/pages/workspace/project/api/env/env-select/env-select.component.ts - 37 + 38 src/app/pages/workspace/project/api/env/env-select/env-select.component.ts - 54 + 56 名称 @@ -578,11 +578,11 @@ src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts - 100 + 110 src/app/pages/workspace/project/api/http/edit/api-edit.component.ts - 155 + 157 src/app/pages/workspace/project/setting/project-setting.component.ts @@ -598,7 +598,7 @@ src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts - 106 + 93 添加失败 @@ -610,11 +610,11 @@ src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts - 105 + 97 src/app/pages/workspace/project/api/http/edit/api-edit.component.ts - 155 + 157 添加成功 @@ -646,11 +646,11 @@ src/app/modules/eo-ui/tab/tab.component.ts - 95 + 99 - src/app/pages/user-modal.component.ts - 477 + src/app/pages/components/user-modal/user-modal.component.ts + 515 src/app/pages/workspace/project/api/websocket/websocket.component.ts @@ -690,7 +690,7 @@ src/app/modules/api-shared/api-table.service.ts - 240 + 241 src/app/pages/workspace/project/api/http/edit/extra-setting/api-params-extra-setting.component.ts @@ -718,7 +718,7 @@ src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts - 33 + 34 src/app/pages/workspace/project/api/http/edit/extra-setting/api-params-extra-setting.component.ts @@ -742,19 +742,19 @@ Value src/app/modules/api-shared/api-table.service.ts - 252 + 253 src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts - 32 + 33 src/app/pages/workspace/project/api/env/env-select/env-select.component.ts - 38 + 39 src/app/pages/workspace/project/api/env/env-select/env-select.component.ts - 55 + 57 参数值 @@ -782,7 +782,7 @@ src/app/pages/workspace/project/setting/project-setting.component.ts - 42 + 40 导入 @@ -882,7 +882,7 @@ Download src/app/modules/download-client/download-client.component.ts - 26 + 28 下载 @@ -930,7 +930,7 @@ Program will not close unsaved tabs src/app/modules/eo-ui/tab/tab-operate.service.ts - 361 + 360 程序将不会关闭未保存的标签 @@ -970,7 +970,7 @@ Do you want to save the changes? src/app/modules/eo-ui/tab/tab.component.ts - 89 + 93 您要保存这些更改吗? @@ -978,7 +978,7 @@ Your changes will be lost if you don't save them. src/app/modules/eo-ui/tab/tab.component.ts - 90 + 94 如未保存,所有更改将会被丢弃。 @@ -986,7 +986,7 @@ Don't Save src/app/modules/eo-ui/tab/tab.component.ts - 102 + 106 放弃保存 @@ -994,7 +994,7 @@ Save src/app/modules/eo-ui/tab/tab.component.ts - 110 + 114 src/app/pages/workspace/project/api/env/env-edit/env-edit.component.html @@ -1058,23 +1058,23 @@ src/app/pages/workspace/components/project-list/project-list.component.html - 19 + 20 src/app/pages/workspace/components/project-list/project-list.component.html - 47 + 48 src/app/pages/workspace/project/api/api.component.ts - 64 + 65 src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 44 + 45 src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 66 + 67 编辑 @@ -1090,19 +1090,19 @@ src/app/pages/workspace/components/project-list/project-list.component.html - 20 + 21 src/app/pages/workspace/components/project-list/project-list.component.html - 48 + 49 src/app/pages/workspace/components/project-list/project-list.component.ts - 70 + 60 src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 52 + 53 src/app/pages/workspace/project/api/components/history/eo-history.component.html @@ -1158,7 +1158,7 @@ src/app/pages/workspace/project/api/http/test/body/api-test-body.component.html - 65 + 66 点击或直接拖拽文件至此区域 @@ -1194,7 +1194,7 @@ Set Editor src/app/modules/member-list/member-list.component.ts - 33,34 + 34,35 设置为读写成员 @@ -1202,7 +1202,7 @@ Set Owner src/app/modules/member-list/member-list.component.ts - 35 + 36 设置为拥有者 @@ -1210,7 +1210,7 @@ Remove src/app/modules/member-list/member-list.component.ts - 36 + 37 移除 @@ -1218,7 +1218,7 @@ Change role successfully src/app/modules/member-list/member-list.component.ts - 77 + 92 更改角色成功 @@ -1226,7 +1226,7 @@ Change role Failed src/app/modules/member-list/member-list.component.ts - 81 + 97 更改角色失败 @@ -1234,7 +1234,7 @@ Change role error src/app/modules/member-list/member-list.component.ts - 86 + 102 更改角色失败 @@ -1242,7 +1242,7 @@ Remove Member successfully src/app/modules/member-list/member-list.component.ts - 89 + 105 移除成员成功 @@ -1270,6 +1270,14 @@ 新密码 + + Please input your new password + + src/app/modules/system-setting/common/account.component.ts + 18 + + 请输入新密码 + Confirm new password @@ -1301,7 +1309,7 @@ 32 - src/app/pages/user-modal.component.ts + src/app/pages/components/user-modal/user-modal.component.ts 81 最小长度为 6 @@ -1438,531 +1446,541 @@ 关于 - - Please Enter - - src/app/pages/extension/detail/components/extensions-settings.component.ts - 24 - - 请输入 - - - Save Success + + or - src/app/pages/extension/detail/components/extensions-settings.component.ts - 119 + src/app/pages/components/third-login/third-login.component.ts + 21 - 保存成功 + - - Enable + + Sign In/Up with Github - src/app/pages/extension/detail/extension-detail.component.html - 42 + src/app/pages/components/third-login/third-login.component.ts + 40,41 - 启用 + 通过 Github 注册/登录 - - Disable + + Check your connection - src/app/pages/extension/detail/extension-detail.component.html - 43 + src/app/pages/components/user-modal/user-modal.component.ts + 26 - 停用 + 检查您的网络连接 - - Uninstall + + Can't connect right now, click to retry or - src/app/pages/extension/detail/extension-detail.component.html - 53 + src/app/pages/components/user-modal/user-modal.component.ts + 30 - 卸载 + 目前无法连接,点击重试或者 - - Install + + config in the configuration - src/app/pages/extension/detail/extension-detail.component.html - 54 + src/app/pages/components/user-modal/user-modal.component.ts + 31 - 安装 + 填写配置 - - Details + + Cancel - src/app/pages/extension/detail/extension-detail.component.html - 77 + src/app/pages/components/user-modal/user-modal.component.ts + 35,36 - src/app/pages/extension/list/extension-list.component.html - 54 + src/app/pages/components/user-modal/user-modal.component.ts + 156,157 - 介绍 + 取消 - - Support + + Retry - src/app/pages/extension/detail/extension-detail.component.html - 85 + src/app/pages/components/user-modal/user-modal.component.ts + 38,39 - 支持 + 重连 - - Author + + Please input your email - src/app/pages/extension/detail/extension-detail.component.html - 87 + src/app/pages/components/user-modal/user-modal.component.ts + 55 - 作者 + 请输入邮箱 - - Repository + + Enter Email - src/app/pages/extension/detail/extension-detail.component.html - 89 + src/app/pages/components/user-modal/user-modal.component.ts + 63 - 代码仓库 + 请输入邮箱 - - Homepage + + Enter password - src/app/pages/extension/detail/extension-detail.component.html - 94 + src/app/pages/components/user-modal/user-modal.component.ts + 76 - 首页 + 输入密码 - - BugReport + + Please input your password - src/app/pages/extension/detail/extension-detail.component.html - 97 + src/app/pages/components/user-modal/user-modal.component.ts + 80 - 报告问题 + 请输入你的密码 - - ChangeLog + + Sign In/Up - src/app/pages/extension/detail/extension-detail.component.html - 103 + src/app/pages/components/user-modal/user-modal.component.ts + 99,100 - 更新日志 + 登录/注册 - - Changelog failed to load + + Open setting - src/app/pages/extension/detail/extension-detail.component.html - 106 + src/app/pages/components/user-modal/user-modal.component.ts + 112 - 更新日志加载失败 + 打开设置 - - Reacquire + + If you want to collaborate, please - src/app/pages/extension/detail/extension-detail.component.html - 108 + src/app/pages/components/user-modal/user-modal.component.ts + 116 - 重新获取 + 如果您想要协作,请 - - Need Client + + open the settings - src/app/pages/extension/detail/extension-detail.component.html - 116 + src/app/pages/components/user-modal/user-modal.component.ts + 117 - 需要客户端 + 打开设置 - - Postcat Client is required to use this extension. + + and fill in the configuration - src/app/pages/extension/detail/extension-detail.component.ts - 40 + src/app/pages/components/user-modal/user-modal.component.ts + 118 - 安装此扩展需要使用 Postcat 客户端。 + 并填写配置 - - This plugin has no documentation yet. + + Workspace Name - src/app/pages/extension/detail/extension-detail.component.ts - 68 + src/app/pages/components/user-modal/user-modal.component.ts + 131 - 此插件尚无文档。 - - - All - src/app/pages/extension/extension.component.ts - 25 + src/app/pages/components/user-modal/user-modal.component.ts + 139 - 所有 - - - Official - src/app/pages/extension/extension.component.ts - 31 + src/app/pages/workspace/components/edit/workspace-edit.component.ts + 15 - 官方 - - - Installed - src/app/pages/extension/extension.component.ts - 37 + src/app/pages/workspace/components/edit/workspace-edit.component.ts + 17 + 空间名称 + + + Please input your new workspace name - src/app/pages/extension/list/extension-list.component.html - 27 + src/app/pages/components/user-modal/user-modal.component.ts + 132 - 已安装 + 请输入您的空间名称 - - format + + Confirm - src/app/pages/extension/extension.model.ts - 25 + src/app/pages/components/user-modal/user-modal.component.ts + 159,160 + 确认 + + + Oops, server fail - src/app/pages/extension/extension.model.ts - 29 + src/app/pages/components/user-modal/user-modal.component.ts + 236 + 糟糕,服务连接失败 + + + Connect failed - src/app/pages/extension/extension.model.ts - 33 + src/app/pages/components/user-modal/user-modal.component.ts + 241 + 连接失败 + + + Connect success - src/app/pages/extension/extension.model.ts - 37 + src/app/pages/components/user-modal/user-modal.component.ts + 248 + 连接成功 + + + Please check you username or password - src/app/pages/extension/extension.model.ts - 48 + src/app/pages/components/user-modal/user-modal.component.ts + 405 - src/app/pages/extension/extension.model.ts - 60 + src/app/pages/components/user-modal/user-modal.component.ts + 418 - 格式 + 请检查您的用户名和密码。 - - themes + + Username must a email - src/app/pages/extension/extension.model.ts - 52 + src/app/pages/components/user-modal/user-modal.component.ts + 415 - 主题 + 用户名必须是邮箱 - - extensions + + New workspace Failed ! - src/app/pages/extension/extension.model.ts - 56 + src/app/pages/components/user-modal/user-modal.component.ts + 495 - 插件 + 新建空间失败 ! - - Data Migration + + New workspace successfully ! - src/app/pages/extension/extension.model.ts - 75 + src/app/pages/components/user-modal/user-modal.component.ts + 498 - 数据迁移 + 新建空间成功 - - Themes + + Upload local data to the cloud - src/app/pages/extension/extension.model.ts - 80 + src/app/pages/components/user-modal/user-modal.component.ts + 510 - 主题 + 上传本地数据 - - API Security + + You have created a cloud workspace, do you need to upload the local data to the new workspace to facilitate team collaboration?<br> + If you do not upload it now, you can also manually export the project data and import it into a new workspace later. - src/app/pages/extension/extension.model.ts - 85 + src/app/pages/components/user-modal/user-modal.component.ts + 511,512 - API 安全 + 您已创建了一个云端工作空间,是否需要将本地的数据上传到新的工作空间以方便团队协作?<br> + 如果现在不上传,后续您也可以手动导出项目数据并导入到新的工作空间。 - - Other + + Upload - src/app/pages/extension/extension.model.ts - 90 + src/app/pages/components/user-modal/user-modal.component.ts + 521 - 其他 + 上传 - - or + + Create Project Failed ! - src/app/pages/third-login.component.ts - 21 + src/app/pages/components/user-modal/user-modal.component.ts + 566 - - - - Sign In/Up with Github - src/app/pages/third-login.component.ts - 38,39 + src/app/shared/store/effect.service.ts + 221 - 通过 Github 注册/登录 + 创建项目失败! - - Check your connection + + Please Enter - src/app/pages/user-modal.component.ts - 26 + src/app/pages/extension/detail/components/extensions-settings.component.ts + 24 - 检查您的网络连接 + 请输入 - - Can't connect right now, click to retry or + + + + - src/app/pages/user-modal.component.ts - 30 + src/app/pages/extension/detail/components/extensions-settings.component.ts + 33 - 目前无法连接,点击重试或者 - - - config in the configuration - src/app/pages/user-modal.component.ts - 31 + src/app/pages/workspace/overview/workspace-overview.component.html + 4,6 - 填写配置 - - - Cancel - src/app/pages/user-modal.component.ts - 35,36 + src/app/pages/workspace/project/api/http/mock/api-mock.component.html + 4,6 + + + + Save Success - src/app/pages/user-modal.component.ts - 156,157 + src/app/pages/extension/detail/components/extensions-settings.component.ts + 119 - 取消 + 保存成功 - - Retry + + Enable - src/app/pages/user-modal.component.ts - 38,39 + src/app/pages/extension/detail/extension-detail.component.html + 44 - 重连 + 启用 - - Sign In/Up + + Disable - src/app/pages/user-modal.component.ts - 48 + src/app/pages/extension/detail/extension-detail.component.html + 45 - 登录/注册 + 停用 - - Please input your email + + Uninstall - src/app/pages/user-modal.component.ts - 55 + src/app/pages/extension/detail/extension-detail.component.html + 58 - 请输入邮箱 + 卸载 - - Enter Email + + Install - src/app/pages/user-modal.component.ts - 63 + src/app/pages/extension/detail/extension-detail.component.html + 59 - 请输入邮箱 + 安装 - - Enter password + + Details - src/app/pages/user-modal.component.ts - 76 + src/app/pages/extension/detail/extension-detail.component.html + 82 - 输入密码 - - - Please input your password - src/app/pages/user-modal.component.ts - 80 + src/app/pages/extension/list/extension-list.component.html + 57 - 请输入你的密码 + 介绍 - - Sign In/Up + + Support - src/app/pages/user-modal.component.ts - 99,100 + src/app/pages/extension/detail/extension-detail.component.html + 90 - 登录/注册 + 支持 - - Open setting + + Author - src/app/pages/user-modal.component.ts - 112 + src/app/pages/extension/detail/extension-detail.component.html + 92 - 打开设置 + 作者 - - If you want to collaborate, please + + Repository - src/app/pages/user-modal.component.ts - 116 + src/app/pages/extension/detail/extension-detail.component.html + 94 - 如果您想要协作,请 + 代码仓库 - - open the settings + + Homepage - src/app/pages/user-modal.component.ts - 117 + src/app/pages/extension/detail/extension-detail.component.html + 99 - 打开设置 + 首页 - - and fill in the configuration + + BugReport - src/app/pages/user-modal.component.ts - 118 + src/app/pages/extension/detail/extension-detail.component.html + 102 - 并填写配置 + 报告问题 - - Add Workspace + + ChangeLog - src/app/pages/user-modal.component.ts - 125 + src/app/pages/extension/detail/extension-detail.component.html + 108 - 新建空间 + 更新日志 - - Workspace Name + + Changelog failed to load - src/app/pages/user-modal.component.ts - 131 + src/app/pages/extension/detail/extension-detail.component.html + 111 + 更新日志加载失败 + + + Reacquire - src/app/pages/user-modal.component.ts - 139 + src/app/pages/extension/detail/extension-detail.component.html + 113 + 重新获取 + + + Need Client - src/app/pages/workspace/components/edit/workspace-edit.component.ts - 15 + src/app/pages/extension/detail/extension-detail.component.html + 121 + 需要客户端 + + + Postcat Client is required to use this extension. - src/app/pages/workspace/components/edit/workspace-edit.component.ts - 17 + src/app/pages/extension/detail/extension-detail.component.ts + 42 - 空间名称 + 安装此扩展需要使用 Postcat 客户端。 - - Confirm + + This plugin has no documentation yet. - src/app/pages/user-modal.component.ts - 159,160 + src/app/pages/extension/detail/extension-detail.component.ts + 70 - 确认 + 此插件尚无文档。 - - Oops, server fail + + All - src/app/pages/user-modal.component.ts - 232 + src/app/pages/extension/extension.component.ts + 25 - 糟糕,服务连接失败 + 所有 - - Connect failed + + Official - src/app/pages/user-modal.component.ts - 237 + src/app/pages/extension/extension.component.ts + 31 - 连接失败 + 官方 - - Connect success + + Installed - src/app/pages/user-modal.component.ts - 244 + src/app/pages/extension/extension.component.ts + 37 - 连接成功 + + src/app/pages/extension/list/extension-list.component.html + 30 + + 已安装 - - Please check you username or password + + format - src/app/pages/user-modal.component.ts - 380 + src/app/pages/extension/extension.model.ts + 25 - src/app/pages/user-modal.component.ts - 393 + src/app/pages/extension/extension.model.ts + 29 - 请检查您的用户名和密码。 - - - Username must a email - src/app/pages/user-modal.component.ts - 390 + src/app/pages/extension/extension.model.ts + 33 - 用户名必须是邮箱 - - - New workspace Failed ! - src/app/pages/user-modal.component.ts - 459 + src/app/pages/extension/extension.model.ts + 37 - 新建空间失败 ! + + src/app/pages/extension/extension.model.ts + 48 + + + src/app/pages/extension/extension.model.ts + 60 + + 格式 - - New workspace successfully ! + + themes - src/app/pages/user-modal.component.ts - 462 + src/app/pages/extension/extension.model.ts + 52 - 新建空间成功 + 主题 - - Upload local data to the cloud + + extensions - src/app/pages/user-modal.component.ts - 472 + src/app/pages/extension/extension.model.ts + 56 - 上传本地数据 + 插件 - - You have created a cloud workspace, do you need to upload the local data to the new workspace to facilitate team collaboration?<br> - If you do not upload it now, you can also manually export the project data and import it into a new workspace later. + + Data Migration - src/app/pages/user-modal.component.ts - 473,474 + src/app/pages/extension/extension.model.ts + 75 - 您已创建了一个云端工作空间,是否需要将本地的数据上传到新的工作空间以方便团队协作?<br> - 如果现在不上传,后续您也可以手动导出项目数据并导入到新的工作空间。 + 数据迁移 - - Upload + + Themes - src/app/pages/user-modal.component.ts - 483 + src/app/pages/extension/extension.model.ts + 80 - 上传 + 主题 - - Create Project Failed ! + + API Security - src/app/pages/user-modal.component.ts - 528 + src/app/pages/extension/extension.model.ts + 85 + API 安全 + + + Other - src/app/shared/store/effect.service.ts - 219 + src/app/pages/extension/extension.model.ts + 90 - 创建项目失败! + 其他 Save @@ -2032,35 +2050,75 @@ 编辑空间成功 - - Add + + Add Member To Workspace src/app/pages/workspace/components/member/workspace-member.component.ts - 33 + 19 + + 添加空间成员 + + + Add + + src/app/pages/workspace/components/member/workspace-member.component.ts + 59,60 src/app/pages/workspace/project/member/project-member.component.ts - 67 + 61,62 - 添加 + 添加 - - You can create a cloud workspace and invite members to collaborate. + + Currently using local workspace, unable to invite members. src/app/pages/workspace/components/member/workspace-member.component.ts - 100 + 71 - 您可以创建一个云空间之后再邀请成员协作。 + + src/app/pages/workspace/project/member/project-member.component.ts + 82 + + 目前正在使用本地工作空间,无法邀请成员。 + + + You cancreate a cloud workspaceand invite members to collaborate. + + src/app/pages/workspace/components/member/workspace-member.component.ts + 73,75 + + + src/app/pages/workspace/project/member/project-member.component.ts + 84,86 + + You can创建一个云空间之后再邀请成员协作。 + + + Please select a member + + src/app/pages/workspace/components/member/workspace-member.component.ts + 151 + + + src/app/pages/workspace/project/member/project-member.component.ts + 156 + + 请选择成员 Add member failed src/app/pages/workspace/components/member/workspace-member.component.ts - 105 + 157 + + + src/app/pages/workspace/components/member/workspace-member.component.ts + 179 src/app/pages/workspace/project/member/project-member.component.ts - 158 + 162 添加成员失败 @@ -2068,19 +2126,31 @@ Add member successfully src/app/pages/workspace/components/member/workspace-member.component.ts - 108 + 161 + + + src/app/pages/workspace/components/member/workspace-member.component.ts + 183 src/app/pages/workspace/project/member/project-member.component.ts - 161 + 166 添加成员成功 + + You can create a cloud workspace and invite members to collaborate. + + src/app/pages/workspace/components/member/workspace-member.component.ts + 174 + + 您可以创建一个云空间之后再邀请成员协作。 + Workspace Owner src/app/pages/workspace/components/member/workspace-member.service.ts - 40 + 39 src/app/pages/workspace/project/member/project-member.service.ts @@ -2096,7 +2166,7 @@ Quit Failed src/app/pages/workspace/components/member/workspace-member.service.ts - 79 + 78 src/app/pages/workspace/project/member/project-member.service.ts @@ -2108,7 +2178,7 @@ Quit successfully src/app/pages/workspace/components/member/workspace-member.service.ts - 82 + 81 src/app/pages/workspace/project/member/project-member.service.ts @@ -2120,7 +2190,7 @@ Edit Project src/app/pages/workspace/components/project-list/project-list.component.ts - 52 + 42 编辑项目 @@ -2128,7 +2198,7 @@ Are you sure delete this project? src/app/pages/workspace/components/project-list/project-list.component.ts - 69 + 59 src/app/pages/workspace/project/setting/project-setting.component.ts @@ -2139,8 +2209,8 @@ New Project - src/app/pages/workspace/components/project-list/project-list.component.ts - 94 + src/app/pages/workspace/components/project-list/project-list.service.ts + 45 src/app/pages/workspace/overview/workspace-overview.component.html @@ -2160,7 +2230,7 @@ Project src/app/pages/workspace/overview/workspace-overview.component.html - 19 + 20 项目 @@ -2168,41 +2238,17 @@ Members src/app/pages/workspace/overview/workspace-overview.component.html - 22 + 23 成员 - - Currently using local workspace, unable to invite members. - - src/app/pages/workspace/overview/workspace-overview.component.html - 32 - - - src/app/pages/workspace/project/member/project-member.component.ts - 79 - - 目前正在使用本地工作空间,无法邀请成员。 - - - You cancreate a cloud workspaceand invite members to collaborate. + + Setting src/app/pages/workspace/overview/workspace-overview.component.html - 34,36 + 27,29 - - src/app/pages/workspace/project/member/project-member.component.ts - 81,83 - - 你可以创建一个云空间之后再邀请成员协作。 - - - You has already selected members tab, you can operate now. - - src/app/pages/workspace/overview/workspace-overview.component.ts - 28 - - 您已经在成员页面了,可以继续操作。 + 设置 New Request @@ -2280,7 +2326,7 @@ Preview src/app/pages/workspace/project/api/api.component.ts - 59 + 60 文档 @@ -2288,7 +2334,7 @@ Test src/app/pages/workspace/project/api/api.component.ts - 70 + 71 测试 @@ -2341,20 +2387,20 @@ 请输入分组名称 - Data from will be deleted. This cannot be undone. Are you sure you want to delete? + Data from will be deleted. This cannot be undone. Are you sure you want to delete? src/app/pages/workspace/project/api/components/group/edit/api-group-edit.component.html 10,13 - 删除 后,该分组下的数据都会被删除,该操作无法撤销,确认删除吗? + 删除 后,该分组下的数据都会被删除,该操作无法撤销,确认删除吗? New API src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.html - 23 + 25 新建 API @@ -2362,7 +2408,7 @@ New Group src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.html - 26 + 28 新建分组 @@ -2370,7 +2416,7 @@ Import API src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.html - 30 + 32 导入 API @@ -2378,7 +2424,7 @@ Copy src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 48 + 49 @Copy 复制 @@ -2387,7 +2433,7 @@ Add API src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 58 + 59 添加 API @@ -2395,7 +2441,7 @@ Add Subgroup src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 62 + 63 添加子分组 @@ -2403,7 +2449,7 @@ Delete src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 70 + 71 删除 @@ -2411,7 +2457,7 @@ Edit Group src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 155 + 157 编辑分组 @@ -2419,7 +2465,7 @@ Delete Group src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 164 + 166 删除分组 @@ -2427,7 +2473,7 @@ Deletion Confirmation? src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 177 + 179 确认删除? @@ -2435,7 +2481,7 @@ Are you sure you want to delete the data <strong title=""></strong> ? You cannot restore it once deleted! src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 178,180 + 180,182 确认要删除数据 <strong title=""></strong> 吗?删除后不可恢复! @@ -2443,7 +2489,7 @@ Add Group src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 196 + 198 添加分组 @@ -2451,7 +2497,7 @@ Import API src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 206 + 208 导入 API @@ -2459,7 +2505,7 @@ Failed to ,Please upgrade extension or try again later src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 216 + 218 src/app/pages/workspace/project/setting/project-setting.component.ts @@ -2471,7 +2517,7 @@ successfully src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 222 + 224 src/app/pages/workspace/project/setting/project-setting.component.ts @@ -2515,7 +2561,7 @@ {{Variable Name}} src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts - 28 + 29 {{变量名}} @@ -2523,26 +2569,38 @@ Operate src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts - 35 + 36 操作 - - Failed to edit + + Environment name length needs to be less than 32 src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts - 101 + 93 - 编辑失败 - - - Environment name length needs to be less than 32 src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts - 115 + 107 + + + src/app/shared/services/storage/db/services/environment.service.ts + 15 + + + src/app/shared/services/storage/db/services/environment.service.ts + 23 环境名称长度必须小于 32 + + Failed to edit + + src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts + 107 + + 编辑失败 + New Environment @@ -2555,7 +2613,7 @@ Environment Quick Look src/app/pages/workspace/project/api/env/env-select/env-select.component.ts - 22 + 23 点击查看环境信息 @@ -2563,7 +2621,7 @@ Global variable src/app/pages/workspace/project/api/env/env-select/env-select.component.ts - 35 + 36 全局变量 @@ -2571,7 +2629,7 @@ No Global variables src/app/pages/workspace/project/api/env/env-select/env-select.component.ts - 44 + 45 暂无全局变量 @@ -2579,7 +2637,7 @@ Environment Host src/app/pages/workspace/project/api/env/env-select/env-select.component.ts - 47 + 48 环境 Host @@ -2587,7 +2645,7 @@ Environment Global variable src/app/pages/workspace/project/api/env/env-select/env-select.component.ts - 52 + 54 环境全局变量 @@ -2595,7 +2653,7 @@ Manage Environment src/app/pages/workspace/project/api/env/env-select/env-select.component.ts - 80 + 83 管理环境 @@ -2611,7 +2669,7 @@ src/app/pages/workspace/project/api/http/test/api-test.component.html - 175 + 187 请求头部 @@ -2627,7 +2685,7 @@ src/app/pages/workspace/project/api/http/test/api-test.component.html - 87 + 98 Query 参数 @@ -2643,7 +2701,7 @@ src/app/pages/workspace/project/api/http/test/api-test.component.html - 99 + 110 REST 参数 @@ -2659,11 +2717,11 @@ src/app/pages/workspace/project/api/http/test/api-test.component.html - 61 + 72 src/app/pages/workspace/project/api/http/test/api-test.component.html - 167,166 + 179,178 请求体 @@ -2687,7 +2745,7 @@ src/app/pages/workspace/project/api/http/test/api-test.component.html - 158 + 170 返回值 @@ -2703,7 +2761,7 @@ src/app/pages/workspace/project/api/http/test/api-test.component.html - 162 + 174 返回头部 @@ -2751,7 +2809,7 @@ Failed Operation src/app/pages/workspace/project/api/http/edit/api-edit.component.ts - 160 + 162 src/app/pages/workspace/project/setting/project-setting.component.ts @@ -2859,11 +2917,11 @@ New Mock src/app/pages/workspace/project/api/http/mock/api-mock.component.html - 9 + 11 src/app/pages/workspace/project/api/http/mock/api-mock.component.ts - 64 + 68 新建 Mock @@ -2871,7 +2929,7 @@ Postcat Client is required to use local mock. src/app/pages/workspace/project/api/http/mock/api-mock.component.ts - 36 + 38 本地 Mock 需要使用 Postcat 客户端。 @@ -2879,7 +2937,7 @@ Use Client src/app/pages/workspace/project/api/http/mock/api-mock.component.ts - 37 + 39 使用客户端 @@ -3127,7 +3185,7 @@ Save as API src/app/pages/workspace/project/api/http/test/api-test.component.html - 42 + 52,53 保存为新 API @@ -3135,11 +3193,11 @@ Headers src/app/pages/workspace/project/api/http/test/api-test.component.html - 49 + 60 src/app/pages/workspace/project/api/websocket/websocket.component.html - 65 + 69 请求头部 @@ -3147,7 +3205,7 @@ Pre-request Script src/app/pages/workspace/project/api/http/test/api-test.component.html - 111 + 122 前置脚本 @@ -3155,7 +3213,7 @@ After-response Script src/app/pages/workspace/project/api/http/test/api-test.component.html - 125 + 136 后置脚本 @@ -3163,7 +3221,7 @@ Save As File src/app/pages/workspace/project/api/http/test/api-test.component.html - 188 + 200 保存为文件 @@ -3175,6 +3233,22 @@ 选择文件 + + files selected + + src/app/pages/workspace/project/api/http/test/body/api-test-body.component.html + 40 + + 选中文件 + + + No file chosen + + src/app/pages/workspace/project/api/http/test/body/api-test-body.component.html + 41 + + 未选定任何文件 + The file is too large and needs to be less than 5 MB @@ -3247,7 +3321,7 @@ Root Group src/app/pages/workspace/project/api/service/store/api-effect.service.ts - 73 + 77 src/app/shared/services/storage/db/services/project.service.ts @@ -3259,7 +3333,7 @@ Connect src/app/pages/workspace/project/api/websocket/websocket.component.html - 28,29 + 30,31 连接 @@ -3267,7 +3341,7 @@ Connecting src/app/pages/workspace/project/api/websocket/websocket.component.html - 30 + 32 连接中 @@ -3275,7 +3349,7 @@ Disconnect src/app/pages/workspace/project/api/websocket/websocket.component.html - 40,41 + 44,45 断开连接 @@ -3283,7 +3357,7 @@ Query Params src/app/pages/workspace/project/api/websocket/websocket.component.html - 82 + 86 Query 参数 @@ -3291,7 +3365,7 @@ Message src/app/pages/workspace/project/api/websocket/websocket.component.html - 96 + 100 报文 @@ -3299,7 +3373,7 @@ Send src/app/pages/workspace/project/api/websocket/websocket.component.html - 120,121 + 124,125 发送 @@ -3307,7 +3381,7 @@ Messages src/app/pages/workspace/project/api/websocket/websocket.component.html - 134 + 138 报文 @@ -3359,39 +3433,39 @@ Add Member To Project src/app/pages/workspace/project/member/project-member.component.ts - 20 + 21 添加成员到项目中 - - Add - - src/app/pages/workspace/project/member/project-member.component.ts - 58,59 - - 添加 - Project Members src/app/pages/workspace/project/member/project-member.component.ts - 65 + 68 项目成员 - - Please select a member + + Add src/app/pages/workspace/project/member/project-member.component.ts - 152 + 70 - 请选择成员 + 添加 + + + Please input your projectName + + src/app/pages/workspace/project/setting/project-setting.component.html + 6 + + 请输入你的项目名称 Import data from other products src/app/pages/workspace/project/setting/project-setting.component.ts - 44 + 42 从其他产品导入数据 @@ -3399,7 +3473,7 @@ Export src/app/pages/workspace/project/setting/project-setting.component.ts - 48 + 47 导出 @@ -3407,7 +3481,7 @@ Export Postcat project data src/app/pages/workspace/project/setting/project-setting.component.ts - 50 + 49 导出 Postcat 项目数据 diff --git a/src/workbench/browser/src/app/core/services/electron/electron.service.ts b/src/workbench/browser/src/app/core/services/electron/electron.service.ts index 497593e6a..1bf4546c4 100644 --- a/src/workbench/browser/src/app/core/services/electron/electron.service.ts +++ b/src/workbench/browser/src/app/core/services/electron/electron.service.ts @@ -36,7 +36,7 @@ export class ElectronService { } get isElectron(): boolean { - return !!window?.electron; + return !!window.electron; } getSystemInfo(): DescriptionsItem[] { const descriptions: DescriptionsItem[] = [ diff --git a/src/workbench/browser/src/app/layouts/navbar/breadcrumb/nav-breadcrumb.component.html b/src/workbench/browser/src/app/layouts/navbar/breadcrumb/nav-breadcrumb.component.html index 929a6c1e9..066518ab9 100644 --- a/src/workbench/browser/src/app/layouts/navbar/breadcrumb/nav-breadcrumb.component.html +++ b/src/workbench/browser/src/app/layouts/navbar/breadcrumb/nav-breadcrumb.component.html @@ -1,7 +1,7 @@ - diff --git a/src/workbench/browser/src/app/layouts/navbar/btn-user/btn-user.component.ts b/src/workbench/browser/src/app/layouts/navbar/btn-user/btn-user.component.ts index 3b746dcfe..7a8f0ab2f 100644 --- a/src/workbench/browser/src/app/layouts/navbar/btn-user/btn-user.component.ts +++ b/src/workbench/browser/src/app/layouts/navbar/btn-user/btn-user.component.ts @@ -12,7 +12,9 @@ import { StoreService } from '../../../shared/store/state.service'; selector: 'pc-btn-user', template: ` - + + diff --git a/src/workbench/browser/src/app/layouts/navbar/help-dropdown/help-dropdown.component.ts b/src/workbench/browser/src/app/layouts/navbar/help-dropdown/help-dropdown.component.ts index 77e1349c2..e24e9994f 100644 --- a/src/workbench/browser/src/app/layouts/navbar/help-dropdown/help-dropdown.component.ts +++ b/src/workbench/browser/src/app/layouts/navbar/help-dropdown/help-dropdown.component.ts @@ -17,6 +17,8 @@ import { ElectronService } from '../../../core/services'; target="_blank" nz-menu-item i18n + trace + traceID="report_issue" >Report Issue @@ -42,7 +44,6 @@ export class HelpDropdownComponent { } private getEnvironment(): string { let result = ''; - console.log(this); const systemInfo = this.electron?.getSystemInfo(); systemInfo?.forEach(val => { if (['homeDir'].includes(val.id)) { @@ -50,7 +51,6 @@ export class HelpDropdownComponent { } result += `- ${val.label}: ${val.value}\r\n`; }); - console.log(systemInfo); return encodeURIComponent(result); } } diff --git a/src/workbench/browser/src/app/layouts/navbar/navbar.component.html b/src/workbench/browser/src/app/layouts/navbar/navbar.component.html index 4928b6ec0..771409ded 100644 --- a/src/workbench/browser/src/app/layouts/navbar/navbar.component.html +++ b/src/workbench/browser/src/app/layouts/navbar/navbar.component.html @@ -2,8 +2,14 @@ @@ -21,6 +27,8 @@ nzTooltipPlacement="bottom" nzTooltipTitle="Extensions" (click)="openExtension()" + trace + traceID="open_extensions" i18n > Extensions diff --git a/src/workbench/browser/src/app/modules/api-shared/api-table.service.ts b/src/workbench/browser/src/app/modules/api-shared/api-table.service.ts index a202da9e0..2c84bd71e 100644 --- a/src/workbench/browser/src/app/modules/api-shared/api-table.service.ts +++ b/src/workbench/browser/src/app/modules/api-shared/api-table.service.ts @@ -222,6 +222,7 @@ export class ApiTableService { } initTestTable( inArg: { + id: string; in: 'body' | 'header' | 'query' | 'rest'; format?: 'FormData'; }, @@ -266,6 +267,7 @@ export class ApiTableService { const result = { columns: [], setting: { + id: inArg.id, primaryKey: 'name', manualAdd: opts.manualAdd, rowSortable: true, diff --git a/src/workbench/browser/src/app/modules/api-shared/api-test-form/api-test-form.component.ts b/src/workbench/browser/src/app/modules/api-shared/api-test-form/api-test-form.component.ts index adf6abda3..c16ba8354 100644 --- a/src/workbench/browser/src/app/modules/api-shared/api-test-form/api-test-form.component.ts +++ b/src/workbench/browser/src/app/modules/api-shared/api-test-form/api-test-form.component.ts @@ -57,7 +57,8 @@ export class ApiTestFormComponent implements OnInit, OnDestroy { } private initListConf() { const config = this.apiTable.initTestTable({ - in: this.module + in: this.module, + id: `api_test_${module}` }); this.listConf.columns = config.columns; this.listConf.setting = config.setting; diff --git a/src/workbench/browser/src/app/modules/download-client/download-client.component.ts b/src/workbench/browser/src/app/modules/download-client/download-client.component.ts index ad35dc9a7..86aec5f6b 100644 --- a/src/workbench/browser/src/app/modules/download-client/download-client.component.ts +++ b/src/workbench/browser/src/app/modules/download-client/download-client.component.ts @@ -15,7 +15,9 @@ import { ElectronService, WebService } from '../../core/services'; = this.MAX_TAB_LIMIT) { return; } + // * Trace + this.trace.report('open_api_test'); this.tabOperate.newDefaultTab(key); } doubleClickTab($event, uuid) { diff --git a/src/workbench/browser/src/app/modules/eo-ui/table-pro/table-pro.component.ts b/src/workbench/browser/src/app/modules/eo-ui/table-pro/table-pro.component.ts index 59e1a9e90..f5b4ac06d 100644 --- a/src/workbench/browser/src/app/modules/eo-ui/table-pro/table-pro.component.ts +++ b/src/workbench/browser/src/app/modules/eo-ui/table-pro/table-pro.component.ts @@ -15,7 +15,6 @@ import { ViewChildren } from '@angular/core'; import _, { attempt, has, isUndefined, omitBy } from 'lodash-es'; -import { collectStoredAnnotations } from 'mobx/dist/internal'; import { eoDeepCopy } from '../../../utils/index.utils'; import StorageUtil from '../../../utils/storage/storage.utils'; @@ -227,9 +226,13 @@ export class EoTableProComponent implements OnInit, OnChanges { * Remeber coloum size after resize */ nzResizeColumn(tableList) { + //* If the first column is sortable, the first column will be removed from the tableList + if (this.setting.rowSortable && this.columns[0].type !== 'sort') { + tableList = tableList.slice(1); + } const widthByKey = {}; this.columns.forEach((val, key) => { - const headerCol = tableList[key]; + const headerCol = tableList.find(col => col.title === val.title || col.key === val.key) || tableList[key]; if (headerCol.width) { widthByKey[val.key || key] = headerCol.width; } diff --git a/src/workbench/browser/src/app/modules/extension-select/export-api/export-api.component.ts b/src/workbench/browser/src/app/modules/extension-select/export-api/export-api.component.ts index 0914c362e..0590a16a9 100644 --- a/src/workbench/browser/src/app/modules/extension-select/export-api/export-api.component.ts +++ b/src/workbench/browser/src/app/modules/extension-select/export-api/export-api.component.ts @@ -3,6 +3,8 @@ import { FeatureInfo } from 'eo/workbench/browser/src/app/shared/models/extensio import { ExtensionService } from 'eo/workbench/browser/src/app/shared/services/extensions/extension.service'; import { Message, MessageService } from 'eo/workbench/browser/src/app/shared/services/message'; import { ApiService } from 'eo/workbench/browser/src/app/shared/services/storage/api.service'; +import { TraceService } from 'eo/workbench/browser/src/app/shared/services/trace.service'; +import { StoreService } from 'eo/workbench/browser/src/app/shared/store/state.service'; import StorageUtil from 'eo/workbench/browser/src/app/utils/storage/storage.utils'; import { has } from 'lodash-es'; import { Subject, takeUntil } from 'rxjs'; @@ -20,7 +22,13 @@ export class ExportApiComponent implements OnInit { supportList: any[] = []; featureMap: Map; private destroy$: Subject = new Subject(); - constructor(private extensionService: ExtensionService, private apiService: ApiService, private messageService: MessageService) {} + constructor( + private extensionService: ExtensionService, + private apiService: ApiService, + private messageService: MessageService, + private trace: TraceService, + private store: StoreService + ) {} ngOnInit(): void { this.initData(); this.messageService @@ -89,6 +97,8 @@ export class ExportApiComponent implements OnInit { if (filename) { this.transferTextToFile(filename, output); } + const workspace_type = this.store.isLocal ? 'local' : 'remote'; + this.trace.report('export_project_success', { sync_platform: this.currentExtension, workspace_type }); callback(true); } catch (e) { console.error(e); diff --git a/src/workbench/browser/src/app/modules/extension-select/extension-select.module.ts b/src/workbench/browser/src/app/modules/extension-select/extension-select.module.ts index 221a5957b..84e58dde0 100644 --- a/src/workbench/browser/src/app/modules/extension-select/extension-select.module.ts +++ b/src/workbench/browser/src/app/modules/extension-select/extension-select.module.ts @@ -10,9 +10,9 @@ import { EoIconparkIconModule } from '../eo-ui/iconpark-icon/eo-iconpark-icon.mo import { ExportApiComponent } from './export-api/export-api.component'; import { ImportApiComponent } from './import-api/import-api.component'; import { ExtensionSelectComponent } from './select/extension-select.component'; -import { SyncApiComponent } from './sync-api/sync-api.component'; +import { PushApiComponent } from './sync-api/sync-api.component'; -const COMPONENTS = [ExtensionSelectComponent, ExportApiComponent, ImportApiComponent, SyncApiComponent]; +const COMPONENTS = [ExtensionSelectComponent, ExportApiComponent, ImportApiComponent, PushApiComponent]; @NgModule({ imports: [EoNgRadioModule, NzUploadModule, EoNgFeedbackTooltipModule, EoIconparkIconModule, CommonModule, FormsModule, SharedModule], declarations: [...COMPONENTS] diff --git a/src/workbench/browser/src/app/modules/extension-select/sync-api/sync-api.component.ts b/src/workbench/browser/src/app/modules/extension-select/sync-api/sync-api.component.ts index 2fe83b35e..09ff3e44c 100644 --- a/src/workbench/browser/src/app/modules/extension-select/sync-api/sync-api.component.ts +++ b/src/workbench/browser/src/app/modules/extension-select/sync-api/sync-api.component.ts @@ -11,9 +11,9 @@ import packageJson from '../../../../../../../../package.json'; @Component({ selector: 'eo-sync-api', - template: `` + template: `` }) -export class SyncApiComponent implements OnInit { +export class PushApiComponent implements OnInit { currentExtension = ''; supportList: any[] = []; featureMap: Map; @@ -37,7 +37,7 @@ export class SyncApiComponent implements OnInit { }); } initData = () => { - this.featureMap = this.extensionService.getValidExtensionsByFature('syncAPI'); + this.featureMap = this.extensionService.getValidExtensionsByFature('pushAPI'); this.supportList = []; this.featureMap?.forEach((data: FeatureInfo, key: string) => { this.supportList.push({ diff --git a/src/workbench/browser/src/app/modules/member-list/member-list.component.ts b/src/workbench/browser/src/app/modules/member-list/member-list.component.ts index 9a195143e..0b25e2c12 100644 --- a/src/workbench/browser/src/app/modules/member-list/member-list.component.ts +++ b/src/workbench/browser/src/app/modules/member-list/member-list.component.ts @@ -1,6 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { EoNgFeedbackMessageService } from 'eo-ng-feedback'; -import { autorun } from 'mobx'; +import { TraceService } from 'eo/workbench/browser/src/app/shared/services/trace.service'; +import { autorun, reaction } from 'mobx'; import { StoreService } from '../../shared/store/state.service'; import { MemberService } from './member.service'; @@ -51,20 +52,34 @@ export class MemberListComponent implements OnInit { list = []; roleList = []; loading = false; - constructor(public store: StoreService, private message: EoNgFeedbackMessageService, public member: MemberService) {} + constructor( + public store: StoreService, + private trace: TraceService, + private message: EoNgFeedbackMessageService, + public member: MemberService + ) {} ngOnInit(): void { - autorun(async () => { - if (this.store.isLogin) { - this.queryList(); - } else { - this.list = [ - { - username: 'Postcat' - } - ]; + this.updateList(); + + //! Use reaction not use autoRun,autoRun will cause loop + reaction( + () => this.store.isLogin, + async () => { + this.updateList(); } - }); + ); + } + updateList() { + if (this.store.isLogin) { + this.queryList(); + } else { + this.list = [ + { + username: 'Postcat' + } + ]; + } } async queryList(username = '') { this.loading = true; @@ -75,6 +90,7 @@ export class MemberListComponent implements OnInit { const isOK: boolean = await this.member.changeRole(item); if (isOK) { this.message.success($localize`Change role successfully`); + this.trace.report('switch_member_permission'); this.queryList(); return; } diff --git a/src/workbench/browser/src/app/modules/system-setting/common/about.component.ts b/src/workbench/browser/src/app/modules/system-setting/common/about.component.ts index 3d389bfa4..3aea19dd8 100644 --- a/src/workbench/browser/src/app/modules/system-setting/common/about.component.ts +++ b/src/workbench/browser/src/app/modules/system-setting/common/about.component.ts @@ -9,13 +9,13 @@ import { ElectronService } from '../../../core/services';

Postcat

V{{ versionInfo?.version }}

- - + +

Hi!~ If you like Postcat, please give the Postcat a Star!
Your support is our greatest motivation~

- + diff --git a/src/workbench/browser/src/app/modules/system-setting/common/account.component.ts b/src/workbench/browser/src/app/modules/system-setting/common/account.component.ts index 729cce92b..2d951804a 100644 --- a/src/workbench/browser/src/app/modules/system-setting/common/account.component.ts +++ b/src/workbench/browser/src/app/modules/system-setting/common/account.component.ts @@ -15,7 +15,7 @@ import { StoreService } from 'eo/workbench/browser/src/app/shared/store/state.se
New password - + diff --git a/src/workbench/browser/src/app/pages/third-login.component.scss b/src/workbench/browser/src/app/pages/components/third-login/third-login.component.scss similarity index 100% rename from src/workbench/browser/src/app/pages/third-login.component.scss rename to src/workbench/browser/src/app/pages/components/third-login/third-login.component.scss diff --git a/src/workbench/browser/src/app/pages/third-login.component.ts b/src/workbench/browser/src/app/pages/components/third-login/third-login.component.ts similarity index 96% rename from src/workbench/browser/src/app/pages/third-login.component.ts rename to src/workbench/browser/src/app/pages/components/third-login/third-login.component.ts index ae96fd2b8..ba604faba 100644 --- a/src/workbench/browser/src/app/pages/third-login.component.ts +++ b/src/workbench/browser/src/app/pages/components/third-login/third-login.component.ts @@ -30,9 +30,11 @@ enum LoginType { class="h-10" nzType="primary" nzBlock + nzGhost nzSize="large" (click)="handleLogin('github')" - nzGhost + traceID="click_login_github" + trace i18n > Sign In/Up with Github @@ -43,6 +45,8 @@ enum LoginType { class="w-8 h-8 rounded-full bg-center bg-no-repeat bg-cover cursor-pointer border-none" *ngFor="let it of renderList" (click)="handleLogin(it.type)" + trace + [traceID]="'click_login_' + it.type" [ngStyle]="{ 'background-image': logoLink(it.logo) }" > diff --git a/src/workbench/browser/src/app/pages/user-modal.component.ts b/src/workbench/browser/src/app/pages/components/user-modal/user-modal.component.ts similarity index 91% rename from src/workbench/browser/src/app/pages/user-modal.component.ts rename to src/workbench/browser/src/app/pages/components/user-modal/user-modal.component.ts index bd7c4aabe..8b016094b 100644 --- a/src/workbench/browser/src/app/pages/user-modal.component.ts +++ b/src/workbench/browser/src/app/pages/components/user-modal/user-modal.component.ts @@ -8,13 +8,13 @@ import { MessageService } from 'eo/workbench/browser/src/app/shared/services/mes import { ApiService } from 'eo/workbench/browser/src/app/shared/services/storage/api.service'; import { LocalService } from 'eo/workbench/browser/src/app/shared/services/storage/local.service'; import { RemoteService } from 'eo/workbench/browser/src/app/shared/services/storage/remote.service'; +import { TraceService } from 'eo/workbench/browser/src/app/shared/services/trace.service'; import { EffectService } from 'eo/workbench/browser/src/app/shared/store/effect.service'; import { StoreService } from 'eo/workbench/browser/src/app/shared/store/state.service'; -import { getUrlParams } from 'eo/workbench/browser/src/app/utils/index.utils'; import { interval, Subject } from 'rxjs'; import { distinct, takeUntil } from 'rxjs/operators'; -import { ModalService } from '../shared/services/modal.service'; +import { ModalService } from '../../../shared/services/modal.service'; @Component({ selector: 'eo-user-modal', @@ -122,14 +122,14 @@ import { ModalService } from '../shared/services/modal.service'; [(nzVisible)]="isAddWorkspaceModalVisible" (nzOnCancel)="handleAddWorkspaceModalCancel()" (nzAfterClose)="ebdsz2aCallback()" - nzTitle="Add Workspace" + nzTitle="New Workspace" i18n-nzTitle > Workspace Name - + { + if (this.store.isClientFirst) { + this.trace.report('first_open_client'); + } this.message .get() .pipe(distinct(({ type }) => type, interval(400))) @@ -306,10 +310,23 @@ export class UserModalComponent implements OnInit, OnDestroy { } async thirdLogin(code) { const [data, err] = await this.api.api_userThirdLoginResult({ code }); + // console.log('data', data); if (err) { this.store.clearAuth(); return; } + this.trace.setUser({ loginUserId: data.userId }); + // * 0=邮箱 1=手机号 2=wx 3=qq 4=飞书 5=github 6=帐号 7=跳转登录 + const hash = new Map().set(0, '邮箱').set(1, '手机号').set(2, 'Wecaht').set(3, 'QQ').set(4, 'Feishu').set(5, 'Github').set(6, '账号'); + // (0, '登录').set(1, '注册'); + if (data.type == 0) { + // * login + this.trace.report('login_success', { login_way: hash.get(data.loginWay) }); + } + if (data.type == 1) { + // * register + this.trace.setUser({ register_way: hash.get(data.loginWay) }); + } this.store.setLoginInfo(data); this.effect.updateWorkspaceList(); { @@ -401,6 +418,25 @@ export class UserModalComponent implements OnInit, OnDestroy { this.eMessage.error($localize`Please check you username or password`); return; } + this.trace.setUser({ loginUserId: data.userId }); + // * 0=邮箱 1=手机号 2=wx 3=qq 4=飞书 5=github 6=帐号 7=跳转登录 + const hash = new Map() + .set(0, 'Email') + .set(1, 'Phone') + .set(2, 'Wecaht') + .set(3, 'QQ') + .set(4, 'Feishu') + .set(5, 'Github') + .set(6, 'Account'); + // (0, '登录').set(1, '注册'); + if (data.type == 0) { + // * login + this.trace.report('login_success', { login_way: hash.get(data.loginWay) }); + } + if (data.type == 1) { + // * register + this.trace.setUser({ register_way: hash.get(data.loginWay) }); + } this.store.setLoginInfo(data); this.effect.updateWorkspaceList(); // * 关闭弹窗 @@ -462,12 +498,13 @@ export class UserModalComponent implements OnInit, OnDestroy { const localProjects = this.store.getProjectList; // ! Attention: data is array const [data, err]: any = await this.remote.api_workspaceCreate({ titles: [titles] }); - const workspace = data.at(0); if (err) { this.eMessage.error($localize`New workspace Failed !`); return; } this.eMessage.success($localize`New workspace successfully !`); + this.trace.report('add_workspace_success'); + const workspace = data.at(0); // * 关闭弹窗 this.isAddWorkspaceModalVisible = false; { @@ -557,7 +594,7 @@ export class UserModalComponent implements OnInit, OnDestroy { await this.router.navigate(['**']); - this.router.navigate(['/home/workspace/overview']); + this.router.navigate(['/home/workspace/overview/projects']); // localProjects.forEach((project, index) => { // importProject(project, index); // }); diff --git a/src/workbench/browser/src/app/pages/extension/detail/extension-detail.component.html b/src/workbench/browser/src/app/pages/extension/detail/extension-detail.component.html index 5f82343f2..b10d3348b 100644 --- a/src/workbench/browser/src/app/pages/extension/detail/extension-detail.component.html +++ b/src/workbench/browser/src/app/pages/extension/detail/extension-detail.component.html @@ -51,6 +51,9 @@ [nzLoading]="isOperating" [nzType]="extensionDetail?.installed ? 'default' : 'primary'" (click)="handleInstall()" + trace + [traceID]="!extensionDetail?.installed ? 'click_install_extension' : ''" + [traceParams]="{ extension_id: extensionDetail.name }" > Uninstall Install diff --git a/src/workbench/browser/src/app/pages/extension/detail/extension-detail.component.ts b/src/workbench/browser/src/app/pages/extension/detail/extension-detail.component.ts index dfe893fae..9fbe3c7ba 100644 --- a/src/workbench/browser/src/app/pages/extension/detail/extension-detail.component.ts +++ b/src/workbench/browser/src/app/pages/extension/detail/extension-detail.component.ts @@ -3,6 +3,7 @@ import { ActivatedRoute } from '@angular/router'; import { ElectronService } from 'eo/workbench/browser/src/app/core/services'; import { LanguageService } from 'eo/workbench/browser/src/app/core/services/language/language.service'; import { ExtensionInfo } from 'eo/workbench/browser/src/app/shared/models/extension-manager'; +import { TraceService } from 'eo/workbench/browser/src/app/shared/services/trace.service'; import { WebService } from '../../../core/services/web/web.service'; import { ExtensionService } from '../../../shared/services/extensions/extension.service'; @@ -30,7 +31,8 @@ export class ExtensionDetailComponent implements OnInit { private route: ActivatedRoute, private webService: WebService, private electron: ElectronService, - private language: LanguageService + private language: LanguageService, + private trace: TraceService ) {} ngOnInit(): void { @@ -151,10 +153,12 @@ ${log} version }); this.extensionDetail['enabled'] = true; + this.trace.report('install_extension_success', { extenison_id: id }); break; } case 'uninstall': { this.extensionDetail.installed = !(await this.extensionService.uninstallExtension(id)); + this.trace.report('uninstall_extension_success', { extenison_id: id }); break; } } diff --git a/src/workbench/browser/src/app/pages/extension/extension.model.ts b/src/workbench/browser/src/app/pages/extension/extension.model.ts index 952511241..ba80c2e88 100644 --- a/src/workbench/browser/src/app/pages/extension/extension.model.ts +++ b/src/workbench/browser/src/app/pages/extension/extension.model.ts @@ -29,9 +29,9 @@ export const featuresTipsMap = { name: $localize`format`, suggest: '@feature:exportAPI' }, - syncAPI: { + pushAPI: { name: $localize`format`, - suggest: '@feature:syncAPI' + suggest: '@feature:pushAPI' }, sidebarView: { name: $localize`format`, diff --git a/src/workbench/browser/src/app/pages/extension/list/extension-list.component.html b/src/workbench/browser/src/app/pages/extension/list/extension-list.component.html index 5caa6fc20..de6a364f2 100644 --- a/src/workbench/browser/src/app/pages/extension/list/extension-list.component.html +++ b/src/workbench/browser/src/app/pages/extension/list/extension-list.component.html @@ -7,6 +7,9 @@
diff --git a/src/workbench/browser/src/app/pages/pages.module.ts b/src/workbench/browser/src/app/pages/pages.module.ts index 6e1d3d465..63d2aca01 100644 --- a/src/workbench/browser/src/app/pages/pages.module.ts +++ b/src/workbench/browser/src/app/pages/pages.module.ts @@ -7,10 +7,10 @@ import { SidebarComponent } from '../layouts/sidebar/sidebar.component'; import { ToolbarModule } from '../layouts/toolbar/toolbar.module'; import { SystemSettingModule } from '../modules/system-setting/system-setting.module'; import { SharedModule } from '../shared/shared.module'; +import { ThirdLoginComponent } from './components/third-login/third-login.component'; +import { UserModalComponent } from './components/user-modal/user-modal.component'; import { PagesRoutingModule } from './pages-routing.module'; import { PagesComponent } from './pages.component'; -import { ThirdLoginComponent } from './third-login.component'; -import { UserModalComponent } from './user-modal.component'; @NgModule({ imports: [PagesRoutingModule, SystemSettingModule, CommonModule, NavbarModule, ToolbarModule, SharedModule], diff --git a/src/workbench/browser/src/app/pages/workspace/components/member/workspace-member.component.ts b/src/workbench/browser/src/app/pages/workspace/components/member/workspace-member.component.ts index e6be14d0e..79c3000ee 100644 --- a/src/workbench/browser/src/app/pages/workspace/components/member/workspace-member.component.ts +++ b/src/workbench/browser/src/app/pages/workspace/components/member/workspace-member.component.ts @@ -1,49 +1,80 @@ -import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core'; +import { Component, OnInit, ViewChild } from '@angular/core'; import { EoNgFeedbackMessageService } from 'eo-ng-feedback'; import { MemberService } from 'eo/workbench/browser/src/app/modules/member-list/member.service'; -import { makeObservable, observable, reaction } from 'mobx'; +import { TraceService } from 'eo/workbench/browser/src/app/shared/services/trace.service'; +import { makeObservable, observable, action, reaction } from 'mobx'; import { MemberListComponent } from '../../../../modules/member-list/member-list.component'; +import { MessageService } from '../../../../shared/services/message/message.service'; import { StoreService } from '../../../../shared/store/state.service'; @Component({ selector: 'eo-workspace-member', - template: ` - + template: ` + + + - -
-
- {{ option.userNickName }} - {{ option.email }} -
- + +
+ {{ option.userNickName }} + {{ option.email }}
- - - - - `, +
+ + + + + +

Currently using local workspace, unable to invite members.

+

You canand invite members to collaborate.

+ + `, styles: [ ` .ant-list-split .ant-list-header { @@ -56,16 +87,21 @@ import { StoreService } from '../../../../shared/store/state.service'; export class WorkspaceMemberComponent implements OnInit { @ViewChild('memberList') memberListRef: MemberListComponent; @observable searchValue = ''; - userCache; + userCache = []; isLoading = false; userList = []; + isSelectBtnLoading = false; + isInvateModalVisible = false; constructor( public store: StoreService, - private message: EoNgFeedbackMessageService, + private eMessage: EoNgFeedbackMessageService, public member: MemberService, - private cdk: ChangeDetectorRef + private message: MessageService, + private trace: TraceService ) {} - + createWorkspace() { + this.message.send({ type: 'addWorkspace', data: {} }); + } ngOnInit(): void { makeObservable(this); reaction( @@ -75,39 +111,76 @@ export class WorkspaceMemberComponent implements OnInit { return; } this.isLoading = true; - console.log('hel'); const result = await this.member.searchUser(value.trim()); const memberList = this.memberListRef.list.map(it => it.username); this.userList = result.filter(it => !memberList.includes(it.userNickName)); + console.log('memberList', this.userList); this.isLoading = false; // this.cdk.detectChanges(); }, { delay: 300 } ); + this.message.get().subscribe(({ data, type }) => { + if (type === 'addWorkspaceMember') { + this.isInvateModalVisible = true; + } + }); } handleChange(event) { - this.searchValue = event; - // if (this.searchValue.includes('t')) { - // this.userList = [ - // { - // userNickName: 'test' - // } - // ]; - // } + this.SetSearchValue(event); + } + @action SetSearchValue(data) { + this.searchValue = data; + } + handleInvateModalCancel(): void { + // * 关闭弹窗 + this.isInvateModalVisible = false; } + ehe4islCallback() { + // * nzAfterClose event callback + this.userCache = []; + } + async btn0r9zcbCallback() { + // * click event callback + this.isSelectBtnLoading = true; + const btnSelectRunning = async () => { + const userIds = this.userCache; + if (userIds.length === 0) { + this.eMessage.error($localize`Please select a member`); + return; + } + + const [aData, aErr]: any = await this.member.addMember(userIds); + if (aErr) { + this.eMessage.error($localize`Add member failed`); + return; + } + this.trace.report('project_add_member_success'); + this.eMessage.success($localize`Add member successfully`); + + // * 关闭弹窗 + this.isInvateModalVisible = false; + + this.memberListRef.queryList(); + }; + await btnSelectRunning(); + this.isSelectBtnLoading = false; + } + async addMember(items) { if (this.store.isLocal) { - this.message.warning($localize`You can create a cloud workspace and invite members to collaborate.`); + this.eMessage.warning($localize`You can create a cloud workspace and invite members to collaborate.`); return; } const [data, err]: any = await this.member.addMember(items.id); if (err) { - this.message.error($localize`Add member failed`); + this.eMessage.error($localize`Add member failed`); return; } - this.message.success($localize`Add member successfully`); + this.trace.report('add_workspace_member_success'); + this.eMessage.success($localize`Add member successfully`); this.userList = []; - this.userCache = ''; + this.userCache = []; this.memberListRef.queryList(); } } diff --git a/src/workbench/browser/src/app/pages/workspace/components/member/workspace-member.service.ts b/src/workbench/browser/src/app/pages/workspace/components/member/workspace-member.service.ts index c937b2e33..33d941888 100644 --- a/src/workbench/browser/src/app/pages/workspace/components/member/workspace-member.service.ts +++ b/src/workbench/browser/src/app/pages/workspace/components/member/workspace-member.service.ts @@ -20,14 +20,13 @@ export class WorkspaceMemberService { ) { autorun(() => { this.role = this.store.getWorkspaceRole; - console.log(this.role); this.workSpaceUuid = this.store.getCurrentWorkspaceUuid; this.isOwner = this.store.getWorkspaceRole.some(it => it.name === 'Workspace Owner'); }); } - async addMember(ids) { + async addMember(ids: string[]) { return await this.api.api_workspaceAddMember({ - userIds: [ids] + userIds: ids }); } async queryMember(search) { diff --git a/src/workbench/browser/src/app/pages/workspace/components/project-list/project-list.component.html b/src/workbench/browser/src/app/pages/workspace/components/project-list/project-list.component.html index 4c92b3e11..68cb14eed 100644 --- a/src/workbench/browser/src/app/pages/workspace/components/project-list/project-list.component.html +++ b/src/workbench/browser/src/app/pages/workspace/components/project-list/project-list.component.html @@ -1,10 +1,11 @@
- - -
+ + + +
- - + +
@@ -29,8 +30,8 @@
- - + +
diff --git a/src/workbench/browser/src/app/pages/workspace/components/project-list/project-list.component.ts b/src/workbench/browser/src/app/pages/workspace/components/project-list/project-list.component.ts index 88f21c48f..35e610112 100644 --- a/src/workbench/browser/src/app/pages/workspace/components/project-list/project-list.component.ts +++ b/src/workbench/browser/src/app/pages/workspace/components/project-list/project-list.component.ts @@ -1,13 +1,12 @@ import { Component, OnInit } from '@angular/core'; -import { EoNgFeedbackMessageService } from 'eo-ng-feedback'; import { OperateProjectFormComponent } from 'eo/workbench/browser/src/app/pages/workspace/project/components/operate-project-form.compoent'; import { ModalService } from 'eo/workbench/browser/src/app/shared/services/modal.service'; import { ApiService } from 'eo/workbench/browser/src/app/shared/services/storage/api.service'; -import { StoreService } from 'eo/workbench/browser/src/app/shared/store/state.service'; +import { autorun } from 'mobx'; -import { SettingService } from '../../../../modules/system-setting/settings.service'; import { EffectService } from '../../../../shared/store/effect.service'; -type ListType = 'list' | 'card'; +import { StoreService } from '../../../../shared/store/state.service'; +import { ProjectListService } from './project-list.service'; @Component({ selector: 'eo-project-list', @@ -15,34 +14,25 @@ type ListType = 'list' | 'card'; styleUrls: ['./project-list.component.scss'] }) export class ProjectListComponent implements OnInit { - listType: ListType; - initLoading = true; projectList: any[] = []; - get WorkspaceID() { - return this.store.getCurrentWorkspaceUuid; - } - constructor( + public projectListService: ProjectListService, private apiService: ApiService, - private setting: SettingService, - private effect: EffectService, private store: StoreService, + private effect: EffectService, private modalService: ModalService - ) { - this.listType = this.setting.get('workbench.list.type') || 'list'; - } + ) {} async ngOnInit(): Promise { - await this.getProjectList(); + this.getProjectList(); + autorun(() => { + this.projectList = this.store.getProjectList; + }); } - - async getProjectList() { - const [data]: any = await this.effect.updateProjects(this.WorkspaceID); - this.projectList = data || []; - this.initLoading = false; + async getProjectList(): Promise { + await this.projectListService.getProjectList(); } - editProject(item: any): void { const model = { ...item, @@ -80,32 +70,4 @@ export class ProjectListComponent implements OnInit { } }); } - - setListType(type: ListType) { - this.listType = type; - this.setting.set('workbench.list.type', type); - } - - createProject() { - const model = { - name: '' - }; - const modal = this.modalService.create({ - nzTitle: $localize`New Project`, - nzContent: OperateProjectFormComponent, - nzComponentParams: { - model - }, - nzOnOk: async () => { - if (!model.name) { - return; - } - await this.effect.createProject([model]); - - // * update project list - this.getProjectList(); - modal.destroy(); - } - }); - } } diff --git a/src/workbench/browser/src/app/pages/workspace/components/project-list/project-list.module.ts b/src/workbench/browser/src/app/pages/workspace/components/project-list/project-list.module.ts index 8801a4773..8e87140eb 100644 --- a/src/workbench/browser/src/app/pages/workspace/components/project-list/project-list.module.ts +++ b/src/workbench/browser/src/app/pages/workspace/components/project-list/project-list.module.ts @@ -1,5 +1,6 @@ import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; +import { RouterModule } from '@angular/router'; import { OperateProjectFormComponent } from 'eo/workbench/browser/src/app/pages/workspace/project/components/operate-project-form.compoent'; import { SharedModule } from 'eo/workbench/browser/src/app/shared/shared.module'; import { NzAvatarModule } from 'ng-zorro-antd/avatar'; @@ -8,9 +9,23 @@ import { NzEmptyModule } from 'ng-zorro-antd/empty'; import { NzFormModule } from 'ng-zorro-antd/form'; import { ProjectListComponent } from './project-list.component'; +import { ProjectListService } from './project-list.service'; @NgModule({ - imports: [NzEmptyModule, NzAvatarModule, NzCardModule, FormsModule, NzFormModule, SharedModule], + imports: [ + NzEmptyModule, + RouterModule.forChild([ + { + path: '', + component: ProjectListComponent + } + ]), + NzAvatarModule, + NzCardModule, + FormsModule, + NzFormModule, + SharedModule + ], declarations: [ProjectListComponent, OperateProjectFormComponent], exports: [ProjectListComponent] }) diff --git a/src/workbench/browser/src/app/pages/workspace/components/project-list/project-list.service.ts b/src/workbench/browser/src/app/pages/workspace/components/project-list/project-list.service.ts new file mode 100644 index 000000000..1ddc915b3 --- /dev/null +++ b/src/workbench/browser/src/app/pages/workspace/components/project-list/project-list.service.ts @@ -0,0 +1,68 @@ +import { Injectable } from '@angular/core'; +import { Router } from '@angular/router'; +import { TraceService } from 'eo/workbench/browser/src/app/shared/services/trace.service'; + +import { SettingService } from '../../../../modules/system-setting/settings.service'; +import { ModalService } from '../../../../shared/services/modal.service'; +import { EffectService } from '../../../../shared/store/effect.service'; +import { StoreService } from '../../../../shared/store/state.service'; +import { OperateProjectFormComponent } from '../../project/components/operate-project-form.compoent'; +type ListType = 'list' | 'card'; +@Injectable({ + providedIn: 'root' +}) +export class ProjectListService { + listType: ListType; + initLoading = true; + constructor( + private setting: SettingService, + private modalService: ModalService, + private store: StoreService, + private effect: EffectService, + private router: Router, + private trace: TraceService + ) { + this.listType = this.setting.get('workbench.list.type') || 'list'; + } + setListType(type: ListType) { + this.listType = type; + this.setting.set('workbench.list.type', type); + } + async getProjectList() { + this.initLoading = true; + this.store.setProjectList([]); + const [data]: any = await this.effect.updateProjects(this.store.getCurrentWorkspaceUuid); + this.initLoading = false; + return data; + } + createProject() { + const model = { + name: '' + }; + const modal = this.modalService.create({ + nzTitle: $localize`New Project`, + nzContent: OperateProjectFormComponent, + nzComponentParams: { + model + }, + nzOnOk: async () => { + if (!model.name) { + return; + } + await this.effect.createProject([model]); + const workspace_type = this.store.isLocal ? 'local' : 'cloud'; + this.trace.report('add_project_success', { workspace_type }); + + // * update project list + this.getProjectList(); + + //* jump to project list + const path = '/home/workspace/overview/projects'; + if (this.router.url !== path) { + this.router.navigate([path]); + } + modal.destroy(); + } + }); + } +} diff --git a/src/workbench/browser/src/app/pages/workspace/overview/workspace-overview.component.html b/src/workbench/browser/src/app/pages/workspace/overview/workspace-overview.component.html index 9675da884..7ed4f69c2 100644 --- a/src/workbench/browser/src/app/pages/workspace/overview/workspace-overview.component.html +++ b/src/workbench/browser/src/app/pages/workspace/overview/workspace-overview.component.html @@ -4,54 +4,47 @@ {{ title }}
- -
- - - + + + Project - -
- - -

Currently using local workspace, unable to invite members.

-

You canand invite members to collaborate.

- -
+ + Members - - + + + Setting
- -
+
diff --git a/src/workbench/browser/src/app/pages/workspace/overview/workspace-overview.component.scss b/src/workbench/browser/src/app/pages/workspace/overview/workspace-overview.component.scss index 3b4ac737a..9e8c78016 100644 --- a/src/workbench/browser/src/app/pages/workspace/overview/workspace-overview.component.scss +++ b/src/workbench/browser/src/app/pages/workspace/overview/workspace-overview.component.scss @@ -1,18 +1,18 @@ :host ::ng-deep { - .ant-tabs-tabpane { + eo-workspace-member, + eo-workspace-setting, + eo-project-list { + height: calc(var(--body-height) - 127px) !important; padding-top: 15px; + display: block; + overflow: auto; } - .half-part-container { + eo-workspace-member, + eo-workspace-setting { width: 50%; - display: block; margin: 0 auto; } - - .ant-tabs-content { - height: calc(var(--body-height) - 127px); - overflow: auto; - } } .list-type-switcher { diff --git a/src/workbench/browser/src/app/pages/workspace/overview/workspace-overview.component.ts b/src/workbench/browser/src/app/pages/workspace/overview/workspace-overview.component.ts index 1b197156a..fbba132dd 100644 --- a/src/workbench/browser/src/app/pages/workspace/overview/workspace-overview.component.ts +++ b/src/workbench/browser/src/app/pages/workspace/overview/workspace-overview.component.ts @@ -1,11 +1,12 @@ -import { Component, OnInit, ViewChild } from '@angular/core'; -import { EoNgFeedbackMessageService } from 'eo-ng-feedback'; +import { Component, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; +import { MessageService } from 'eo/workbench/browser/src/app/shared/services/message'; +import { waitNextTick } from 'eo/workbench/browser/src/app/utils/index.utils'; import { autorun, reaction } from 'mobx'; import { FeatureControlService } from '../../../core/services/feature-control/feature-control.service'; -import { MessageService } from '../../../shared/services/message'; import { StoreService } from '../../../shared/store/state.service'; -import { ProjectListComponent } from '../components/project-list/project-list.component'; +import { ProjectListService } from '../components/project-list/project-list.service'; @Component({ selector: 'eo-workspace-overview', @@ -13,29 +14,28 @@ import { ProjectListComponent } from '../components/project-list/project-list.co styleUrls: ['./workspace-overview.component.scss'] }) export class WorkspaceOverviewComponent implements OnInit { - @ViewChild('eoProjectList') eoProjectList: ProjectListComponent; title = 'Workspaces'; nzSelectedIndex = 0; - isOwner = false; + isOwner = true; constructor( - private nzMessage: EoNgFeedbackMessageService, - private message: MessageService, + public projectList: ProjectListService, public store: StoreService, - public feature: FeatureControlService + private router: Router, + public feature: FeatureControlService, + private message: MessageService ) {} - invite() { - if (this.nzSelectedIndex) { - this.nzMessage.warning($localize`You has already selected members tab, you can operate now.`); + async invite() { + if (this.nzSelectedIndex !== 1) { + this.router.navigate(['/home/workspace/overview/member']); } - this.nzSelectedIndex = 1; + await waitNextTick(); + this.message.send({ type: 'addWorkspaceMember', data: {} }); } ngOnInit(): void { - autorun(() => { + autorun(async () => { + await waitNextTick(); this.title = this.store.getCurrentWorkspace?.title; - this.isOwner = this.store.getWorkspaceRole.some(it => ['Workspace Owner'].includes(it.name)); + this.isOwner = this.store?.getWorkspaceRole?.some(it => ['Workspace Owner'].includes(it.name)); }); } - createWorkspace() { - this.message.send({ type: 'addWorkspace', data: {} }); - } } diff --git a/src/workbench/browser/src/app/pages/workspace/overview/workspace-overview.module.ts b/src/workbench/browser/src/app/pages/workspace/overview/workspace-overview.module.ts index de8893c2e..beae74ec5 100644 --- a/src/workbench/browser/src/app/pages/workspace/overview/workspace-overview.module.ts +++ b/src/workbench/browser/src/app/pages/workspace/overview/workspace-overview.module.ts @@ -11,13 +11,13 @@ import { WorkspaceSettingComponent } from '../components/edit/workspace-edit.com import { WorkspaceMemberComponent } from '../components/member/workspace-member.component'; import { WorkspaceMemberService } from '../components/member/workspace-member.service'; import { ProjectListModule } from '../components/project-list/project-list.module'; +import { ProjectListService } from '../components/project-list/project-list.service'; import { WorkspaceOverviewComponent } from './workspace-overview.component'; @NgModule({ declarations: [WorkspaceOverviewComponent, WorkspaceMemberComponent, WorkspaceSettingComponent], imports: [ CommonModule, - ProjectListModule, MemberListModule, SharedModule, EoNgTabsModule, @@ -25,7 +25,26 @@ import { WorkspaceOverviewComponent } from './workspace-overview.component'; RouterModule.forChild([ { path: '', - component: WorkspaceOverviewComponent + component: WorkspaceOverviewComponent, + children: [ + { + path: '', + redirectTo: 'projects', + pathMatch: 'full' + }, + { + path: 'projects', + loadChildren: () => import('../components/project-list/project-list.module').then(m => m.ProjectListModule) + }, + { + path: 'member', + component: WorkspaceMemberComponent + }, + { + path: 'setting', + component: WorkspaceSettingComponent + } + ] } ]) ], diff --git a/src/workbench/browser/src/app/pages/workspace/project/api/api.component.html b/src/workbench/browser/src/app/pages/workspace/project/api/api.component.html index eecf69f8c..5f80966a2 100644 --- a/src/workbench/browser/src/app/pages/workspace/project/api/api.component.html +++ b/src/workbench/browser/src/app/pages/workspace/project/api/api.component.html @@ -63,6 +63,7 @@ (beforeClose)="apiTab.beforeTabClose($event)" [addDropDown]="newTabTemplate" [titleLabel]="titleLabel" + (nzAdd)="apiTabComponent.newTab()" #apiTabComponent > diff --git a/src/workbench/browser/src/app/pages/workspace/project/api/api.component.ts b/src/workbench/browser/src/app/pages/workspace/project/api/api.component.ts index d7b69c701..16df8b2cb 100644 --- a/src/workbench/browser/src/app/pages/workspace/project/api/api.component.ts +++ b/src/workbench/browser/src/app/pages/workspace/project/api/api.component.ts @@ -4,6 +4,7 @@ import { WebService } from 'eo/workbench/browser/src/app/core/services'; import { EoTabComponent } from 'eo/workbench/browser/src/app/modules/eo-ui/tab/tab.component'; import { ExtensionService } from 'eo/workbench/browser/src/app/shared/services/extensions/extension.service'; import { ApiData } from 'eo/workbench/browser/src/app/shared/services/storage/index.model'; +import { TraceService } from 'eo/workbench/browser/src/app/shared/services/trace.service'; import { StoreService } from 'eo/workbench/browser/src/app/shared/store/state.service'; import { NzResizeEvent } from 'ng-zorro-antd/resizable'; import { filter, Subject, takeUntil } from 'rxjs'; @@ -89,7 +90,8 @@ export class ApiComponent implements OnInit, OnDestroy { public web: WebService, private messageService: MessageService, private extensionService: ExtensionService, - public store: StoreService + public store: StoreService, + private trace: TraceService ) { this.initExtensionExtra(); this.watchInstalledExtensionsChange(); @@ -183,6 +185,7 @@ export class ApiComponent implements OnInit, OnDestroy { onResizeEnd() { this.isDragging = false; + this.trace.report('drag_group_sider_width', { group_sider_width: this.siderWidth }); } toggleRightBar(operate: 'open' | 'close') { if (operate === 'open') { diff --git a/src/workbench/browser/src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.html b/src/workbench/browser/src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.html index cdac9e26b..8eaa040e8 100644 --- a/src/workbench/browser/src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.html +++ b/src/workbench/browser/src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.html @@ -13,6 +13,8 @@ eo-ng-dropdown [nzDropdownMenu]="menu" nzPlacement="bottomRight" + trace + traceID="open_edit_api_document" (click)="addAPI()" > @@ -27,7 +29,7 @@
  • -
  • Import API
  • +
  • Import API
  • diff --git a/src/workbench/browser/src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts b/src/workbench/browser/src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts index 264fc04c3..006101495 100644 --- a/src/workbench/browser/src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts +++ b/src/workbench/browser/src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts @@ -7,6 +7,7 @@ import { ApiTabService } from 'eo/workbench/browser/src/app/pages/workspace/proj import { ApiGroupEditComponent } from 'eo/workbench/browser/src/app/pages/workspace/project/api/components/group/edit/api-group-edit.component'; import { ModalService } from 'eo/workbench/browser/src/app/shared/services/modal.service'; import { GroupCreateDto, GroupUpdateDto } from 'eo/workbench/browser/src/app/shared/services/storage/db/dto/group.dto'; +import { TraceService } from 'eo/workbench/browser/src/app/shared/services/trace.service'; import { StoreService } from 'eo/workbench/browser/src/app/shared/store/state.service'; import { eoDeepCopy, waitNextTick } from 'eo/workbench/browser/src/app/utils/index.utils'; import { getExpandGroupByKey } from 'eo/workbench/browser/src/app/utils/tree/tree.utils'; @@ -82,6 +83,7 @@ export class ApiGroupTreeComponent implements OnInit { private router: Router, private route: ActivatedRoute, private tab: ApiTabService, + private trace: TraceService, private message: EoNgFeedbackMessageService ) {} @@ -220,6 +222,10 @@ export class ApiGroupTreeComponent implements OnInit { return resolve(true); } this.message.success($localize`${title} successfully`); + // * For trace + const sync_platform = modal.componentInstance.currentExtension; + const workspace_type = this.globalStore.isLocal ? 'local' : 'remote'; + this.trace.report('import_project_success', { sync_platform, workspace_type }); modal.destroy(); return resolve(true); }); diff --git a/src/workbench/browser/src/app/pages/workspace/project/api/components/history/eo-history.component.html b/src/workbench/browser/src/app/pages/workspace/project/api/components/history/eo-history.component.html index 8047ee234..d859d8673 100644 --- a/src/workbench/browser/src/app/pages/workspace/project/api/components/history/eo-history.component.html +++ b/src/workbench/browser/src/app/pages/workspace/project/api/components/history/eo-history.component.html @@ -28,6 +28,8 @@ [nzData]="getTestHistory" [nzSelectedKeys]="nzSelectedKeys" nzBlockNode + trace + traceID="click_api_test_history" (nzClick)="gotoTestHistory($event)" [nzTreeTemplate]="nzFixedTreeTemplate" class="overflow-auto pt-[10px]" diff --git a/src/workbench/browser/src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts b/src/workbench/browser/src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts index 1f1de0404..ffb0ecd41 100644 --- a/src/workbench/browser/src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts +++ b/src/workbench/browser/src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts @@ -4,6 +4,7 @@ import { ActivatedRoute, Router } from '@angular/router'; import { EoNgFeedbackMessageService } from 'eo-ng-feedback'; import { TabViewComponent } from 'eo/workbench/browser/src/app/modules/eo-ui/tab/tab.model'; import { ApiService } from 'eo/workbench/browser/src/app/shared/services/storage/api.service'; +import { TraceService } from 'eo/workbench/browser/src/app/shared/services/trace.service'; import { StoreService } from 'eo/workbench/browser/src/app/shared/store/state.service'; import { fromEvent, Subject, takeUntil } from 'rxjs'; @@ -56,7 +57,8 @@ export class EnvEditComponent implements OnDestroy, TabViewComponent { private fb: FormBuilder, private message: EoNgFeedbackMessageService, private route: ActivatedRoute, - private router: Router + private router: Router, + private trace: TraceService ) { this.initShortcutKey(); this.initForm(); @@ -70,7 +72,7 @@ export class EnvEditComponent implements OnDestroy, TabViewComponent { if ([ctrlKey, metaKey].includes(true) && code === 'KeyS') { // 或者 return false; event.preventDefault(); - this.saveEnv(); + this.saveEnv('shortcut'); } }); } @@ -85,8 +87,31 @@ export class EnvEditComponent implements OnDestroy, TabViewComponent { } return true; } - async saveEnv() { - const uuid = Number(this.route.snapshot.queryParams.uuid); + private async createEnv(form, ux = 'ui') { + const [data, err] = await this.effect.addEnv(form); + if (err) { + this.message.error(err.code == 131000001 ? $localize`Environment name length needs to be less than 32` : $localize`Failed to add`); + return; + } + this.trace.report('add_environment_success', { trigger_way: ux }); + this.message.success($localize`Added successfully`); + // * Would not refresh page + this.router.navigate(['home/workspace/project/api/env/edit'], { + queryParams: { pageID: this.route.snapshot.queryParams.pageID, uuid: data.id } + }); + return data; + } + private async editEnv(form) { + const [data, err] = await this.effect.updateEnv(form); + if (err) { + this.message.error(err.code == 131000001 ? $localize`Environment name length needs to be less than 32` : $localize`Failed to edit`); + return; + } + this.message.success($localize`Edited successfully`); + return data; + } + async saveEnv(ux = 'ui') { + const isEdit = !!this.route.snapshot.queryParams.uuid; if (!this.checkForm()) { return; } @@ -94,39 +119,9 @@ export class EnvEditComponent implements OnDestroy, TabViewComponent { const formdata = this.formatEnvData(this.model); this.initialModel = eoDeepCopy(formdata); formdata.parameters = JSON.stringify(formdata.parameters); - const operateMUI = { - edit: { - params: [formdata, uuid], - success: $localize`Edited successfully`, - error: $localize`Failed to edit` - }, - add: { - params: [formdata], - success: $localize`Added successfully`, - error: $localize`Failed to add` - } - }; - const operateName = uuid ? 'edit' : 'add'; - const operate = operateMUI[operateName]; - const [data, err] = await this.effect[operateName === 'edit' ? 'updateEnv' : 'addEnv'](formdata); + const data = isEdit ? await this.editEnv(formdata) : await this.createEnv(formdata, ux); this.isSaving = false; - if (err) { - if (err.code == 131000001) { - this.message.error($localize`Environment name length needs to be less than 32`); - return; - } - this.message.error(operate.error); - return; - } - if (data) { - this.message.success(operate.success); - if (operateName === 'add') { - this.router.navigate(['home/workspace/project/api/env/edit'], { - queryParams: { pageID: this.route.snapshot.queryParams.pageID, uuid: data.id } - }); - } - this.afterSaved.emit(this.initialModel); - } + this.afterSaved.emit(this.initialModel); if (!this.store.getEnvUuid) { this.store.setEnvUuid(data.id || formdata.id); } diff --git a/src/workbench/browser/src/app/pages/workspace/project/api/env/env-list/env-list.component.html b/src/workbench/browser/src/app/pages/workspace/project/api/env/env-list/env-list.component.html index a4d76584c..c5787646f 100644 --- a/src/workbench/browser/src/app/pages/workspace/project/api/env/env-list/env-list.component.html +++ b/src/workbench/browser/src/app/pages/workspace/project/api/env/env-list/env-list.component.html @@ -2,7 +2,7 @@
    Environment
    -
    diff --git a/src/workbench/browser/src/app/pages/workspace/project/api/env/env-select/env-select.component.scss b/src/workbench/browser/src/app/pages/workspace/project/api/env/env-select/env-select.component.scss index 0e57476c8..11ae3286d 100644 --- a/src/workbench/browser/src/app/pages/workspace/project/api/env/env-select/env-select.component.scss +++ b/src/workbench/browser/src/app/pages/workspace/project/api/env/env-select/env-select.component.scss @@ -8,22 +8,14 @@ nz-divider { margin: 0.1em 0; } -:lang(zh) { - .ant-select { - width: 132px; - } -} - -:lang(en) { - .ant-select { - width: 162px; - } -} - :host ::ng-deep { eo-ng-select eo-ng-select-top-control { border: none !important; } + + .ant-select { + width: 140px; + } } .content { diff --git a/src/workbench/browser/src/app/pages/workspace/project/api/env/env-select/env-select.component.ts b/src/workbench/browser/src/app/pages/workspace/project/api/env/env-select/env-select.component.ts index 3f933edbe..308304db2 100644 --- a/src/workbench/browser/src/app/pages/workspace/project/api/env/env-select/env-select.component.ts +++ b/src/workbench/browser/src/app/pages/workspace/project/api/env/env-select/env-select.component.ts @@ -2,8 +2,9 @@ import { Component, OnInit } from '@angular/core'; import { SidebarService } from 'eo/workbench/browser/src/app/layouts/sidebar/sidebar.service'; import { ApiTestUtilService } from 'eo/workbench/browser/src/app/pages/workspace/project/api/service/api-test-util.service'; import { Environment } from 'eo/workbench/browser/src/app/shared/services/storage/db/models'; +import { TraceService } from 'eo/workbench/browser/src/app/shared/services/trace.service'; import { StoreService } from 'eo/workbench/browser/src/app/shared/store/state.service'; -import { autorun, makeObservable, observable, reaction, toJS } from 'mobx'; +import { autorun, makeObservable, observable, reaction, action, toJS } from 'mobx'; import { ApiEffectService } from '../../service/store/api-effect.service'; import { ApiStoreService } from '../../service/store/api-state.service'; @@ -49,11 +50,13 @@ import { ApiStoreService } from '../../service/store/api-state.service'; {{ renderEnv.hostUri }}
    - Environment Global variable -
    - Name - Value -
    + + Environment Global variable +
    + Name + Value +
    +
    {{ it.name }} {{ it.value }} @@ -99,7 +102,8 @@ export class EnvSelectComponent implements OnInit { public globalStore: StoreService, private sidebar: SidebarService, private effect: ApiEffectService, - private testUtils: ApiTestUtilService + private testUtils: ApiTestUtilService, + private trace: TraceService ) {} onVisibleChange($event) { if ($event) { @@ -110,10 +114,14 @@ export class EnvSelectComponent implements OnInit { makeObservable(this); this.effect.updateEnvList(); - autorun(() => { - this.renderEnvList = this.store.getEnvList.map(it => ({ label: it.name, value: it.id })); - this.setCurrentEnv(); - }); + reaction( + () => this.store.getEnvList, + list => { + this.renderEnvList = list.map(it => ({ label: it.name, value: it.id })); + this.setCurrentEnv(); + } + ); + /** * Change Select env id */ @@ -121,9 +129,10 @@ export class EnvSelectComponent implements OnInit { () => this.envUuid, data => { this.store.setEnvUuid(data); + data && this.trace.report('select_environment'); } ); - this.envUuid = this.store.getEnvUuid; + this.setEnvUuid(this.store.getEnvUuid); /** * Set current selected environment by id @@ -135,13 +144,17 @@ export class EnvSelectComponent implements OnInit { * From outside change env uuid * Such as add enviroment */ - this.envUuid = this.store.getEnvUuid; + this.setEnvUuid(data); this.setCurrentEnv(); } ); } + @action setEnvUuid(uuid) { + this.envUuid = uuid; + } + setCurrentEnv() { - this.renderEnv = this.store.getEnvList.find((it: any) => it.id === this.store.getEnvUuid); + this.renderEnv = toJS(this.store.getEnvList.find((it: any) => it.id === this.store.getEnvUuid)); if (!this.renderEnv) return; this.renderEnv.parameters = this.renderEnv.parameters.filter(item => item.name || item.value); } diff --git a/src/workbench/browser/src/app/pages/workspace/project/api/http/detail/api-detail.component.html b/src/workbench/browser/src/app/pages/workspace/project/api/http/detail/api-detail.component.html index 04cfe8f44..c9d19e70f 100644 --- a/src/workbench/browser/src/app/pages/workspace/project/api/http/detail/api-detail.component.html +++ b/src/workbench/browser/src/app/pages/workspace/project/api/http/detail/api-detail.component.html @@ -7,7 +7,7 @@
    - {{ model.uri }} + {{ url }} +
    - +
    diff --git a/src/workbench/browser/src/app/pages/workspace/project/api/http/mock/api-mock.component.ts b/src/workbench/browser/src/app/pages/workspace/project/api/http/mock/api-mock.component.ts index c4b9d6c74..0d9092073 100644 --- a/src/workbench/browser/src/app/pages/workspace/project/api/http/mock/api-mock.component.ts +++ b/src/workbench/browser/src/app/pages/workspace/project/api/http/mock/api-mock.component.ts @@ -9,6 +9,8 @@ import { ApiMockEditComponent } from 'eo/workbench/browser/src/app/pages/workspa import { PROTOCOL } from 'eo/workbench/browser/src/app/shared/constants/protocol'; import { ModalService } from 'eo/workbench/browser/src/app/shared/services/modal.service'; import { ApiData } from 'eo/workbench/browser/src/app/shared/services/storage/db/models/apiData'; +import { TraceService } from 'eo/workbench/browser/src/app/shared/services/trace.service'; +import { StoreService } from 'eo/workbench/browser/src/app/shared/store/state.service'; @Component({ selector: 'eo-api-mock', @@ -41,7 +43,9 @@ export class ApiMockComponent implements OnInit, TabViewComponent { public web: WebService, private apiMock: ApiMockService, private modal: ModalService, - private api: ProjectApiService + private api: ProjectApiService, + private store: StoreService, + private trace: TraceService ) { this.apiUuid = this.route.snapshot.queryParams.uuid; } @@ -72,6 +76,8 @@ export class ApiMockComponent implements OnInit, TabViewComponent { }, nzOnOk: async () => { await this.mockTable.addOrEditModal(modal.componentInstance.model); + const workspace_type = this.store.isLocal ? 'local' : 'cloud'; + this.trace.report('add_mock_success', { workspace_type }); modal.destroy(); } }); diff --git a/src/workbench/browser/src/app/pages/workspace/project/api/http/test/api-test.component.html b/src/workbench/browser/src/app/pages/workspace/project/api/http/test/api-test.component.html index 2c6f1f8d8..e3ce76e40 100644 --- a/src/workbench/browser/src/app/pages/workspace/project/api/http/test/api-test.component.html +++ b/src/workbench/browser/src/app/pages/workspace/project/api/http/test/api-test.component.html @@ -39,7 +39,18 @@ Abort {{ waitSeconds }} - + @@ -144,6 +155,7 @@ [style.height.px]="responseContainerHeight" [style.--bottom-height]="responseContainerHeight - 15 + 'px'" (nzResize)="onResize($event)" + (nzResizeEnd)="onResizeEnd()" > diff --git a/src/workbench/browser/src/app/pages/workspace/project/api/http/test/api-test.component.ts b/src/workbench/browser/src/app/pages/workspace/project/api/http/test/api-test.component.ts index 3d58be628..3bf322fa0 100644 --- a/src/workbench/browser/src/app/pages/workspace/project/api/http/test/api-test.component.ts +++ b/src/workbench/browser/src/app/pages/workspace/project/api/http/test/api-test.component.ts @@ -29,6 +29,7 @@ import { } from 'eo/workbench/browser/src/app/pages/workspace/project/api/service/test-server/test-server.model'; import { generateRestFromUrl, syncUrlAndQuery } from 'eo/workbench/browser/src/app/pages/workspace/project/api/utils/api.utils'; import { ApiData, ApiTestHistory } from 'eo/workbench/browser/src/app/shared/services/storage/db/models'; +import { TraceService } from 'eo/workbench/browser/src/app/shared/services/trace.service'; import { StoreService } from 'eo/workbench/browser/src/app/shared/store/state.service'; import StorageUtil from 'eo/workbench/browser/src/app/utils/storage/storage.utils'; import { isEmpty } from 'lodash-es'; @@ -138,13 +139,15 @@ export class ApiTestComponent implements OnInit, AfterViewInit, OnDestroy, TabVi private projectApi: ProjectApiService, private lang: LanguageService, private elementRef: ElementRef, - private apiEdit: ApiEditUtilService + private apiEdit: ApiEditUtilService, + private trace: TraceService ) { this.initBasicForm(); this.testServer.init(message => { this.receiveMessage(message); }); this.status$.pipe(distinctUntilChanged(), takeUntil(this.destroy$)).subscribe(status => { + console.log('this.status$', status); this.changeStatus(status); }); } @@ -219,6 +222,7 @@ export class ApiTestComponent implements OnInit, AfterViewInit, OnDestroy, TabVi return; } this.test(); + this.trace.report('click_api_test'); } /** * Save api test data to api @@ -399,8 +403,11 @@ export class ApiTestComponent implements OnInit, AfterViewInit, OnDestroy, TabVi } this.timer$ = interval(1000) .pipe( - takeWhile(() => this.waitSeconds < this.MAX_TEST_SECONDS), - finalize(() => this.changeStatus('tested')) + takeWhile(() => { + if (this.waitSeconds < this.MAX_TEST_SECONDS) return true; + this.status$.next('tested'); + return false; + }) ) .subscribe(() => this.waitSeconds++); } @@ -408,6 +415,10 @@ export class ApiTestComponent implements OnInit, AfterViewInit, OnDestroy, TabVi this.apiTestResultResponseComponent.downloadResponseText(); } + onResizeEnd() { + this.trace.report('drag_test_response_height', { test_response_height: this.responseContainerHeight }); + } + onResize({ height }: NzResizeEvent): void { this.responseContainerHeight = height; localStorage.setItem(API_TEST_DRAG_TOP_HEIGHT_KEY, String(height)); @@ -431,6 +442,7 @@ export class ApiTestComponent implements OnInit, AfterViewInit, OnDestroy, TabVi this.waitSeconds = 0; this.model.responseTabIndex = 0; this.ref.detectChanges(); + this.trace.report('api_test_finish'); // 测试完自动帮用户将返回高度调到 40% const height = this.elementRef.nativeElement.parentElement.offsetHeight * 0.5; if (this.responseContainerHeight < height) { diff --git a/src/workbench/browser/src/app/pages/workspace/project/api/http/test/body/api-test-body.component.html b/src/workbench/browser/src/app/pages/workspace/project/api/http/test/body/api-test-body.component.html index fb5924ffc..11bc86d40 100644 --- a/src/workbench/browser/src/app/pages/workspace/project/api/http/test/body/api-test-body.component.html +++ b/src/workbench/browser/src/app/pages/workspace/project/api/http/test/body/api-test-body.component.html @@ -37,7 +37,8 @@
    - {{ item.files?.length ? item.files?.length + ' files selected' : 'No file chosen' }} + {{ item.files?.length }} files selected + No file chosen
    diff --git a/src/workbench/browser/src/app/pages/workspace/project/api/http/test/body/api-test-body.component.ts b/src/workbench/browser/src/app/pages/workspace/project/api/http/test/body/api-test-body.component.ts index cadc7d99b..6fa10d2d9 100644 --- a/src/workbench/browser/src/app/pages/workspace/project/api/http/test/body/api-test-body.component.ts +++ b/src/workbench/browser/src/app/pages/workspace/project/api/http/test/body/api-test-body.component.ts @@ -214,7 +214,8 @@ export class ApiTestBodyComponent implements OnInit, OnChanges, OnDestroy { } private initListConf() { const config = this.apiTable.initTestTable({ - in: 'body' + in: 'body', + id: 'api_test_body' }); this.listConf.columns = config.columns; this.listConf.setting = config.setting; diff --git a/src/workbench/browser/src/app/pages/workspace/project/api/service/api-test-util.service.ts b/src/workbench/browser/src/app/pages/workspace/project/api/service/api-test-util.service.ts index 9b0f68495..c1d3dcaa4 100644 --- a/src/workbench/browser/src/app/pages/workspace/project/api/service/api-test-util.service.ts +++ b/src/workbench/browser/src/app/pages/workspace/project/api/service/api-test-util.service.ts @@ -162,7 +162,12 @@ export class ApiTestUtilService { const result = this.apiEditUtil.formatStorageApiDataToUI(inData); //handle query and url - const tmpResult = syncUrlAndQuery(result.uri, result.requestParams.queryParams); + const tmpResult = syncUrlAndQuery(result.uri, result.requestParams.queryParams, { + method: 'replace', + //* Query Priority is higher than url + nowOperate: 'query' + }); + console.log(tmpResult); result.uri = tmpResult.url; result.requestParams.queryParams = tmpResult.query; diff --git a/src/workbench/browser/src/app/pages/workspace/project/api/service/store/api-effect.service.ts b/src/workbench/browser/src/app/pages/workspace/project/api/service/store/api-effect.service.ts index da44a4bfa..3bb9ea37e 100644 --- a/src/workbench/browser/src/app/pages/workspace/project/api/service/store/api-effect.service.ts +++ b/src/workbench/browser/src/app/pages/workspace/project/api/service/store/api-effect.service.ts @@ -69,6 +69,10 @@ export class ApiEffectService { if (gErr) { return; } + if (!groupList?.length) { + pcConsole.error(`Can't get root group,groupList is empty`); + return; + } const rootGroup = groupList.at(0); rootGroup.name = $localize`Root Group`; this.store.setRootGroup(rootGroup); diff --git a/src/workbench/browser/src/app/pages/workspace/project/api/websocket/websocket.component.html b/src/workbench/browser/src/app/pages/workspace/project/api/websocket/websocket.component.html index 7296397df..8179fc426 100644 --- a/src/workbench/browser/src/app/pages/workspace/project/api/websocket/websocket.component.html +++ b/src/workbench/browser/src/app/pages/workspace/project/api/websocket/websocket.component.html @@ -22,6 +22,8 @@ *ngIf="wsStatus === 'disconnect'" eo-ng-button nzType="primary" + trace + traceID="click_api_test" i18n (click)="handleConnect('connecting')" > @@ -34,6 +36,8 @@ eo-ng-button nzDanger i18n + trace + traceID="api_test_finish" nzType="default" (click)="handleConnect('disconnect')" > diff --git a/src/workbench/browser/src/app/pages/workspace/project/member/project-member.component.ts b/src/workbench/browser/src/app/pages/workspace/project/member/project-member.component.ts index 239d36402..40f4d0f72 100644 --- a/src/workbench/browser/src/app/pages/workspace/project/member/project-member.component.ts +++ b/src/workbench/browser/src/app/pages/workspace/project/member/project-member.component.ts @@ -4,6 +4,7 @@ import { MemberService } from 'eo/workbench/browser/src/app/modules/member-list/ import { DataSourceService } from 'eo/workbench/browser/src/app/shared/services/data-source/data-source.service'; import { MessageService } from 'eo/workbench/browser/src/app/shared/services/message/message.service'; import { ApiService } from 'eo/workbench/browser/src/app/shared/services/storage/api.service'; +import { TraceService } from 'eo/workbench/browser/src/app/shared/services/trace.service'; import { StoreService } from 'eo/workbench/browser/src/app/shared/store/state.service'; import { observable, makeObservable, computed, reaction } from 'mobx'; import { NzModalService } from 'ng-zorro-antd/modal'; @@ -37,7 +38,7 @@ import { MemberListComponent } from '../../../../modules/member-list/member-list
    --> - +
    {{ option.username }} {{ option.email }} @@ -53,6 +54,8 @@ import { MemberListComponent } from '../../../../modules/member-list/member-list nzBlock (click)="btn0r9zcbCallback()" [disabled]="btnguixdgStatus()" + trace + traceID="click_project_add_member" i18n > Add @@ -103,7 +106,8 @@ export class ProjectMemberComponent implements OnInit { public api: ApiService, public eMessage: EoNgFeedbackMessageService, public dataSource: DataSourceService, - private member: MemberService + private member: MemberService, + private trace: TraceService ) { this.isInvateModalVisible = false; this.isSelectBtnLoading = false; @@ -158,6 +162,7 @@ export class ProjectMemberComponent implements OnInit { this.eMessage.error($localize`Add member failed`); return; } + this.trace.report('project_add_member_success'); this.eMessage.success($localize`Add member successfully`); // * 关闭弹窗 diff --git a/src/workbench/browser/src/app/pages/workspace/project/setting/project-setting.component.html b/src/workbench/browser/src/app/pages/workspace/project/setting/project-setting.component.html index 994d184d4..e10ee7c09 100644 --- a/src/workbench/browser/src/app/pages/workspace/project/setting/project-setting.component.html +++ b/src/workbench/browser/src/app/pages/workspace/project/setting/project-setting.component.html @@ -3,7 +3,7 @@
    Project Name - + @@ -19,9 +19,16 @@
    {{ item.title }} {{ item.desc }} - +
    diff --git a/src/workbench/browser/src/app/pages/workspace/project/setting/project-setting.component.ts b/src/workbench/browser/src/app/pages/workspace/project/setting/project-setting.component.ts index 722a409f5..55294dfa9 100644 --- a/src/workbench/browser/src/app/pages/workspace/project/setting/project-setting.component.ts +++ b/src/workbench/browser/src/app/pages/workspace/project/setting/project-setting.component.ts @@ -8,14 +8,12 @@ import { NzModalRef } from 'ng-zorro-antd/modal'; import { ExportApiComponent } from '../../../../modules/extension-select/export-api/export-api.component'; import { ImportApiComponent } from '../../../../modules/extension-select/import-api/import-api.component'; -import { SyncApiComponent } from '../../../../modules/extension-select/sync-api/sync-api.component'; +import { PushApiComponent } from '../../../../modules/extension-select/sync-api/sync-api.component'; import { ModalService } from '../../../../shared/services/modal.service'; import { ApiService } from '../../../../shared/services/storage/api.service'; -import { debug } from 'console'; - const actionComponent = { - push: SyncApiComponent, + push: PushApiComponent, import: ImportApiComponent, export: ExportApiComponent }; @@ -42,13 +40,15 @@ export class ProjectSettingComponent implements OnInit { title: $localize`Import`, icon: 'afferent', desc: $localize`Import data from other products`, - type: 'import' + type: 'import', + traceID: 'click_import_project' }, { title: $localize`Export`, icon: 'efferent', desc: $localize`Export Postcat project data`, - type: 'export' + type: 'export', + traceID: 'click_export_project' }, { title: $localize`Push`, @@ -92,7 +92,7 @@ export class ProjectSettingComponent implements OnInit { if (err) { return; } - this.router.navigate(['/home/workspace/overview']); + this.router.navigate(['/home/workspace/overview/projects']); this.effect.updateProjects(this.store.getCurrentWorkspaceUuid); modal.destroy(); } diff --git a/src/workbench/browser/src/app/shared/components/download-client.component.ts b/src/workbench/browser/src/app/shared/components/download-client.component.ts index 6838532e4..adff772a7 100644 --- a/src/workbench/browser/src/app/shared/components/download-client.component.ts +++ b/src/workbench/browser/src/app/shared/components/download-client.component.ts @@ -7,7 +7,7 @@ import { WebService } from 'eo/workbench/browser/src/app/core/services'; Don't have Postcat Client? - {{ item.name }} + {{ item.name }} ` }) diff --git a/src/workbench/browser/src/app/shared/models/extension-manager/module.ts b/src/workbench/browser/src/app/shared/models/extension-manager/module.ts index 8db410cdf..c6622e5c1 100644 --- a/src/workbench/browser/src/app/shared/models/extension-manager/module.ts +++ b/src/workbench/browser/src/app/shared/models/extension-manager/module.ts @@ -59,10 +59,14 @@ export interface ExtensionInfo { sidebarView: SidebarView; importAPI: FeatureInfo; exportAPI: FeatureInfo; - syncAPI: FeatureInfo; + pushAPI: FeatureInfo; theme: ThemeItems[]; //Random feature [index: string]: any; + /** + * @deprecated + */ + syncAPI: FeatureInfo; }; //*Field for browser generate by code,not actually in package.json diff --git a/src/workbench/browser/src/app/shared/services/storage/db/initData/apiData.ts b/src/workbench/browser/src/app/shared/services/storage/db/initData/apiData.ts index 5c497dc37..df66f02af 100644 --- a/src/workbench/browser/src/app/shared/services/storage/db/initData/apiData.ts +++ b/src/workbench/browser/src/app/shared/services/storage/db/initData/apiData.ts @@ -333,7 +333,7 @@ export const genSimpleApiData = ({ projectUuid, workSpaceUuid, groupId }) => { paramType: 0, partType: 3, dataType: 0, - isRequired: 0, + isRequired: 1, description: 'City Code : http://www.mca.gov.cn/article/sj/xzqh/2020/20201201.html', orderNo: 0, paramAttr: { diff --git a/src/workbench/browser/src/app/shared/services/trace.directive.ts b/src/workbench/browser/src/app/shared/services/trace.directive.ts new file mode 100644 index 000000000..1656d597a --- /dev/null +++ b/src/workbench/browser/src/app/shared/services/trace.directive.ts @@ -0,0 +1,30 @@ +import { Directive, HostListener, Input } from '@angular/core'; +import { TraceService } from 'eo/workbench/browser/src/app/shared/services/trace.service'; + +@Directive({ + selector: '[trace]' +}) +export class TraceDirective { + @Input() traceID: string; + @Input() traceParams: any = {}; + constructor(private trace: TraceService) {} + + @HostListener('click', ['$event']) + tClick(event) { + this.trace.report(this.traceID, this.traceParams); + } + + @HostListener('keydown') + tKeyDown() { + console.log('keydown'); + } + + @HostListener('focus', ['$event']) + onFocus(event) { + const tagName = event.target.tagName; + if (!['INPUT', 'SELECT', 'RADIO'].includes(tagName)) { + return; + } + this.trace.report(this.traceID, this.traceParams); + } +} diff --git a/src/workbench/browser/src/app/shared/services/trace.service.ts b/src/workbench/browser/src/app/shared/services/trace.service.ts new file mode 100644 index 000000000..cd79704d4 --- /dev/null +++ b/src/workbench/browser/src/app/shared/services/trace.service.ts @@ -0,0 +1,27 @@ +import { Injectable } from '@angular/core'; + +declare const gio; + +@Injectable({ + providedIn: 'root' +}) +export class TraceService { + constructor() {} + + report(eventId, params = {}) { + if (!eventId) { + return; + } + // console.log('trace =>>', eventId, JSON.stringify(params, null, 2)); + gio('track', eventId, params); + } + setUser(data = {}) { + gio('people.set', data); + } + start() { + gio('config', { dataCollect: false }); + } + stop() { + gio('config', { dataCollect: true }); + } +} diff --git a/src/workbench/browser/src/app/shared/shared.module.ts b/src/workbench/browser/src/app/shared/shared.module.ts index 4fdbf4630..b7aba4aa1 100644 --- a/src/workbench/browser/src/app/shared/shared.module.ts +++ b/src/workbench/browser/src/app/shared/shared.module.ts @@ -10,6 +10,7 @@ import { EoNgFeedbackAlertModule, EoNgFeedbackTooltipModule, EoNgFeedbackMessage import { EoNgInputModule } from 'eo-ng-input'; import { EoNgRadioModule } from 'eo-ng-radio'; import { EoNgSelectModule } from 'eo-ng-select'; +import { TraceDirective } from 'eo/workbench/browser/src/app/shared/services/trace.directive'; import { NzDividerModule } from 'ng-zorro-antd/divider'; import { NzEmptyModule } from 'ng-zorro-antd/empty'; import { NzFormModule } from 'ng-zorro-antd/form'; @@ -27,7 +28,8 @@ import { ExtensionAppComponent } from './components/extension-app/extension-app. import { ClickStopPropagationDirective, FormFocusDirective } from './directives'; const COMPONENTS = [DownloadClientModalComponent, ExtensionAppComponent]; -const DIRECTIVES = [ClickStopPropagationDirective, FormFocusDirective]; +const DIRECTIVES = [ClickStopPropagationDirective, FormFocusDirective, TraceDirective]; + const SHARED_UI_MODULE = [ NzFormModule, EoNgButtonModule, diff --git a/src/workbench/browser/src/app/shared/store/effect.service.ts b/src/workbench/browser/src/app/shared/store/effect.service.ts index 52fa24d22..d28fc6894 100644 --- a/src/workbench/browser/src/app/shared/store/effect.service.ts +++ b/src/workbench/browser/src/app/shared/store/effect.service.ts @@ -39,7 +39,7 @@ export class EffectService { //User first use postcat,select localwork space if (isUserFirstUse) { - this.switchWorkspace(this.store.getLocalWorkspace.workSpaceUuid); + this.pureSwitchWorkspace(this.store.getLocalWorkspace.workSpaceUuid); } //TODO perf const initWorkspaceInfo = async () => { @@ -88,7 +88,7 @@ export class EffectService { return; } if (this.store.getProjectList.length === 0) { - this.router.navigate(['/home/workspace/overview']); + this.router.navigate(['/home/workspace/overview/projects']); } // * Fixed projectID const { pid } = this.route.snapshot.queryParams; @@ -132,19 +132,20 @@ export class EffectService { })) .concat(apiDataFilters); } - async switchWorkspace(workspaceID: string) { + async pureSwitchWorkspace(workspaceID: string) { const workspace = this.store.getWorkspaceList.find(it => it.workSpaceUuid === workspaceID) || this.store.getLocalWorkspace; this.store.setCurrentWorkspace(workspace); - - // * real set workspace - await this.router.navigate(['**']); - this.router.navigate(['/home/workspace/overview']); // * update title document.title = this.store.getCurrentWorkspace?.title ? `Postcat - ${this.store.getCurrentWorkspace?.title}` : 'Postcat'; - // * update workspace role await this.updateWorkspacePermission(); } + async switchWorkspace(workspaceID: string) { + this.pureSwitchWorkspace(workspaceID); + // * real set workspace + await this.router.navigate(['**']); + this.router.navigate(['/home/workspace/overview/projects']); + } async updateWorkspacePermission() { // * local workspace no need to set permission if (this.store.isLocal) { @@ -178,13 +179,14 @@ export class EffectService { async switchProject(pid) { if (!pid) { - this.router.navigate(['/home/workspace/overview']); + this.router.navigate(['/home/workspace/overview/projects']); return; } this.store.setCurrentProjectID(pid); //* update project info this.apiStore.setGroupList([]); + //* jump to project await this.router.navigate(['**']); this.router.navigate(['/home/workspace/project/api'], { queryParams: { pid: this.store.getCurrentProjectID } }); diff --git a/src/workbench/browser/src/app/shared/store/state.service.ts b/src/workbench/browser/src/app/shared/store/state.service.ts index 796cb4f02..766e3fbbb 100644 --- a/src/workbench/browser/src/app/shared/store/state.service.ts +++ b/src/workbench/browser/src/app/shared/store/state.service.ts @@ -19,6 +19,8 @@ export class StoreService { private localWorkspace: API.Workspace; // * observable data + private isBack = StorageUtil.get('isBack') || false; + // ? router @observable private url = ''; @observable private pageLevel = 'project'; @@ -92,6 +94,11 @@ export class StoreService { } // ? data source + @computed get isClientFirst() { + const isClientFist = !this.isBack && !!window.electron; + this.setIsBack(); + return isClientFist; + } @computed get isLocal() { return !this.isShare && this.currentWorkspace?.isLocal; } @@ -184,6 +191,10 @@ export class StoreService { }); } + @action setIsBack() { + StorageUtil.set('isBack', true); + } + @action setLocalWorkspace(data) { this.localWorkspace = data; } diff --git a/src/workbench/browser/src/index.html b/src/workbench/browser/src/index.html index 16d8f796a..80426527d 100644 --- a/src/workbench/browser/src/index.html +++ b/src/workbench/browser/src/index.html @@ -73,27 +73,30 @@ }