From 64a421f8b305fca2edbefdd8c8573c6ba9d6043a Mon Sep 17 00:00:00 2001 From: "Jiangjie.Bai" Date: Thu, 22 Sep 2022 15:53:52 +0800 Subject: [PATCH 1/6] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=20Endpoint=20?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=20Manugs=20DB=20listen=20port=20=E7=9A=84?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/model.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/app/model.ts b/src/app/model.ts index e18f842b..c14b8329 100644 --- a/src/app/model.ts +++ b/src/app/model.ts @@ -340,10 +340,8 @@ export class Endpoint { host: string; https_port: number; http_port: number; - mysql_port: number; - mariadb_port: number; - postgresql_port: number; - redis_port: number; + ssh_port: number; + magnus_listen_db_port: number; getHost(): string { return this.host || window.location.host; @@ -352,7 +350,15 @@ export class Endpoint { getPort(protocol?: string): string { let _protocol = protocol || window.location.protocol; _protocol = _protocol.replace(':', ''); - let port = this[_protocol + '_port']; + let port; + if (['http', 'https', 'ssh'].indexOf(_protocol) !== -1) { + // 先获取后台返回的 port 地址 + port = this[_protocol + '_port']; + } else { + // db protocol 的端口统一使用 magnus_listen_db_port + port = this['magnus_listen_db_port']; + } + // 处理 http(s) 协议的后台端口为0的时候, 使用当前地址中的端口 if (['http', 'https'].indexOf(_protocol) !== -1 && port === 0) { port = window.location.port; } From 81d78d06fc2b0e3b56cfddade2f605b7bb275df4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Fri, 23 Sep 2022 15:10:41 +0800 Subject: [PATCH 2/6] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AF=BC=E8=88=AA?= =?UTF-8?q?=E9=80=89=E9=A1=B9=E9=BC=A0=E6=A0=87hover=E5=90=8E=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E6=98=BE=E7=A4=BA=E7=A8=B3=E5=AE=9A=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/elements/nav/nav.component.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/elements/nav/nav.component.css b/src/app/elements/nav/nav.component.css index 8786fe9d..4cd65e89 100644 --- a/src/app/elements/nav/nav.component.css +++ b/src/app/elements/nav/nav.component.css @@ -21,6 +21,7 @@ .nav li { display: inline-block; + vertical-align: top; } .nav .dropdown a { @@ -40,7 +41,7 @@ .dropdown { position: relative; - top: -6px; + top: 0px; display: inline-block; } From 1c5b3298e48efd75dc943222c0c3d9a11456cfed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Thu, 22 Sep 2022 13:59:00 +0800 Subject: [PATCH 3/6] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=B5=84=E4=BA=A7?= =?UTF-8?q?=E6=A0=91=E4=B8=8D=E6=98=AF=E5=BC=82=E6=AD=A5=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E4=B8=8B=E7=82=B9=E5=87=BB=E5=88=B7=E6=96=B0=E8=B5=84=E4=BA=A7?= =?UTF-8?q?=E6=A0=91=E4=B8=8D=E6=8A=98=E5=8F=A0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/elements/asset-tree/asset-tree.component.ts | 7 ++++++- src/app/services/setting.ts | 8 ++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/app/elements/asset-tree/asset-tree.component.ts b/src/app/elements/asset-tree/asset-tree.component.ts index fe94ebfc..0c5bfa70 100644 --- a/src/app/elements/asset-tree/asset-tree.component.ts +++ b/src/app/elements/asset-tree/asset-tree.component.ts @@ -157,7 +157,9 @@ export class ElementAssetTreeComponent implements OnInit { }); ngOnInit() { - this.isLoadTreeAsync = this._settingSvc.isLoadTreeAsync(); + this._settingSvc.isLoadTreeAsync$.subscribe((state) => { + this.isLoadTreeAsync = state; + }); this.initTree(); document.addEventListener('click', this.hideRMenu.bind(this), false); } @@ -212,6 +214,9 @@ export class ElementAssetTreeComponent implements OnInit { this.assetsTree.destroy(); } const _assetTree = $.fn.zTree.init($('#assetsTree'), setting, resp); + _assetTree.setting.view.expandSpeed = ''; + _assetTree.expandAll(false); + _assetTree.setting.view.expandSpeed = 'fast'; myAssetsNodes.push(_assetTree.getNodes()); this.assetsTree = _assetTree; }, error => { diff --git a/src/app/services/setting.ts b/src/app/services/setting.ts index 868091a8..d0cd3c28 100644 --- a/src/app/services/setting.ts +++ b/src/app/services/setting.ts @@ -4,6 +4,7 @@ import {LocalStorageService} from './share'; import {HttpClient} from '@angular/common/http'; import {I18nService} from '@app/services/i18n'; import {canvasWaterMark, getQueryParamFromURL} from '@app/utils/common'; +import {BehaviorSubject} from 'rxjs'; @Injectable() export class SettingService { @@ -11,6 +12,7 @@ export class SettingService { public globalSetting: GlobalSetting = new GlobalSetting(); settingKey = 'LunaSetting'; private inited = false; + public isLoadTreeAsync$ = new BehaviorSubject(true); constructor( private _localStorage: LocalStorageService, @@ -20,6 +22,7 @@ export class SettingService { const settingData = this._localStorage.get(this.settingKey); if (settingData && typeof settingData === 'object') { this.setting = settingData; + this.setIsLoadTreeAsync(); } else { this.setting = new Setting(); } @@ -78,10 +81,11 @@ export class SettingService { save() { this._localStorage.set(this.settingKey, this.setting); + this.setIsLoadTreeAsync(); } - isLoadTreeAsync(): boolean { - return this.setting.isLoadTreeAsync === '1'; + setIsLoadTreeAsync() { + this.isLoadTreeAsync$.next(this.setting.isLoadTreeAsync === '1'); } // 全局跳过手动输入windows账号密码 From fa7744caf21570bfb1bafe82d7388546814c9663 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Thu, 29 Sep 2022 17:09:24 +0800 Subject: [PATCH 4/6] =?UTF-8?q?perf:=20=E6=9E=84=E5=BB=BA=E6=97=B6?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=BC=93=E5=AD=98=20(#700)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * perf: 构建时使用缓存 * perf: 使用 yarn 构建 Co-authored-by: 吴小白 <296015668@qq.com> --- Dockerfile | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7fb55dd5..d99e06df 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,24 @@ -FROM node:10 as stage-build +FROM node:14.16 as stage-build +ARG TARGETARCH +ARG VERSION +ENV VERSION=$VERSION ARG NPM_REGISTRY="https://registry.npmmirror.com" ENV NPM_REGISTY=$NPM_REGISTRY -ARG SASS_BINARY_SITE="https://npmmirror.com/mirrors/node-sass" -ENV SASS_BINARY_SITE=$SASS_BINARY_SITE WORKDIR /data -# Install deps -RUN npm config set sass_binary_site=${SASS_BINARY_SITE} -RUN npm config set registry ${NPM_REGISTRY} -COPY package.json package-lock.json /data/ -COPY utils /data/utils -RUN cd utils && bash -ixeu build.sh dep +RUN set -ex \ + && npm config set registry ${NPM_REGISTRY} \ + && yarn config set registry ${NPM_REGISTRY} \ + && yarn config set cache-folder /root/.cache/yarn/luna -ARG VERSION -ENV VERSION=$VERSION -# Build ADD . /data -RUN cd utils && ls .. && bash -ixeu build.sh build +RUN RUN --mount=type=cache,target=/root/.cache/yarn \ + sed -i "s@[0-9].[0-9].[0-9]@${VERSION}@g" src/environments/environment.prod.ts \ + && yarn install \ + && yarn build \ + && cp -R src/assets/i18n luna/ FROM nginx:alpine -COPY --from=stage-build /data/release/luna /opt/luna/ +COPY --from=stage-build /data/luna /opt/luna COPY nginx.conf /etc/nginx/conf.d/default.conf From bf3a1456633630a970fed2928e6b1bb437d133c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Thu, 29 Sep 2022 17:20:14 +0800 Subject: [PATCH 5/6] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d99e06df..f1ced7e6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ RUN set -ex \ && yarn config set cache-folder /root/.cache/yarn/luna ADD . /data -RUN RUN --mount=type=cache,target=/root/.cache/yarn \ +RUN --mount=type=cache,target=/root/.cache/yarn \ sed -i "s@[0-9].[0-9].[0-9]@${VERSION}@g" src/environments/environment.prod.ts \ && yarn install \ && yarn build \ From 74b0a83f02461d32714f773b40912f2b4d9895e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Thu, 13 Oct 2022 11:27:25 +0800 Subject: [PATCH 6/6] perf: update jquery --- package.json | 2 +- yarn.lock | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2c2fb1cc..f889a709 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "crypto-js": "^4.1.1", "font-awesome": "4.7.0", "guacamole-common-js": "1.1.0", - "jquery": "^3.4.1", + "jquery": "^3.6.1", "jsencrypt": "^3.2.1", "material-design-icons": "^3.0.1", "metismenu": "^2.7.9", diff --git a/yarn.lock b/yarn.lock index e149b893..2904be81 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4940,11 +4940,16 @@ jest-worker@^26.0.0: merge-stream "^2.0.0" supports-color "^7.0.0" -jquery@>=1.4.4, jquery@^3.4.1: +jquery@>=1.4.4: version "3.6.0" resolved "https://registry.npmmirror.com/jquery/-/jquery-3.6.0.tgz#c72a09f15c1bdce142f49dbf1170bdf8adac2470" integrity sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw== +jquery@^3.6.1: + version "3.6.1" + resolved "https://registry.npmmirror.com/jquery/-/jquery-3.6.1.tgz#fab0408f8b45fc19f956205773b62b292c147a16" + integrity sha512-opJeO4nCucVnsjiXOE+/PcCgYw9Gwpvs/a6B1LL/lQhwWwpbVEVYDZ1FokFr8PRc7ghYlrFPuyHuiiDNTQxmcw== + "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.npmmirror.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"