Skip to content

Commit

Permalink
perf: 未部署发布机,连接远程应用资产加说明
Browse files Browse the repository at this point in the history
  • Loading branch information
w940853815 committed May 8, 2024
1 parent d0819b2 commit b501908
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ <h3>{{"Connect" | translate}} - {{ asset.name | truncatechars:30 }}</h3>
<mat-dialog-actions style="float: right; margin: 8px 0 0 0; width: 100%">
<button
(click)="onConfirm()"
[disabled]="isConnectDisabled()"
[disabled]="connectButtonInfo().disabled"
[title]="connectButtonInfo().reason"
[mat-dialog-close]="outputData"
class="confirm-btn"
color="primary"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import {Account, Asset, AuthInfo, ConnectData, ConnectMethod, Protocol} from '@a
import {BehaviorSubject} from 'rxjs';
import {debounceTime} from 'rxjs/operators';

class ConnectButtonInfo{
disabled: boolean = false;
reason: string = '';
}

@Component({
selector: 'elements-asset-tree-dialog',
Expand Down Expand Up @@ -125,14 +129,25 @@ export class ElementConnectDialogComponent implements OnInit {
this.accountOrUsernameChanged.next(true);
}

isConnectDisabled(): Boolean {
connectButtonInfo():ConnectButtonInfo {
const connectButtonInfo = new ConnectButtonInfo()
let disabled = false;
let trans_key= '';
if (this.accounts.length === 0) {
return true;
disabled = true;
trans_key = 'connectDisabledTipsNoAccount'
}
else if(this.connectMethod && this.connectMethod.disabled === true){
disabled = true;
trans_key = 'connectDisabledTipsMethodDisabled'
}
if (!this.connectMethod || this.connectMethod.disabled === true) {
return true;
else if (!this.connectMethod){
disabled = true;
trans_key = 'connectDisabledTipsNoConnectMethod'
}
return false;
connectButtonInfo.disabled = disabled;
connectButtonInfo.reason = trans_key ? this._i18n.instant(trans_key): '';
return connectButtonInfo;
}

onConfirm(downloadRDP = false) {
Expand Down
5 changes: 4 additions & 1 deletion src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,5 +200,8 @@
"Current online": "Current online",
"Token expired": "Token has expired",
"No protocol available": "No protocol available",
"VirtualApp": "Virtual App"
"VirtualApp": "Virtual App",
"connectDisabledTipsNoAccount": "Tips: No valid authorization account found, current resource cannot be connected. Please contact the administrator for assistance",
"connectDisabledTipsNoConnectMethod": "Tips: No valid connection method found, current resource cannot be connected. Please contact the administrator for assistance",
"connectDisabledTipsMethodDisabled": "Tips: No valid remote application deployment machine found, current resource cannot be connected. Please contact the administrator for assistance"
}
5 changes: 4 additions & 1 deletion src/assets/i18n/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,5 +204,8 @@
"Token expired": "トークンの有効期限が切れました",
"No protocol available": "利用可能なプロトコルがありません",
"Stop": "Stop",
"VirtualApp": "仮想アプリ"
"VirtualApp": "仮想アプリ",
"connectDisabledTipsNoAccount": "ヒント:有効な認可アカウントが見つかりませんでした。このリソースは接続できません。管理者に連絡してください",
"connectDisabledTipsNoConnectMethod": "ヒント:有効な接続方法が見つかりませんでした。このリソースは接続できません。管理者に連絡してください",
"connectDisabledTipsMethodDisabled": "ヒント:有効なリモートアプリケーションデプロイメントマシンが見つかりませんでした。このリソースは接続できません。管理者に連絡してください"
}
5 changes: 4 additions & 1 deletion src/assets/i18n/zh-hant.json
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@
"Token expired": "Token 已過期, 請重新連接",
"No protocol available": "沒有可用的協議",
"Stop": "停止",
"VirtualApp": "虛擬應用"
"VirtualApp": "虛擬應用",
"connectDisabledTipsNoAccount": "提示:未找到有效的授權帳號,當前資源無法連接,請聯繫管理員進行處理",
"connectDisabledTipsNoConnectMethod": "提示:未找到有效的連接方式,當前資源無法連接,請聯繫管理員進行處理",
"connectDisabledTipsMethodDisabled": "提示:未找到有效的遠程應用發布機,當前資源無法連接,請聯繫管理員進行處理"
}

5 changes: 4 additions & 1 deletion src/assets/i18n/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@
"Token expired": "Token 已过期, 请重新连接",
"No protocol available": "没有可用的协议",
"Stop": "停止",
"VirtualApp": "虚拟应用"
"VirtualApp": "虚拟应用",
"connectDisabledTipsNoAccount": "提示:未找到有效的授权账号,当前资源无法连接,请联系管理员进行处理",
"connectDisabledTipsNoConnectMethod": "提示:未找到有效的连接方式,当前资源无法连接,请联系管理员进行处理",
"connectDisabledTipsMethodDisabled": "提示:未找到有效的远程应用发布机,当前资源无法连接,请联系管理员进行处理"
}

0 comments on commit b501908

Please sign in to comment.