Skip to content

Commit

Permalink
Merge pull request #18 from leozhang2018/main
Browse files Browse the repository at this point in the history
Service guide optimization
  • Loading branch information
landylee007 authored May 19, 2021
2 parents 7c04aad + 218e479 commit b988e39
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 17 deletions.
10 changes: 9 additions & 1 deletion zadig-portal/src/components/projects/guide/service.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@
class="no-content">
<img src="@assets/icons/illustration/editor_nodata.svg"
alt="">
<p v-if="services.length === 0">暂无服务,创建服务请在左侧栏点击创建服务按钮</p>
<p v-if="services.length === 0">暂无服务,点击 <el-button size="mini"
icon="el-icon-plus"
@click="createService()"
plain
circle>
</el-button> 创建服务</p>
<p v-else-if="service.service_name==='服务列表' && services.length >0">请在左侧选择需要编辑的服务</p>
<p v-else-if="!service.service_name && services.length >0">请在左侧选择需要编辑的服务</p>
</div>
Expand Down Expand Up @@ -112,6 +117,9 @@ export default {
}
},
methods: {
createService() {
this.$refs['serviceTree'].createService('platform');
},
toNext() {
this.$router.push(`/v1/projects/create/${this.projectName}/basic/runtime?serviceName=${this.serviceName}&serviceType=${this.serviceType}`);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,11 @@
</el-radio-group>
</div>
</el-col>
<el-col :span="14" class="text-right">
<el-col :span="14"
class="text-right">
<div style="line-height:32px">
<el-tooltip effect="dark"
content="平台编辑"
content="创建服务"
placement="top">
<el-button v-if="deployType==='k8s'"
size="mini"
Expand Down Expand Up @@ -709,16 +710,16 @@ export default {
},
async createService(cmd) {
const res = await getCodeSourceByAdminAPI(1);
if (res && res.length > 0) {
if (cmd && this.deployType === 'k8s') {
if (cmd === 'platform') {
this.showNewServiceInput = true;
this.mode = 'edit';
this.$nextTick(() => {
this.$refs.serviceNamedRef.focus();
});
}
else if (cmd === 'repo') {
if (cmd && this.deployType === 'k8s') {
if (cmd === 'platform') {
this.showNewServiceInput = true;
this.mode = 'edit';
this.$nextTick(() => {
this.$refs.serviceNamedRef.focus();
});
}
else if (cmd === 'repo') {
if (res && res.length > 0) {
this.dialogImportFileVisible = true;
this.showNewServiceInput = false;
this.mode = 'edit';
Expand All @@ -729,10 +730,10 @@ export default {
return element;
});
});
} else {
this.$emit('onAddCodeSource', true);
}
}
} else {
this.$emit('onAddCodeSource', true);
}
},
Expand Down Expand Up @@ -1151,4 +1152,4 @@ export default {
.text-right {
text-align: right;
}
</style>
</style>
10 changes: 9 additions & 1 deletion zadig-portal/src/components/projects/service_mgr/service.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@
class="no-content">
<img src="@assets/icons/illustration/editor_nodata.svg"
alt="">
<p v-if="services.length === 0">暂无服务,创建服务请在左侧栏点击创建服务按钮</p>
<p v-if="services.length === 0">暂无服务,点击 <el-button size="mini"
icon="el-icon-plus"
@click="createService()"
plain
circle>
</el-button> 创建服务</p>
<p v-else-if="service.service_name==='服务列表' && services.length >0">请在左侧选择需要编辑的服务</p>
<p v-else-if="!service.service_name && services.length >0">请在左侧选择需要编辑的服务</p>
</div>
Expand Down Expand Up @@ -130,6 +135,9 @@ export default {
}
},
methods: {
createService() {
this.$refs['serviceTree'].createService('platform');
},
toNext() {
this.updateEnvDialogVisible = true;
},
Expand Down

0 comments on commit b988e39

Please sign in to comment.