⚡ 优化异常信息获取逻辑.
This commit is contained in:
@@ -28,21 +28,11 @@ interface XHRCustom extends XHR {
|
||||
Mock.XHR.prototype.send = (() => {
|
||||
// @ts-ignore
|
||||
const _send = Mock.XHR.prototype.send;
|
||||
const defaultEvent = () => {
|
||||
};
|
||||
return function (this: XHRCustom) {
|
||||
if (!this.match) {
|
||||
this.custom.xhr.responseType = this.responseType || '';
|
||||
this.custom.xhr.timeout = this.timeout || 0;
|
||||
this.custom.xhr.withCredentials = this.withCredentials || false;
|
||||
this.custom.xhr.onabort = this.onabort || defaultEvent;
|
||||
this.custom.xhr.onerror = this.onerror || defaultEvent;
|
||||
this.custom.xhr.onload = this.onload || defaultEvent;
|
||||
this.custom.xhr.onloadend = this.onloadend || defaultEvent;
|
||||
this.custom.xhr.onloadstart = this.onloadstart || defaultEvent;
|
||||
this.custom.xhr.onprogress = this.onprogress || defaultEvent;
|
||||
this.custom.xhr.onreadystatechange = this.onreadystatechange || defaultEvent;
|
||||
this.custom.xhr.ontimeout = this.ontimeout || defaultEvent;
|
||||
}
|
||||
return _send.apply(this, arguments);
|
||||
};
|
||||
|
||||
@@ -43,9 +43,9 @@
|
||||
:disabled="SshAuthType.IDENTITY === formModel.authType"
|
||||
placeholder="请输入用户名" />
|
||||
</a-form-item>
|
||||
<!-- 验证方式 -->
|
||||
<!-- 认证方式 -->
|
||||
<a-form-item field="authType"
|
||||
label="验证方式"
|
||||
label="认证方式"
|
||||
:hide-asterisk="true">
|
||||
<a-radio-group type="button"
|
||||
class="auth-type-group usn"
|
||||
@@ -165,7 +165,7 @@
|
||||
formModel.value.useNewPassword = !formModel.value.hasPassword;
|
||||
});
|
||||
|
||||
// 用户名验证
|
||||
// 用户名认证
|
||||
const usernameRules = [{
|
||||
validator: (value, cb) => {
|
||||
if (value && value.length > 128) {
|
||||
@@ -179,7 +179,7 @@
|
||||
}
|
||||
}] as FieldRule[];
|
||||
|
||||
// 密码验证
|
||||
// 密码认证
|
||||
const passwordRules = [{
|
||||
validator: (value, cb) => {
|
||||
if (value && value.length > 256) {
|
||||
|
||||
@@ -14,17 +14,17 @@ export interface HostSshConfig {
|
||||
hasPassword?: boolean;
|
||||
}
|
||||
|
||||
// 主机验证方式
|
||||
// 主机认证方式
|
||||
export const SshAuthType = {
|
||||
// 密码验证
|
||||
// 密码认证
|
||||
PASSWORD: 'PASSWORD',
|
||||
// 密钥验证
|
||||
// 密钥认证
|
||||
KEY: 'KEY',
|
||||
// 身份验证
|
||||
// 身份认证
|
||||
IDENTITY: 'IDENTITY'
|
||||
};
|
||||
|
||||
// 主机验证方式 字典项
|
||||
// 主机认证方式 字典项
|
||||
export const sshAuthTypeKey = 'hostSshAuthType';
|
||||
|
||||
// 主机系统类型 字典项
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
|
||||
defineExpose({ openAdd, openUpdate });
|
||||
|
||||
// 密码验证
|
||||
// 密码认证
|
||||
const passwordRules = [{
|
||||
validator: (value, cb) => {
|
||||
if (value && value.length > 512) {
|
||||
|
||||
@@ -163,7 +163,7 @@
|
||||
|
||||
defineExpose({ openAdd, openUpdate, openView });
|
||||
|
||||
// 密码验证
|
||||
// 密码认证
|
||||
const passwordRules = [{
|
||||
validator: (value, cb) => {
|
||||
if (value && value.length > 512) {
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
label-align="right"
|
||||
:label-col-props="{ span: 5 }"
|
||||
:wrapper-col-props="{ span: 18 }">
|
||||
<!-- 验证方式 -->
|
||||
<a-form-item field="authType" label="验证方式">
|
||||
<!-- 认证方式 -->
|
||||
<a-form-item field="authType" label="认证方式">
|
||||
<a-radio-group type="button"
|
||||
v-model="formModel.authType"
|
||||
:options="toRadioOptions(extraSshAuthTypeKey)" />
|
||||
|
||||
@@ -36,7 +36,7 @@ export default class TerminalOutputProcessor implements ITerminalOutputProcessor
|
||||
});
|
||||
} else {
|
||||
// 未成功展示错误信息
|
||||
ssh.write(`[91m${msg || ''}[0m\r\n[91m输入回车重新连接...[0m\r\n\r\n`);
|
||||
ssh.write(`[91m${msg || ''}[0m\r\n\r\n[91m输入回车重新连接...[0m\r\n\r\n`);
|
||||
ssh.status = TerminalStatus.CLOSED;
|
||||
}
|
||||
}, sftp => {
|
||||
@@ -69,7 +69,7 @@ export default class TerminalOutputProcessor implements ITerminalOutputProcessor
|
||||
ssh.connect();
|
||||
} else {
|
||||
// 未成功展示错误信息
|
||||
ssh.write(`[91m${msg || ''}[0m\r\n[91m输入回车重新连接...[0m\r\n\r\n`);
|
||||
ssh.write(`[91m${msg || ''}[0m\r\n\r\n[91m输入回车重新连接...[0m\r\n\r\n`);
|
||||
ssh.status = TerminalStatus.CLOSED;
|
||||
}
|
||||
}, sftp => {
|
||||
|
||||
Reference in New Issue
Block a user