feat: nginx 应用增加 disabled 项

pull/93/head
zhengkunwang223 2022-12-26 16:33:54 +08:00 committed by zhengkunwang223
parent e44d325404
commit cf934801c3
3 changed files with 11 additions and 3 deletions

View File

@ -6,7 +6,8 @@
"labelEn": "Http Port",
"required": true,
"default": 80,
"envKey": "PANEL_APP_PORT_HTTP"
"envKey": "PANEL_APP_PORT_HTTP",
"disabled": true,
},
{
"type": "number",
@ -14,7 +15,8 @@
"labelEn": "Https Port",
"required": true,
"default": 443,
"envKey": "PANEL_APP_PORT_HTTPS"
"envKey": "PANEL_APP_PORT_HTTPS",
"disabled": true
}
]
}

View File

@ -123,7 +123,9 @@ func (a AppService) GetAppDetail(appId uint, version string) (response.AppDetail
return appDetailDTO, err
}
paramMap := make(map[string]interface{})
_ = json.Unmarshal([]byte(detail.Params), &paramMap)
if err := json.Unmarshal([]byte(detail.Params), &paramMap); err != nil {
return appDetailDTO, err
}
appDetailDTO.AppDetail = detail
appDetailDTO.Params = paramMap
appDetailDTO.Enable = true

View File

@ -7,6 +7,7 @@
v-if="p.type == 'number'"
:type="p.type"
@change="updateParam"
:disabled="p.disabled"
></el-input>
<el-input
v-model="form[p.envKey]"
@ -41,6 +42,7 @@ import { App } from '@/api/interface/app';
interface ParamObj extends App.FromField {
services: App.AppService[];
prop: string;
disabled: false;
}
const emit = defineEmits(['update:form', 'update:rules']);
@ -96,6 +98,8 @@ const handleParams = () => {
for (const p of params.value.formFields) {
const pObj = p;
pObj.prop = propStart.value + p.envKey;
pObj.disabled = p.disabled;
console.log(pObj);
paramObjs.value.push(pObj);
if (p.default == 'random') {
form[p.envKey] = getRandomStr(6);