Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: 未部署发布机,连接远程应用资产加说明 #1091

Merged
merged 1 commit into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 transKey= '';
if (this.accounts.length === 0) {
return true;
disabled = true;
transKey = 'connectDisabledTipsNoAccount'
}
else if(this.connectMethod && this.connectMethod.disabled === true){
disabled = true;
transKey = 'connectDisabledTipsMethodDisabled'
}
if (!this.connectMethod || this.connectMethod.disabled === true) {
return true;
else if (!this.connectMethod){
disabled = true;
transKey = 'connectDisabledTipsNoConnectMethod'
}
return false;
connectButtonInfo.disabled = disabled;
connectButtonInfo.reason = transKey ? this._i18n.instant(transKey): '';
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": "提示:未找到有效的远程应用发布机,当前资源无法连接,请联系管理员进行处理"
}

Loading