Skip to content

Commit 51ea7d2

Browse files
committed
perf: change acl perform
1 parent ca032c2 commit 51ea7d2

5 files changed

Lines changed: 40 additions & 31 deletions

File tree

src/app/elements/asset-tree/asset-tree.component.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,14 @@
117117
&.active {
118118
.fa-search {
119119
position: absolute;
120-
left: 5px;
120+
left: 2px;
121121
}
122122

123123
.tree-input {
124124
@include flex(center);
125125
opacity: 1;
126126
width: 130px;
127-
padding-left: 30px;
127+
padding-left: 25px;
128128
}
129129
}
130130
}

src/app/elements/chat/chat.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ nz-float-button {
88
.chat-container {
99
position: fixed;
1010
bottom: 200px;
11-
right: 5px;
11+
right: 9px;
1212
z-index: 99999;
1313
cursor: move;
1414
user-select: none;

src/app/services/connect-token/acl-dialog/acl-dialog.component.html

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,53 @@
11
<div class="acl-dialog">
2-
<h3 nz-typography nzTitle>{{ content.title | translate }}</h3>
2+
<div *nzModalTitle>
3+
{{ content?.title | translate }}
4+
</div>
35

4-
<div class="nz-modal-content">
6+
<ng-container>
57
<div [class.error-message]="content.isError">
6-
<nz-alert [nzType]="content.isError ? 'error' : 'info'" class="content-message" [nzDescription]="alertContent">
8+
<nz-alert
9+
[nzType]="content.isError ? 'error' : 'info'"
10+
class="content-message"
11+
[nzDescription]="alertContent"
12+
>
713
<ng-template #alertContent>
814
<div>{{ content.message | translate }}</div>
915

1016
<ng-container *ngIf="content.customContent?.type === 'link'">
11-
<br>
12-
<a [href]="content.customContent.link">{{ content.customContent.linkText | translate }}</a>
17+
<br />
18+
<a [href]="content.customContent.link">{{
19+
content.customContent.linkText | translate
20+
}}</a>
1321
</ng-container>
1422

1523
<ng-container *ngIf="content.customContent?.type === 'ticket'">
16-
<br><br>
17-
{{ 'Assignees' | translate }}: <b>{{ content.customContent.assignees }}</b>
18-
<br><br>
24+
<br /><br />
25+
{{ 'Assignees' | translate }}: <b>{{ content.customContent.assignees }}</b> <br /><br />
1926
{{ 'Do not close this page' | translate }}
20-
<br><br>
27+
<br /><br />
2128
<div class="loading-bar">
2229
<div class="loading-bar-progress"></div>
2330
</div>
2431
</ng-container>
2532
</ng-template>
2633
</nz-alert>
2734
</div>
28-
</div>
35+
</ng-container>
2936

3037
<!-- Face verify capture iframe -->
3138
<ng-container *ngIf="code === 'face_verify_capture' && faceVerifyUrl">
3239
<iframe
3340
[src]="faceVerifyUrl"
3441
allow="camera"
3542
sandbox="allow-scripts allow-same-origin"
36-
style="width: 100%; height: 540px;border: none;">
43+
style="width: 100%; height: 540px; border: none"
44+
>
3745
</iframe>
3846
</ng-container>
3947

4048
<div *nzModalFooter class="nz-modal-footer">
4149
<ng-container *ngFor="let action of content.actions">
42-
<button nz-button
43-
[nzType]="action.type || 'default'"
44-
(click)="action.callback()">
50+
<button nz-button [nzType]="action.type || 'default'" (click)="action.callback()">
4551
{{ action.text | translate }}
4652
</button>
4753
</ng-container>

src/app/services/connect-token/acl-dialog/acl-dialog.component.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ export class ElementACLDialogComponent implements OnInit {
6363

6464
get errorDetail() {
6565
let error = this.data.error.error;
66+
if (this.data.error.status === 500) {
67+
error = this.data.error.message;
68+
}
6669
if (Array.isArray(error)) {
6770
error = error.join(' ');
6871
} else if (typeof error === 'object') {
@@ -108,7 +111,6 @@ export class ElementACLDialogComponent implements OnInit {
108111
this.code = 'face_verify_capture';
109112
this.content = this.getDialogContent(this.code);
110113

111-
112114
const timer = setInterval(() => {
113115
this._http.getFaceVerifyState(connToken.face_token).subscribe(async data => {
114116
if (data.is_finished) {
@@ -279,7 +281,7 @@ export class ElementACLDialogComponent implements OnInit {
279281

280282
if (state === 'approved') {
281283
const msg = await this._i18n.t('Login review approved');
282-
this._toastr.success(msg, '', { nzClass: 'custom-success-notification' } );
284+
this._toastr.success(msg, '', { nzClass: 'custom-success-notification' });
283285
this.dialogRef.close(this.connectionToken);
284286
} else if (state === 'rejected') {
285287
this.code = 'ticket_review_rejected';
@@ -362,7 +364,7 @@ export class ElementACLDialogComponent implements OnInit {
362364
},
363365
acl_face_online_not_supported: {
364366
title: 'Login reminder',
365-
message: 'FaceOnlineNotSupported',
367+
message: this.errorDetail,
366368
isError: true,
367369
actions: [
368370
{
@@ -407,7 +409,7 @@ export class ElementACLDialogComponent implements OnInit {
407409
text: 'Copy link',
408410
type: 'primary',
409411
callback: () => {
410-
vm.onCopySuccess(this.connectionToken?.from_ticket_info?.ticket_detail_page_url)
412+
vm.onCopySuccess(this.connectionToken?.from_ticket_info?.ticket_detail_page_url);
411413
}
412414
}
413415
]
@@ -455,13 +457,10 @@ export class ElementACLDialogComponent implements OnInit {
455457
callback: () => vm.closeDialog()
456458
}
457459
]
458-
}
459-
};
460-
461-
return (
462-
contentMap[code] || {
463-
title: 'Login reminder',
464-
message: this.data.errorDetail,
460+
},
461+
unknown: {
462+
title: 'Unknown error',
463+
message: this.errorDetail,
465464
isError: true,
466465
actions: [
467466
{
@@ -470,6 +469,8 @@ export class ElementACLDialogComponent implements OnInit {
470469
}
471470
]
472471
}
473-
);
472+
};
473+
474+
return contentMap[code] || contentMap.unknown;
474475
}
475476
}

src/sass/theme/main.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ export const mainTheme = () => {
3737
'--el-icon-color': '#ffffff',
3838
// icon hover 时的颜色
3939
'--el-icon-hover-color': '#d6cbcb',
40-
'--el-border-color-x': '#202020',
41-
'--el-border-color-y': '#202020',
40+
// '--el-border-color-x': darken(30, '#000000', 0.4),
41+
// '--el-border-color-y': darken(30, '#000000', 0.4),
42+
'--el-border-color-x': 'rgba(0, 0, 0, 0.3)',
43+
'--el-border-color-y': 'rgba(0, 0, 0, 0.3)',
4244

4345
// 头部导航背景
4446
'--el-nav-bg-color': lighten(0),

0 commit comments

Comments
 (0)