|
|
@@ -6,7 +6,11 @@
|
|
|
</div>
|
|
|
<div class="select-mirror" v-if="deployStatus != 'RUNNING'">
|
|
|
<div class="latest-build">
|
|
|
- <div class="test-item" :key="item.id" v-for="item in latestBuildList">
|
|
|
+ <div
|
|
|
+ class="test-item"
|
|
|
+ :key="`b${item.id}`"
|
|
|
+ v-for="item in latestBuildList"
|
|
|
+ >
|
|
|
<div>
|
|
|
<b-radio v-model="radio" :native-value="`b${item.id}`"> </b-radio>
|
|
|
<strong>构建ID: #</strong> {{ item.id }}
|
|
|
@@ -18,7 +22,7 @@
|
|
|
</div>
|
|
|
<div
|
|
|
class="test-item"
|
|
|
- :key="item.id"
|
|
|
+ :key="`d${item.id}`"
|
|
|
v-for="item in latestDeployList"
|
|
|
>
|
|
|
<div>
|
|
|
@@ -71,8 +75,13 @@
|
|
|
<div class="deploy-item">
|
|
|
<div class="subtitle">部署输出信息</div>
|
|
|
<a
|
|
|
- class="button is-small is-info"
|
|
|
- @click="unfoldDeployLogInfo = !unfoldDeployLogInfo"
|
|
|
+ :class="[
|
|
|
+ 'button',
|
|
|
+ 'is-small',
|
|
|
+ 'is-info',
|
|
|
+ { 'is-loading': isfetchLog }
|
|
|
+ ]"
|
|
|
+ @click="getDeployLogInfo"
|
|
|
>
|
|
|
{{ unfoldDeployLogInfo ? "收起部署详细信息" : "查看部署详细信息" }}</a
|
|
|
>
|
|
|
@@ -105,7 +114,8 @@ export default {
|
|
|
latestBuildList: [],
|
|
|
latestDeployList: [],
|
|
|
latestMirrorIdList: [],
|
|
|
- radio: -1
|
|
|
+ radio: -1,
|
|
|
+ isfetchLog: false
|
|
|
};
|
|
|
},
|
|
|
props: {
|
|
|
@@ -125,8 +135,7 @@ export default {
|
|
|
if (newVal.latestDeploy && newVal.latestDeploy.id) {
|
|
|
this.haveDeployRecord = true;
|
|
|
this.getLatestDeployInfo(newVal.latestDeploy.id);
|
|
|
- // this.getLatestDeployInfo(17);
|
|
|
- this.getDeployLogInfo(this.projectDetail.latestDeploy.id);
|
|
|
+ // this.getDeployLogInfo(this.projectDetail.latestDeploy.id);
|
|
|
}
|
|
|
this.getLatestBuildInfo(this.projectDetail && this.projectDetail.id, 5);
|
|
|
this.getLastNDeployInfoList(
|
|
|
@@ -138,7 +147,7 @@ export default {
|
|
|
mounted() {
|
|
|
if (this.projectDetail.latestDeploy) {
|
|
|
this.getLatestDeployInfo(this.projectDetail.latestDeploy.id);
|
|
|
- this.getDeployLogInfo(this.projectDetail.latestDeploy.id);
|
|
|
+ // this.getDeployLogInfo(this.projectDetail.latestDeploy.id);
|
|
|
}
|
|
|
if (this.projectDetail.id) {
|
|
|
this.getLatestBuildInfo(this.projectDetail.id, 5);
|
|
|
@@ -146,6 +155,12 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ //获取部署日志
|
|
|
+ // checkDeployLog(){
|
|
|
+ // if(this.projectDetail.latestDeploy){
|
|
|
+ // this.getDeployLogInfo(this.projectDetail.latestDeploy.id);
|
|
|
+ // }
|
|
|
+ // },
|
|
|
//获取最新一次部署详细信息
|
|
|
getLatestDeployInfo(deployId) {
|
|
|
getDeployDetail(deployId)
|
|
|
@@ -192,11 +207,11 @@ export default {
|
|
|
type: "is-success"
|
|
|
});
|
|
|
this.isRunning = true;
|
|
|
- setTimeout(() => {
|
|
|
- this.getLatestDeployInfo(this.projectDetail.latestDeploy.id);
|
|
|
- }, 1000);
|
|
|
+ // setTimeout(() => {
|
|
|
+ // this.getLatestDeployInfo(this.projectDetail.latestDeploy.id);
|
|
|
+ // }, 1000);
|
|
|
})
|
|
|
- .then(e => {
|
|
|
+ .catch(e => {
|
|
|
this.$toast.open({
|
|
|
message: e.message || "服务器未知错误",
|
|
|
type: "is-danger"
|
|
|
@@ -233,17 +248,26 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
//获取部署日志
|
|
|
- getDeployLogInfo(deployId) {
|
|
|
- getDeployLogInfo(deployId)
|
|
|
- .then(res => {
|
|
|
- this.deployLog = res.data;
|
|
|
- })
|
|
|
- .catch(e => {
|
|
|
- this.$toast.open({
|
|
|
- message: e.message || "服务器未知错误",
|
|
|
- type: "is-danger"
|
|
|
+ getDeployLogInfo() {
|
|
|
+ if (this.unfoldDeployLogInfo) {
|
|
|
+ this.unfoldDeployLogInfo = false;
|
|
|
+ } else {
|
|
|
+ let deployId = this.projectDetail.latestDeploy.id;
|
|
|
+ this.isfetchLog = true;
|
|
|
+ getDeployLogInfo(deployId)
|
|
|
+ .then(res => {
|
|
|
+ this.deployLog = res.data;
|
|
|
+ this.unfoldDeployLogInfo = true;
|
|
|
+ this.isfetchLog = false;
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ this.isfetchLog = false;
|
|
|
+ this.$toast.open({
|
|
|
+ message: e.message || "服务器未知错误",
|
|
|
+ type: "is-danger"
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
+ }
|
|
|
},
|
|
|
//部署类型
|
|
|
type(value) {
|