|
@@ -37,7 +37,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<button
|
|
<button
|
|
|
- :class="['button', 'block', 'is-link', { 'is-loading': isRunning }]"
|
|
|
|
|
|
|
+ :class="['button', 'block', 'is-link', { 'is-loading': isRunning || deployButtonDisabled }]"
|
|
|
@click="startDeploy"
|
|
@click="startDeploy"
|
|
|
style="margin-top: 20px;"
|
|
style="margin-top: 20px;"
|
|
|
>
|
|
>
|
|
@@ -116,7 +116,8 @@ export default {
|
|
|
latestMirrorIdList: [],
|
|
latestMirrorIdList: [],
|
|
|
radio: -1,
|
|
radio: -1,
|
|
|
isfetchLog: false,
|
|
isfetchLog: false,
|
|
|
- latestDeployId: 0
|
|
|
|
|
|
|
+ latestDeployId: 0,
|
|
|
|
|
+ deployButtonDisabled: false
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
props: {
|
|
props: {
|
|
@@ -131,13 +132,6 @@ export default {
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
|
projectDetail: function() {
|
|
projectDetail: function() {
|
|
|
- // console.log(newVal);
|
|
|
|
|
- //获取最新一次部署详细信息
|
|
|
|
|
- // if (newVal.latestDeploy && newVal.latestDeploy.id) {
|
|
|
|
|
- // // this.haveDeployRecord = true;
|
|
|
|
|
- //
|
|
|
|
|
- // // this.getDeployLogInfo(this.projectDetail.latestDeploy.id);
|
|
|
|
|
- // }
|
|
|
|
|
this.getLatestDeployInfo();
|
|
this.getLatestDeployInfo();
|
|
|
this.getLatestBuildInfo(this.projectDetail && this.projectDetail.id, 5);
|
|
this.getLatestBuildInfo(this.projectDetail && this.projectDetail.id, 5);
|
|
|
this.getLastNDeployInfoList(
|
|
this.getLastNDeployInfoList(
|
|
@@ -199,11 +193,13 @@ export default {
|
|
|
},
|
|
},
|
|
|
//开始部署
|
|
//开始部署
|
|
|
startDeploy() {
|
|
startDeploy() {
|
|
|
|
|
+ this.deployButtonDisabled = true;
|
|
|
if (this.radio == -1) {
|
|
if (this.radio == -1) {
|
|
|
this.$toast.open({
|
|
this.$toast.open({
|
|
|
message: "请先选择镜像",
|
|
message: "请先选择镜像",
|
|
|
type: "is-danger"
|
|
type: "is-danger"
|
|
|
});
|
|
});
|
|
|
|
|
+ this.deployButtonDisabled = false;
|
|
|
return;
|
|
return;
|
|
|
} else {
|
|
} else {
|
|
|
let mirrorId = this.getSelectedMirrorId();
|
|
let mirrorId = this.getSelectedMirrorId();
|
|
@@ -214,6 +210,7 @@ export default {
|
|
|
replicas: 1
|
|
replicas: 1
|
|
|
})
|
|
})
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
|
|
+ this.deployButtonDisabled = false;
|
|
|
if (res.data.status == "SUCCESS") {
|
|
if (res.data.status == "SUCCESS") {
|
|
|
this.$toast.open({
|
|
this.$toast.open({
|
|
|
message: "不要重复部署哦~",
|
|
message: "不要重复部署哦~",
|
|
@@ -221,18 +218,16 @@ export default {
|
|
|
});
|
|
});
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- // console.log(res);
|
|
|
|
|
this.$toast.open({
|
|
this.$toast.open({
|
|
|
message: "开始部署",
|
|
message: "开始部署",
|
|
|
type: "is-success"
|
|
type: "is-success"
|
|
|
});
|
|
});
|
|
|
this.isRunning = true;
|
|
this.isRunning = true;
|
|
|
this.deployInfo = res.data;
|
|
this.deployInfo = res.data;
|
|
|
- // setTimeout(() => {
|
|
|
|
|
- // this.getLatestDeployInfo(this.projectDetail.latestDeploy.id);
|
|
|
|
|
- // }, 1000);
|
|
|
|
|
|
|
+ this.latestDeployId = res.data.id;
|
|
|
})
|
|
})
|
|
|
.catch(e => {
|
|
.catch(e => {
|
|
|
|
|
+ this.deployButtonDisabled = false;
|
|
|
this.$toast.open({
|
|
this.$toast.open({
|
|
|
message: e.message || "服务器未知错误",
|
|
message: e.message || "服务器未知错误",
|
|
|
type: "is-danger"
|
|
type: "is-danger"
|