|
@@ -32,6 +32,9 @@
|
|
|
<el-form-item style="float: right;">
|
|
|
<el-button type="primary" @click="showAllocation">{{$t('base.add')}}</el-button>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item style="float:right;" v-if="user.parentId == 0">
|
|
|
+ <el-button type="primary" @click="showChangeIp()">{{$t('runTest.changeIp')}}</el-button>
|
|
|
+ </el-form-item>
|
|
|
<!-- <el-form-item style="float: right;">
|
|
|
<el-button type="primary" @click="issued">{{$t('base.issued')}}</el-button>
|
|
|
</el-form-item> -->
|
|
@@ -677,6 +680,43 @@
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
+ },
|
|
|
+
|
|
|
+ //改变ip
|
|
|
+ showChangeIp() {
|
|
|
+ this.$prompt('', this.$t('runTest.changeIp'), {
|
|
|
+ confirmButtonText: this.$t('el.datepicker.confirm'),
|
|
|
+ cancelButtonText: this.$t('el.datepicker.cancel'),
|
|
|
+ inputPattern: /^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?):([0-9]|[1-9]\d{1,3}|[1-5]\d{4}|6[0-4]\d{4}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$/,
|
|
|
+ inputErrorMessage: this.$t('runTest.IPWrong')
|
|
|
+ }).then(({ value }) => {
|
|
|
+ var ip = value.split(':')[0] , port = value.split(':')[1];
|
|
|
+ this.http.post( this.port.mold.changeIp , {
|
|
|
+ "ip": ip,
|
|
|
+ "port": port,
|
|
|
+ },
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: this.$t('prompt.success')
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }).catch(() => {
|
|
|
+
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
created() {
|