diff --git a/src/resources/assets/languages/page/en.json b/src/resources/assets/languages/page/en.json
index 6cfb27bf9b353448ecaf125f53ea21e305c70bb0..68289762b746367e2afc4a21426a24222296efac 100644
--- a/src/resources/assets/languages/page/en.json
+++ b/src/resources/assets/languages/page/en.json
@@ -1052,5 +1052,6 @@
"pastethescreenshotfromtheclipboardintotheinputboxbelow": "Copy and paste the screenshot of the clipboard into the input box below:",
"pastethescreenshotfromtheclipboard": "Paste clipboard screenshot",
"scriptlanguage": "scripting language",
- "example": "for example"
+ "example": "for example",
+ "copyerrorinfo": "Copy error message"
}
\ No newline at end of file
diff --git a/src/resources/assets/languages/page/zh.json b/src/resources/assets/languages/page/zh.json
index 42aa7083624f26fe842f230bffe40b6dbf1b6f06..413c9df9a2d7cc5b124c4c1325d17207839d0cb4 100644
--- a/src/resources/assets/languages/page/zh.json
+++ b/src/resources/assets/languages/page/zh.json
@@ -1054,5 +1054,6 @@
"pastethescreenshotfromtheclipboardintotheinputboxbelow": "剪切板截图粘贴在下面输入框:",
"pastethescreenshotfromtheclipboard": "粘贴剪切板截图",
"scriptlanguage": "脚本语言",
- "example": "例如"
+ "example": "例如",
+ "copyerrorinfo": "复制错误信息"
}
\ No newline at end of file
diff --git a/src/views/pages/cmdb/asset/components/account-edit-dialog.vue b/src/views/pages/cmdb/asset/components/account-edit-dialog.vue
index bf3be5bf129dd004d9ba318112ee94d813eed98e..ca1c28d081827cb123f5e13dcde7778ad0e918c1 100644
--- a/src/views/pages/cmdb/asset/components/account-edit-dialog.vue
+++ b/src/views/pages/cmdb/asset/components/account-edit-dialog.vue
@@ -63,15 +63,43 @@
v-bind="settingForm.testRunner"
@first="gotoRunner"
@searchCallback="refreshSuccess()"
- >
-
-
-
- -
-
- '{{ getConnectResultText(item) }}' 通过执行器 '{{ connectTestRunner }}' 测试{{ getReasonText(item) }}
-
-
+ >
+
+
+
+
+
{{ $t('page.copyerrorinfo') }}
+
+
+
+
+
+ {{ getReasonText(row) }}
+
+
+ {{ getConnectResultText(row) }}
+
+
+ {{ connectTestRunner }}
+
+
+ {{ row.msgError }}
+
+
+
@@ -95,6 +123,7 @@ export default {
components: {
TsForm: () => import('@/resources/plugins/TsForm/TsForm'),
TsFormSelect: () => import('@/resources/plugins/TsForm/TsFormSelect'),
+ TsTable: () => import('@/resources/components/TsTable/TsTable.vue'),
PrivateAccountEditDialog: () => import('./private-account-edit-dialog')
},
filters: {},
@@ -124,8 +153,27 @@ export default {
isShow: true,
title: this.$t('page.accountsmanage'),
maskClose: false,
- width: '700px'
+ width: 'medium'
},
+ theadList: [
+ {
+ title: '',
+ width: 50,
+ key: 'showInnerTable'
+ },
+ {
+ title: this.$t('page.status'),
+ key: 'status'
+ },
+ {
+ title: this.$t('page.account'),
+ key: 'accountName'
+ },
+ {
+ title: this.$t('term.deploy.actuator'),
+ key: 'runner'
+ }
+ ],
settingConfig: {
accountList: []
},
@@ -141,7 +189,7 @@ export default {
label: this.$t('page.publicaccount'),
transfer: true,
multiple: true,
- firstText: this.$t('dialog.title.addtarget', {'target': this.$t('page.account')}),
+ firstText: this.$t('dialog.title.addtarget', { target: this.$t('page.account') }),
firstLi: true,
dynamicUrl: '/api/rest/resourcecenter/account/search',
rootName: 'tbodyList',
@@ -165,13 +213,18 @@ export default {
label: this.$t('page.test') + this.$t('term.deploy.actuator'),
transfer: true,
multiple: false,
- firstText: this.$t('dialog.title.addtarget', {'target': this.$t('term.deploy.actuator')}),
+ firstText: this.$t('dialog.title.addtarget', { target: this.$t('term.deploy.actuator') }),
firstLi: true,
dynamicUrl: '/api/rest/runner/search',
rootName: 'tbodyList',
valueName: 'id',
textName: 'name',
needCallback: false
+ },
+ testResult: {
+ type: 'slot',
+ label: '测试结果',
+ isHidden: true // 默认隐藏,点击【测试连接】之后才显示
}
}
};
@@ -191,6 +244,15 @@ export default {
beforeDestroy() {},
destroyed() {},
methods: {
+ handleCopy() {
+ let errorList = this.connectTestResultList.filter(v => v.exitValue != 0);
+ let errorInfo = errorList.map(v => `${this.getConnectResultText(v)}通过执行器${this.connectTestRunner}测试${this.getReasonText(v)}${v.msgError}`).join('\n');
+ this.$utils.copyText('', errorInfo);
+ },
+ openInnerTable(row) {
+ // 展开收起内嵌表格
+ this.$set(row, '_expand', !row._expand);
+ },
getValidMessage(list) {
if (list.length == 0) {
this.validMessage = '';
@@ -269,6 +331,7 @@ export default {
this.$Notice.error({ title: this.$t('page.tip'), desc: this.$t('term.cmdb.publicprivateaccountchooseoneaccountdesc') });
this.connectTestResultList = [];
this.connectTestRunner = '';
+ this.settingForm.testResult.isHidden = true;
return false;
}
return true;
@@ -310,8 +373,8 @@ export default {
duration: 10,
render: h => {
return h('div', [
- h('div', { class: 'text-success pb-md' }, [h('span', { class: 'text-success valid-icon tsfont-check-s' }, ''), this.$t('term.cmdb.successfullyboundaccountforassetstarget', {target: this.successCount || 0})]),
- h('div', { class: 'text-danger pb-md' }, [h('span', { class: 'valid-icon tsfont-close-s' }, ''), this.$t('term.cmdb.failedtobindaccountforassetstarget', {target: this.failureCount || 0})]),
+ h('div', { class: 'text-success pb-md' }, [h('span', { class: 'text-success valid-icon tsfont-check-s' }, ''), this.$t('term.cmdb.successfullyboundaccountforassetstarget', { target: this.successCount || 0 })]),
+ h('div', { class: 'text-danger pb-md' }, [h('span', { class: 'valid-icon tsfont-close-s' }, ''), this.$t('term.cmdb.failedtobindaccountforassetstarget', { target: this.failureCount || 0 })]),
h(
'ul',
{ class: 'pb-md', style: { lineHeight: '20px', display: this.failureReasonList && this.failureReasonList.length > 0 ? 'block' : 'none' } },
@@ -336,7 +399,7 @@ export default {
if (row && row.value) {
this.$createDialog({
title: this.$t('dialog.title.deleteconfirm'),
- content: this.$t('dialog.content.deleteconfirm', {target: row.text }),
+ content: this.$t('dialog.content.deleteconfirm', { target: row.text }),
btnType: 'error',
okText: this.$t('page.delete'),
'on-ok': vnode => {
@@ -396,6 +459,9 @@ export default {
if (res && res.Status == 'OK') {
this.connectTestRunner = res.Return.runner;
this.connectTestResultList = res.Return.result || [];
+ if (this.connectTestResultList && this.connectTestResultList.length > 0) {
+ this.settingForm.testResult.isHidden = false;
+ }
if (this.connectTestResultList.every(item => item.exitValue == 0)) {
this.$Message.success(this.$t('message.executesuccess'));
}
@@ -459,9 +525,14 @@ export default {
if (value.exitValue == 0) {
return this.$t('page.success');
} else {
- return this.$t('page.fail') + ':' + value.msgError;
+ return this.$t('page.fail');
}
};
+ },
+ hasErrorInfo() {
+ return (connectTestResultList) => {
+ return connectTestResultList.some(v => v.exitValue != 0);
+ };
}
},
watch: {}