fix:account 配置秘钥由文件改为文本类型 & 导入导出下载模板补充提交
This commit is contained in:
@@ -330,7 +330,7 @@ const en = {
|
|||||||
host: 'Host',//'Host'
|
host: 'Host',//'Host'
|
||||||
assetState: 'State',//'状态'
|
assetState: 'State',//'状态'
|
||||||
assetPing: 'Ping',
|
assetPing: 'Ping',
|
||||||
modules: 'Module',//'组件'
|
modules: 'Endpoint',//'组件'
|
||||||
alerts: 'Alert message',//'告警信息'
|
alerts: 'Alert message',//'告警信息'
|
||||||
dataCenter: 'DC',//DC
|
dataCenter: 'DC',//DC
|
||||||
cabinet: 'Cabinet',//'机柜'
|
cabinet: 'Cabinet',//'机柜'
|
||||||
|
|||||||
@@ -301,7 +301,8 @@
|
|||||||
<!------------------------------------------IDC---------------------------------------------->
|
<!------------------------------------------IDC---------------------------------------------->
|
||||||
<el-form-item :label="this.$t('asset.createAssetTab.dcName')" class="right-box-form-content" prop="idcId">
|
<el-form-item :label="this.$t('asset.createAssetTab.dcName')" class="right-box-form-content" prop="idcId">
|
||||||
<template v-if="!tabView">
|
<template v-if="!tabView">
|
||||||
<el-select popper-class="asset-dropdown" size="mini" v-model="assetData.idcId" clearable @change="getSingleIDCData" class="right-box-row-with-btn" placeholder="">
|
<!-- <el-select popper-class="asset-dropdown" size="mini" v-model="assetData.idcId" clearable @change="getSingleIDCData" class="right-box-row-with-btn" placeholder="">-->
|
||||||
|
<el-select popper-class="asset-dropdown" size="mini" v-model="assetData.idcId" clearable @change="getSingleIDCData" placeholder="">
|
||||||
<el-option
|
<el-option
|
||||||
:id="'asset-edit-idc-op-'+item.id"
|
:id="'asset-edit-idc-op-'+item.id"
|
||||||
v-for="item in IDCOptionData"
|
v-for="item in IDCOptionData"
|
||||||
@@ -310,21 +311,21 @@
|
|||||||
:value="item.id"
|
:value="item.id"
|
||||||
>
|
>
|
||||||
<span class="config-dropdown-label-txt">{{ item.name }}</span>
|
<span class="config-dropdown-label-txt">{{ item.name }}</span>
|
||||||
<div class="config-dropdown-label-icons">
|
<!-- <div class="config-dropdown-label-icons">-->
|
||||||
<span class="config-dropdown-btn config-dropdown-btn-delete"
|
<!-- <span class="config-dropdown-btn config-dropdown-btn-delete"-->
|
||||||
@click.stop="deleteData('idc',item.id)" :id="'asset-edit-idc-op-del-'+item.id"><i
|
<!-- @click.stop="deleteData('idc',item.id)" :id="'asset-edit-idc-op-del-'+item.id"><i-->
|
||||||
class="el-icon-delete"></i></span>
|
<!-- class="el-icon-delete"></i></span>-->
|
||||||
<idc-config-box :post-idc="popIdcData" placement="left" @after="getIDCOptionData" :button-class="'config-dropdown-btn'">
|
<!-- <idc-config-box :post-idc="popIdcData" placement="left" @after="getIDCOptionData" :button-class="'config-dropdown-btn'">-->
|
||||||
<template v-slot:optionZone>
|
<!-- <template v-slot:optionZone>-->
|
||||||
<i class="nz-icon nz-icon-edit" @click="getSingleIDCData(item.id,'edit', item)"></i>
|
<!-- <i class="nz-icon nz-icon-edit" @click="getSingleIDCData(item.id,'edit', item)"></i>-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
</idc-config-box>
|
<!-- </idc-config-box>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<div class="right-box-row-btn right-box-row-btn-small">
|
<!-- <div class="right-box-row-btn right-box-row-btn-small">-->
|
||||||
<idc-config-box placement="left" @after="getIDCOptionData"></idc-config-box>
|
<!-- <idc-config-box placement="left" @after="getIDCOptionData"></idc-config-box>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
</template>
|
</template>
|
||||||
<span v-if="tabView">{{assetViewData.idcName}}</span>
|
<span v-if="tabView">{{assetViewData.idcName}}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -343,7 +344,8 @@
|
|||||||
<!------------------------------------------cabinet---------------------------------------------->
|
<!------------------------------------------cabinet---------------------------------------------->
|
||||||
<el-form-item :label="$t('asset.createAssetTab.cabinet')" class="right-box-form-content">
|
<el-form-item :label="$t('asset.createAssetTab.cabinet')" class="right-box-form-content">
|
||||||
<template v-if="!tabView">
|
<template v-if="!tabView">
|
||||||
<el-select clearable v-model="assetData.cabinetId" clearable class="right-box-row-with-btn" popper-class="asset-dropdown"
|
<!-- <el-select clearable v-model="assetData.cabinetId" clearable class="right-box-row-with-btn" popper-class="asset-dropdown"-->
|
||||||
|
<el-select clearable v-model="assetData.cabinetId" clearable popper-class="asset-dropdown"
|
||||||
:disabled="assetData.idcId==''?true:false" size="mini" placeholder=""
|
:disabled="assetData.idcId==''?true:false" size="mini" placeholder=""
|
||||||
@change="getSingleCabinetData">
|
@change="getSingleCabinetData">
|
||||||
<el-option
|
<el-option
|
||||||
@@ -354,21 +356,21 @@
|
|||||||
:value="item.id"
|
:value="item.id"
|
||||||
>
|
>
|
||||||
<span class="config-dropdown-label-txt">{{ item.name }}</span>
|
<span class="config-dropdown-label-txt">{{ item.name }}</span>
|
||||||
<div class="config-dropdown-label-icons">
|
<!-- <div class="config-dropdown-label-icons">-->
|
||||||
<span class="config-dropdown-btn config-dropdown-btn-delete"
|
<!-- <span class="config-dropdown-btn config-dropdown-btn-delete"-->
|
||||||
@click.stop="deleteData('cabinet',item.id)" :id="'asset-edit-cabinet-op-del-'+item.id">
|
<!-- @click.stop="deleteData('cabinet',item.id)" :id="'asset-edit-cabinet-op-del-'+item.id">-->
|
||||||
<i class="el-icon-delete"></i>
|
<!-- <i class="el-icon-delete"></i>-->
|
||||||
</span>
|
<!-- </span>-->
|
||||||
<cabinet-config-box placement="left" :post-cabinet="item" button-class="config-dropdown-btn" @after="getCabinetOptionData">
|
<!-- <cabinet-config-box placement="left" :post-cabinet="item" button-class="config-dropdown-btn" @after="getCabinetOptionData">-->
|
||||||
<i slot="optionZone" class="nz-icon nz-icon-edit"></i>
|
<!-- <i slot="optionZone" class="nz-icon nz-icon-edit"></i>-->
|
||||||
</cabinet-config-box>
|
<!-- </cabinet-config-box>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
||||||
<div class="right-box-row-btn right-box-row-btn-small">
|
<!-- <div class="right-box-row-btn right-box-row-btn-small">-->
|
||||||
<cabinet-config-box placement="left" :post-cabinet="addCabinetData" @after="getCabinetOptionData"></cabinet-config-box>
|
<!-- <cabinet-config-box placement="left" :post-cabinet="addCabinetData" @after="getCabinetOptionData"></cabinet-config-box>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
</template>
|
</template>
|
||||||
<span v-if="tabView">{{assetViewData.cabinetName}}</span>
|
<span v-if="tabView">{{assetViewData.cabinetName}}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -439,7 +441,6 @@
|
|||||||
user: '',
|
user: '',
|
||||||
pwd: '',
|
pwd: '',
|
||||||
port: '',
|
port: '',
|
||||||
uploadFile: null
|
|
||||||
}],
|
}],
|
||||||
exporter: 0
|
exporter: 0
|
||||||
},
|
},
|
||||||
@@ -597,7 +598,6 @@
|
|||||||
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
|
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
uploadFileList:[],
|
|
||||||
formData:null,
|
formData:null,
|
||||||
module:{},
|
module:{},
|
||||||
accountValideResult:true
|
accountValideResult:true
|
||||||
@@ -638,7 +638,6 @@
|
|||||||
pwd:"",
|
pwd:"",
|
||||||
port:'',
|
port:'',
|
||||||
privateKey:'',
|
privateKey:'',
|
||||||
uploadFile:''
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -740,7 +739,6 @@
|
|||||||
user: '',
|
user: '',
|
||||||
pwd: '',
|
pwd: '',
|
||||||
port: '',
|
port: '',
|
||||||
uploadFile: null
|
|
||||||
}]
|
}]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -822,15 +820,6 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
changeLoginType:function(loginType){
|
|
||||||
this.assetData.accounts[0].authType = loginType;
|
|
||||||
if(loginType == 1){//密码登录
|
|
||||||
this.clearFile();
|
|
||||||
}
|
|
||||||
if(loginType == 2){//公钥登录
|
|
||||||
this.assetData.accounts[0].pwd='';
|
|
||||||
}
|
|
||||||
},
|
|
||||||
editData(data, item, mark) {
|
editData(data, item, mark) {
|
||||||
let obj = {
|
let obj = {
|
||||||
id: '',
|
id: '',
|
||||||
@@ -846,35 +835,33 @@
|
|||||||
tel: ''
|
tel: ''
|
||||||
}
|
}
|
||||||
if (data === 'asset') {
|
if (data === 'asset') {
|
||||||
//this.assetData.modelId = this.assetData.modelId.join(',').split(',')[1];
|
this.assetData.modelId = this.assetData.modelId.join(',').split(',')[1];
|
||||||
let modelId = this.assetData.modelId.join(',').split(',')[1];
|
// let modelId = this.assetData.modelId.join(',').split(',')[1];
|
||||||
let form = new FormData();
|
// let form = new FormData();
|
||||||
form.append("id", this.pageObj.id);
|
// form.append("id", this.pageObj.id);
|
||||||
form.append("sn", this.assetData.sn);
|
// form.append("sn", this.assetData.sn);
|
||||||
form.append("host", this.assetData.host);
|
// form.append("host", this.assetData.host);
|
||||||
form.append("state", this.assetData.state);
|
// form.append("state", this.assetData.state);
|
||||||
form.append("purchaseDate", !this.assetData.purchaseDate?'':this.assetData.purchaseDate);
|
// form.append("purchaseDate", !this.assetData.purchaseDate?'':this.assetData.purchaseDate);
|
||||||
form.append("idcId", this.assetData.idcId);
|
// form.append("idcId", this.assetData.idcId);
|
||||||
form.append("cabinetId", this.assetData.cabinetId);
|
// form.append("cabinetId", this.assetData.cabinetId);
|
||||||
form.append("modelId", modelId);
|
// form.append("modelId", modelId);
|
||||||
if (!this.accountSwitch) {
|
// if (!this.accountSwitch) {
|
||||||
this.assetData.accounts = [];
|
// this.assetData.accounts = [];
|
||||||
}
|
// }
|
||||||
for(let i in this.assetData.accounts){
|
// for(let i in this.assetData.accounts){
|
||||||
let account=this.assetData.accounts[i];
|
// let account=this.assetData.accounts[i];
|
||||||
if(account.user){
|
// if(account.user){
|
||||||
if (account.id) {
|
// if (account.id) {
|
||||||
form.append("accounts["+i+"].id", account.id);
|
// form.append("accounts["+i+"].id", account.id);
|
||||||
}
|
// }
|
||||||
form.append("accounts["+i+"].authType",account.authType);
|
// form.append("accounts["+i+"].authType",account.authType);
|
||||||
form.append("accounts["+i+"].user", account.user);
|
// form.append("accounts["+i+"].user", account.user);
|
||||||
form.append("accounts["+i+"].port", account.port);
|
// form.append("accounts["+i+"].port", account.port);
|
||||||
form.append("accounts["+i+"].pwd", account.pwd);
|
// form.append("accounts["+i+"].pwd", account.pwd);
|
||||||
if(account.authType==2){
|
// form.append("accounts["+i+"].privateKey", account.privateKey);
|
||||||
form.append('cert',account.uploadFile?account.uploadFile.raw:null);
|
// }
|
||||||
}
|
// }
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(this.$refs.accountConfigBox&&this.$refs.accountConfigBox.length>0){
|
if(this.$refs.accountConfigBox&&this.$refs.accountConfigBox.length>0){
|
||||||
this.$refs.accountConfigBox[0].validateAccount();
|
this.$refs.accountConfigBox[0].validateAccount();
|
||||||
@@ -882,11 +869,12 @@
|
|||||||
this.$refs.assetEditForm.validate((valid) => {
|
this.$refs.assetEditForm.validate((valid) => {
|
||||||
if (valid&&this.accountValideResult) {
|
if (valid&&this.accountValideResult) {
|
||||||
if (this.pageObj.id) {
|
if (this.pageObj.id) {
|
||||||
this.$put('asset', form,{'Content-Type': 'multipart/form-data'}).then(res => {
|
this.assetData.id=this.pageObj.id;
|
||||||
|
console.log(JSON.stringify(this.assetData));
|
||||||
|
this.$put('asset', this.assetData).then(res => {
|
||||||
const h = this.$createElement;
|
const h = this.$createElement;
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.$message({duration: 2000, type: 'success', message: this.$t("tip.saveSuccess")});
|
this.$message({duration: 2000, type: 'success', message: this.$t("tip.saveSuccess")});
|
||||||
this.clearFile();
|
|
||||||
this.pageObj.id = '';
|
this.pageObj.id = '';
|
||||||
this.$emit('refreshData', 'true');
|
this.$emit('refreshData', 'true');
|
||||||
this.sendStateData('close');
|
this.sendStateData('close');
|
||||||
@@ -901,44 +889,41 @@
|
|||||||
}
|
}
|
||||||
let modelId = ''
|
let modelId = ''
|
||||||
let authType = ''
|
let authType = ''
|
||||||
if (this.assetData.modelId !== '') {
|
// if (this.assetData.modelId !== '') {
|
||||||
modelId = this.assetData.modelId.join(',').split(',')[1]
|
// modelId = this.assetData.modelId.join(',').split(',')[1]
|
||||||
} else {
|
// } else {
|
||||||
this.assetData.modelId = ''
|
// this.assetData.modelId = ''
|
||||||
}
|
// }
|
||||||
if (this.assetData.accounts[0].user === '') {
|
if (this.assetData.accounts[0].user === '') {
|
||||||
authType = ''
|
authType = ''
|
||||||
} else {
|
} else {
|
||||||
authType = this.assetData.accounts[0].authType
|
authType = this.assetData.accounts[0].authType
|
||||||
}
|
}
|
||||||
let form = new FormData();
|
// let form = new FormData();
|
||||||
form.append("sn", this.assetData.sn);
|
// form.append("sn", this.assetData.sn);
|
||||||
form.append("host", this.assetData.host);
|
// form.append("host", this.assetData.host);
|
||||||
form.append("state", this.assetData.state);
|
// form.append("state", this.assetData.state);
|
||||||
form.append("purchaseDate", !this.assetData.purchaseDate?'':this.assetData.purchaseDate);
|
// form.append("purchaseDate", !this.assetData.purchaseDate?'':this.assetData.purchaseDate);
|
||||||
form.append("idcId", this.assetData.idcId);
|
// form.append("idcId", this.assetData.idcId);
|
||||||
form.append("cabinetId", this.assetData.cabinetId);
|
// form.append("cabinetId", this.assetData.cabinetId);
|
||||||
form.append("modelId", modelId);
|
// form.append("modelId", modelId);
|
||||||
if(this.accountSwitch){
|
// if(this.accountSwitch){
|
||||||
for(let i in this.assetData.accounts){
|
// for(let i in this.assetData.accounts){
|
||||||
let account=this.assetData.accounts[i];
|
// let account=this.assetData.accounts[i];
|
||||||
if(account.user){
|
// if(account.user){
|
||||||
form.append("accounts["+i+"].authType",account.authType);
|
// form.append("accounts["+i+"].authType",account.authType);
|
||||||
form.append("accounts["+i+"].user", account.user);
|
// form.append("accounts["+i+"].user", account.user);
|
||||||
form.append("accounts["+i+"].port", account.port);
|
// form.append("accounts["+i+"].port", account.port);
|
||||||
form.append("accounts["+i+"].pwd", account.pwd);
|
// form.append("accounts["+i+"].pwd", account.pwd);
|
||||||
if(account.authType==2){
|
// form.append("accounts["+i+"].privateKey", account.privateKey)
|
||||||
form.append('cert',account.uploadFile?account.uploadFile.raw:null);
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// form.append("exporter",parseInt(this.assetData.exporter));
|
||||||
}
|
this.$post('asset', this.assetData).then(res => {
|
||||||
form.append("exporter",parseInt(this.assetData.exporter));
|
|
||||||
this.$post('asset', form,{'Content-Type': 'multipart/form-data'}).then(res => {
|
|
||||||
const h = this.$createElement;
|
const h = this.$createElement;
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.$message({duration: 2000, type: 'success', message: this.$t("tip.saveSuccess")});
|
this.$message({duration: 2000, type: 'success', message: this.$t("tip.saveSuccess")});
|
||||||
this.clearFile();
|
|
||||||
this.$emit('refreshData', 'true');
|
this.$emit('refreshData', 'true');
|
||||||
this.sendStateData('close');
|
this.sendStateData('close');
|
||||||
} else {
|
} else {
|
||||||
@@ -1098,13 +1083,6 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
clearFile:function(){
|
|
||||||
if(this.$refs.upload){
|
|
||||||
this.$refs.upload.clearFiles();
|
|
||||||
}
|
|
||||||
this.uploadFileList=[];
|
|
||||||
this.assetData.accounts[0].privateKey='';
|
|
||||||
},
|
|
||||||
deleteData(data, item) {
|
deleteData(data, item) {
|
||||||
this.$confirm(this.$t("tip.confirmDelete"), {
|
this.$confirm(this.$t("tip.confirmDelete"), {
|
||||||
confirmButtonText: this.$t("tip.yes"),
|
confirmButtonText: this.$t("tip.yes"),
|
||||||
@@ -1349,12 +1327,6 @@
|
|||||||
this.tempData = ''
|
this.tempData = ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleChange(file,fileList) {
|
|
||||||
if (fileList.length > 0) {
|
|
||||||
this.uploadFileList = [fileList[fileList.length - 1]]
|
|
||||||
}
|
|
||||||
this.assetData.accounts[0].file = this.uploadFileList[0];
|
|
||||||
},
|
|
||||||
editPopoverClose(data) {
|
editPopoverClose(data) {
|
||||||
if (data === 'type') {
|
if (data === 'type') {
|
||||||
this.modelCount = ''
|
this.modelCount = ''
|
||||||
@@ -1441,21 +1413,4 @@
|
|||||||
margin-bottom: 18px;
|
margin-bottom: 18px;
|
||||||
background-color: #DCDFE6;
|
background-color: #DCDFE6;
|
||||||
}
|
}
|
||||||
/*去除上传文件动画start*/
|
|
||||||
/*.upload-demo {*/
|
|
||||||
/* display: flex;*/
|
|
||||||
/*}*/
|
|
||||||
/deep/ .el-list-enter-active,
|
|
||||||
/deep/ .el-list-leave-active {
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/deep/ .el-list-enter,
|
|
||||||
/deep/ .el-list-leave-active {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
/deep/ .el-upload-list {
|
|
||||||
height: 40px;
|
|
||||||
}
|
|
||||||
/*去除上传文件动画end*/
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -36,13 +36,7 @@
|
|||||||
<div class="right-box-form-content-txt" v-if="!isEdit">{{account.port}}</div>
|
<div class="right-box-form-content-txt" v-if="!isEdit">{{account.port}}</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('asset.createAssetTab.ssh')" v-show="account.authType==2" prop="file" v-if="isEdit">
|
<el-form-item :label="this.$t('asset.createAssetTab.ssh')" v-show="account.authType==2" prop="file" v-if="isEdit">
|
||||||
<el-upload class="upload-demo" ref="upload" action="" :file-list="uploadFileList" :on-change="handleChange" :auto-upload="false">
|
<el-input rows="4" type="textarea" placeholder="" v-model="account.privateKey" size="small"></el-input>
|
||||||
<div slot="tip" class="el-upload__tip" v-if="account.privateKey" >{{$t('asset.createAssetTab.sshKeyWasConfig')}}</div>
|
|
||||||
<button type="button" class="nz-btn nz-btn-size-normal nz-btn-style-normal">
|
|
||||||
<span class="top-tool-btn-txt" v-if="account.privateKey">{{$t('asset.createAssetTab.clickToCover')}}</span>
|
|
||||||
<span class="top-tool-btn-txt" v-else>{{$t('asset.createAssetTab.clickToUpload')}}</span>
|
|
||||||
</button>
|
|
||||||
</el-upload>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@@ -59,14 +53,7 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
},
|
},
|
||||||
data(){
|
data(){
|
||||||
let validateFile=(rule,value,callback) => {
|
|
||||||
if(!this.validateFile()){
|
|
||||||
callback(new Error(this.uploadTip))
|
|
||||||
}
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
return {
|
return {
|
||||||
uploadFileList:[],
|
|
||||||
rules:{
|
rules:{
|
||||||
user:[
|
user:[
|
||||||
{ required: true, message:this.$t('validate.required'),trigger: 'blur'}
|
{ required: true, message:this.$t('validate.required'),trigger: 'blur'}
|
||||||
@@ -75,9 +62,6 @@ export default {
|
|||||||
{required:true,message:this.$t('validate.required'),trigger: 'blur'},
|
{required:true,message:this.$t('validate.required'),trigger: 'blur'},
|
||||||
{ validator: port, trigger: 'blur'}
|
{ validator: port, trigger: 'blur'}
|
||||||
],
|
],
|
||||||
file:[
|
|
||||||
{ validator: validateFile, trigger: 'change'}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
uploadTip:''
|
uploadTip:''
|
||||||
}
|
}
|
||||||
@@ -97,12 +81,15 @@ export default {
|
|||||||
changeLoginType:function(loginType){
|
changeLoginType:function(loginType){
|
||||||
this.account.authType=loginType;
|
this.account.authType=loginType;
|
||||||
if(loginType == 1){//密码登录
|
if(loginType == 1){//密码登录
|
||||||
this.clearFile();
|
this.clearPrivateKey();
|
||||||
}
|
}
|
||||||
if(loginType == 2){//公钥登录
|
if(loginType == 2){//公钥登录
|
||||||
this.account.pwd='';
|
this.account.pwd='';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
clearPrivateKey:function(){
|
||||||
|
this.account.privateKey=null;
|
||||||
|
},
|
||||||
handleChange(file,fileList) {
|
handleChange(file,fileList) {
|
||||||
if (fileList.length > 0) {
|
if (fileList.length > 0) {
|
||||||
this.uploadFileList = [fileList[fileList.length - 1]]
|
this.uploadFileList = [fileList[fileList.length - 1]]
|
||||||
@@ -110,28 +97,12 @@ export default {
|
|||||||
this.account.uploadFile = this.uploadFileList[0];
|
this.account.uploadFile = this.uploadFileList[0];
|
||||||
this.validateFile();
|
this.validateFile();
|
||||||
},
|
},
|
||||||
clearFile:function() {
|
|
||||||
if (this.$refs.upload) {
|
|
||||||
this.$refs.upload.clearFiles();
|
|
||||||
}
|
|
||||||
this.uploadFileList = [];
|
|
||||||
},
|
|
||||||
validateAccount:function(){
|
validateAccount:function(){
|
||||||
this.validateResult=false;
|
this.validateResult=false;
|
||||||
this.$refs.accountForm.validate((valid) => {
|
this.$refs.accountForm.validate((valid) => {
|
||||||
this.$emit("setValidateResult",valid);
|
this.$emit("setValidateResult",valid);
|
||||||
console.log(valid)
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
validateFile:function(){
|
|
||||||
let file=this.uploadFileList[0];
|
|
||||||
if(file&&file.size>500){
|
|
||||||
this.uploadTip=this.$t('validate.fileSize')
|
|
||||||
return false;
|
|
||||||
}else{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
},
|
},
|
||||||
watch:{
|
watch:{
|
||||||
|
|||||||
@@ -37,7 +37,6 @@
|
|||||||
export-file-name="asset"
|
export-file-name="asset"
|
||||||
export-url="/asset/export"
|
export-url="/asset/export"
|
||||||
:params="searchLabel"
|
:params="searchLabel"
|
||||||
:template-key="templateKey"
|
|
||||||
@afterImport="getAssetData"
|
@afterImport="getAssetData"
|
||||||
class="float-right">
|
class="float-right">
|
||||||
<template slot="optionZone">
|
<template slot="optionZone">
|
||||||
@@ -371,25 +370,6 @@
|
|||||||
checkAllFlag: false,
|
checkAllFlag: false,
|
||||||
checkAllHandler: false,
|
checkAllHandler: false,
|
||||||
assetClick: false,
|
assetClick: false,
|
||||||
templateHeader:['*Sn','*Type','*Vendor','*Model','*Idc','Cabinet','*Host','State','PurchaseDate','AuthType','User','Pwd','PrivateKey','Port','Exporter'],
|
|
||||||
templateDate:[{
|
|
||||||
sn:'0001',
|
|
||||||
type:'server/net',
|
|
||||||
vendor:'huawei',
|
|
||||||
model:'rongyao',
|
|
||||||
idc:'beijing',
|
|
||||||
cabinet:'cab-01',
|
|
||||||
host:'192.168.1.1',
|
|
||||||
state:'1:在库 2:出库 默认:在库',
|
|
||||||
purchaseData:'2020-02-11 19:30:33',
|
|
||||||
authType:'认证类型,1:密码,2:私钥证书',
|
|
||||||
user:'root',
|
|
||||||
pwd:'111111',
|
|
||||||
privateKey:'xxxxxxxx',
|
|
||||||
port:'22',
|
|
||||||
exporter:'是否安装node_exporter,1:安装,0:不安装'
|
|
||||||
}],
|
|
||||||
templateKey:['sn','type','vendor','model','idc','cabinet','host','state','purchaseData','authType','user','pwd','privateKey','port','exporter']
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|||||||
@@ -34,14 +34,14 @@
|
|||||||
<el-table-column :resizable="false" v-for="(item, index) in tablelable" v-if="item.show" :width="item.width"
|
<el-table-column :resizable="false" v-for="(item, index) in tablelable" v-if="item.show" :width="item.width"
|
||||||
:key="`col-${index}`" :label="item.label">
|
:key="`col-${index}`" :label="item.label">
|
||||||
<template slot-scope="scope" :column="item">
|
<template slot-scope="scope" :column="item">
|
||||||
<idc-config-box v-if="item.prop == 'idc'" ref="idcConfigBox"
|
<!--<idc-config-box v-if="item.prop == 'idc'" ref="idcConfigBox"
|
||||||
:post-idc="JSON.parse(JSON.stringify(scope.row[item.prop]))" :is-edit="false"
|
:post-idc="JSON.parse(JSON.stringify(scope.row[item.prop]))" :is-edit="false"
|
||||||
placement="left" @after="getIdcData" :button-class="'checkbox-edit'">
|
placement="left" @after="getIdcData" :button-class="'checkbox-edit'">
|
||||||
<template v-slot:optionZone>
|
<template v-slot:optionZone>
|
||||||
<span class="link" @click="closeAllPop">{{scope.row[item.prop].name}}</span>
|
<span class="link" @click="closeAllPop">{{scope.row[item.prop].name}}</span>
|
||||||
</template>
|
</template>
|
||||||
</idc-config-box>
|
</idc-config-box>-->
|
||||||
|
<span v-if="item.prop == 'idc'" >{{scope.row[item.prop].name}}</span>
|
||||||
|
|
||||||
<span v-else-if="item.prop == 'type'">
|
<span v-else-if="item.prop == 'type'">
|
||||||
{{scope.row[item.prop] == '1' ? 'Global' : ''}}
|
{{scope.row[item.prop] == '1' ? 'Global' : ''}}
|
||||||
@@ -107,28 +107,30 @@
|
|||||||
<!--DC start-->
|
<!--DC start-->
|
||||||
<el-form-item label="DC" prop="idc.name">
|
<el-form-item label="DC" prop="idc.name">
|
||||||
<div class="right-box-form-content">
|
<div class="right-box-form-content">
|
||||||
<el-select class="right-box-row-with-btn" value-key="id" popper-class="config-dropdown"
|
<!-- <el-select class="right-box-row-with-btn" value-key="id" popper-class="config-dropdown"-->
|
||||||
|
<!-- v-model="promServer.idc" placeholder="" v-if="rightBox.isEdit" size="small">-->
|
||||||
|
<el-select value-key="id" popper-class="config-dropdown"
|
||||||
v-model="promServer.idc" placeholder="" v-if="rightBox.isEdit" size="small">
|
v-model="promServer.idc" placeholder="" v-if="rightBox.isEdit" size="small">
|
||||||
<el-option @click.native="blurEditIdc()" v-for="item in idcData" :key="item.id" :label="item.name"
|
<el-option @click.native="blurEditIdc()" v-for="item in idcData" :key="item.id" :label="item.name"
|
||||||
:value="item" :id="'prom-edit-idc-op-'+item.id">
|
:value="item" :id="'prom-edit-idc-op-'+item.id">
|
||||||
<span class="config-dropdown-label-txt">{{item.name}}</span>
|
<span class="config-dropdown-label-txt">{{item.name}}</span>
|
||||||
<div class="config-dropdown-label-icons">
|
<!-- <div class="config-dropdown-label-icons">-->
|
||||||
<span class="config-dropdown-btn config-dropdown-btn-delete" @click.stop="toDelIdc(item)"
|
<!-- <span class="config-dropdown-btn config-dropdown-btn-delete" @click.stop="toDelIdc(item)"-->
|
||||||
:id="'prom-edit-idc-op-del-'+item.id"><i class="el-icon-delete"></i></span>
|
<!-- :id="'prom-edit-idc-op-del-'+item.id"><i class="el-icon-delete"></i></span>-->
|
||||||
<idc-config-box :post-idc="item" placement="left" @after="getIdcData"
|
<!-- <idc-config-box :post-idc="item" placement="left" @after="getIdcData"-->
|
||||||
:button-class="'config-dropdown-btn'">
|
<!-- :button-class="'config-dropdown-btn'">-->
|
||||||
<template v-slot:optionZone>
|
<!-- <template v-slot:optionZone>-->
|
||||||
<i class="nz-icon nz-icon-edit"></i>
|
<!-- <i class="nz-icon nz-icon-edit"></i>-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
</idc-config-box>
|
<!-- </idc-config-box>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
||||||
|
|
||||||
<div class="right-box-row-btn" v-if="rightBox.isEdit">
|
<!-- <div class="right-box-row-btn" v-if="rightBox.isEdit">-->
|
||||||
<idc-config-box placement="left" @after="getIdcData"></idc-config-box>
|
<!-- <idc-config-box placement="left" @after="getIdcData"></idc-config-box>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
<div class="right-box-form-content-txt" v-if="!rightBox.isEdit">{{promServer.idc.name}}</div>
|
<div class="right-box-form-content-txt" v-if="!rightBox.isEdit">{{promServer.idc.name}}</div>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|||||||
BIN
nezha-fronted/static/template/en/asset-template.xlsx
Normal file
BIN
nezha-fronted/static/template/en/asset-template.xlsx
Normal file
Binary file not shown.
BIN
nezha-fronted/static/template/en/endpoint-template.xlsx
Normal file
BIN
nezha-fronted/static/template/en/endpoint-template.xlsx
Normal file
Binary file not shown.
Reference in New Issue
Block a user