Commit 9387e20e authored by 徐一鸣's avatar 徐一鸣

应用管理镜像编辑fixed

parent 76d0dce8
...@@ -127,6 +127,7 @@ export default { ...@@ -127,6 +127,7 @@ export default {
type: "success", type: "success",
}); });
this.getImageDetail(); this.getImageDetail();
this.$emit("refresh");
} else { } else {
this.$message({ this.$message({
message: `删除失败`, message: `删除失败`,
......
...@@ -268,7 +268,10 @@ ...@@ -268,7 +268,10 @@
完成 完成
</el-button> </el-button>
</div> </div>
<image-detail ref="imageDetail"></image-detail> <image-detail
ref="imageDetail"
@refresh="refreshImageList"
></image-detail>
</app-build-step> </app-build-step>
<template slot="action"> <template slot="action">
...@@ -451,7 +454,6 @@ export default { ...@@ -451,7 +454,6 @@ export default {
message: `提交成功`, message: `提交成功`,
type: "success", type: "success",
}); });
this.step2Loading = false;
this.step = 2; this.step = 2;
this.app_id = response.data; this.app_id = response.data;
...@@ -463,8 +465,9 @@ export default { ...@@ -463,8 +465,9 @@ export default {
message: response.errMsg || `提交失败`, message: response.errMsg || `提交失败`,
type: "warning", type: "warning",
}); });
this.step2Loading = false;
} }
this.step2Loading = false;
}, },
deployUploadError() { deployUploadError() {
this.$message({ this.$message({
...@@ -530,19 +533,17 @@ export default { ...@@ -530,19 +533,17 @@ export default {
}); });
this.image_info.image_name = ""; this.image_info.image_name = "";
this.image_info.tag = ""; this.image_info.tag = "";
this.image_info.file = ""; this.refreshImageList();
this.$refs.step1_upload.clearFiles();
this.addImageLoading = false;
this.image_datas = [];
this.image_page = 1;
this.initImageList();
} else { } else {
this.$message({ this.$message({
message: response.errMsg || `上传镜像失败`, message: response.errMsg || `上传镜像失败`,
type: "warning", type: "warning",
}); });
this.addImageLoading = false;
} }
this.image_info.file = "";
this.$refs.step1_upload.clearFiles();
this.addImageLoading = false;
}, },
imageUploadError() { imageUploadError() {
this.$message({ this.$message({
...@@ -569,16 +570,14 @@ export default { ...@@ -569,16 +570,14 @@ export default {
this.dialogInfo.msg = "是否删除该镜像?"; this.dialogInfo.msg = "是否删除该镜像?";
this.dialogInfo.submit = () => { this.dialogInfo.submit = () => {
this.$http this.$http
.delete(`/apaas/hubApi/image/del/${item.name}`) .delete(`/apaas/hubApi/image/del/${item.name}?app_id=${this.app_id}`)
.then((response) => { .then((response) => {
if (response.data.success == 1) { if (response.data.success == 1) {
this.$message({ this.$message({
message: `删除成功`, message: `删除成功`,
type: "success", type: "success",
}); });
this.image_datas = []; this.refreshImageList();
this.image_page = 1;
this.initImageList();
} else { } else {
this.$message({ this.$message({
message: `删除失败`, message: `删除失败`,
...@@ -599,7 +598,7 @@ export default { ...@@ -599,7 +598,7 @@ export default {
showImageDetail(item) { showImageDetail(item) {
this.$refs.imageDetail.showDialog({ this.$refs.imageDetail.showDialog({
...item, ...item,
app_id: this.app_id app_id: this.app_id,
}); });
}, },
stepsDone() { stepsDone() {
...@@ -607,13 +606,16 @@ export default { ...@@ -607,13 +606,16 @@ export default {
}, },
deployAction() { deployAction() {
// 跳转至应用详情进行部署操作 // 跳转至应用详情进行部署操作
this.$router.push( this.$router.push(`/yygl/0/0/detail/${this.app_id}`);
`/yygl/0/0/detail/${this.app_id}`
);
}, },
backToList() { backToList() {
this.$router.push(`/yygl/0/0`); this.$router.push(`/yygl/0/0`);
}, },
refreshImageList() {
this.image_datas = [];
this.image_page = 1;
this.initImageList();
},
}, },
mounted() { mounted() {
this.getYwlys(); this.getYwlys();
......
...@@ -57,11 +57,10 @@ ...@@ -57,11 +57,10 @@
:data="image_arr" :data="image_arr"
:padding-left="60" :padding-left="60"
></apass-table> ></apass-table>
<p style="text-align: center" v-if="image_loading">加载中...</p> <p style="text-align: center;line-height: 36px;" v-if="image_loading">
<p 加载中...
style="text-align: center" </p>
v-if="image_noMore && image_arr.length > 0" <p style="text-align: center;line-height: 36px;" v-if="image_noMore">
>
没有更多了 没有更多了
</p> </p>
</div> </div>
...@@ -198,7 +197,7 @@ ...@@ -198,7 +197,7 @@
ref="myConfirm" ref="myConfirm"
:confirmOptions="tipsOptions" :confirmOptions="tipsOptions"
></dialog-action> ></dialog-action>
<image-detail ref="imageDetail"></image-detail> <image-detail ref="imageDetail" @refresh="refreshImageList"></image-detail>
</div> </div>
</template> </template>
...@@ -488,12 +487,11 @@ export default { ...@@ -488,12 +487,11 @@ export default {
this.$message.error("上传失败"); this.$message.error("上传失败");
}, },
load_data() { load_data() {
console.log(2222);
this.asynLoad = false; this.asynLoad = false;
if (5 * this.now_page < this.total) { if (5 * this.now_page < this.total) {
this.now_page = this.now_page + 1; this.now_page = this.now_page + 1;
this.get_image_list(); this.get_image_list();
} else { } else if (this.total > 0) {
this.image_noMore = true; this.image_noMore = true;
} }
}, },
...@@ -530,13 +528,11 @@ export default { ...@@ -530,13 +528,11 @@ export default {
}, },
delete_data(name) { delete_data(name) {
this.$http this.$http
.delete(`/apaas/hubApi/image/del/${name}`) .delete(`/apaas/hubApi/image/del/${name}?app_id=${this.$route.params.id}`)
.then((response) => { .then((response) => {
if (response.data.success == 1) { if (response.data.success == 1) {
this.$message.success("删除成功"); this.$message.success("删除成功");
this.now_page = 1; this.refreshImageList();
this.image_arr = [];
this.get_image_list();
} else { } else {
this.$message.error("删除失败"); this.$message.error("删除失败");
} }
...@@ -786,6 +782,11 @@ export default { ...@@ -786,6 +782,11 @@ export default {
}) })
.catch(function(response) {}); .catch(function(response) {});
}, },
refreshImageList() {
this.now_page = 1;
this.image_arr = [];
this.get_image_list();
}
}, },
}; };
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment