|
@@ -28,6 +28,7 @@
|
|
:clearable="false"
|
|
:clearable="false"
|
|
manual-fetch
|
|
manual-fetch
|
|
select-default
|
|
select-default
|
|
|
|
+ @change="envChange"
|
|
></env-select>
|
|
></env-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item prop="moduleId" label="模块">
|
|
<el-form-item prop="moduleId" label="模块">
|
|
@@ -44,7 +45,7 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<div
|
|
<div
|
|
- v-if="checkPrivilege('app_config_nginx_edit')"
|
|
|
|
|
|
+ v-if="checkPrivilege('app_config_nginx_edit') || IS_MAINTAINER"
|
|
class="part-box-action"
|
|
class="part-box-action"
|
|
>
|
|
>
|
|
<el-button
|
|
<el-button
|
|
@@ -107,14 +108,25 @@ export default {
|
|
},
|
|
},
|
|
nginxContent: "",
|
|
nginxContent: "",
|
|
isEdit: false,
|
|
isEdit: false,
|
|
- loading: false
|
|
|
|
|
|
+ loading: false,
|
|
|
|
+ curSelectEnv: {},
|
|
|
|
+ curSearchEnv: {},
|
|
|
|
+ user: {}
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
title() {
|
|
title() {
|
|
return `应用nginx配置-${this.app.name}`;
|
|
return `应用nginx配置-${this.app.name}`;
|
|
|
|
+ },
|
|
|
|
+ IS_MAINTAINER() {
|
|
|
|
+ return (
|
|
|
|
+ this.curSearchEnv.user && this.curSearchEnv.user.id === this.user.id
|
|
|
|
+ );
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ created() {
|
|
|
|
+ this.user = this.$ls.get("user", {});
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
visibleChange() {
|
|
visibleChange() {
|
|
this.isEdit = false;
|
|
this.isEdit = false;
|
|
@@ -136,6 +148,9 @@ export default {
|
|
open() {
|
|
open() {
|
|
this.modalIsShow = true;
|
|
this.modalIsShow = true;
|
|
},
|
|
},
|
|
|
|
+ envChange(val) {
|
|
|
|
+ this.curSelectEnv = val || {};
|
|
|
|
+ },
|
|
async search() {
|
|
async search() {
|
|
const valid = await this.$refs.FilterForm.validate().catch(() => {});
|
|
const valid = await this.$refs.FilterForm.validate().catch(() => {});
|
|
if (!valid) return;
|
|
if (!valid) return;
|
|
@@ -143,9 +158,11 @@ export default {
|
|
this.searchFilter = { ...this.filter };
|
|
this.searchFilter = { ...this.filter };
|
|
const data = await appNginxConfig(this.searchFilter);
|
|
const data = await appNginxConfig(this.searchFilter);
|
|
this.nginxContent = data.content || "";
|
|
this.nginxContent = data.content || "";
|
|
|
|
+ this.curSearchEnv = { ...this.curSelectEnv };
|
|
},
|
|
},
|
|
async confirm() {
|
|
async confirm() {
|
|
- if (!this.checkPrivilege("app_config_nginx_edit")) return;
|
|
|
|
|
|
+ if (!this.checkPrivilege("app_config_nginx_edit") && !this.IS_MAINTAINER)
|
|
|
|
+ return;
|
|
|
|
|
|
if (!this.nginxContent) {
|
|
if (!this.nginxContent) {
|
|
this.$message.error("请输入配置内容!");
|
|
this.$message.error("请输入配置内容!");
|