Skip to content

Commit

Permalink
Refactor service stable version retrieval in ComposeConfig.vue
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanghengxin committed Apr 2, 2024
1 parent c3f64ca commit dcb9708
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions main/src/components/Apps/ComposeConfig.vue
Original file line number Diff line number Diff line change
Expand Up @@ -418,17 +418,22 @@ export default {
},
watch: {
current_service: {
async handler(val) {
handler(val) {
this.$emit("updateDockerComposeServiceName", val);
this.serviceStableVersion = await this.$openAPI.appManagement.appStore
.composeAppStableTag(yaml.name, this.current_service)
if (this.configData.name) {
this.$openAPI.appManagement.appStore
.composeAppServiceStableTag(this.configData.name, this.current_service)
.then((res) => {
return res.data.data.tag;
this.serviceStableVersion = res.data.data.tag;
})
.catch((e) => {
console.error(e);
return "";
this.serviceStableVersion = "";
});
}else{
this.serviceStableVersion = "";
}
},
immediate: true,
},
Expand Down

0 comments on commit dcb9708

Please sign in to comment.