mirror of https://github.com/1Panel-dev/1Panel
fix: 去掉不该存在的参数
parent
25604d4dda
commit
6281905a55
|
@ -54,7 +54,6 @@
|
||||||
show-icon
|
show-icon
|
||||||
:closable="false"
|
:closable="false"
|
||||||
/>
|
/>
|
||||||
<!-- <span v-if="!appDetail.enable">{{ $t('app.limitHelper') }}</span> -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
|
@ -2,13 +2,18 @@
|
||||||
<el-dialog
|
<el-dialog
|
||||||
v-model="open"
|
v-model="open"
|
||||||
:title="$t('app.install')"
|
:title="$t('app.install')"
|
||||||
:destroy-on-close="true"
|
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
width="40%"
|
width="40%"
|
||||||
:before-close="handleClose"
|
:before-close="handleClose"
|
||||||
@opened="opened"
|
|
||||||
>
|
>
|
||||||
<el-form ref="paramForm" label-position="left" :model="form" label-width="150px" :rules="rules">
|
<el-form
|
||||||
|
ref="paramForm"
|
||||||
|
label-position="left"
|
||||||
|
:model="form"
|
||||||
|
label-width="150px"
|
||||||
|
:rules="rules"
|
||||||
|
:validate-on-rule-change="false"
|
||||||
|
>
|
||||||
<el-form-item :label="$t('app.name')" prop="NAME">
|
<el-form-item :label="$t('app.name')" prop="NAME">
|
||||||
<el-input v-model="form['NAME']"></el-input>
|
<el-input v-model="form['NAME']"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -30,7 +35,7 @@ import { App } from '@/api/interface/app';
|
||||||
import { InstallApp } from '@/api/modules/app';
|
import { InstallApp } from '@/api/modules/app';
|
||||||
import { Rules } from '@/global/form-rules';
|
import { Rules } from '@/global/form-rules';
|
||||||
import { FormInstance, FormRules } from 'element-plus';
|
import { FormInstance, FormRules } from 'element-plus';
|
||||||
import { nextTick, reactive, ref } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import Params from '../params/index.vue';
|
import Params from '../params/index.vue';
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
@ -61,22 +66,16 @@ const handleClose = () => {
|
||||||
resetForm();
|
resetForm();
|
||||||
};
|
};
|
||||||
|
|
||||||
const opened = () => {
|
|
||||||
nextTick(() => {
|
|
||||||
if (paramForm.value) {
|
|
||||||
paramForm.value.clearValidate();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const resetForm = () => {
|
const resetForm = () => {
|
||||||
if (paramForm.value) {
|
if (paramForm.value) {
|
||||||
|
paramForm.value.clearValidate();
|
||||||
paramForm.value.resetFields();
|
paramForm.value.resetFields();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const acceptParams = (props: InstallRrops): void => {
|
const acceptParams = (props: InstallRrops): void => {
|
||||||
installData.value = props;
|
installData.value = props;
|
||||||
|
resetForm();
|
||||||
open.value = true;
|
open.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,6 @@ const updateParam = () => {
|
||||||
|
|
||||||
const handleParams = () => {
|
const handleParams = () => {
|
||||||
rules = props.rules;
|
rules = props.rules;
|
||||||
|
|
||||||
if (params.value != undefined && params.value.formFields != undefined) {
|
if (params.value != undefined && params.value.formFields != undefined) {
|
||||||
for (const p of params.value.formFields) {
|
for (const p of params.value.formFields) {
|
||||||
const pObj = p;
|
const pObj = p;
|
||||||
|
@ -129,7 +128,11 @@ const getServices = async (envKey: string, key: string | undefined, pObj: ParamO
|
||||||
form[envKey] = res.data[0].value;
|
form[envKey] = res.data[0].value;
|
||||||
if (res.data[0].config) {
|
if (res.data[0].config) {
|
||||||
Object.entries(res.data[0].config).forEach(([k, v]) => {
|
Object.entries(res.data[0].config).forEach(([k, v]) => {
|
||||||
|
params.value.formFields.forEach((field) => {
|
||||||
|
if (field.envKey === k) {
|
||||||
form[k] = v;
|
form[k] = v;
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
updateParam();
|
updateParam();
|
||||||
|
@ -141,7 +144,9 @@ const changeService = (value: string, services: App.AppService[]) => {
|
||||||
services.forEach((item) => {
|
services.forEach((item) => {
|
||||||
if (item.value === value) {
|
if (item.value === value) {
|
||||||
Object.entries(item.config).forEach(([k, v]) => {
|
Object.entries(item.config).forEach(([k, v]) => {
|
||||||
|
if (form.hasOwnProperty(k)) {
|
||||||
form[k] = v;
|
form[k] = v;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue