diff --git a/CHANGELOG.md b/CHANGELOG.md index c5d137f36..c4599806e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +<<<<<<< HEAD +## [0.3.2](https://github.com/Postcatlab/postcat/compare/v0.2.1...v0.3.2) (2023-03-06) +======= ## [0.3.2](https://github.com/Postcatlab/postcat/compare/v0.3.1...v0.3.2) (2023-03-07) @@ -14,6 +17,7 @@ ## [0.3.1](https://github.com/Postcatlab/postcat/compare/v0.2.1...v0.3.1) (2023-03-06) +>>>>>>> main ### Bug Fixes @@ -46,6 +50,10 @@ * API Authorization ([938ec7d](https://github.com/Postcatlab/postcat/commit/938ec7d68270c2be4c17cd2e1098377f2db180d2)) * change description ([0341ba8](https://github.com/Postcatlab/postcat/commit/0341ba8f423cd6554fc83c50bf477dd9d1b36a9c)) * change github project url ([42c801c](https://github.com/Postcatlab/postcat/commit/42c801c49cbd859c876e9aafc2d4bae8fb38b9b6)) +<<<<<<< HEAD +* chat robot ([7878664](https://github.com/Postcatlab/postcat/commit/78786640f464f7370c14aaf14bb224c61a29ae03)) +======= +>>>>>>> main * delete useless code ([a558094](https://github.com/Postcatlab/postcat/commit/a55809494695b1cdcb44009ca55213ca2fc2a570)) * delete useless log ([d878582](https://github.com/Postcatlab/postcat/commit/d87858232292f61f89e1412b259dc27b5e644a79)) * nps ([426a08f](https://github.com/Postcatlab/postcat/commit/426a08ff1af75d401a8358dae1940f4cfd8f3268)) diff --git a/src/app/electron-main/updater.ts b/src/app/electron-main/updater.ts index ee0bd6914..81a8a2218 100644 --- a/src/app/electron-main/updater.ts +++ b/src/app/electron-main/updater.ts @@ -2,7 +2,7 @@ import log from 'electron-log'; import { autoUpdater } from 'electron-updater'; -import { ELETRON_APP_CONFIG } from '../../environment'; +import { COMMON_APP_CONFIG } from '../../environment'; const appVersion = require('../../../package.json').version; @@ -11,7 +11,7 @@ export class EoUpdater { this.watchLog(); autoUpdater.setFeedURL({ provider: 'generic', - url: ELETRON_APP_CONFIG.BASE_DOWNLOAD_URL + url: COMMON_APP_CONFIG.BASE_DOWNLOAD_URL }); // 是否自动更新 // autoUpdater.autoDownload = window.pc.getExtensionSettings('common.app.autoUpdate') !== false; diff --git a/src/environment.ts b/src/environment.ts index fd6c32a57..055211864 100644 --- a/src/environment.ts +++ b/src/environment.ts @@ -1,10 +1,17 @@ -export const ELETRON_APP_CONFIG = { +const variables = { + GITHUB_ORANIZATION_NAME: 'postcatlab', + GITHUB_PROJECT_NAME: 'postcat' +}; +export const COMMON_APP_CONFIG = { // EXTENSION_URL: 'http://localhost:5000', EXTENSION_URL: 'https://extensions.postcat.com', REMOTE_SOCKET_URL: 'wss://postcat.com', // SOCKET_PORT: '', // MOCK_URL: 'http://8.219.85.124:5000', NODE_SERVER_PORT: 4201, + GITHUB_ORANIZATION_NAME: variables.GITHUB_ORANIZATION_NAME, + GITHUB_PROJECT_NAME: variables.GITHUB_PROJECT_NAME, + GITHUB_REPO_URL: `https://github.com/${variables.GITHUB_ORANIZATION_NAME}/${variables.GITHUB_PROJECT_NAME}`, BASE_DOWNLOAD_URL: 'https://data.postcat.com/download/' // BASE_DOWNLOAD_URL: 'http://127.0.0.1:8080' } as const; diff --git a/src/platform/node/extension-manager/core.ts b/src/platform/node/extension-manager/core.ts index d332ce2c1..2ee99a0af 100644 --- a/src/platform/node/extension-manager/core.ts +++ b/src/platform/node/extension-manager/core.ts @@ -58,8 +58,8 @@ export class CoreHandler { if (extensionInfo.main) { extensionInfo.main = `file://${path.join(extensionInfo.baseDir, extensionInfo.main)}`; } - if (extensionInfo.node) { - extensionInfo.node = `file://${path.join(extensionInfo.baseDir, extensionInfo.node)}`; + if (extensionInfo.browser) { + extensionInfo.browser = `file://${path.join(extensionInfo.baseDir, extensionInfo.browser)}`; } if (extensionInfo.logo?.length > 0 && !extensionInfo.logo.startsWith('http') && !extensionInfo.logo.includes('icon-')) { extensionInfo.logo = `file://${path.join(extensionInfo.baseDir, extensionInfo.logo)}`; @@ -91,6 +91,6 @@ export class CoreHandler { // @ts-ignore modules = Object.keys(packageInfo.dependencies || {}); } - return modules; + return modules.filter(val => val); } } diff --git a/src/platform/node/extension-manager/handler.ts b/src/platform/node/extension-manager/handler.ts index faed66c6c..c5f6d7123 100644 --- a/src/platform/node/extension-manager/handler.ts +++ b/src/platform/node/extension-manager/handler.ts @@ -128,7 +128,7 @@ export class ModuleHandler extends CoreHandler { private executeByAppNpm(command: string, modules: any[], resolve, reject) { // https://www.npmjs.com/package/bin-links npmCli.load({ 'bin-links': false, verbose: true, prefix: this.baseDir, registry: this.registry }, loaderr => { - const moduleList = modules.map(({ name, version }) => (version ? `${name}@${version}` : name)); + const moduleList = modules.filter(val => val).map(({ name, version }) => (version ? `${name}@${version}` : name)); let executeCommand = ['update', 'install', 'uninstall']; if (!executeCommand.includes(command)) { return; diff --git a/src/platform/node/extension-manager/manager.ts b/src/platform/node/extension-manager/manager.ts index fcbe0f15e..b7adf7220 100644 --- a/src/platform/node/extension-manager/manager.ts +++ b/src/platform/node/extension-manager/manager.ts @@ -5,7 +5,7 @@ import { ExtensionInfo, SidebarView, FeatureInfo } from 'eo/workbench/browser/sr import { createServer } from 'http-server/lib/http-server'; import portfinder from 'portfinder'; -import { ELETRON_APP_CONFIG } from '../../../environment'; +import { COMMON_APP_CONFIG } from '../../../environment'; import { ModuleHandler } from './handler'; import { ModuleHandlerResult, ModuleManagerInfo } from './handler.model'; @@ -55,7 +55,7 @@ export class ModuleManager { async getRemoteExtension(): Promise { return new Promise(resolve => { let data = ''; - https.get(`${ELETRON_APP_CONFIG.EXTENSION_URL}/list`, res => { + https.get(`${COMMON_APP_CONFIG.EXTENSION_URL}/list`, res => { res.on('data', chunk => { data += chunk; }); @@ -82,6 +82,7 @@ export class ModuleManager { * @param module */ async install(module: ModuleManagerInfo): Promise { + if (!module) return; const result = await this.moduleHandler.install([module], module?.isLocal || false); if (result.code === 0) { const moduleInfo: ExtensionInfo = await this.moduleHandler.info(module.name); diff --git a/src/workbench/browser/locale/messages.xlf b/src/workbench/browser/locale/messages.xlf index d724da976..e57c19f91 100644 --- a/src/workbench/browser/locale/messages.xlf +++ b/src/workbench/browser/locale/messages.xlf @@ -93,8 +93,8 @@ 37 - - MacOS(M1) Client + + MacOS(Apple) Client src/app/core/services/web/web.service.ts 44 @@ -108,7 +108,7 @@ src/app/pages/extension/detail/extension-detail.component.html - 93 + 97 @@ -136,7 +136,7 @@ You don't have cloud space yet, please new one src/app/layouts/local-workspace-tip/local-workspace-tip.component.ts - 56 + 57 @@ -158,7 +158,7 @@ src/app/pages/workspace/overview/member/workspace-member.component.ts - 31,30 + 32,31 src/app/pages/workspace/project/member/project-member.component.ts @@ -246,38 +246,11 @@ 33,34 - - Copied - - src/app/layouts/navbar/get-share-link.component.ts - 69 - - - src/app/modules/api-shared/api-mock-table.component.ts - 127 - - - src/app/modules/eo-ui/monaco-editor/monaco-editor.component.ts - 286 - - - src/app/modules/system-setting/common/token.component.ts - 54 - - - src/app/pages/workspace/project/api/http/detail/api-detail.component.ts - 51 - - - src/app/utils/index.utils.ts - 187 - - If you want to share API,Please switch to cloud workspace src/app/layouts/navbar/get-share-link.component.ts - 79 + 60 @@ -348,7 +321,7 @@ Extensions Hub src/app/layouts/navbar/navbar.component.ts - 43 + 45 @@ -409,25 +382,36 @@ 23 + + ChatGPT Robot + + src/app/layouts/toolbar/toolbar.component.html + 37 + + + src/app/pages/components/chatgpt-robot/chatgpt-robot.component.ts + 67 + + Hide Sidebar src/app/layouts/toolbar/toolbar.component.ts - 16 + 17 Show Sidebar src/app/layouts/toolbar/toolbar.component.ts - 17 + 18 Settings src/app/layouts/toolbar/toolbar.component.ts - 34 + 32 src/app/modules/system-setting/settings.service.ts @@ -435,25 +419,25 @@ src/app/pages/extension/detail/extension-detail.component.html - 74 + 78 Delete Succeeded src/app/modules/api-shared/api-mock-table.component.ts - 43 + 50 Name src/app/modules/api-shared/api-mock-table.component.ts - 48 + 55 src/app/modules/api-shared/api-table.service.ts - 233 + 235 src/app/pages/workspace/project/api/env/env-edit/env-edit.component.html @@ -476,49 +460,49 @@ Created Type src/app/modules/api-shared/api-mock-table.component.ts - 50 + 57 System creation src/app/modules/api-shared/api-mock-table.component.ts - 54 + 61 Manual creation src/app/modules/api-shared/api-mock-table.component.ts - 55 + 62 Preview src/app/modules/api-shared/api-mock-table.component.ts - 63 + 70 Preview Mock src/app/modules/api-shared/api-mock-table.component.ts - 67 + 74 Edit Mock src/app/modules/api-shared/api-mock-table.component.ts - 82 + 89 Edited successfully src/app/modules/api-shared/api-mock-table.component.ts - 132 + 135 src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts @@ -526,7 +510,7 @@ src/app/pages/workspace/project/api/http/edit/api-edit.component.ts - 157 + 163 src/app/pages/workspace/project/setting/project-setting.component.ts @@ -537,7 +521,7 @@ Failed to add src/app/modules/api-shared/api-mock-table.component.ts - 139 + 142 src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts @@ -548,7 +532,7 @@ Added successfully src/app/modules/api-shared/api-mock-table.component.ts - 143 + 146 src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts @@ -556,7 +540,7 @@ src/app/pages/workspace/project/api/http/edit/api-edit.component.ts - 157 + 163 @@ -567,11 +551,11 @@ src/app/modules/api-shared/api-table.service.ts - 105 + 107 src/app/modules/api-shared/api-table.service.ts - 138 + 140 @@ -582,7 +566,7 @@ src/app/modules/api-shared/params-import/params-import.component.html - 20 + 22 src/app/modules/eo-ui/tab/tab.component.ts @@ -594,7 +578,7 @@ src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 235 + 234 src/app/pages/workspace/project/api/websocket/websocket.component.ts @@ -631,11 +615,11 @@ Type src/app/modules/api-shared/api-table.service.ts - 75 + 76 src/app/modules/api-shared/api-table.service.ts - 241 + 244 src/app/pages/workspace/project/api/http/edit/extra-setting/api-params-extra-setting.component.ts @@ -646,7 +630,7 @@ Required src/app/modules/api-shared/api-table.service.ts - 82 + 83 src/app/pages/workspace/project/api/http/edit/extra-setting/api-params-extra-setting.component.ts @@ -657,7 +641,7 @@ Description src/app/modules/api-shared/api-table.service.ts - 90 + 91 src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts @@ -672,7 +656,7 @@ Example src/app/modules/api-shared/api-table.service.ts - 95 + 96 src/app/pages/workspace/project/api/http/edit/extra-setting/api-params-extra-setting.component.html @@ -683,7 +667,7 @@ Value src/app/modules/api-shared/api-table.service.ts - 253 + 256 src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts @@ -734,21 +718,21 @@ Replace All src/app/modules/api-shared/params-import/params-import.component.html - 21 + 23 Insert at the end src/app/modules/api-shared/params-import/params-import.component.html - 22 + 24 Replace Changed src/app/modules/api-shared/params-import/params-import.component.html - 23 + 25 @@ -804,6 +788,20 @@ 125 + + Power by + + src/app/modules/chat-robot/chat-robot-container/chat-robot.component.ts + 26 + + + + Send + + src/app/modules/chat-robot/chat-robot-form/chat-robot-form.component.ts + 16 + + Download @@ -847,11 +845,18 @@ 26 + + Copied + + src/app/modules/eo-ui/monaco-editor/monaco-editor.component.ts + 303 + + Program will not close unsaved tabs src/app/modules/eo-ui/tab/tab-operate.service.ts - 360 + 366 @@ -988,7 +993,7 @@ src/app/pages/workspace/overview/edit/workspace-edit.component.ts - 111 + 112 src/app/pages/workspace/overview/project-list/project-list.component.html @@ -1049,7 +1054,7 @@ src/app/pages/workspace/project/api/http/test/body/api-test-body.component.html - 66 + 67 @@ -1112,7 +1117,7 @@ Sync API from URL error: src/app/modules/extension-select/sync-api/sync-api.component.ts - 152 + 172 @@ -1164,11 +1169,12 @@ 110 - - Hi!~ If you like Postcat, please give the Postcat a Star!Your support is our greatest motivation~ + + Hi!~ If you like , please give the Postcat a Star!Your support is our greatest motivation~ - src/app/modules/system-setting/common/about.component.ts - 22,24 + src/app/modules/star-motivation/star-motivation.component.ts + 9,12 @@ -1323,28 +1329,28 @@ Token succeddfully generated src/app/modules/system-setting/common/token.component.ts - 18 + 17 Make sure to copy your token. It will never be displayed again. src/app/modules/system-setting/common/token.component.ts - 21 + 20 Personal Access Token src/app/modules/system-setting/common/token.component.ts - 33 + 41 Generate Token src/app/modules/system-setting/common/token.component.ts - 35 + 43 @@ -1375,18 +1381,39 @@ 42 + + ChatGPT Extensions + + src/app/pages/components/chatgpt-robot/chatgpt-robot.component.ts + 45 + + + + Send message to AI + + src/app/pages/components/chatgpt-robot/chatgpt-robot.component.ts + 59 + + + + Visitor + + src/app/pages/components/chatgpt-robot/chatgpt-robot.component.ts + 154 + + or src/app/pages/components/third-login/third-login.component.ts - 21 + 22 Sign In/Up with Github src/app/pages/components/third-login/third-login.component.ts - 40,41 + 41,42 @@ -1503,7 +1530,7 @@ src/app/pages/workspace/overview/edit/workspace-edit.component.ts - 28 + 29 @@ -1645,11 +1672,25 @@ 59 + + Jump to Use + + src/app/pages/extension/detail/extension-detail.component.html + 63 + + + + * This exension only support web + + src/app/pages/extension/detail/extension-detail.component.html + 64 + + Details src/app/pages/extension/detail/extension-detail.component.html - 82 + 86 src/app/pages/extension/list/extension-list.component.html @@ -1660,63 +1701,63 @@ Support src/app/pages/extension/detail/extension-detail.component.html - 90 + 94 Author src/app/pages/extension/detail/extension-detail.component.html - 92 + 96 Repository src/app/pages/extension/detail/extension-detail.component.html - 94 + 98 Homepage src/app/pages/extension/detail/extension-detail.component.html - 99 + 103 BugReport src/app/pages/extension/detail/extension-detail.component.html - 102 + 106 ChangeLog src/app/pages/extension/detail/extension-detail.component.html - 108 + 112 Changelog failed to load src/app/pages/extension/detail/extension-detail.component.html - 111 + 115 Reacquire src/app/pages/extension/detail/extension-detail.component.html - 113 + 117 Need Client src/app/pages/extension/detail/extension-detail.component.html - 121 + 125 @@ -1857,81 +1898,81 @@ We use cookies src/app/pages/pages.component.html - 24 + 27 GOT IT src/app/pages/pages.component.html - 25 + 28 Actions src/app/pages/workspace/overview/edit/workspace-edit.component.ts - 47 + 48 src/app/pages/workspace/project/setting/project-setting.component.html - 60 + 61 Delete Workspace src/app/pages/workspace/overview/edit/workspace-edit.component.ts - 69 + 70 Are you sure delete this workspace? src/app/pages/workspace/overview/edit/workspace-edit.component.ts - 110 + 111 Delete failed ! src/app/pages/workspace/overview/edit/workspace-edit.component.ts - 118 + 119 Delete success ! src/app/pages/workspace/overview/edit/workspace-edit.component.ts - 121 + 122 Edit workspace failed src/app/pages/workspace/overview/edit/workspace-edit.component.ts - 142 + 143 Edit workspace successfully ! src/app/pages/workspace/overview/edit/workspace-edit.component.ts - 145 + 146 Add Member To Workspace src/app/pages/workspace/overview/member/workspace-member.component.ts - 19 + 20 Add src/app/pages/workspace/overview/member/workspace-member.component.ts - 57,58 + 58,59 src/app/pages/workspace/project/member/project-member.component.ts @@ -1942,7 +1983,7 @@ Currently using local workspace, unable to invite members. src/app/pages/workspace/overview/member/workspace-member.component.ts - 69 + 70 src/app/pages/workspace/project/member/project-member.component.ts @@ -1955,7 +1996,7 @@ >"/>and invite members to collaborate. src/app/pages/workspace/overview/member/workspace-member.component.ts - 71,73 + 72,74 src/app/pages/workspace/project/member/project-member.component.ts @@ -1966,7 +2007,7 @@ Please select a member src/app/pages/workspace/overview/member/workspace-member.component.ts - 149 + 153 src/app/pages/workspace/project/member/project-member.component.ts @@ -1977,11 +2018,11 @@ Add member failed src/app/pages/workspace/overview/member/workspace-member.component.ts - 155 + 159 src/app/pages/workspace/overview/member/workspace-member.component.ts - 177 + 181 src/app/pages/workspace/project/member/project-member.component.ts @@ -1992,11 +2033,11 @@ Add member successfully src/app/pages/workspace/overview/member/workspace-member.component.ts - 159 + 163 src/app/pages/workspace/overview/member/workspace-member.component.ts - 181 + 185 src/app/pages/workspace/project/member/project-member.component.ts @@ -2007,7 +2048,7 @@ You can create a cloud workspace and invite members to collaborate. src/app/pages/workspace/overview/member/workspace-member.component.ts - 172 + 176 @@ -2088,7 +2129,7 @@ src/app/shared/components/schema-form/schema-form.component.ts - 38 + 56 @@ -2335,42 +2376,42 @@ Edit Group src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 178 + 177 Delete Group src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 187 + 186 Deletion Confirmation? src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 200 + 199 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 - 201,203 + 200,202 Add Group src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 219 + 218 Save and Sync src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 239 + 238 src/app/pages/workspace/project/setting/project-setting.component.ts @@ -2381,7 +2422,7 @@ Confirm src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 239 + 238 src/app/pages/workspace/project/setting/project-setting.component.ts @@ -2396,7 +2437,7 @@ Failed to ,Please upgrade extension or try again later src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 246 + 245 src/app/pages/workspace/project/setting/project-setting.component.ts @@ -2407,7 +2448,7 @@ successfully src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 254 + 253 src/app/pages/workspace/project/setting/project-setting.component.ts @@ -2535,11 +2576,11 @@ Request Headers src/app/pages/workspace/project/api/http/detail/api-detail.component.html - 21 + 18 src/app/pages/workspace/project/api/http/edit/api-edit.component.html - 51 + 58 src/app/pages/workspace/project/api/http/test/api-test.component.html @@ -2550,11 +2591,11 @@ Query src/app/pages/workspace/project/api/http/detail/api-detail.component.html - 33,32 + 30,29 src/app/pages/workspace/project/api/http/edit/api-edit.component.html - 79 + 86 src/app/pages/workspace/project/api/http/test/api-test.component.html @@ -2565,11 +2606,11 @@ REST src/app/pages/workspace/project/api/http/detail/api-detail.component.html - 44,43 + 41,40 src/app/pages/workspace/project/api/http/edit/api-edit.component.html - 92 + 99 src/app/pages/workspace/project/api/http/test/api-test.component.html @@ -2580,11 +2621,11 @@ Body src/app/pages/workspace/project/api/http/detail/api-detail.component.html - 61 + 58 src/app/pages/workspace/project/api/http/edit/api-edit.component.html - 65 + 72 src/app/pages/workspace/project/api/http/test/api-test.component.html @@ -2599,15 +2640,15 @@ Response src/app/pages/workspace/project/api/http/detail/api-detail.component.html - 80 + 77 src/app/pages/workspace/project/api/http/edit/api-edit.component.html - 104 + 111 src/app/pages/workspace/project/api/http/edit/api-edit.component.html - 125 + 132 src/app/pages/workspace/project/api/http/mock/edit/api-mock-edit.component.ts @@ -2622,11 +2663,11 @@ Response Headers src/app/pages/workspace/project/api/http/detail/api-detail.component.html - 99 + 96 src/app/pages/workspace/project/api/http/edit/api-edit.component.html - 108 + 115 src/app/pages/workspace/project/api/http/test/api-test.component.html @@ -2637,42 +2678,42 @@ MOCK src/app/pages/workspace/project/api/http/detail/api-detail.component.html - 112,111 + 109,108 Please enter API Path src/app/pages/workspace/project/api/http/edit/api-edit.component.html - 15 + 22 Please select an API group src/app/pages/workspace/project/api/http/edit/api-edit.component.html - 22 + 29 Please enter API name src/app/pages/workspace/project/api/http/edit/api-edit.component.html - 39 + 46 Request src/app/pages/workspace/project/api/http/edit/api-edit.component.html - 46 + 53 Failed Operation src/app/pages/workspace/project/api/http/edit/api-edit.component.ts - 162 + 168 src/app/pages/workspace/project/setting/project-setting.component.ts @@ -2690,7 +2731,7 @@ Binary Description src/app/pages/workspace/project/api/http/edit/body/api-edit-body.component.html - 61 + 62 @@ -3172,14 +3213,14 @@ Send src/app/pages/workspace/project/api/websocket/websocket.component.html - 124,125 + 125,126 Messages src/app/pages/workspace/project/api/websocket/websocket.component.html - 138 + 139 @@ -3341,7 +3382,7 @@ Please Enter src/app/shared/components/schema-form/schema-form.component.ts - 29 + 47 diff --git a/src/workbench/browser/locale/messages.zh.xlf b/src/workbench/browser/locale/messages.zh.xlf index d0c860554..185080598 100644 --- a/src/workbench/browser/locale/messages.zh.xlf +++ b/src/workbench/browser/locale/messages.zh.xlf @@ -106,13 +106,13 @@ MacOS(Intel) 客户端 - - MacOS(M1) Client + + MacOS(Apple) Client src/app/core/services/web/web.service.ts 44 - MacOS(M1) 客户端 + MacOS(Apple) 客户端 Version @@ -122,7 +122,7 @@ src/app/pages/extension/detail/extension-detail.component.html - 93 + 97 版本 @@ -154,7 +154,7 @@ You don't have cloud space yet, please new one src/app/layouts/local-workspace-tip/local-workspace-tip.component.ts - 56 + 57 您还没有云空间,请新建一个 @@ -178,7 +178,7 @@ src/app/pages/workspace/overview/member/workspace-member.component.ts - 31,30 + 32,31 src/app/pages/workspace/project/member/project-member.component.ts @@ -278,39 +278,11 @@ 每个人都可以在没有登录的情况下查看最新的 API 文档 - - Copied - - src/app/layouts/navbar/get-share-link.component.ts - 69 - - - src/app/modules/api-shared/api-mock-table.component.ts - 127 - - - src/app/modules/eo-ui/monaco-editor/monaco-editor.component.ts - 286 - - - src/app/modules/system-setting/common/token.component.ts - 54 - - - src/app/pages/workspace/project/api/http/detail/api-detail.component.ts - 51 - - - src/app/utils/index.utils.ts - 187 - - 已复制 - If you want to share API,Please switch to cloud workspace src/app/layouts/navbar/get-share-link.component.ts - 79 + 60 如果您想要分享 API,请切换到云空间 @@ -390,7 +362,7 @@ Extensions Hub src/app/layouts/navbar/navbar.component.ts - 43 + 45 插件广场 @@ -458,11 +430,23 @@ 更改主题 + + ChatGPT Robot + + src/app/layouts/toolbar/toolbar.component.html + 37 + + + src/app/pages/components/chatgpt-robot/chatgpt-robot.component.ts + 67 + + ChatGPT 机器人 + Hide Sidebar src/app/layouts/toolbar/toolbar.component.ts - 16 + 17 隐藏侧边栏 @@ -470,7 +454,7 @@ Show Sidebar src/app/layouts/toolbar/toolbar.component.ts - 17 + 18 展示侧边栏 @@ -478,7 +462,7 @@ Settings src/app/layouts/toolbar/toolbar.component.ts - 34 + 32 src/app/modules/system-setting/settings.service.ts @@ -486,7 +470,7 @@ src/app/pages/extension/detail/extension-detail.component.html - 74 + 78 设置 @@ -494,7 +478,7 @@ Delete Succeeded src/app/modules/api-shared/api-mock-table.component.ts - 43 + 50 删除成功 @@ -502,11 +486,11 @@ Name src/app/modules/api-shared/api-mock-table.component.ts - 48 + 55 src/app/modules/api-shared/api-table.service.ts - 233 + 235 src/app/pages/workspace/project/api/env/env-edit/env-edit.component.html @@ -530,7 +514,7 @@ Created Type src/app/modules/api-shared/api-mock-table.component.ts - 50 + 57 创建方式 @@ -538,7 +522,7 @@ System creation src/app/modules/api-shared/api-mock-table.component.ts - 54 + 61 系统自动创建 @@ -546,7 +530,7 @@ Manual creation src/app/modules/api-shared/api-mock-table.component.ts - 55 + 62 手动创建 @@ -554,7 +538,7 @@ Preview src/app/modules/api-shared/api-mock-table.component.ts - 63 + 70 预览 @@ -562,7 +546,7 @@ Preview Mock src/app/modules/api-shared/api-mock-table.component.ts - 67 + 74 预览 Mock @@ -570,7 +554,7 @@ Edit Mock src/app/modules/api-shared/api-mock-table.component.ts - 82 + 89 编辑 Mock @@ -578,7 +562,7 @@ Edited successfully src/app/modules/api-shared/api-mock-table.component.ts - 132 + 135 src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts @@ -586,7 +570,7 @@ src/app/pages/workspace/project/api/http/edit/api-edit.component.ts - 157 + 163 src/app/pages/workspace/project/setting/project-setting.component.ts @@ -598,7 +582,7 @@ Failed to add src/app/modules/api-shared/api-mock-table.component.ts - 139 + 142 src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts @@ -610,7 +594,7 @@ Added successfully src/app/modules/api-shared/api-mock-table.component.ts - 143 + 146 src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts @@ -618,7 +602,7 @@ src/app/pages/workspace/project/api/http/edit/api-edit.component.ts - 157 + 163 添加成功 @@ -630,11 +614,11 @@ src/app/modules/api-shared/api-table.service.ts - 105 + 107 src/app/modules/api-shared/api-table.service.ts - 138 + 140 更多设置 @@ -646,7 +630,7 @@ src/app/modules/api-shared/params-import/params-import.component.html - 20 + 22 src/app/modules/eo-ui/tab/tab.component.ts @@ -658,7 +642,7 @@ src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 235 + 234 src/app/pages/workspace/project/api/websocket/websocket.component.ts @@ -698,11 +682,11 @@ Type src/app/modules/api-shared/api-table.service.ts - 75 + 76 src/app/modules/api-shared/api-table.service.ts - 241 + 244 src/app/pages/workspace/project/api/http/edit/extra-setting/api-params-extra-setting.component.ts @@ -714,7 +698,7 @@ Required src/app/modules/api-shared/api-table.service.ts - 82 + 83 src/app/pages/workspace/project/api/http/edit/extra-setting/api-params-extra-setting.component.ts @@ -726,7 +710,7 @@ Description src/app/modules/api-shared/api-table.service.ts - 90 + 91 src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts @@ -742,7 +726,7 @@ Example src/app/modules/api-shared/api-table.service.ts - 95 + 96 src/app/pages/workspace/project/api/http/edit/extra-setting/api-params-extra-setting.component.html @@ -754,7 +738,7 @@ Value src/app/modules/api-shared/api-table.service.ts - 253 + 256 src/app/pages/workspace/project/api/env/env-edit/env-edit.component.ts @@ -810,7 +794,7 @@ Replace All src/app/modules/api-shared/params-import/params-import.component.html - 21 + 23 全量替换 @@ -818,7 +802,7 @@ Insert at the end src/app/modules/api-shared/params-import/params-import.component.html - 22 + 24 在末端插入 @@ -826,7 +810,7 @@ Replace Changed src/app/modules/api-shared/params-import/params-import.component.html - 23 + 25 增量更新 @@ -890,6 +874,22 @@ XML 格式不正确 + + Power by + + src/app/modules/chat-robot/chat-robot-container/chat-robot.component.ts + 26 + + 技术支持: + + + Send + + src/app/modules/chat-robot/chat-robot-form/chat-robot-form.component.ts + 16 + + 发送 + Download @@ -938,11 +938,19 @@ 替换 + + Copied + + src/app/modules/eo-ui/monaco-editor/monaco-editor.component.ts + 303 + + 已复制 + Program will not close unsaved tabs src/app/modules/eo-ui/tab/tab-operate.service.ts - 360 + 366 程序将不会关闭未保存的标签 @@ -1094,7 +1102,7 @@ src/app/pages/workspace/overview/edit/workspace-edit.component.ts - 111 + 112 src/app/pages/workspace/overview/project-list/project-list.component.html @@ -1158,7 +1166,7 @@ src/app/pages/workspace/project/api/http/test/body/api-test-body.component.html - 66 + 67 点击或直接拖拽文件至此区域 @@ -1230,7 +1238,7 @@ Sync API from URL error: src/app/modules/extension-select/sync-api/sync-api.component.ts - 152 + 172 从 URL 同步 API 错误: @@ -1290,13 +1298,13 @@ 移除成员成功 - - Hi!~ If you like Postcat, please give the Postcat a Star!Your support is our greatest motivation~ + + Hi!~ If you like , please give the Postcat a Star!Your support is our greatest motivation~ - src/app/modules/system-setting/common/about.component.ts - 22,24 + src/app/modules/star-motivation/star-motivation.component.ts + 9,12 - 您好~ 如果您喜欢 Postcat, 请给 Postcat 一颗星!您的支持是我们最大的动力~ + 您好~ 如果您喜欢 ,请给 Postcat 一颗星!您的支持是我们最大的动力~ Change Password @@ -1470,7 +1478,7 @@ Token succeddfully generated src/app/modules/system-setting/common/token.component.ts - 18 + 17 已成功生成令牌 @@ -1478,7 +1486,7 @@ Make sure to copy your token. It will never be displayed again. src/app/modules/system-setting/common/token.component.ts - 21 + 20 请确保复制您的令牌。它将永远不会显示。 @@ -1486,7 +1494,7 @@ Personal Access Token src/app/modules/system-setting/common/token.component.ts - 33 + 41 个人访问令牌 @@ -1494,7 +1502,7 @@ Generate Token src/app/modules/system-setting/common/token.component.ts - 35 + 43 生成令牌 @@ -1530,11 +1538,35 @@ 关于 + + ChatGPT Extensions + + src/app/pages/components/chatgpt-robot/chatgpt-robot.component.ts + 45 + + ChatGPT 插件 + + + Send message to AI + + src/app/pages/components/chatgpt-robot/chatgpt-robot.component.ts + 59 + + 发送消息给 AI + + + Visitor + + src/app/pages/components/chatgpt-robot/chatgpt-robot.component.ts + 154 + + 游客 + or src/app/pages/components/third-login/third-login.component.ts - 21 + 22 @@ -1542,7 +1574,7 @@ Sign In/Up with Github src/app/pages/components/third-login/third-login.component.ts - 40,41 + 41,42 通过 Github 注册/登录 @@ -1674,7 +1706,7 @@ src/app/pages/workspace/overview/edit/workspace-edit.component.ts - 28 + 29 空间名称 @@ -1836,11 +1868,27 @@ 安装 + + Jump to Use + + src/app/pages/extension/detail/extension-detail.component.html + 63 + + 跳转使用 + + + * This exension only support web + + src/app/pages/extension/detail/extension-detail.component.html + 64 + + * 此插件在 Web 浏览器支持 + Details src/app/pages/extension/detail/extension-detail.component.html - 82 + 86 src/app/pages/extension/list/extension-list.component.html @@ -1852,7 +1900,7 @@ Support src/app/pages/extension/detail/extension-detail.component.html - 90 + 94 支持 @@ -1860,7 +1908,7 @@ Author src/app/pages/extension/detail/extension-detail.component.html - 92 + 96 作者 @@ -1868,7 +1916,7 @@ Repository src/app/pages/extension/detail/extension-detail.component.html - 94 + 98 代码仓库 @@ -1876,7 +1924,7 @@ Homepage src/app/pages/extension/detail/extension-detail.component.html - 99 + 103 首页 @@ -1884,7 +1932,7 @@ BugReport src/app/pages/extension/detail/extension-detail.component.html - 102 + 106 报告问题 @@ -1892,7 +1940,7 @@ ChangeLog src/app/pages/extension/detail/extension-detail.component.html - 108 + 112 更新日志 @@ -1900,7 +1948,7 @@ Changelog failed to load src/app/pages/extension/detail/extension-detail.component.html - 111 + 115 更新日志加载失败 @@ -1908,7 +1956,7 @@ Reacquire src/app/pages/extension/detail/extension-detail.component.html - 113 + 117 重新获取 @@ -1916,7 +1964,7 @@ Need Client src/app/pages/extension/detail/extension-detail.component.html - 121 + 125 需要客户端 @@ -2064,7 +2112,7 @@ We use cookies src/app/pages/pages.component.html - 24 + 27 我们使用 Cookie @@ -2072,7 +2120,7 @@ GOT IT src/app/pages/pages.component.html - 25 + 28 了解 @@ -2080,11 +2128,11 @@ Actions src/app/pages/workspace/overview/edit/workspace-edit.component.ts - 47 + 48 src/app/pages/workspace/project/setting/project-setting.component.html - 60 + 61 操作 @@ -2092,7 +2140,7 @@ Delete Workspace src/app/pages/workspace/overview/edit/workspace-edit.component.ts - 69 + 70 删除空间 @@ -2100,7 +2148,7 @@ Are you sure delete this workspace? src/app/pages/workspace/overview/edit/workspace-edit.component.ts - 110 + 111 确定删除这个空间? @@ -2108,7 +2156,7 @@ Delete failed ! src/app/pages/workspace/overview/edit/workspace-edit.component.ts - 118 + 119 删除失败 @@ -2116,7 +2164,7 @@ Delete success ! src/app/pages/workspace/overview/edit/workspace-edit.component.ts - 121 + 122 删除成功! @@ -2124,7 +2172,7 @@ Edit workspace failed src/app/pages/workspace/overview/edit/workspace-edit.component.ts - 142 + 143 编辑空间失败 @@ -2132,7 +2180,7 @@ Edit workspace successfully ! src/app/pages/workspace/overview/edit/workspace-edit.component.ts - 145 + 146 编辑空间成功 @@ -2140,7 +2188,7 @@ Add Member To Workspace src/app/pages/workspace/overview/member/workspace-member.component.ts - 19 + 20 添加空间成员 @@ -2148,7 +2196,7 @@ Add src/app/pages/workspace/overview/member/workspace-member.component.ts - 57,58 + 58,59 src/app/pages/workspace/project/member/project-member.component.ts @@ -2160,7 +2208,7 @@ Currently using local workspace, unable to invite members. src/app/pages/workspace/overview/member/workspace-member.component.ts - 69 + 70 src/app/pages/workspace/project/member/project-member.component.ts @@ -2172,7 +2220,7 @@ You cannew a cloud workspaceand invite members to collaborate. src/app/pages/workspace/overview/member/workspace-member.component.ts - 71,73 + 72,74 src/app/pages/workspace/project/member/project-member.component.ts @@ -2184,7 +2232,7 @@ Please select a member src/app/pages/workspace/overview/member/workspace-member.component.ts - 149 + 153 src/app/pages/workspace/project/member/project-member.component.ts @@ -2196,11 +2244,11 @@ Add member failed src/app/pages/workspace/overview/member/workspace-member.component.ts - 155 + 159 src/app/pages/workspace/overview/member/workspace-member.component.ts - 177 + 181 src/app/pages/workspace/project/member/project-member.component.ts @@ -2212,11 +2260,11 @@ Add member successfully src/app/pages/workspace/overview/member/workspace-member.component.ts - 159 + 163 src/app/pages/workspace/overview/member/workspace-member.component.ts - 181 + 185 src/app/pages/workspace/project/member/project-member.component.ts @@ -2228,7 +2276,7 @@ You can create a cloud workspace and invite members to collaborate. src/app/pages/workspace/overview/member/workspace-member.component.ts - 172 + 176 您可以创建一个云空间之后再邀请成员协作。 @@ -2318,7 +2366,7 @@ src/app/shared/components/schema-form/schema-form.component.ts - 38 + 56 @@ -2597,7 +2645,7 @@ Edit Group src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 178 + 177 编辑分组 @@ -2605,7 +2653,7 @@ Delete Group src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 187 + 186 删除分组 @@ -2613,7 +2661,7 @@ Deletion Confirmation? src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 200 + 199 确认删除? @@ -2621,7 +2669,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 - 201,203 + 200,202 确认要删除数据 <strong title=""></strong> 吗?删除后不可恢复! @@ -2629,7 +2677,7 @@ Add Group src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 219 + 218 添加分组 @@ -2637,7 +2685,7 @@ Save and Sync src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 239 + 238 src/app/pages/workspace/project/setting/project-setting.component.ts @@ -2649,7 +2697,7 @@ Confirm src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 239 + 238 src/app/pages/workspace/project/setting/project-setting.component.ts @@ -2665,7 +2713,7 @@ Failed to ,Please upgrade extension or try again later src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 246 + 245 src/app/pages/workspace/project/setting/project-setting.component.ts @@ -2677,7 +2725,7 @@ successfully src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 254 + 253 src/app/pages/workspace/project/setting/project-setting.component.ts @@ -2821,11 +2869,11 @@ Request Headers src/app/pages/workspace/project/api/http/detail/api-detail.component.html - 21 + 18 src/app/pages/workspace/project/api/http/edit/api-edit.component.html - 51 + 58 src/app/pages/workspace/project/api/http/test/api-test.component.html @@ -2837,11 +2885,11 @@ Query src/app/pages/workspace/project/api/http/detail/api-detail.component.html - 33,32 + 30,29 src/app/pages/workspace/project/api/http/edit/api-edit.component.html - 79 + 86 src/app/pages/workspace/project/api/http/test/api-test.component.html @@ -2853,11 +2901,11 @@ REST src/app/pages/workspace/project/api/http/detail/api-detail.component.html - 44,43 + 41,40 src/app/pages/workspace/project/api/http/edit/api-edit.component.html - 92 + 99 src/app/pages/workspace/project/api/http/test/api-test.component.html @@ -2869,11 +2917,11 @@ Body src/app/pages/workspace/project/api/http/detail/api-detail.component.html - 61 + 58 src/app/pages/workspace/project/api/http/edit/api-edit.component.html - 65 + 72 src/app/pages/workspace/project/api/http/test/api-test.component.html @@ -2889,15 +2937,15 @@ Response src/app/pages/workspace/project/api/http/detail/api-detail.component.html - 80 + 77 src/app/pages/workspace/project/api/http/edit/api-edit.component.html - 104 + 111 src/app/pages/workspace/project/api/http/edit/api-edit.component.html - 125 + 132 src/app/pages/workspace/project/api/http/mock/edit/api-mock-edit.component.ts @@ -2913,11 +2961,11 @@ Response Headers src/app/pages/workspace/project/api/http/detail/api-detail.component.html - 99 + 96 src/app/pages/workspace/project/api/http/edit/api-edit.component.html - 108 + 115 src/app/pages/workspace/project/api/http/test/api-test.component.html @@ -2929,7 +2977,7 @@ MOCK src/app/pages/workspace/project/api/http/detail/api-detail.component.html - 112,111 + 109,108 MOCK @@ -2937,7 +2985,7 @@ Please enter API Path src/app/pages/workspace/project/api/http/edit/api-edit.component.html - 15 + 22 请输入 API Path @@ -2945,7 +2993,7 @@ Please select an API group src/app/pages/workspace/project/api/http/edit/api-edit.component.html - 22 + 29 请选择 API 分组 @@ -2953,7 +3001,7 @@ Please enter API name src/app/pages/workspace/project/api/http/edit/api-edit.component.html - 39 + 46 请输入 API 名称 @@ -2961,7 +3009,7 @@ Request src/app/pages/workspace/project/api/http/edit/api-edit.component.html - 46 + 53 请求参数 @@ -2969,7 +3017,7 @@ Failed Operation src/app/pages/workspace/project/api/http/edit/api-edit.component.ts - 162 + 168 src/app/pages/workspace/project/setting/project-setting.component.ts @@ -2989,7 +3037,7 @@ Binary Description src/app/pages/workspace/project/api/http/edit/body/api-edit-body.component.html - 61 + 62 Binary 说明 @@ -3533,7 +3581,7 @@ Send src/app/pages/workspace/project/api/websocket/websocket.component.html - 124,125 + 125,126 发送 @@ -3541,7 +3589,7 @@ Messages src/app/pages/workspace/project/api/websocket/websocket.component.html - 138 + 139 报文 @@ -3725,7 +3773,7 @@ Please Enter src/app/shared/components/schema-form/schema-form.component.ts - 29 + 47 请输入 diff --git a/src/workbench/browser/src/app/core/services/feature-control/feature-control.service.ts b/src/workbench/browser/src/app/core/services/feature-control/feature-control.service.ts index e53d9e55d..db4519596 100644 --- a/src/workbench/browser/src/app/core/services/feature-control/feature-control.service.ts +++ b/src/workbench/browser/src/app/core/services/feature-control/feature-control.service.ts @@ -1,4 +1,6 @@ import { Injectable } from '@angular/core'; +import { ExtensionInfo } from 'eo/workbench/browser/src/app/shared/models/extension-manager'; +import { Message, MessageService } from 'eo/workbench/browser/src/app/shared/services/message'; import featureJSON from './feature.json'; type configKey = keyof typeof featureJSON; @@ -7,7 +9,37 @@ type configKey = keyof typeof featureJSON; }) export class FeatureControlService { config: { [key: configKey | string]: boolean }; - constructor() { + constructor(private message: MessageService) { this.config = featureJSON; + this.watchExtensionChange(); + } + watchExtensionChange() { + this.message.get().subscribe((inArg: Message) => { + if (inArg.type !== 'extensionsChange') return; + const extension = inArg.data.extension; + if (!extension?.features?.featureControl?.length) return; + switch (inArg.data.action) { + case 'install': + case 'enable': { + this.openFearure(extension?.features?.featureControl); + break; + } + case 'disable': + case 'uninstall': { + this.closeFeature(extension?.features?.featureControl); + break; + } + } + }); + } + openFearure(features) { + features.forEach(({ id }) => { + this.config[id] = true; + }); + } + closeFeature(features) { + features.forEach(({ id }) => { + this.config[id] = false; + }); } } diff --git a/src/workbench/browser/src/app/core/services/feature-control/feature.json b/src/workbench/browser/src/app/core/services/feature-control/feature.json index 41a3753e8..b6d2c1e3d 100644 --- a/src/workbench/browser/src/app/core/services/feature-control/feature.json +++ b/src/workbench/browser/src/app/core/services/feature-control/feature.json @@ -3,5 +3,6 @@ "apimanage.test": true, "apimanage.document": true, "apimanage.edit": true, - "apimanage.mock": true + "apimanage.mock": true, + "chatRobot": false } diff --git a/src/workbench/browser/src/app/core/services/theme/theme.service.ts b/src/workbench/browser/src/app/core/services/theme/theme.service.ts index eaf05226e..a248d7196 100644 --- a/src/workbench/browser/src/app/core/services/theme/theme.service.ts +++ b/src/workbench/browser/src/app/core/services/theme/theme.service.ts @@ -194,30 +194,29 @@ export class ThemeService { } watchInstalledExtensionsChange() { this.message.get().subscribe((inArg: Message) => { - if (inArg.type === 'installedExtensionsChange') { - //Rest newest theme list - this.themes = this.themes.filter(val => !val.isExtension); - this.queryExtensionThemes(); - this.afterAllThemeLoad(); + if (inArg.type !== 'extensionsChange') return; + //Rest newest theme list + this.themes = this.themes.filter(val => !val.isExtension); + this.queryExtensionThemes(); + this.afterAllThemeLoad(); - switch (inArg.data.action) { - case 'enable': - case 'install': { - const name = inArg.data.name; - const extension: ExtensionInfo = inArg.data.installedMap.get(name); - if (!extension?.features?.theme?.length) break; + switch (inArg.data.action) { + case 'enable': + case 'install': { + const name = inArg.data.name; + const extension: ExtensionInfo = inArg.data.installedMap.get(name); + if (!extension?.features?.theme?.length) break; - //Change theme after install/enable extension - const themeID = extension.features.theme[0].id; - const id = this.themeExtension.getExtensionID(name, themeID); - const theme = this.themes.find(val => val.id === id); - if (!theme) return; - this.changeTheme(theme); - break; - } - default: { - break; - } + //Change theme after install/enable extension + const themeID = extension.features.theme[0].id; + const id = this.themeExtension.getExtensionID(name, themeID); + const theme = this.themes.find(val => val.id === id); + if (!theme) return; + this.changeTheme(theme); + break; + } + default: { + break; } } }); diff --git a/src/workbench/browser/src/app/core/services/web/web.service.ts b/src/workbench/browser/src/app/core/services/web/web.service.ts index 27ca39f8f..b8bb65e46 100644 --- a/src/workbench/browser/src/app/core/services/web/web.service.ts +++ b/src/workbench/browser/src/app/core/services/web/web.service.ts @@ -41,7 +41,7 @@ export class WebService { }, { id: 'mac-m1', - name: $localize`MacOS(M1) Client`, + name: $localize`MacOS(Apple) Client`, icon: 'mac', suffix: 'arm64.dmg', link: 'https://data.postcat.com/download/latest/Postcat-latest-arm64.dmg' @@ -59,12 +59,12 @@ export class WebService { if (this.isWeb) { this.settingService.putSettings({ 'backend.url': window.location.origin }); } else { - this.settingService.putSettings({ 'backend.url': APP_CONFIG.production ? 'https://postcat.com' : 'http://52.76.76.88:8080' }); + this.settingService.putSettings({ 'backend.url': APP_CONFIG.serverUrl }); } this.getClientResource(); } getGithubUrl(opts = {}) { - const href = 'https://github.com/Postcatlab/postcat/issues/new'; + const href = `${APP_CONFIG.GITHUB_REPO_URL}/issues/new`; const query = { assignees: '', labels: '', 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 6c7f1c0b7..55a73c2b1 100644 --- a/src/workbench/browser/src/app/layouts/navbar/navbar.component.html +++ b/src/workbench/browser/src/app/layouts/navbar/navbar.component.html @@ -3,7 +3,7 @@ = new Subject(); constructor( public electron: ElectronService, diff --git a/src/workbench/browser/src/app/layouts/navbar/share-navbar/share-navbar.component.ts b/src/workbench/browser/src/app/layouts/navbar/share-navbar/share-navbar.component.ts index 559084890..aab4e2b42 100644 --- a/src/workbench/browser/src/app/layouts/navbar/share-navbar/share-navbar.component.ts +++ b/src/workbench/browser/src/app/layouts/navbar/share-navbar/share-navbar.component.ts @@ -1,4 +1,5 @@ import { Component, OnInit } from '@angular/core'; +import { APP_CONFIG } from 'eo/workbench/browser/src/environments/environment'; import { ApiService } from '../../../shared/services/storage/api.service'; import { StoreService } from '../../../shared/store/state.service'; @@ -10,7 +11,7 @@ import { StoreService } from '../../../shared/store/state.service';
- + @@ -30,6 +31,7 @@ import { StoreService } from '../../../shared/store/state.service'; }) export class ShareNavbarComponent { projectName: string; + readonly APP_CONFIG = APP_CONFIG; constructor(private api: ApiService, private store: StoreService) { this.initProjectName(); } diff --git a/src/workbench/browser/src/app/layouts/sidebar/sidebar.component.ts b/src/workbench/browser/src/app/layouts/sidebar/sidebar.component.ts index e36824b09..11e0f043e 100644 --- a/src/workbench/browser/src/app/layouts/sidebar/sidebar.component.ts +++ b/src/workbench/browser/src/app/layouts/sidebar/sidebar.component.ts @@ -70,7 +70,7 @@ export class SidebarComponent implements OnInit, OnDestroy { watchInstalledExtensionsChange() { this.messageService.get().subscribe((inArg: Message) => { - if (inArg.type === 'installedExtensionsChange') { + if (inArg.type === 'extensionsChange') { if (!this.sidebar.visible) return; const installedMap = inArg.data.installedMap; const extensionIDs = Array.isArray(installedMap) ? installedMap.map(n => n.name) : [...installedMap.keys()]; diff --git a/src/workbench/browser/src/app/layouts/sidebar/sidebar.service.ts b/src/workbench/browser/src/app/layouts/sidebar/sidebar.service.ts index 375e5fd3f..55cb7daac 100644 --- a/src/workbench/browser/src/app/layouts/sidebar/sidebar.service.ts +++ b/src/workbench/browser/src/app/layouts/sidebar/sidebar.service.ts @@ -14,7 +14,7 @@ export class SidebarService { currentID: string = StorageUtil.get(this.selectKey); private collapsedChanged$: Subject = new Subject(); constructor(private setting: SettingService) { - this.collapsed = this.setting.get('workbench.sidebar.shrink') || false; + this.collapsed = this.setting.get('workbench.sidebar.shrink'); } getCollapsed() { return this.collapsed; diff --git a/src/workbench/browser/src/app/layouts/toolbar/toolbar.component.html b/src/workbench/browser/src/app/layouts/toolbar/toolbar.component.html index f44f7c69e..fcaaeff59 100644 --- a/src/workbench/browser/src/app/layouts/toolbar/toolbar.component.html +++ b/src/workbench/browser/src/app/layouts/toolbar/toolbar.component.html @@ -1,4 +1,4 @@ -
+
+
+ +
diff --git a/src/workbench/browser/src/app/layouts/toolbar/toolbar.component.ts b/src/workbench/browser/src/app/layouts/toolbar/toolbar.component.ts index 21fbc9338..46ae99f46 100644 --- a/src/workbench/browser/src/app/layouts/toolbar/toolbar.component.ts +++ b/src/workbench/browser/src/app/layouts/toolbar/toolbar.component.ts @@ -1,7 +1,9 @@ import { Component, OnInit, OnDestroy } from '@angular/core'; +import { FeatureControlService } from 'eo/workbench/browser/src/app/core/services/feature-control/feature-control.service'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; +import { ChatRobotService } from '../../modules/chat-robot/chat-robot.service'; import { SystemSettingComponent } from '../../modules/system-setting/system-setting.component'; import { ModalService } from '../../shared/services/modal.service'; import { SidebarService } from '../sidebar/sidebar.service'; @@ -12,19 +14,15 @@ import { SidebarService } from '../sidebar/sidebar.service'; styleUrls: ['./toolbar.component.scss'] }) export class ToolbarComponent implements OnDestroy { - sideBarCollapsed: boolean; hideSidebar = $localize`Hide Sidebar`; showSidebar = $localize`Show Sidebar`; private destroy$: Subject = new Subject(); - constructor(public sidebar: SidebarService, private modal: ModalService) { - this.sideBarCollapsed = this.sidebar.getCollapsed(); - this.sidebar - .onCollapsedChanged() - .pipe(takeUntil(this.destroy$)) - .subscribe(isCollapsed => { - this.sideBarCollapsed = isCollapsed; - }); - } + constructor( + public sidebar: SidebarService, + private modal: ModalService, + private chat: ChatRobotService, + public feature: FeatureControlService + ) {} toggleCollapsed() { this.sidebar.toggleCollapsed(); } @@ -39,6 +37,9 @@ export class ToolbarComponent implements OnDestroy { withoutFooter: true }); } + openRobot() { + this.chat.open(); + } ngOnDestroy(): void { this.destroy$.next(); this.destroy$.complete(); diff --git a/src/workbench/browser/src/app/modules/chat-robot/chat-robot-container/chat-robot.component.scss b/src/workbench/browser/src/app/modules/chat-robot/chat-robot-container/chat-robot.component.scss new file mode 100644 index 000000000..8dbe09d51 --- /dev/null +++ b/src/workbench/browser/src/app/modules/chat-robot/chat-robot-container/chat-robot.component.scss @@ -0,0 +1,30 @@ +:host { + display: flex; + flex-direction: column; + background-color: var(--background-color); + width: 500px; + height: 600px; + border-radius: 6px; + box-shadow: 0 0 10px var(--shadow-color); +} + +.header, +.messages, +.form { + padding: 15px 20px; +} + +.header, +.messages { + border-bottom: 1px solid var(--system-border-color); +} + +.header { + font-weight: bold; + font-size: 15px; +} + +.messages { + overflow-y: auto; + overflow-x: hidden; +} diff --git a/src/workbench/browser/src/app/modules/chat-robot/chat-robot-container/chat-robot.component.ts b/src/workbench/browser/src/app/modules/chat-robot/chat-robot-container/chat-robot.component.ts new file mode 100644 index 000000000..3bc4d7507 --- /dev/null +++ b/src/workbench/browser/src/app/modules/chat-robot/chat-robot-container/chat-robot.component.ts @@ -0,0 +1,60 @@ +/** + * API Design reference: https://github.dev/akveo/nebular/blob/master/src/playground/with-layout/chat/chat.module.ts + * Component Document:https://akveo.github.io/nebular/docs/components/chat-ui/overview/#nbchatcomponent + */ +import { AfterViewInit, Component, ContentChildren, ElementRef, Input, QueryList, TemplateRef, ViewChild } from '@angular/core'; + +import { ChatRobotMessageComponent } from '../chat-robot-message/chat-robot-message.component'; +import { ChatRobotService } from '../chat-robot.service'; + +@Component({ + selector: 'pc-chat-robot', + template: ` +
+ {{ title }} + +
+
+ +

+
+
+ +

Power by {{ powerBy.title }}

+
+ `, + styleUrls: ['./chat-robot.component.scss'] +}) +export class ChatRobotComponent implements AfterViewInit { + @Input() title: string; + @ContentChildren(ChatRobotMessageComponent) messages: QueryList; + + @ViewChild('scrollable') scrollable: ElementRef; + + @Input() powerBy: { title: string; link: string }; + + constructor(private chat: ChatRobotService) {} + closeRobot() { + this.chat.close(); + } + + ngAfterViewInit() { + this.messages.changes.subscribe(messages => { + this.messages = messages; + this.updateView(); + }); + + this.updateView(); + } + scrollListBottom() { + this.scrollable.nativeElement.scrollTop = this.scrollable.nativeElement.scrollHeight; + } + + updateView() { + this.scrollListBottom(); + } +} diff --git a/src/workbench/browser/src/app/modules/chat-robot/chat-robot-form/chat-robot-form.component.ts b/src/workbench/browser/src/app/modules/chat-robot/chat-robot-form/chat-robot-form.component.ts new file mode 100644 index 000000000..acc03a3fb --- /dev/null +++ b/src/workbench/browser/src/app/modules/chat-robot/chat-robot-form/chat-robot-form.component.ts @@ -0,0 +1,41 @@ +import { Component, EventEmitter, Input, Output } from '@angular/core'; + +@Component({ + selector: 'pc-chat-robot-form', + template: `
+ + +
`, + styles: [] +}) +export class ChatRobotFormComponent { + /** + * Predefined message text + * + * @type {string} + */ + @Input() message: string = ''; + @Input() placeholder: string = ''; + + @Input() loading: boolean = false; + + /** + * Send message triggle event + */ + @Output() readonly send = new EventEmitter<{ message: string }>(); + sendMessage() { + if (this.loading) return; + if (!String(this.message).trim().length) return; + this.send.emit({ message: this.message.replace(/^[\r\n]+|[\r\n]+$/g, '') }); + this.message = ''; + } +} diff --git a/src/workbench/browser/src/app/modules/chat-robot/chat-robot-message/chat-robot-message.component.scss b/src/workbench/browser/src/app/modules/chat-robot/chat-robot-message/chat-robot-message.component.scss new file mode 100644 index 000000000..1fbbd793b --- /dev/null +++ b/src/workbench/browser/src/app/modules/chat-robot/chat-robot-message/chat-robot-message.component.scss @@ -0,0 +1,40 @@ +:host { + display: flex; + margin-bottom: 1.5rem; + + .message-content { + padding: 1rem; + border-radius: 0.5rem; + min-width: fit-content; + max-width: 400px; + } + + .text { + word-wrap: break-word; + white-space: pre-wrap; + } + + &.not-reply { + flex-direction: row-reverse; + + .message-content { + background: var(--item-hover-background-color); + color: var(--text-color); + } + + nz-avatar { + margin-left: 5px; + } + } + + &.reply { + .message-content { + background: #36f; + color: #fff; + } + + nz-avatar { + margin-right: 5px; + } + } +} diff --git a/src/workbench/browser/src/app/modules/chat-robot/chat-robot-message/chat-robot-message.component.ts b/src/workbench/browser/src/app/modules/chat-robot/chat-robot-message/chat-robot-message.component.ts new file mode 100644 index 000000000..205d88fdc --- /dev/null +++ b/src/workbench/browser/src/app/modules/chat-robot/chat-robot-message/chat-robot-message.component.ts @@ -0,0 +1,53 @@ +import { AfterViewInit, Component, ElementRef, HostBinding, Input, OnInit, TemplateRef, ViewChild } from '@angular/core'; + +@Component({ + selector: 'pc-chat-robot-message', + template: ` + +
+

+ {{ sender }} + {{ date | date }} +

+
+ +
 {{ message }} 
+
+
+ `, + styleUrls: ['./chat-robot-message.component.scss'] +}) +export class ChatRobotMessageComponent { + /** + * Message sender + */ + @Input() sender: string; + + /** + * Message sender + */ + @Input() message: string; + + /** + * Message send date + */ + @Input() date: Date; + + /** + * Message send avatar + */ + @Input() avatar: string; + + /** + * Determines if a message is a reply + */ + @Input() + @HostBinding('class.reply') + reply: boolean; + + @HostBinding('class.not-reply') + get notReply() { + return !this.reply; + } + @Input() messageContent: TemplateRef; +} diff --git a/src/workbench/browser/src/app/modules/chat-robot/chat-robot.module.ts b/src/workbench/browser/src/app/modules/chat-robot/chat-robot.module.ts new file mode 100644 index 000000000..e1fdaaeb1 --- /dev/null +++ b/src/workbench/browser/src/app/modules/chat-robot/chat-robot.module.ts @@ -0,0 +1,19 @@ +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { EoNgButtonModule } from 'eo-ng-button'; +import { EoNgInputModule } from 'eo-ng-input'; +import { NzAvatarModule } from 'ng-zorro-antd/avatar'; + +import { EoIconparkIconModule } from '../eo-ui/iconpark-icon/eo-iconpark-icon.module'; +import { ChatRobotComponent } from './chat-robot-container/chat-robot.component'; +import { ChatRobotFormComponent } from './chat-robot-form/chat-robot-form.component'; +import { ChatRobotMessageComponent } from './chat-robot-message/chat-robot-message.component'; +import { ChatRobotService } from './chat-robot.service'; +@NgModule({ + declarations: [ChatRobotComponent, ChatRobotMessageComponent, ChatRobotFormComponent], + providers: [ChatRobotService], + imports: [CommonModule, EoNgInputModule, EoIconparkIconModule, NzAvatarModule, EoNgButtonModule, FormsModule], + exports: [ChatRobotComponent, ChatRobotMessageComponent, ChatRobotFormComponent] +}) +export class ChatRobotModule {} diff --git a/src/workbench/browser/src/app/modules/chat-robot/chat-robot.service.ts b/src/workbench/browser/src/app/modules/chat-robot/chat-robot.service.ts new file mode 100644 index 000000000..a1968d458 --- /dev/null +++ b/src/workbench/browser/src/app/modules/chat-robot/chat-robot.service.ts @@ -0,0 +1,18 @@ +import { Injectable } from '@angular/core'; + +@Injectable({ + providedIn: 'root' +}) +export class ChatRobotService { + isShow: boolean = false; + constructor() {} + open() { + this.isShow = true; + } + close() { + this.isShow = false; + } + toggleShowStatus() { + this.isShow = !this.isShow; + } +} 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 56642adc8..81a791ff3 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 @@ -36,7 +36,7 @@ export class ExportApiComponent implements OnInit { .get() .pipe(takeUntil(this.destroy$)) .subscribe((inArg: Message) => { - if (inArg.type === 'installedExtensionsChange') { + if (inArg.type === 'extensionsChange') { this.initData(); } }); diff --git a/src/workbench/browser/src/app/modules/extension-select/import-api/import-api.component.ts b/src/workbench/browser/src/app/modules/extension-select/import-api/import-api.component.ts index 47e50b127..681dc5d53 100644 --- a/src/workbench/browser/src/app/modules/extension-select/import-api/import-api.component.ts +++ b/src/workbench/browser/src/app/modules/extension-select/import-api/import-api.component.ts @@ -77,7 +77,7 @@ export class ImportApiComponent implements OnInit { .get() .pipe(takeUntil(this.destroy$)) .subscribe((inArg: Message) => { - if (inArg.type === 'installedExtensionsChange') { + if (inArg.type === 'extensionsChange') { this.initData(); } }); diff --git a/src/workbench/browser/src/app/modules/extension-select/push-api/push-api.component.ts b/src/workbench/browser/src/app/modules/extension-select/push-api/push-api.component.ts index 08e314804..2c1af1034 100644 --- a/src/workbench/browser/src/app/modules/extension-select/push-api/push-api.component.ts +++ b/src/workbench/browser/src/app/modules/extension-select/push-api/push-api.component.ts @@ -32,7 +32,7 @@ export class PushApiComponent implements OnInit { .get() .pipe(takeUntil(this.destroy$)) .subscribe((inArg: Message) => { - if (inArg.type === 'installedExtensionsChange') { + if (inArg.type === 'extensionsChange') { this.initData(); } }); 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 8be389d07..7ec92aab7 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 @@ -56,7 +56,7 @@ export class SyncApiComponent implements OnInit, OnChanges { .get() .pipe(takeUntil(this.destroy$)) .subscribe((inArg: Message) => { - if (inArg.type === 'installedExtensionsChange') { + if (inArg.type === 'extensionsChange') { this.initData(() => { if (this.supportList?.length) { const { key } = this.supportList.at(0); diff --git a/src/workbench/browser/src/app/modules/star-motivation/star-motivation.component.ts b/src/workbench/browser/src/app/modules/star-motivation/star-motivation.component.ts new file mode 100644 index 000000000..dc1d320a1 --- /dev/null +++ b/src/workbench/browser/src/app/modules/star-motivation/star-motivation.component.ts @@ -0,0 +1,47 @@ +import { Component, Input } from '@angular/core'; +import { APP_CONFIG } from 'eo/workbench/browser/src/environments/environment'; + +import { SharedModule } from '../../shared/shared.module'; + +@Component({ + selector: 'pc-star-motivation', + template: `

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

+ + + +
`, + standalone: true, + imports: [SharedModule], + styles: [ + ` + .favor-image-link { + background-color: #eee; + border-radius: 50%; + padding: 13px; + } + + .favor-image { + transition: all 0.3s; + } + .favor-image:hover { + transform: scale(1.2); + } + ` + ] +}) +export class StarMotivationComponent { + @Input() subject: string = 'Postcat'; + + readonly APP_CONFIG = APP_CONFIG; +} diff --git a/src/workbench/browser/src/app/modules/system-setting/common/about.component.scss b/src/workbench/browser/src/app/modules/system-setting/common/about.component.scss deleted file mode 100644 index 325081950..000000000 --- a/src/workbench/browser/src/app/modules/system-setting/common/about.component.scss +++ /dev/null @@ -1,13 +0,0 @@ -.favor-image { - transition: all 0.3s; - - &:hover { - transform: scale(1.2); - } -} - -.favor-image-link { - background-color: #eee; - border-radius: 50%; - padding: 13px; -} 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 2ee602321..951cd5b2b 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 @@ -1,4 +1,5 @@ import { Component, OnInit } from '@angular/core'; +import { APP_CONFIG } from 'eo/workbench/browser/src/environments/environment'; import { WebService } from '../../../core/services'; @Component({ @@ -8,9 +9,9 @@ import { WebService } from '../../../core/services';

Postcat

V{{ versionInfo?.version }}

- + -

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

- - - + + +

{{ item.label }}: {{ item.value }}

- `, - styleUrls: ['./about.component.scss'] + ` }) export class AboutComponent implements OnInit { list; versionInfo; - + readonly APP_CONFIG = APP_CONFIG; constructor(private web: WebService) {} ngOnInit(): void { diff --git a/src/workbench/browser/src/app/modules/system-setting/system-setting.module.ts b/src/workbench/browser/src/app/modules/system-setting/system-setting.module.ts index 690cc24ca..7e2cacf19 100644 --- a/src/workbench/browser/src/app/modules/system-setting/system-setting.module.ts +++ b/src/workbench/browser/src/app/modules/system-setting/system-setting.module.ts @@ -11,6 +11,7 @@ import { NzTreeViewModule } from 'ng-zorro-antd/tree-view'; import { EoSettingModule } from '../eo-ui/setting/setting.module'; import { LogoModule } from '../logo/logo.module'; +import { StarMotivationComponent } from '../star-motivation/star-motivation.component'; import { AboutComponent, DataStorageComponent, LanguageSwticherComponent, TokenComponent } from './common'; import { AccountComponent } from './common/account.component'; import { SelectThemeComponent } from './common/select-theme/select-theme.component'; @@ -27,7 +28,17 @@ const ANTDMODULES = [NzDividerModule, NzInputNumberModule, NzEmptyModule, NzDesc LanguageSwticherComponent, AboutComponent ], - imports: [EoSettingModule, LogoModule, FormsModule, EoNgTabsModule, ReactiveFormsModule, SharedModule, CommonModule, ...ANTDMODULES], + imports: [ + EoSettingModule, + StarMotivationComponent, + LogoModule, + FormsModule, + EoNgTabsModule, + ReactiveFormsModule, + SharedModule, + CommonModule, + ...ANTDMODULES + ], exports: [SystemSettingComponent] }) export class SystemSettingModule {} diff --git a/src/workbench/browser/src/app/pages/components/chatgpt-robot/chatgpt-robot.component.scss b/src/workbench/browser/src/app/pages/components/chatgpt-robot/chatgpt-robot.component.scss new file mode 100644 index 000000000..6e658cdd2 --- /dev/null +++ b/src/workbench/browser/src/app/pages/components/chatgpt-robot/chatgpt-robot.component.scss @@ -0,0 +1,6 @@ +:host { + position: fixed; + right: 25px; + bottom: 25px; + z-index: 10; +} diff --git a/src/workbench/browser/src/app/pages/components/chatgpt-robot/chatgpt-robot.component.ts b/src/workbench/browser/src/app/pages/components/chatgpt-robot/chatgpt-robot.component.ts new file mode 100644 index 000000000..4bb630d8b --- /dev/null +++ b/src/workbench/browser/src/app/pages/components/chatgpt-robot/chatgpt-robot.component.ts @@ -0,0 +1,174 @@ +import { animate, style, transition, trigger } from '@angular/animations'; +import { CommonModule } from '@angular/common'; +import { HttpClient } from '@angular/common/http'; +import { Component, OnInit } from '@angular/core'; +import { FeatureControlService } from 'eo/workbench/browser/src/app/core/services/feature-control/feature-control.service'; +import { ExtensionInfo } from 'eo/workbench/browser/src/app/shared/models/extension-manager'; +import { Message, MessageService } from 'eo/workbench/browser/src/app/shared/services/message'; +import { APP_CONFIG } from 'eo/workbench/browser/src/environments/environment'; + +import { ChatRobotModule } from '../../../modules/chat-robot/chat-robot.module'; +import { ChatRobotService } from '../../../modules/chat-robot/chat-robot.service'; +import { StarMotivationComponent } from '../../../modules/star-motivation/star-motivation.component'; + +type messageItem = { + text: string; + date: Date; + reply: boolean; + type: string; + user: { + name: string; + avatar: string; + }; +}; + +@Component({ + selector: 'pc-chatgpt-robot', + standalone: true, + imports: [StarMotivationComponent, CommonModule, ChatRobotModule], + animations: [ + trigger('slideInOut', [ + transition(':enter', [style({ transform: 'translateX(100%)' }), animate('300ms ease-in', style({ transform: 'translateX(0)' }))]), + transition(':leave', [animate('300ms ease-in', style({ transform: 'translateX(100%)' }))]) + ]) + ], + template: ` + + + + + + + + + + `, + styleUrls: ['./chatgpt-robot.component.scss'] +}) +export class ChatgptRobotComponent implements OnInit { + title = $localize`ChatGPT Robot`; + loading = false; + initMessage = { + date: new Date(), + reply: true, + type: 'init', + user: { + name: 'Postcat', + avatar: './assets/images/logo.svg' + } + }; + powerBy = { + title: 'APISPace', + link: 'https://www.apispace.com?utm_source=postcat&utm_medium=robot&utm_term=chatgptturbo' + }; + messages: messageItem[] = []; + constructor( + private http: HttpClient, + public chat: ChatRobotService, + public feature: FeatureControlService, + private message: MessageService + ) {} + ngOnInit() { + setTimeout(() => { + this.watchExtensionChange(); + }, 5 * 1000); + } + sendChatGPTMessage($event) { + this.loading = true; + this.http + .post(`${APP_CONFIG.EXTENSION_URL}/chatGPT`, { + message: this.messages.map(val => { + if (val.reply) { + return `assistant: ${val.text}`; + } + return `user: ${val.text}`; + }) + }) + .subscribe({ + next: (res: any) => { + this.loading = false; + if (!res?.result) { + this.messages.push({ + text: `ChatGPT Error:${res?.msg}`, + date: new Date(), + reply: true, + type: 'text', + user: { + name: 'ChatGPT', + avatar: 'https://data-apibee.apispace.com/license/167773762614902e10710-8d88-4d7e-b962-2df477b361ec' + } + }); + return; + } + this.messages.push({ + text: res.result, + date: new Date(), + reply: true, + type: 'text', + user: { + name: 'ChatGPT', + avatar: 'https://data-apibee.apispace.com/license/167773762614902e10710-8d88-4d7e-b962-2df477b361ec' + } + }); + }, + error: e => { + this.loading = false; + this.messages.push({ + text: 'ChatGPT Error', + date: new Date(), + reply: true, + type: 'text', + user: { + name: 'ChatGPT', + avatar: 'https://data-apibee.apispace.com/license/167773762614902e10710-8d88-4d7e-b962-2df477b361ec' + } + }); + } + }); + } + sendMessage($event) { + this.messages.push({ + text: $event.message, + date: new Date(), + reply: false, + type: 'text', + user: { + name: $localize`Visitor`, + avatar: 'https://data.eolink.com/PXMbLGmc2f0b29596764f7456eefb75478ed77b4fd172d9' + } + }); + this.sendChatGPTMessage($event); + } + watchExtensionChange() { + this.message.get().subscribe((inArg: Message) => { + if (inArg.type !== 'extensionsChange') return; + const extension: ExtensionInfo = inArg.data.extension; + if (!extension?.features?.featureControl?.length) return; + switch (inArg.data.action) { + case 'install': + case 'enable': { + this.chat.open(); + break; + } + } + }); + } +} diff --git a/src/workbench/browser/src/app/pages/components/third-login/third-login.component.ts b/src/workbench/browser/src/app/pages/components/third-login/third-login.component.ts index ba604faba..214472151 100644 --- a/src/workbench/browser/src/app/pages/components/third-login/third-login.component.ts +++ b/src/workbench/browser/src/app/pages/components/third-login/third-login.component.ts @@ -3,6 +3,7 @@ import { WebService } from 'eo/workbench/browser/src/app/core/services'; import { LanguageService } from 'eo/workbench/browser/src/app/core/services/language/language.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 { APP_CONFIG } from 'eo/workbench/browser/src/environments/environment'; import { autorun, reaction } from 'mobx'; // * type(0=wechat, 1=qq, 2=github, 3=feishu, 4=corp_wechat, 5=ding_talk, 6=oauth2) @@ -77,7 +78,7 @@ export class ThirdLoginComponent implements OnInit { // * get login url const [res, err] = await this.api.api_userThirdLogin({ type: LoginType[type], - redirectUri: this.web.isWeb ? window.location.href.split('?').at(0) : 'https://postcat.com', + redirectUri: this.web.isWeb ? window.location.href.split('?').at(0) : APP_CONFIG.serverUrl, appType: 0, client: 0 }); 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 96961a94e..12ab440cb 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 @@ -32,7 +32,7 @@
-
+
Install
+
+ +

* This exension only support web

+
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 81807924e..c3d9e2d07 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 @@ -1,9 +1,9 @@ import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core'; -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 { APP_CONFIG } from 'eo/workbench/browser/src/environments/environment'; import { WebService } from '../../../core/services/web/web.service'; import { ExtensionService } from '../../../shared/services/extensions/extension.service'; @@ -20,15 +20,15 @@ export class ExtensionDetailComponent implements OnInit { @Input() nzSelectedIndex = 0; isOperating = false; introLoading = false; + isAvailableElectron = true; changelogLoading = false; isNotLoaded = true; extensionDetail: EoExtensionInfo; - + readonly APP_CONFIG = APP_CONFIG; changeLog = ''; changeLogNotFound = false; constructor( public extensionService: ExtensionService, - private route: ActivatedRoute, private webService: WebService, private electron: ElectronService, private language: LanguageService, @@ -68,14 +68,13 @@ export class ExtensionDetailComponent implements OnInit { this.introLoading = false; this.isNotLoaded = false; this.extensionDetail.introduction ||= $localize`This plugin has no documentation yet.`; - + this.isAvailableElectron = this.checkisAvailableElectron(this.extensionDetail); this.fetchChangelog(this.language.systemLanguage); setTimeout(() => { this.nzSelectedIndex = nzSelectedIndex; }); } - async fetchChangelog(locale = '') { //Default locale en-US if (locale === 'en-US') { @@ -136,23 +135,25 @@ ${log} } finally { } } - handleTabChange = e => { if (e.tab?.nzTitle === 'ChangeLog') { this.fetchChangelog(); } }; - + checkisAvailableElectron(pkgInfo): boolean { + if (this.electron.isElectron && this.extensionDetail.browser && !this.extensionDetail.main) return false; + return true; + } private async manageExtension(operate: string, id) { this.isOperating = true; switch (operate) { case 'install': { const { name, version, i18n } = this.extensionDetail; + this.extensionDetail['enabled'] = true; this.extensionDetail.installed = await this.extensionService.installExtension({ name, version }); - this.extensionDetail['enabled'] = true; this.trace.report('install_extension_success', { extension_id: id }); break; } diff --git a/src/workbench/browser/src/app/pages/pages.component.html b/src/workbench/browser/src/app/pages/pages.component.html index 7fe3a09dd..1fbac22b7 100644 --- a/src/workbench/browser/src/app/pages/pages.component.html +++ b/src/workbench/browser/src/app/pages/pages.component.html @@ -19,7 +19,10 @@ + + +

We use cookies

diff --git a/src/workbench/browser/src/app/pages/pages.module.ts b/src/workbench/browser/src/app/pages/pages.module.ts index 7c762e3a6..d69081c48 100644 --- a/src/workbench/browser/src/app/pages/pages.module.ts +++ b/src/workbench/browser/src/app/pages/pages.module.ts @@ -9,13 +9,19 @@ import { ToolbarModule } from '../layouts/toolbar/toolbar.module'; import { NpsMaskModule } from '../modules/nps-mask/nps-mask.module'; import { SystemSettingModule } from '../modules/system-setting/system-setting.module'; import { SharedModule } from '../shared/shared.module'; +import { ChatgptRobotComponent } from './components/chatgpt-robot/chatgpt-robot.component'; 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'; @NgModule({ + declarations: [PagesComponent, SidebarComponent, LocalWorkspaceTipComponent, UserModalComponent, ThirdLoginComponent], + exports: [], + providers: [], + schemas: [], imports: [ + ChatgptRobotComponent, PagesRoutingModule, NpsMaskModule, NzNotificationModule, @@ -24,10 +30,6 @@ import { PagesComponent } from './pages.component'; NavbarModule, ToolbarModule, SharedModule - ], - declarations: [PagesComponent, SidebarComponent, LocalWorkspaceTipComponent, UserModalComponent, ThirdLoginComponent], - exports: [], - providers: [], - schemas: [] + ] }) export class PagesModule {} 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 16df8b2cb..8f07ef037 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 @@ -98,7 +98,7 @@ export class ApiComponent implements OnInit, OnDestroy { } watchInstalledExtensionsChange() { this.messageService.get().subscribe((inArg: Message) => { - if (inArg.type === 'installedExtensionsChange') { + if (inArg.type === 'extensionsChange') { const name = inArg.data.name; const extension: ExtensionInfo = inArg.data.installedMap.get(name); if (!extension?.features?.apiPreviewTab) return; 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 86e65d815..b047df91b 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 @@ -38,6 +38,7 @@ export interface ExtensionInfo { //Unique npm package name name: string; version: string; + browser: string; author: string | { name: 'string' }; //Entry js file,webRender environment main: string; diff --git a/src/workbench/browser/src/app/shared/services/extensions/extension-store.service.ts b/src/workbench/browser/src/app/shared/services/extensions/extension-store.service.ts index b2fa7308a..c3a3d29ca 100644 --- a/src/workbench/browser/src/app/shared/services/extensions/extension-store.service.ts +++ b/src/workbench/browser/src/app/shared/services/extensions/extension-store.service.ts @@ -1,17 +1,44 @@ import { Injectable } from '@angular/core'; +import { TranslateService } from 'eo/platform/common/i18n'; +import { LanguageService } from '../../../core/services/language/language.service'; import { ExtensionInfo } from '../../models/extension-manager'; - @Injectable({ providedIn: 'root' }) -export class ExtensionStoreService { +export class ExtensionCommonService { private extensionList: ExtensionInfo[]; - constructor() {} + constructor(private language: LanguageService) {} setExtensionList(list) { this.extensionList = list; } get getExtensionList() { return this.extensionList; } + private translateModule(module: ExtensionInfo) { + const lang = this.language.systemLanguage; + //If extension from web,transalte package content from http moduleInfo + //Locale extension will translate from local i18n file + + const locale = module.i18n?.find(val => val.locale === lang)?.package; + if (!locale) { + return module; + } + module = new TranslateService(module, locale).translate(); + return module; + } + /** + * Parse extension info for ui show + * such as: author, translate ... + * + * @param pkg + * @returns + */ + parseExtensionInfo(pkg): ExtensionInfo { + pkg = this.translateModule(pkg); + if (typeof pkg.author === 'object') { + pkg.author = pkg.author['name'] || ''; + } + return pkg; + } } diff --git a/src/workbench/browser/src/app/shared/services/extensions/extension.service.ts b/src/workbench/browser/src/app/shared/services/extensions/extension.service.ts index 924df547e..fcdbf72dc 100644 --- a/src/workbench/browser/src/app/shared/services/extensions/extension.service.ts +++ b/src/workbench/browser/src/app/shared/services/extensions/extension.service.ts @@ -8,7 +8,7 @@ import { MessageService } from 'eo/workbench/browser/src/app/shared/services/mes import { APP_CONFIG } from 'eo/workbench/browser/src/environments/environment'; import { lastValueFrom, Subscription } from 'rxjs'; -import { ExtensionStoreService } from './extension-store.service'; +import { ExtensionCommonService } from './extension-store.service'; import { WebExtensionService } from './webExtension.service'; const defaultExtensions = ['postcat-export-openapi', 'postcat-import-openapi']; @@ -27,7 +27,7 @@ export class ExtensionService { constructor( private http: HttpClient, private electron: ElectronService, - private store: ExtensionStoreService, + private extensionCommon: ExtensionCommonService, private language: LanguageService, private webExtensionService: WebExtensionService, private messageService: MessageService @@ -48,7 +48,6 @@ export class ExtensionService { if (this.installedList.some(m => m.name === val.name)) return; installedName.push(val.name); }); - //* Install Extension by foreach because of async const uniqueNames = [...Array.from(new Set(installedName)), ...this.webExtensionService.debugExtensionNames]; for (let i = 0; i < uniqueNames.length; i++) { @@ -66,7 +65,7 @@ export class ExtensionService { if (this.electron.isElectron) { result = window.electron.getInstalledExtensions() || new Map(); result.forEach((value, key) => { - result.set(key, this.parseExtensionInfo(value)); + result.set(key, this.extensionCommon.parseExtensionInfo(value)); }); } else { result = this.webExtensionService.getExtensions(); @@ -85,9 +84,10 @@ export class ExtensionService { this.extensionIDs = this.updateExtensionIDs(); this.installedList = Array.from(this.installedMap.values()).filter(it => this.extensionIDs.includes(it.name)); this.messageService.send({ - type: 'installedExtensionsChange', + type: 'extensionsChange', data: { installedMap: this.installedMap, + extension: this.installedList.find(val => val.name === opts.name), ...opts } }); @@ -117,8 +117,8 @@ export class ExtensionService { } result.data = [ - ...result.data.filter(val => this.installedList.every(childVal => childVal.name !== val.name)), - //Local debug package + ...debugExtensions, + //Installed package ...this.installedList .filter(n => { const target = result.data.find(m => n.name === m.name); @@ -132,18 +132,18 @@ export class ExtensionService { } return module; }), - ...debugExtensions + ...result.data.filter(val => this.installedList.every(childVal => childVal.name !== val.name)) ]; //Handle feature data result.data = result.data.map(module => { - let result = this.parseExtensionInfo(module); + let result = this.extensionCommon.parseExtensionInfo(module); return result; }); //Get debug extensions this.webExtensionService.debugExtensions = result.data.filter(val => val.isDebug); - this.store.setExtensionList(result.data); + this.extensionCommon.setExtensionList(result.data); this.requestPending = null; this.isFirstInit = false; resolve([result, originData]); @@ -166,7 +166,7 @@ export class ExtensionService { Object.assign(result, this.installedMap.get(name), { installed: true }); result.enable = this.isEnable(result.name); } - result = this.parseExtensionInfo(result); + result = this.extensionCommon.parseExtensionInfo(result); return result; } /** @@ -205,10 +205,12 @@ export class ExtensionService { } } async uninstallExtension(name): Promise { + const extension = this.installedList.find(it => it.name === name); const successCallback = () => { this.updateInstalledInfo(this.getExtensions(), { action: 'uninstall', - name + name, + extension }); }; if (this.electron.isElectron) { @@ -317,18 +319,4 @@ export class ExtensionService { .filter(it => it) .filter(it => !this.ignoreList.includes(it)); } - /** - * Parse extension info for ui show - * such as: author, translate ... - * - * @param pkg - * @returns - */ - private parseExtensionInfo(pkg): ExtensionInfo { - pkg = this.webExtensionService.translateModule(pkg); - if (typeof pkg.author === 'object') { - pkg.author = pkg.author['name'] || ''; - } - return pkg; - } } diff --git a/src/workbench/browser/src/app/shared/services/extensions/webExtension.service.ts b/src/workbench/browser/src/app/shared/services/extensions/webExtension.service.ts index 45c48bb8d..81d63db21 100644 --- a/src/workbench/browser/src/app/shared/services/extensions/webExtension.service.ts +++ b/src/workbench/browser/src/app/shared/services/extensions/webExtension.service.ts @@ -7,8 +7,7 @@ import { APP_CONFIG } from 'eo/workbench/browser/src/environments/environment'; import { WebService } from '../../../core/services'; import { LanguageService } from '../../../core/services/language/language.service'; -import { ExtensionInfo } from '../../models/extension-manager'; -import { ExtensionStoreService } from './extension-store.service'; +import { ExtensionCommonService } from './extension-store.service'; type ExtensionItem = { name: string; @@ -26,13 +25,19 @@ const extKey = 'ext_installed_list'; }) export class WebExtensionService { installedList: ExtensionItem[] = StorageUtil.get(extKey, []); - disabledExtensionNames = []; - debugExtensions = []; + /** + * Debug Extensions Name + */ debugExtensionNames; + /** + * Storage Debug Extensions Info + */ + debugExtensions = []; + disabledExtensionNames = []; resourceUrl = 'https://unpkg.com'; - constructor(private web: WebService, private language: LanguageService, private store: ExtensionStoreService) { + constructor(private web: WebService, private language: LanguageService, private extensionCommon: ExtensionCommonService) { const isDevEnv = !APP_CONFIG.production || this.web.isVercel || 'http://52.76.76.88:8080'.includes(window.location.hostname); - this.debugExtensionNames = isDevEnv ? [] : []; + this.debugExtensionNames = isDevEnv && this.web.isWeb ? [] : []; } async installExtension(extName: string, { version = 'latest' }) { //Get package.json @@ -165,7 +170,7 @@ export class WebExtensionService { } async getPkgInfo(extName: string, version = 'latest') { - const newestExt = this.store.getExtensionList.find(val => val.name === extName); + const newestExt = this.extensionCommon.getExtensionList.find(val => val.name === extName); version = version === 'latest' ? newestExt?.version || 'latest' : version; let pkgInfo; if (version === newestExt?.version) { @@ -221,20 +226,8 @@ export class WebExtensionService { if (!pkgInfo.i18n?.length && pkgInfo.features.i18n) { pkgInfo.i18n = await this.getExtI18n(pkgInfo.name); } - pkgInfo = this.translateModule(pkgInfo); + pkgInfo = this.extensionCommon.parseExtensionInfo(pkgInfo); return pkgInfo; } - translateModule(module: ExtensionInfo) { - const lang = this.language.systemLanguage; - //If extension from web,transalte package content from http moduleInfo - //Locale extension will translate from local i18n file - - const locale = module.i18n?.find(val => val.locale === lang)?.package; - if (!locale) { - return module; - } - module = new TranslateService(module, locale).translate(); - return module; - } } diff --git a/src/workbench/browser/src/app/shared/services/storage/http/lib/baseUrl.service.ts b/src/workbench/browser/src/app/shared/services/storage/http/lib/baseUrl.service.ts index 3bae9d080..e6430023e 100644 --- a/src/workbench/browser/src/app/shared/services/storage/http/lib/baseUrl.service.ts +++ b/src/workbench/browser/src/app/shared/services/storage/http/lib/baseUrl.service.ts @@ -1,7 +1,5 @@ import { HttpErrorResponse, HttpEvent, HttpHandler, HttpHeaders, HttpInterceptor, HttpRequest, HttpResponse } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { WebService } from 'eo/workbench/browser/src/app/core/services'; -import { SettingService } from 'eo/workbench/browser/src/app/modules/system-setting/settings.service'; import { MessageService } from 'eo/workbench/browser/src/app/shared/services/message'; import { StoreService } from 'eo/workbench/browser/src/app/shared/store/state.service'; import { filter, map, tap, Observable, catchError } from 'rxjs'; @@ -17,14 +15,16 @@ export class BaseUrlInterceptor implements HttpInterceptor { constructor(private store: StoreService, private messageService: MessageService) {} intercept(req: HttpRequest, next: HttpHandler): Observable> { + const isSystemUrl = !this.protocolReg.test(req.url); + if (!isSystemUrl) return next.handle(req); + const serverUrl = this.store.remoteUrl || ''; req = req.clone({ - url: this.protocolReg.test(req.url) ? req.url : `${serverUrl}${req.url}`, + url: `${serverUrl}${req.url}`, headers: new HttpHeaders({ Authorization: this.store.getLoginInfo?.accessToken || '' }) }); - return next.handle(req).pipe( filter(event => event instanceof HttpResponse && [200, 201].includes(event.status)), map((event: HttpResponse) => diff --git a/src/workbench/browser/src/app/shared/shared.module.ts b/src/workbench/browser/src/app/shared/shared.module.ts index 7b97335d4..6b05bf268 100644 --- a/src/workbench/browser/src/app/shared/shared.module.ts +++ b/src/workbench/browser/src/app/shared/shared.module.ts @@ -13,7 +13,6 @@ import { EoNgSelectModule } from 'eo-ng-select'; import { EoNgSwitchModule } from 'eo-ng-switch'; import { ExtensionFeedbackComponent } from 'eo/workbench/browser/src/app/shared/components/extension-feedback/extension-feedback'; import { EoSchemaFormComponent } from 'eo/workbench/browser/src/app/shared/components/schema-form/schema-form.component'; -import { TraceDirective } from 'eo/workbench/browser/src/app/shared/directives/trace.directive'; import { NzDividerModule } from 'ng-zorro-antd/divider'; import { NzEmptyModule } from 'ng-zorro-antd/empty'; import { NzFormModule } from 'ng-zorro-antd/form'; @@ -29,6 +28,7 @@ import { EoIconparkIconModule } from '../modules/eo-ui/iconpark-icon/eo-iconpark import { DownloadClientModalComponent } from './components/download-client.component'; import { ExtensionAppComponent } from './components/extension-app/extension-app.component'; import { ClickStopPropagationDirective, FormFocusDirective } from './directives'; +import { TraceDirective } from './directives/trace.directive'; const COMPONENTS = [DownloadClientModalComponent, ExtensionAppComponent, EoSchemaFormComponent, ExtensionFeedbackComponent]; const DIRECTIVES = [ClickStopPropagationDirective, FormFocusDirective, TraceDirective]; diff --git a/src/workbench/browser/src/environments/common.ts b/src/workbench/browser/src/environments/common.constant.ts similarity index 65% rename from src/workbench/browser/src/environments/common.ts rename to src/workbench/browser/src/environments/common.constant.ts index c5f43ee21..1e92748f6 100644 --- a/src/workbench/browser/src/environments/common.ts +++ b/src/workbench/browser/src/environments/common.constant.ts @@ -1,5 +1,7 @@ -import { ELETRON_APP_CONFIG } from 'eo/environment'; -export const COMMON_CONFIG = { ...ELETRON_APP_CONFIG }; +import { COMMON_APP_CONFIG } from 'eo/environment'; + +export const COMMON_CONFIG = { ...COMMON_APP_CONFIG }; + export type APP_CONFIG_INSTANT = { production: boolean; environment: 'DEV' | 'PROD'; diff --git a/src/workbench/browser/src/environments/environment.dev.ts b/src/workbench/browser/src/environments/environment.dev.ts index fcc3b9298..b3406b7a1 100644 --- a/src/workbench/browser/src/environments/environment.dev.ts +++ b/src/workbench/browser/src/environments/environment.dev.ts @@ -1,4 +1,4 @@ -import { COMMON_CONFIG } from 'eo/workbench/browser/src/environments/common'; +import { COMMON_CONFIG } from 'eo/workbench/browser/src/environments/common.constant'; export const APP_CONFIG = { serverUrl: 'http://52.76.76.88:8080', production: false, diff --git a/src/workbench/browser/src/environments/environment.prod.ts b/src/workbench/browser/src/environments/environment.prod.ts index 0a9b86859..2b985f183 100644 --- a/src/workbench/browser/src/environments/environment.prod.ts +++ b/src/workbench/browser/src/environments/environment.prod.ts @@ -1,4 +1,4 @@ -import { APP_CONFIG_INSTANT, COMMON_CONFIG } from 'eo/workbench/browser/src/environments/common'; +import { APP_CONFIG_INSTANT, COMMON_CONFIG } from 'eo/workbench/browser/src/environments/common.constant'; export const APP_CONFIG = { serverUrl: 'https://postcat.com', diff --git a/src/workbench/browser/src/environments/environment.ts b/src/workbench/browser/src/environments/environment.ts index e3132cf21..365cc9dd1 100644 --- a/src/workbench/browser/src/environments/environment.ts +++ b/src/workbench/browser/src/environments/environment.ts @@ -1,7 +1,7 @@ -import { APP_CONFIG_INSTANT, COMMON_CONFIG } from 'eo/workbench/browser/src/environments/common'; +import { APP_CONFIG_INSTANT, COMMON_CONFIG } from 'eo/workbench/browser/src/environments/common.constant'; export const APP_CONFIG: APP_CONFIG_INSTANT | any = { production: false, environment: 'LOCAL', - ...COMMON_CONFIG, + ...COMMON_CONFIG };