Commit 23c2f929 authored by 黄贤军's avatar 黄贤军

bug修改

parent 69bde0e8
Pipeline #21285 passed with stage
in 2 minutes and 15 seconds
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm"> <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
<el-form-item label="项目代码" prop="name" > <el-form-item label="项目代码" prop="name" >
<el-input class="demo" v-model="ruleForm.project_no"></el-input> <el-input class="demo" v-model="ruleForm.project_no"></el-input>
<span class="Prompt">向开发人员询问</span>
</el-form-item> </el-form-item>
<el-form-item label="数据库IP" prop="name"> <el-form-item label="数据库IP" prop="name">
<el-input class="demo" v-model="ruleForm.db_ip"></el-input> <el-input class="demo" v-model="ruleForm.db_ip"></el-input>
...@@ -12,10 +13,10 @@ ...@@ -12,10 +13,10 @@
<el-form-item label="数据库端口" prop="name"> <el-form-item label="数据库端口" prop="name">
<el-input class="demo" v-model="ruleForm.db_port"></el-input> <el-input class="demo" v-model="ruleForm.db_port"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="用户名" prop="name"> <el-form-item label="数据库用户名" prop="name">
<el-input class="demo" v-model="ruleForm.db_user"></el-input> <el-input class="demo" v-model="ruleForm.db_user"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="密码" prop="name"> <el-form-item label="数据库密码" prop="name">
<el-input class="demo" type="password" v-model="ruleForm.db_password"></el-input> <el-input class="demo" type="password" v-model="ruleForm.db_password"></el-input>
</el-form-item> </el-form-item>
...@@ -23,7 +24,7 @@ ...@@ -23,7 +24,7 @@
<el-input class="demo" v-model="ruleForm.host_ip"></el-input> <el-input class="demo" v-model="ruleForm.host_ip"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="TIIP数据库名" prop="name"> <el-form-item label="TIIP数据库名" prop="name">
<el-input class="demo" v-model="ruleForm.tiip_db_name"></el-input> <el-input class="demo" placeholder="(非必填)" v-model="ruleForm.tiip_db_name"></el-input>
<el-button style="margin-left: 40px" type="primary" @click="test(ruleForm.tiip_db_name)">测试连接</el-button> <el-button style="margin-left: 40px" type="primary" @click="test(ruleForm.tiip_db_name)">测试连接</el-button>
</el-form-item> </el-form-item>
<el-form-item label="MES数据库名" prop="name"> <el-form-item label="MES数据库名" prop="name">
...@@ -121,15 +122,15 @@ ...@@ -121,15 +122,15 @@
<el-input class="demo" v-model="remote_server.server_ssh_port"></el-input> <el-input class="demo" v-model="remote_server.server_ssh_port"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="用户名" prop="name"> <el-form-item label="数据库用户名" prop="name">
<el-input class="demo" v-model="remote_server.server_user"></el-input> <el-input class="demo" v-model="remote_server.server_user"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="密码" prop="name"> <el-form-item label="数据库密码" prop="name">
<el-input class="demo" type="password" v-model="remote_server.server_password"></el-input> <el-input class="demo" type="password" v-model="remote_server.server_password"></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="set_remote_server('')">保存</el-button> <el-button type="primary" @click="set_remote_server('')">保存</el-button>
<el-button type="primary" @click="docker()">安装dokcer</el-button>
<el-button type="primary" @click="upgrade('sen_ruleForm')">推送升级</el-button> <el-button type="primary" @click="upgrade('sen_ruleForm')">推送升级</el-button>
</el-form-item> </el-form-item>
<el-form-item style="float:right;margin-top:-200px;margin-right:47%;"> <el-form-item style="float:right;margin-top:-200px;margin-right:47%;">
...@@ -225,32 +226,48 @@ export default { ...@@ -225,32 +226,48 @@ export default {
closeFullScreen(loadings) { closeFullScreen(loadings) {
loadings.close() loadings.close()
}, },
// 安装dokcer
docker() {
axios.get(`mesAPI/install/remote_server/docker/`).then(res => {
this.dialogVisible_install = true
var myDate = new Date()
var since_time = `${myDate.getFullYear()}-${myDate.getMonth() + 1}-${myDate.getDate()} ${myDate.getHours()}:${myDate.getMinutes()}:${myDate.getSeconds()}`
this.chatTimer = setInterval(() => {
this.get_info_logs(since_time)
}, 2000)
})
},
// 安装runner // 安装runner
install_runner() { install_runner() {
axios.get(`mesAPI/install/runner/`).then(res => { axios.get(`mesAPI/install/runner/`).then(res => {
this.dialogVisible_install = true this.dialogVisible_install = true
var myDate = new Date()
var since_time = `${myDate.getFullYear()}-${myDate.getMonth() + 1}-${myDate.getDate()} ${myDate.getHours()}:${myDate.getMinutes()}:${myDate.getSeconds()}`
this.chatTimer = setInterval(() => { this.chatTimer = setInterval(() => {
this.get_info_logs() this.get_info_logs(since_time)
}, 2000) }, 2000)
}) })
}, },
get_info_logs() { get_info_logs(since_time) {
// var myDate = new Date() axios.get(`mesAPI/info/logs/?since_time=${since_time}`).then(res => {
// var since_time = `${myDate.getFullYear()}-${myDate.getMonth()}-${myDate.getDate()} ${myDate.getHours()}:${myDate.getMinutes()}:${myDate.getSeconds()}` if (res.data.indexOf('runner安装成功') !== -1 || res.data.indexOf('远程升级完成') !== -1 || res.data.indexOf('runner安装失败') !== -1 || res.data.indexOf('远程升级失败') !== -1 || res.data.indexOf('docker安装成功') !== -1 || res.data.indexOf('docker安装失败') !== -1) {
axios.get(`mesAPI/info/logs/`).then(res => { clearInterval(this.chatTimer)
// if (res.data.indexOf('安装成功') !== -1 || res.data.indexOf('远程升级完成') !== -1) {
// clearInterval(this.chatTimer)
// this.text = res.data
// } else {
this.text = res.data this.text = res.data
// } } else {
this.text = res.data
}
}) })
}, },
upgrade() { upgrade() {
axios.get(`mesAPI/upgrade/remote/`).then(res => { axios.get(`mesAPI/upgrade/remote/`).then(res => {
if (res.data) {
console.log(11)
}
this.dialogVisible_install = true this.dialogVisible_install = true
var myDate = new Date()
var since_time = `${myDate.getFullYear()}-${myDate.getMonth() + 1}-${myDate.getDate()} ${myDate.getHours()}:${myDate.getMinutes()}:${myDate.getSeconds()}`
this.chatTimer = setInterval(() => { this.chatTimer = setInterval(() => {
this.get_info_logs() this.get_info_logs(since_time)
}, 2000) }, 2000)
}) })
// this.openFullScreen('正在推送升级,请稍等') // this.openFullScreen('正在推送升级,请稍等')
...@@ -265,7 +282,8 @@ export default { ...@@ -265,7 +282,8 @@ export default {
}, },
test(str) { test(str) {
if (!this.ruleForm.id) { if (!this.ruleForm.id) {
this.$message.error('请先系统配置') this.$message.error('请先设置系统配置并保存')
return
} }
var url = `${this.ruleForm.project_no}/${str}` var url = `${this.ruleForm.project_no}/${str}`
this.$API.get(`mesAPI/connection/${url}/`).then(res => { this.$API.get(`mesAPI/connection/${url}/`).then(res => {
...@@ -353,6 +371,11 @@ export default { ...@@ -353,6 +371,11 @@ export default {
} }
</script> </script>
<style scope> <style scope>
.Prompt{
margin-left: 30px;
color: #c1c1c1;
size:10px;
}
.demo { .demo {
width: 300px; width: 300px;
} }
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div style="margin-top:20px;color:#31a9d3"> <div style="margin-top:20px;color:#31a9d3">
<span style="display: inline-block;width:49%;" v-if="user_name" @click="setting_login">设置登陆信息</span> <span style="display: inline-block;width:49%;" v-if="!user_name" @click="setting_login">设置登陆信息</span>
</div> </div>
</el-card> </el-card>
</div> </div>
...@@ -109,7 +109,11 @@ export default { ...@@ -109,7 +109,11 @@ export default {
// 查询用户信息 // 查询用户信息
get_user() { get_user() {
this.$API.get(`${this.module_name}/`).then(res => { this.$API.get(`${this.module_name}/`).then(res => {
if (res.data) {
this.user_name = res.data this.user_name = res.data
} else {
this.$message('请先设置您的登录信息')
}
}) })
}, },
// 登录 // 登录
...@@ -117,7 +121,7 @@ export default { ...@@ -117,7 +121,7 @@ export default {
this.$API.post(`${this.module_name}/login/`, {}, {}, this.form).then(res => { this.$API.post(`${this.module_name}/login/`, {}, {}, this.form).then(res => {
sessionStorage.setItem('user', true) sessionStorage.setItem('user', true)
this.$router.push({ path: '/hs/system' }) this.$router.push({ path: '/hs/system' })
this.$message('登录成功') this.$message.success('登录成功')
}) })
}, },
getUserData() { getUserData() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment