提交 d359421e authored 作者: Your Name's avatar Your Name

日志

上级 a27f46f8
...@@ -4,12 +4,14 @@ ...@@ -4,12 +4,14 @@
// 服务地址 // 服务地址
// const IP = 'https://www.easy-mock.com/mock/5b70ec93ad23a1570071a34e/Interview'; // easymock // const IP = 'https://www.easy-mock.com/mock/5b70ec93ad23a1570071a34e/Interview'; // easymock
const IP = 'http://192.168.1.54:8077'; const IP = 'http://192.168.0.116:8077';
const WS = '192.168.0.116:8077';
// 请求目标服务器域名配置 // 请求目标服务器域名配置
const DOMAIN_NAME = { const DOMAIN_NAME = {
URL_CNODEJS: IP, // 网关 服务端口 URL_CNODEJS: IP, // 网关 服务端口
WS_CONT: WS
}; };
export default DOMAIN_NAME; export default DOMAIN_NAME;
...@@ -38,7 +38,8 @@ export default { ...@@ -38,7 +38,8 @@ export default {
// 这里存放数据 // 这里存放数据
return { return {
tech: '', tech: '',
isCheck: false, isCheck: '',
itemId: ''
}; };
}, },
// 方法集合 // 方法集合
...@@ -47,11 +48,23 @@ export default { ...@@ -47,11 +48,23 @@ export default {
this.$emit('on-close'); this.$emit('on-close');
}, },
check(i) { check(i) {
console.log('选中') console.log('选中',i)
this.isCheck = i; this.isCheck = i;
}, },
makeSure() { makeSure() {
let a = this.applyId;
let b = this.isCheck + 1;
let obj = {
id: a,
techId: b
}
this.$server.postMidify(obj).then(res => {
console.log('postMidify',res.data);
this.$emit('on-close');
}).catch(err => {
console.log(err)
this.$message.error('请求失败')
})
} }
}, },
// 监听属性 类似于data概念 // 监听属性 类似于data概念
......
...@@ -21,8 +21,20 @@ const server = { ...@@ -21,8 +21,20 @@ const server = {
method: 'get' method: 'get'
}) })
}, },
midify() { // 技术路线 postMidify(data) { // 项目修改
return axios('/project/midify/', { return axios('/project/modify', {
method: 'post',
data: data
})
},
setPath(data) { // 修改路径
return axios('/project/setPath', {
method: 'post',
data: data
})
},
getDeploy(id) { // 获取项目详情
return axios('/project/deploy/' + id, {
method: 'get' method: 'get'
}) })
}, },
......
<!-- XClab系统页面 --> <!-- XClab系统页面 -->
<template> <template>
<div class="labsystem"> <div class="labsystem">
<div class="labContent"> <div class="labContent">
...@@ -9,14 +10,15 @@ ...@@ -9,14 +10,15 @@
<div class="themeBtn"> <span>项目归档</span> </div> <div class="themeBtn"> <span>项目归档</span> </div>
<div class="themeName"> <i></i> {{name}} </div> <div class="themeName"> <i></i> {{name}} </div>
<div class="themeOne"> <div class="themeOne">
<p class="themeOne-title"> <i></i> 项目配置详情 <span class="edit"><img src="../assets/img/edit.png" alt="">编辑</span> </p> <p class="themeOne-title"> <i></i> 项目信息 <!--<span class="edit"><img src="../assets/img/edit.png" alt="">编辑</span>--> </p>
<div class="themeOne-context"> <div class="themeOne-context">
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :offset="1" :span="11"> <el-col :offset="1" :span="11">
<div>访问路径: <span>http://www.baidu.com</span> </div>
<div>项目路径: <span @click="openAnother(path)">{{path}}</span></div>
</el-col> </el-col>
<el-col :offset="1" :span="11"> <el-col :offset="1" :span="11">
<div>gitlab地址: <span></span> </div> <div>gitlab地址: <span>{{gitPath}}</span> </div>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
...@@ -67,6 +69,24 @@ ...@@ -67,6 +69,24 @@
<div class="themeThree"> <div class="themeThree">
<p class="themeOne-title"> <i></i> 项目环境 <span class="apply" @click="apply"><img src="../assets/img/apply.png" alt="">重新申请</span> </p> <p class="themeOne-title"> <i></i> 项目环境 <span class="apply" @click="apply"><img src="../assets/img/apply.png" alt="">重新申请</span> </p>
<div class="themeThree-context"> <div class="themeThree-context">
<span class="deploy" @click="deploy">部署</span>
<p style="line-height: 50px">
访问路径:
<span>
<a v-if="editLink === false" @click="openLink(pathSuffix)" class="aLinkClick">{{pathSuffix}}</a>
<el-input
v-if="editLink === true"
type="textarea"
rows="1"
resize="none"
placeholder="请输入demo链接"
v-model="pathSuffix">
</el-input>
</span>
<i class="edit editPlus" v-if="editLink === false" @click="editLinkClick"><img src="../assets/img/edit.png" alt=""> 编辑</i>
<i class="edit editPlus" v-if="editLink === true" @click="saveLinkClick"><img src="../assets/img/edit.png" alt=""> 保存</i>
</p>
<div> <div>
<i></i> <i></i>
服务器: 服务器:
...@@ -94,6 +114,18 @@ ...@@ -94,6 +114,18 @@
<div class="themeFour"> <div class="themeFour">
<p class="themeOne-title"> <i></i> 项目运行日志 <span class="refresh"><img src="../assets/img/refresh.png" alt="">刷新</span> </p> <p class="themeOne-title"> <i></i> 项目运行日志 <span class="refresh"><img src="../assets/img/refresh.png" alt="">刷新</span> </p>
<div class="themeFour-context"> <div class="themeFour-context">
<!--<div v-if="logData.length === 0" class="logNone">暂无数据</div>-->
<div class="logData">
<el-scrollbar ref="elscroll" style="height:100%;">
<!--<div ref="logDiv" id="logDiv">-->
<!--<ul ref="logUl">-->
<!--<li class="logLi" v-for="(item,index) in logData" :key="index">{{item}}</li>-->
<!--<li>{{logData}}</li>-->
<!--</ul>-->
<textarea name="" id="" cols="30" rows="10">{{logData}}</textarea>
<!--</div>-->
</el-scrollbar>
</div>
</div> </div>
</div> </div>
...@@ -112,7 +144,8 @@ ...@@ -112,7 +144,8 @@
<script> <script>
// 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等) // 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
// 例如:import 《组件名称》 from '《组件路径》'; // 例如:import 《组件名称》 from '《组件路径》';
import newApply from '../components/dial/newApply' import newApply from '../components/dial/newApply';
import baseUrl from '../../config';
export default { export default {
name: 'labSystem', name: 'labSystem',
// import引入的组件需要注入到对象中才能使用 // import引入的组件需要注入到对象中才能使用
...@@ -122,6 +155,8 @@ export default { ...@@ -122,6 +155,8 @@ export default {
// 这里存放数据 // 这里存放数据
return { return {
id: 1, // id: 1, //
path: '', // 项目路径
gitPath: '', // git路径
name:'', // 项目名字 name:'', // 项目名字
pack: '', // 打包方式 pack: '', // 打包方式
codeType: '', // 代码类型 codeType: '', // 代码类型
...@@ -133,6 +168,11 @@ export default { ...@@ -133,6 +168,11 @@ export default {
applyModal: false, // 重新申请弹窗 applyModal: false, // 重新申请弹窗
applyMessage: '', // 弹窗数据 applyMessage: '', // 弹窗数据
applyId:'', // 传给弹窗的项目id applyId:'', // 传给弹窗的项目id
editLink: false, // 编辑链接
pathSuffix: '', // 链接
jenkinsName: '', // webstock
logData:'', // 日志
data: ''
}; };
}, },
// 方法集合 // 方法集合
...@@ -141,38 +181,102 @@ export default { ...@@ -141,38 +181,102 @@ export default {
console.log(3333) console.log(3333)
this.$server.getProject(this.id).then(res => { this.$server.getProject(this.id).then(res => {
console.log(res.data); console.log(res.data);
this.path = res.data.path
this.gitPath = res.data.gitPath
this.name = res.data.name this.name = res.data.name
this.pack = res.data.pack this.pack = res.data.pack
this.codeType = res.data.codeType this.codeType = res.data.codeType
this.rate = res.data.rate this.rate = res.data.rate
this.compile = res.data.compile this.compile = res.data.compile
this.os = res.data.os; this.os = res.data.os;
console.log('服务器',this.os) // console.log('服务器',this.os)
this.mid = res.data.mid; this.mid = res.data.mid;
console.log('中间件',this.mid) // console.log('中间件',this.mid)
this.db = res.data.db; this.db = res.data.db;
console.log('数据库',this.db) // console.log('数据库',this.db)
this.pathSuffix = res.data.pathSuffix
this.jenkinsName = res.data.jenkinsName
this.copyWebsocket(res.data.jenkinsName)
}).catch(err => { }).catch(err => {
console.log(err); // console.log(err);
this.$message.error('数据请求失败'); this.$message.error('数据请求失败');
}) })
}, },
// 重新申请
apply() { apply() {
console.log(1) // console.log(1)
this.applyModal = true this.applyModal = true
this.$server.findAll().then(res => { this.$server.findAll().then(res => {
console.log(res.data); // console.log(res.data);
this.applyMessage = res.data this.applyMessage = res.data
this.applyId = this.id this.applyId = this.id
console.log('77777',this.applyId) // console.log('77777',this.applyId)
}).catch(err => { }).catch(err => {
console.log(err) // console.log(err)
this.$message.error('请求失败') this.$message.error('请求失败')
}) })
}, },
reset(){ reset(){
this.applyModal = false; this.applyModal = false;
}, },
openLink(val) {
console.log(val)
},
// 编辑
editLinkClick() {
this.editLink = !this.editLink;
},
// 保存
saveLinkClick() {
console.log(this.pathSuffix)
let obj = {
"pathSuffix": this.pathSuffix,
"id": this.id,
}
console.log(obj)
this.$server.setPath(obj).then(res => {
console.log(res.data);
console.log('77777')
this.editLink = false
this.getProject();
}).catch(err => {
console.log(err)
this.$message.error('请求失败')
})
},
// 打开项目路径链接新页面
openAnother(val) {
console.log(val)
window.open(this.val, '_blank').location;
},
// 部署
deploy() {
this.$server.getDeploy(this.id).then(res => {
console.log(res.data);
console.log('77777');
}).catch(err => {
console.log(err)
this.$message.error('请求失败')
})
},
// websocket
copyWebsocket(val) {
// Create WebSocket connection.
// console.log('this.jenkinsName2121',this.jenkinsName)
// const socket = new WebSocket('ws://' + baseUrl.WS_CONT + '/webServer/${this.jenkinsName}');
const socket = new WebSocket(`ws://${baseUrl.WS_CONT}/webServer/${val}`);
// Connection opened
socket.addEventListener('open', function (event) {
socket.send('Hello Server!');
});
// Listen for messages
socket.addEventListener('message', function (event) {
// console.log('Message from server ', event.data);
this.logData = event.data
// logData: event.data
console.log('this.logData', this.logData)
});
}
}, },
// 监听属性 类似于data概念 // 监听属性 类似于data概念
computed: {}, computed: {},
...@@ -183,6 +287,7 @@ export default { ...@@ -183,6 +287,7 @@ export default {
// 生命周期 - 挂载完成(可以访问DOM元素) // 生命周期 - 挂载完成(可以访问DOM元素)
mounted () { mounted () {
this.getProject(); this.getProject();
// this.copyWebsocket();
}, },
// 生命周期 - 创建之前 // 生命周期 - 创建之前
beforeCreate () {}, beforeCreate () {},
...@@ -307,9 +412,9 @@ export default { ...@@ -307,9 +412,9 @@ export default {
display: inline-block; display: inline-block;
width: 60%; width: 60%;
height: 36px; height: 36px;
background: #f5f8fd; /*background: #f5f8fd;*/
border: 1px solid #d5e3ff; /*border: 1px solid #d5e3ff;*/
border-radius: 2px; /*border-radius: 2px;*/
line-height: 36px; line-height: 36px;
padding: 0 12px; padding: 0 12px;
margin-bottom: -14px; margin-bottom: -14px;
...@@ -325,8 +430,24 @@ export default { ...@@ -325,8 +430,24 @@ export default {
} }
.themeThree-context { .themeThree-context {
height: 85px; height: 150px;
color: #666; color: #666;
position: relative;
}
.themeThree-context p {
height: 50px;
}
.themeThree-context p span {
/*color: #333;*/
display: inline-block;
width: 33%;
/*height: 36px;*/
/*background: #f5f8fd;*/
/*border: 1px solid #d5e3ff;*/
/*border-radius: 2px;*/
/*line-height: 36px;*/
/*padding: 0 12px;*/
margin-bottom: -14px
} }
.themeThree-context div { .themeThree-context div {
margin-bottom: 10px; margin-bottom: 10px;
...@@ -355,4 +476,42 @@ export default { ...@@ -355,4 +476,42 @@ export default {
.closeModel:hover { .closeModel:hover {
content: url("../assets/img/closeh.png"); content: url("../assets/img/closeh.png");
} }
.editPlus {
color: rgba(72,119,230,.6);
}
.editPlus:hover {
color: #4877e6;
}
.editPlus:hover img {
content: url("../assets/img/eidth.png");
}
.editPlus img {
margin-right: 8px;
}
.aLinkClick {
padding-left: 23px;
}
.deploy {
display: inline-block;
position: absolute;
right: 15px;
top: 17px;
color: rgba(72,119,230,.6);
}
.deploy:hover {
color: #4877e6;
}
.logData{
margin: 0 10px;
height: 24vh;
overflow-y: auto;
}
.logLi{
color: #FFF;
font-size: 16px;
padding: 10px 10px;
text-align: left;
border-bottom: 3px dotted rgba(3,110,183, 0.2);
word-wrap:break-word;
}
</style> </style>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论