|
|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <ElTabs class="tabs" v-model="activeTab">
|
|
|
+ <ElTabs class="tabs" v-model="activeTab" v-loading.lock="loading">
|
|
|
<ElTabPane label="流水线" name="pipeline">
|
|
|
<ElTable :data="pipelines" width="100%" :default-sort="{prop: 'id', order: 'descending'}">
|
|
|
<ElTableColumn
|
|
|
@@ -79,11 +79,11 @@
|
|
|
</template>
|
|
|
</ElTableColumn>
|
|
|
</ElTable>
|
|
|
- <ElDialog v-model="showPipelineDetailModal" destroy-on-close>
|
|
|
+ <ElDialog v-loading="diaLogLoading" v-model="showPipelineDetailModal" destroy-on-close>
|
|
|
<template #title>历史执行结果详情</template>
|
|
|
<pre class="pipeline-detail">{{detail}}</pre>
|
|
|
</ElDialog>
|
|
|
- <ElDialog v-model="showPipelineHistoryModal" destroy-on-close>
|
|
|
+ <ElDialog v-loading="diaLogLoading" v-model="showPipelineHistoryModal" destroy-on-close>
|
|
|
<template #title>流水线构建历史</template>
|
|
|
<ElTable
|
|
|
:data="pipelineHistory"
|
|
|
@@ -120,6 +120,7 @@
|
|
|
</ElTable>
|
|
|
</ElDialog>
|
|
|
<ElDialog
|
|
|
+ v-loading="diaLogLoading"
|
|
|
v-model="showPipelineEditModal"
|
|
|
:before-close="(done) => {
|
|
|
jsonValid=true;
|
|
|
@@ -148,6 +149,7 @@
|
|
|
</template>
|
|
|
</ElDialog>
|
|
|
<ElDialog
|
|
|
+ v-loading="diaLogLoading"
|
|
|
v-model="showPipelineCreateModal"
|
|
|
:before-close="(done) => {
|
|
|
$refs['createPipelineForm'].resetFields();
|
|
|
@@ -183,7 +185,7 @@
|
|
|
</ElForm>
|
|
|
<template #footer>
|
|
|
<span class="dialog-footer">
|
|
|
- <el-button type="primary" @click="handlePipelineCreateConfirm">确 定</el-button>
|
|
|
+ <el-button type="primary" v-loading="confirmLoading" @click="handlePipelineCreateConfirm">确 定</el-button>
|
|
|
</span>
|
|
|
</template>
|
|
|
</ElDialog>
|
|
|
@@ -258,6 +260,9 @@ import { formatter } from '@/utils/time';
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ loading: false,
|
|
|
+ dialogLoading: false,
|
|
|
+ confirmLoading: false,
|
|
|
activeTab: 'pipeline',
|
|
|
pipelines: [],
|
|
|
productions: [],
|
|
|
@@ -278,9 +283,11 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
async mounted() {
|
|
|
+ this.loading = true;
|
|
|
this.pipelines = await PipelineAPI.getPipelinesByProjectId(this.$store.state.workspace.currentProjectId);
|
|
|
this.productions = await PipelineAPI.getDeploymentsByProjectId(this.$store.state.workspace.currentProjectId);
|
|
|
this.templates = await PipelineAPI.getPipelineTemplates();
|
|
|
+ this.loading = false;
|
|
|
},
|
|
|
methods: {
|
|
|
formatter,
|
|
|
@@ -291,40 +298,50 @@ export default {
|
|
|
break;
|
|
|
}
|
|
|
case 'trigger': {
|
|
|
+ this.loading = true;
|
|
|
await PipelineAPI.triggerDeployment({
|
|
|
projectId: this.$store.state.workspace.currentProjectId,
|
|
|
pipelineId: id,
|
|
|
});
|
|
|
this.productions = await PipelineAPI.getDeploymentsByProjectId(this.$store.state.workspace.currentProjectId);
|
|
|
+ this.loading = false;
|
|
|
break;
|
|
|
}
|
|
|
case 'detail': {
|
|
|
this.showPipelineDetailModal = true;
|
|
|
+ this.dialogLoading = true;
|
|
|
this.detail = await PipelineAPI.getPipelineHistoryDetail(id);
|
|
|
+ this.dialogLoading = false;
|
|
|
break;
|
|
|
}
|
|
|
case 'history': {
|
|
|
this.showPipelineHistoryModal = true;
|
|
|
+ this.dialogLoading = true;
|
|
|
this.pipelineHistory = await PipelineAPI.getPipelineHistory({
|
|
|
projectId: this.$store.state.workspace.currentProjectId,
|
|
|
pipelineId: id,
|
|
|
});
|
|
|
+ this.dialogLoading = false;
|
|
|
break;
|
|
|
}
|
|
|
case 'edit': {
|
|
|
this.showPipelineEditModal = true;
|
|
|
+ this.dialogLoading = true;
|
|
|
this.editingPipelineId = id;
|
|
|
this.pipelineConfig = await PipelineAPI.getPipeline({
|
|
|
projectId: this.$store.state.workspace.currentProjectId,
|
|
|
pipelineId: id,
|
|
|
}).configJson || '{}';
|
|
|
+ this.dialogLoading = false;
|
|
|
break;
|
|
|
}
|
|
|
case 'delete': {
|
|
|
+ this.loading = true;
|
|
|
PipelineAPI.deletePipeline({
|
|
|
projectId: this.$store.state.workspace.currentProjectId,
|
|
|
pipelineId: id,
|
|
|
});
|
|
|
+ this.loading = false;
|
|
|
break;
|
|
|
}
|
|
|
default: {
|
|
|
@@ -344,14 +361,17 @@ export default {
|
|
|
}
|
|
|
}, 500),
|
|
|
async handlePipelineUpdateConfirm() {
|
|
|
+ this.confirmLoading = true;
|
|
|
await PipelineAPI.updatePipeline({
|
|
|
projectId: this.$store.state.workspace.currentProjectId,
|
|
|
pipelineId: this.editingPipelineId,
|
|
|
configJson: JSON.stringify(JSON.parse(this.pipelineConfig)),
|
|
|
});
|
|
|
+ this.confirmLoading = false;
|
|
|
this.showPipelineEditModal = false;
|
|
|
},
|
|
|
async handlePipelineCreateConfirm() {
|
|
|
+ this.confirmLoading = true;
|
|
|
this.$refs.createPipelineForm.validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
await PipelineAPI.createPipeline({
|
|
|
@@ -363,12 +383,15 @@ export default {
|
|
|
this.showPipelineCreateModal = false;
|
|
|
}
|
|
|
});
|
|
|
+ this.confirmLoading = false;
|
|
|
},
|
|
|
open(url, target) {
|
|
|
window.open(url, target);
|
|
|
},
|
|
|
async deleteProduction(id) {
|
|
|
+ this.loading = true;
|
|
|
await PipelineAPI.deleteInstance(id);
|
|
|
+ this.loading = false;
|
|
|
},
|
|
|
},
|
|
|
};
|