|
|
@@ -1,42 +1,6 @@
|
|
|
<template>
|
|
|
<div class="data-table">
|
|
|
<section>
|
|
|
- <!--<div class="mirror-subtitle" v-if="deployStatus != 'RUNNING'">-->
|
|
|
- <!--选择镜像-->
|
|
|
- <!--</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>-->
|
|
|
- <!--<b-radio v-model="radio" :native-value="`b${item.id}`"> </b-radio>-->
|
|
|
- <!--<strong>构建ID: #</strong> {{ item.id }}-->
|
|
|
- <!--<span style="padding-left: 10px">-->
|
|
|
- <!--<strong>镜像ID: #</strong> {{ item.mirrorId }}-->
|
|
|
- <!--</span>-->
|
|
|
- <!--</div>-->
|
|
|
- <!--</div>-->
|
|
|
- <!--<div-->
|
|
|
- <!--class="test-item"-->
|
|
|
- <!--:key="item.id"-->
|
|
|
- <!--v-for="item in latestDeployList"-->
|
|
|
- <!-->-->
|
|
|
- <!--<div>-->
|
|
|
- <!--<b-radio v-model="radio" :native-value="`d${item.id}`"> </b-radio>-->
|
|
|
- <!--<strong>构建ID: #</strong> {{ item.id }}-->
|
|
|
- <!--<span style="padding-left: 10px">-->
|
|
|
- <!--<strong>镜像ID: #</strong> {{ item.mirrorId }}-->
|
|
|
- <!--</span>-->
|
|
|
- <!--</div>-->
|
|
|
- <!--</div>-->
|
|
|
- <!--</div>-->
|
|
|
- <!--</div>-->
|
|
|
- <!--<button-->
|
|
|
- <!--:class="['button', 'block', 'is-link', { 'is-loading': isRunning }]"-->
|
|
|
- <!--@click="startDeploy"-->
|
|
|
- <!--style="margin-top: 20px;"-->
|
|
|
- <!-->-->
|
|
|
- <!--开始部署-->
|
|
|
- <!--</button>-->
|
|
|
<b-message
|
|
|
title="部署进行中..."
|
|
|
:active.sync="isRunning"
|
|
|
@@ -93,10 +57,6 @@ export default {
|
|
|
haveDeployRecord: false,
|
|
|
deployLog: "",
|
|
|
unfoldDeployLogInfo: false
|
|
|
- // latestBuildList: [],
|
|
|
- // latestDeployList: [],
|
|
|
- // latestMirrorIdList: [],
|
|
|
- // radio: -1
|
|
|
};
|
|
|
},
|
|
|
props: {
|
|
|
@@ -116,14 +76,8 @@ 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.getLatestBuildInfo(this.projectDetail && this.projectDetail.id, 5);
|
|
|
- // this.getLastNDeployInfoList(
|
|
|
- // this.projectDetail && this.projectDetail.id,
|
|
|
- // 5
|
|
|
- // );
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
@@ -131,10 +85,6 @@ export default {
|
|
|
this.getLatestDeployInfo(this.projectDetail.latestDeploy.id);
|
|
|
this.getDeployLogInfo(this.projectDetail.latestDeploy.id);
|
|
|
}
|
|
|
- // if (this.projectDetail.id) {
|
|
|
- // this.getLatestBuildInfo(this.projectDetail.id, 5);
|
|
|
- // this.getLastNDeployInfoList(this.projectDetail.id, 5);
|
|
|
- // }
|
|
|
},
|
|
|
methods: {
|
|
|
//获取最新一次部署详细信息
|
|
|
@@ -160,67 +110,6 @@ export default {
|
|
|
}
|
|
|
return time.replace("T", " ") + "ms";
|
|
|
},
|
|
|
- //开始部署
|
|
|
- // startDeploy() {
|
|
|
- // if (this.radio == -1) {
|
|
|
- // this.$toast.open({
|
|
|
- // message: "请先选择镜像",
|
|
|
- // type: "is-danger"
|
|
|
- // });
|
|
|
- // return;
|
|
|
- // } else {
|
|
|
- // let mirrorId = this.getSelectedMirrorId();
|
|
|
- // //触发部署
|
|
|
- // makeDeploy({
|
|
|
- // projectId: this.projectDetail.id,
|
|
|
- // mirrorId: mirrorId,
|
|
|
- // replicas: 1
|
|
|
- // })
|
|
|
- // .then(res => {
|
|
|
- // console.log(res);
|
|
|
- // this.$toast.open({
|
|
|
- // message: "开始部署",
|
|
|
- // type: "is-success"
|
|
|
- // });
|
|
|
- //
|
|
|
- // this.isRunning = true;
|
|
|
- // })
|
|
|
- // .then(e => {
|
|
|
- // this.$toast.open({
|
|
|
- // message: e.message || "服务器未知错误",
|
|
|
- // type: "is-danger"
|
|
|
- // });
|
|
|
- // });
|
|
|
- // }
|
|
|
- // },
|
|
|
- //获取最近n次部署成功记录
|
|
|
- // getLastNDeployInfoList(projectId, limit) {
|
|
|
- // getLatestDeployInfoList(projectId, limit)
|
|
|
- // .then(res => {
|
|
|
- // this.latestDeployList = res.data;
|
|
|
- // // this.latestMirrorIdList = this.latestMirrorIdList.concat(res.data);
|
|
|
- // })
|
|
|
- // .catch(e => {
|
|
|
- // this.$toast.open({
|
|
|
- // message: e.message || " 服务器未知错误",
|
|
|
- // type: "is-danger"
|
|
|
- // });
|
|
|
- // });
|
|
|
- // },
|
|
|
- //获取最近n个构建的信息
|
|
|
- // getLatestBuildInfo(projectId, limit) {
|
|
|
- // getLatestBuildInfoList(projectId, limit)
|
|
|
- // .then(res => {
|
|
|
- // this.latestBuildList = res.data;
|
|
|
- // // this.latestMirrorIdList = this.latestMirrorIdList.concat(res.data);
|
|
|
- // })
|
|
|
- // .catch(e => {
|
|
|
- // this.$toast.open({
|
|
|
- // message: e.message || "服务器未知错误",
|
|
|
- // type: "is-danger"
|
|
|
- // });
|
|
|
- // });
|
|
|
- // },
|
|
|
//获取部署日志
|
|
|
getDeployLogInfo(deployId) {
|
|
|
getDeployLogInfo(deployId)
|
|
|
@@ -246,50 +135,11 @@ export default {
|
|
|
return "";
|
|
|
}
|
|
|
}
|
|
|
- //选择镜像ID
|
|
|
- // getSelectedMirrorId() {
|
|
|
- // let list =
|
|
|
- // this.radio[0] == "b" ? this.latestBuildList : this.latestDeployList;
|
|
|
- // let id = this.radio.substring(1);
|
|
|
- // for (let item of list) {
|
|
|
- // if (item.id == id) {
|
|
|
- // return item.mirrorId;
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
@import "../../../../assets/scss/app";
|
|
|
-.mirror-subtitle {
|
|
|
- font-size: 1.25rem;
|
|
|
- width: 100%;
|
|
|
- font-weight: bold;
|
|
|
- padding-bottom: 10px;
|
|
|
- border-bottom: 1px solid #dbdbdb;
|
|
|
-}
|
|
|
-.select-mirror {
|
|
|
- width: 100%;
|
|
|
- display: flex;
|
|
|
- .latest-build {
|
|
|
- width: 100%;
|
|
|
- }
|
|
|
-}
|
|
|
-.test-item {
|
|
|
- width: 100%;
|
|
|
- padding: $default-margin $default-margin-between;
|
|
|
- margin: 0 -#{$default-margin-between};
|
|
|
- cursor: pointer;
|
|
|
-}
|
|
|
-/*.test-item:hover,*/
|
|
|
-/*.test-item:nth-child(even):hover {*/
|
|
|
-/*background-color: #dde3ef;*/
|
|
|
-/*}*/
|
|
|
-
|
|
|
-.test-item:nth-child(even) {
|
|
|
- background-color: rgba(244, 247, 252, 0.6);
|
|
|
-}
|
|
|
.deploy-list {
|
|
|
margin-top: 1.5rem;
|
|
|
.deploy-item {
|