From 233e8b840dc4768f0a11210c59187c4ffcacd2ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Sat, 6 May 2023 11:19:16 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20mysql=E3=80=81mariadb=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=AB=98=E7=BA=A7=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../advanced-option.component.ts | 26 ++++++++----------- .../connect-dialog.component.html | 2 +- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/app/elements/connect/connect-dialog/advanced-option/advanced-option.component.ts b/src/app/elements/connect/connect-dialog/advanced-option/advanced-option.component.ts index 8dc6b7e4..cb42c241 100644 --- a/src/app/elements/connect/connect-dialog/advanced-option/advanced-option.component.ts +++ b/src/app/elements/connect/connect-dialog/advanced-option/advanced-option.component.ts @@ -1,14 +1,14 @@ -import {Component, Input, OnInit, OnChanges, Output, EventEmitter} from '@angular/core'; -import {ConnectMethod, ConnectOption} from '@app/model'; +import {Component, Input, OnChanges, Output, EventEmitter} from '@angular/core'; +import {ConnectMethod, ConnectOption, Protocol} from '@app/model'; @Component({ selector: 'elements-advanced-option', templateUrl: './advanced-option.component.html', styleUrls: ['./advanced-option.component.scss'], }) -export class ElementAdvancedOptionComponent implements OnInit, OnChanges { +export class ElementAdvancedOptionComponent implements OnChanges { + @Input() protocol: Protocol; @Input() connectMethod: ConnectMethod; - @Input() accountSelected: any; @Output() onOptionsChange = new EventEmitter(); public advancedOptions: ConnectOption[] = []; public isShowAdvancedOption = false; @@ -16,23 +16,19 @@ export class ElementAdvancedOptionComponent implements OnInit, OnChanges { constructor() {} - ngOnInit() { - const accountSelectedProtocol = this.accountSelected && this.accountSelected.hasOwnProperty('protocol') ? this.accountSelected.protocol : ''; + ngOnChanges() { this.advancedOptions = [ { type: 'checkbox', field: 'disableautohash', hidden: () => { return this.connectMethod.value === 'web_cli' - && this.needShowAutoCompletionProtocols.includes(accountSelectedProtocol); - }, - label: 'Disable auto completion', - value: false - } - ]; - } - - ngOnChanges(changes) { + && this.needShowAutoCompletionProtocols.includes(this.protocol.name); + }, + label: 'Disable auto completion', + value: false + } + ]; this.isShowAdvancedOption = this.advancedOptions.some(i => i.hidden()); } diff --git a/src/app/elements/connect/connect-dialog/connect-dialog.component.html b/src/app/elements/connect/connect-dialog/connect-dialog.component.html index d7ec213c..17a01b88 100644 --- a/src/app/elements/connect/connect-dialog/connect-dialog.component.html +++ b/src/app/elements/connect/connect-dialog/connect-dialog.component.html @@ -36,8 +36,8 @@

{{"Connect" | translate}} - {{ asset.name | truncatechars:30 }}