diff --git a/src/workbench/browser/locale/messages.xlf b/src/workbench/browser/locale/messages.xlf index 55d8b21c..1046bc90 100644 --- a/src/workbench/browser/locale/messages.xlf +++ b/src/workbench/browser/locale/messages.xlf @@ -20,6 +20,20 @@ 118 + + Release Notes + + src/app/core/services/notification.service.ts + 26 + + + + There will be downtime updates from :00 to :00 today, and may be temporarily inaccessible. + + src/app/core/services/notification.service.ts + 27 + + Debug Theme @@ -87,21 +101,21 @@ Windows Client src/app/core/services/web/web.service.ts - 19 + 21 MacOS(Intel) Client src/app/core/services/web/web.service.ts - 27 + 29 MacOS(M1) Client src/app/core/services/web/web.service.ts - 34 + 36 @@ -352,7 +366,7 @@ src/app/pages/extension/list/extension-list.component.html - 40 + 42 src/app/pages/workspace/overview/workspace-overview.component.html @@ -573,7 +587,7 @@ src/app/pages/workspace/project/api/websocket/websocket.component.ts - 313 + 318 src/app/shared/services/modal.service.ts @@ -775,29 +789,6 @@ 99 - - - - src/app/modules/download-client/download-client.component.ts - 13 - - - src/app/pages/extension/detail/components/extensions-settings.component.ts - 33 - - - src/app/pages/workspace/overview/workspace-overview.component.html - 4 - - - src/app/pages/workspace/project/api/http/mock/api-mock.component.html - 3,4 - - - src/app/pages/workspace/project/api/http/test/body/api-test-body.component.html - 40 - - Download @@ -1010,7 +1001,7 @@ src/app/pages/workspace/project/api/env/env-list/env-list.component.html - 33 + 34 src/app/pages/workspace/project/setting/project-setting.component.ts @@ -1029,14 +1020,14 @@ src/app/pages/workspace/project/api/env/env-list/env-list.component.html - 35 + 36 Please import the file first src/app/modules/extension-select/import-api/import-api.component.ts - 90 + 84 @@ -1296,6 +1287,25 @@ 24 + + + + src/app/pages/extension/detail/components/extensions-settings.component.ts + 33 + + + src/app/pages/workspace/overview/workspace-overview.component.html + 4 + + + src/app/pages/workspace/project/api/http/mock/api-mock.component.html + 3,4 + + + src/app/pages/workspace/project/api/http/test/body/api-test-body.component.html + 40 + + Save Success @@ -1339,7 +1349,7 @@ src/app/pages/extension/list/extension-list.component.html - 43 + 45 @@ -1441,7 +1451,7 @@ src/app/pages/extension/list/extension-list.component.html - 21 + 23 @@ -1683,7 +1693,7 @@ src/app/shared/store/effect.service.ts - 221 + 218 @@ -1754,7 +1764,7 @@ src/app/pages/workspace/project/member/project-member.component.ts - 69 + 67 @@ -1772,7 +1782,7 @@ src/app/pages/workspace/project/member/project-member.component.ts - 160 + 158 @@ -1783,7 +1793,7 @@ src/app/pages/workspace/project/member/project-member.component.ts - 163 + 161 @@ -1881,7 +1891,7 @@ src/app/pages/workspace/project/member/project-member.component.ts - 81 + 79 @@ -1894,7 +1904,7 @@ src/app/pages/workspace/project/member/project-member.component.ts - 83,85 + 81,83 @@ -2087,49 +2097,49 @@ Edit Group src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 151 + 146 Delete Group src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 160 + 155 Deletion Confirmation? src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 173 + 168 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 - 174,176 + 169,171 Add Group src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 192 + 187 Import API src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 202 + 197 Failed to ,Please upgrade extension or try again later src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 212 + 207 src/app/pages/workspace/project/setting/project-setting.component.ts @@ -2140,7 +2150,7 @@ successfully src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 218 + 213 src/app/pages/workspace/project/setting/project-setting.component.ts @@ -2486,7 +2496,7 @@ src/app/pages/workspace/project/api/http/mock/api-mock.component.ts - 65 + 64 @@ -2886,28 +2896,28 @@ Connect to is failed src/app/pages/workspace/project/api/websocket/websocket.component.ts - 261 + 266 Do you want to leave the page? src/app/pages/workspace/project/api/websocket/websocket.component.ts - 308 + 313 After leaving, the current long connection is no longer maintained, whether to confirm to leave? src/app/pages/workspace/project/api/websocket/websocket.component.ts - 309 + 314 Leave src/app/pages/workspace/project/api/websocket/websocket.component.ts - 321 + 326 @@ -2932,21 +2942,21 @@ Add src/app/pages/workspace/project/member/project-member.component.ts - 60,61 + 58,59 Project Members src/app/pages/workspace/project/member/project-member.component.ts - 67 + 65 Please select a member src/app/pages/workspace/project/member/project-member.component.ts - 154 + 152 diff --git a/src/workbench/browser/locale/messages.zh.xlf b/src/workbench/browser/locale/messages.zh.xlf index 3fb3ce17..b5d71cf8 100644 --- a/src/workbench/browser/locale/messages.zh.xlf +++ b/src/workbench/browser/locale/messages.zh.xlf @@ -22,6 +22,22 @@ 平台 + + Release Notes + + src/app/core/services/notification.service.ts + 26 + + 更新说明 + + + There will be downtime updates from :00 to :00 today, and may be temporarily inaccessible. + + src/app/core/services/notification.service.ts + 27 + + 今天 :00至 :00 将会进行停机更新,可能暂时无法访问。 + Debug Theme @@ -98,7 +114,7 @@ Windows Client src/app/core/services/web/web.service.ts - 19 + 21 Windows 客户端 @@ -106,7 +122,7 @@ MacOS(Intel) Client src/app/core/services/web/web.service.ts - 27 + 29 MacOS(Intel) 客户端 @@ -114,7 +130,7 @@ MacOS(M1) Client src/app/core/services/web/web.service.ts - 34 + 36 MacOS(M1) 客户端 @@ -394,7 +410,7 @@ src/app/pages/extension/list/extension-list.component.html - 40 + 42 src/app/pages/workspace/overview/workspace-overview.component.html @@ -634,7 +650,7 @@ src/app/pages/workspace/project/api/websocket/websocket.component.ts - 313 + 318 src/app/shared/services/modal.service.ts @@ -1090,7 +1106,7 @@ src/app/pages/workspace/project/api/env/env-list/env-list.component.html - 33 + 34 src/app/pages/workspace/project/setting/project-setting.component.ts @@ -1110,7 +1126,7 @@ src/app/pages/workspace/project/api/env/env-list/env-list.component.html - 35 + 36 是否确定删除? @@ -1118,7 +1134,7 @@ Please import the file first src/app/modules/extension-select/import-api/import-api.component.ts - 90 + 84 请先导入文件 @@ -1414,6 +1430,28 @@ 请输入 + + + + + + src/app/pages/extension/detail/components/extensions-settings.component.ts + 33 + + + src/app/pages/workspace/overview/workspace-overview.component.html + 4 + + + src/app/pages/workspace/project/api/http/mock/api-mock.component.html + 3,4 + + + src/app/pages/workspace/project/api/http/test/body/api-test-body.component.html + 40 + + + Save Success @@ -1462,7 +1500,7 @@ src/app/pages/extension/list/extension-list.component.html - 43 + 45 介绍 @@ -1578,7 +1616,7 @@ src/app/pages/extension/list/extension-list.component.html - 21 + 23 已安装 @@ -1852,7 +1890,7 @@ src/app/shared/store/effect.service.ts - 221 + 218 创建项目失败! @@ -1932,7 +1970,7 @@ src/app/pages/workspace/project/member/project-member.component.ts - 69 + 67 添加 @@ -1952,7 +1990,7 @@ src/app/pages/workspace/project/member/project-member.component.ts - 160 + 158 添加成员失败 @@ -1964,7 +2002,7 @@ src/app/pages/workspace/project/member/project-member.component.ts - 163 + 161 添加成员成功 @@ -2072,7 +2110,7 @@ src/app/pages/workspace/project/member/project-member.component.ts - 81 + 79 目前正在使用本地工作空间,无法邀请成员。 @@ -2084,7 +2122,7 @@ src/app/pages/workspace/project/member/project-member.component.ts - 83,85 + 81,83 你可以创建一个云空间之后再邀请成员协作。 @@ -2303,7 +2341,7 @@ Edit Group src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 151 + 146 编辑分组 @@ -2311,7 +2349,7 @@ Delete Group src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 160 + 155 删除分组 @@ -2319,7 +2357,7 @@ Deletion Confirmation? src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 173 + 168 确认删除? @@ -2327,7 +2365,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 - 174,176 + 169,171 确认要删除数据 <strong title=""></strong> 吗?删除后不可恢复! @@ -2335,7 +2373,7 @@ Add Group src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 192 + 187 添加分组 @@ -2343,7 +2381,7 @@ Import API src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 202 + 197 导入 API @@ -2351,7 +2389,7 @@ Failed to ,Please upgrade extension or try again later src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 212 + 207 src/app/pages/workspace/project/setting/project-setting.component.ts @@ -2363,7 +2401,7 @@ successfully src/app/pages/workspace/project/api/components/group/tree/api-group-tree.component.ts - 218 + 213 src/app/pages/workspace/project/setting/project-setting.component.ts @@ -2747,7 +2785,7 @@ src/app/pages/workspace/project/api/http/mock/api-mock.component.ts - 65 + 64 新建 Mock @@ -3199,7 +3237,7 @@ Connect to is failed src/app/pages/workspace/project/api/websocket/websocket.component.ts - 261 + 266 连接到 失败 @@ -3207,7 +3245,7 @@ Do you want to leave the page? src/app/pages/workspace/project/api/websocket/websocket.component.ts - 308 + 313 你想要离开当前页面吗? @@ -3215,7 +3253,7 @@ After leaving, the current long connection is no longer maintained, whether to confirm to leave? src/app/pages/workspace/project/api/websocket/websocket.component.ts - 309 + 314 当前的长连接将会断开,是否确认离开? @@ -3223,7 +3261,7 @@ Leave src/app/pages/workspace/project/api/websocket/websocket.component.ts - 321 + 326 离开 @@ -3251,7 +3289,7 @@ Add src/app/pages/workspace/project/member/project-member.component.ts - 60,61 + 58,59 添加 @@ -3259,7 +3297,7 @@ Project Members src/app/pages/workspace/project/member/project-member.component.ts - 67 + 65 项目成员 @@ -3267,7 +3305,7 @@ Please select a member src/app/pages/workspace/project/member/project-member.component.ts - 154 + 152 请选择成员 @@ -3441,6 +3479,10 @@ src/app/shared/services/storage/db/dataSource/migration.ts 33 + + src/app/shared/services/storage/db/services/workspace.service.ts + 16 + 个人工作空间 diff --git a/src/workbench/browser/src/app/app.module.ts b/src/workbench/browser/src/app/app.module.ts index 42a128d4..04688200 100644 --- a/src/workbench/browser/src/app/app.module.ts +++ b/src/workbench/browser/src/app/app.module.ts @@ -11,6 +11,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { WarningFill } from '@ant-design/icons-angular/icons'; import { EoNgFeedbackTooltipModule, EoNgFeedbackMessageModule } from 'eo-ng-feedback'; import { LanguageService } from 'eo/workbench/browser/src/app/core/services/language/language.service'; +import { NotificationService } from 'eo/workbench/browser/src/app/core/services/notification.service'; import { ExtensionService } from 'eo/workbench/browser/src/app/shared/services/extensions/extension.service'; import { GlobalProvider } from 'eo/workbench/browser/src/app/shared/services/globalProvider'; import { IndexedDBStorage } from 'eo/workbench/browser/src/app/shared/services/storage/IndexedDB/lib/'; @@ -83,22 +84,34 @@ export class AppModule { private mockService: MockService, private global: GlobalProvider, private theme: ThemeService, - private extensionService: ExtensionService + private extensionService: ExtensionService, + private notification: NotificationService ) { this.init(); - this.mockService.init(); - this.global.injectGlobalData(); + } + async init() { + //* Init language if (APP_CONFIG.production) { this.lang.init(); } - } - async init() { + + //* Init theme const promiseSystem = this.theme.initTheme(); + //* Init Extension await this.extensionService.init(); this.theme.queryExtensionThemes(); + //*Reset theme after theme/extension theme loading Promise.all([promiseSystem]).then(() => { this.theme.afterAllThemeLoad(); this.theme.watchInstalledExtensionsChange(); }); + + //* Init local mock server + this.mockService.init(); + //* Inject extension global data + this.global.injectGlobalData(); + + //* Init notification + this.notification.init(); } } diff --git a/src/workbench/browser/src/app/core/core.module.ts b/src/workbench/browser/src/app/core/core.module.ts index ae37d97c..81b96e57 100644 --- a/src/workbench/browser/src/app/core/core.module.ts +++ b/src/workbench/browser/src/app/core/core.module.ts @@ -3,6 +3,6 @@ import { NgModule } from '@angular/core'; @NgModule({ declarations: [], - imports: [CommonModule], + imports: [CommonModule] }) export class CoreModule {} diff --git a/src/workbench/browser/src/app/core/services/notification.service.ts b/src/workbench/browser/src/app/core/services/notification.service.ts new file mode 100644 index 00000000..66aee874 --- /dev/null +++ b/src/workbench/browser/src/app/core/services/notification.service.ts @@ -0,0 +1,31 @@ +import { Injectable } from '@angular/core'; +import { ModalService } from 'eo/workbench/browser/src/app/shared/services/modal.service'; +import StorageUtil from 'eo/workbench/browser/src/app/utils/storage/storage.utils'; + +@Injectable({ + providedIn: 'root' +}) +export class NotificationService { + constructor(private modal: ModalService) {} + init() { + const hasShow = StorageUtil.get('notification_has_show'); + if (hasShow) return; + + const logInfo = { + startTime: new Date('2023-02-07 16:00:00'), + endTime: new Date('2023-02-07 18:00:00') + }; + const currentData = new Date(); + + //Curent data is greater than end time + if (currentData.getTime() > logInfo.endTime.getTime()) { + return; + } + + this.modal.create({ + nzTitle: $localize`Release Notes`, + nzContent: $localize`There will be downtime updates from ${logInfo.startTime.getHours()}\:00 to ${logInfo.endTime.getHours()}\:00 today, and may be temporarily inaccessible.` + }); + StorageUtil.set('notification_has_show', true, 60 * 60 * 24); + } +} diff --git a/src/workbench/browser/src/app/utils/storage/storage.utils.ts b/src/workbench/browser/src/app/utils/storage/storage.utils.ts index d592af6b..3b914ee3 100644 --- a/src/workbench/browser/src/app/utils/storage/storage.utils.ts +++ b/src/workbench/browser/src/app/utils/storage/storage.utils.ts @@ -25,7 +25,7 @@ export const createStorage = ({ prefixKey = '', storage = localStorage } = {}) = * @description 设置缓存 * @param {string} key 缓存键 * @param {*} value 缓存值 - * @param expire + * @param expire unit second */ set(key: string, value: any, expire: number | null = DEFAULT_CACHE_TIME) { const stringData = JSON.stringify({