mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 01:57:19 +08:00
feat: 优化部署模版
This commit is contained in:
@@ -21,7 +21,7 @@ type Template struct {
|
||||
Description string `json:"description"` // 变量描述
|
||||
Type string `json:"type"` // 变量类型, text, password, number, port, select
|
||||
Options map[string]string `json:"options,omitempty"` // 下拉框选项,key -> value
|
||||
Default any `json:"default"` // 默认值,string or number
|
||||
Default any `json:"default,omitempty"` // 默认值,string or number
|
||||
} `json:"environments"`
|
||||
}
|
||||
|
||||
|
||||
@@ -403,7 +403,7 @@ const composeOptions = computed(() => {
|
||||
:key="env.name"
|
||||
:path="`envs.${env.name}`"
|
||||
:label="env.description"
|
||||
:required="env.default == ''"
|
||||
:required="env.default == null || env.default === ''"
|
||||
>
|
||||
<!-- Select 类型 -->
|
||||
<n-select
|
||||
@@ -419,7 +419,7 @@ const composeOptions = computed(() => {
|
||||
:min="env.type === 'port' ? 1 : undefined"
|
||||
:max="env.type === 'port' ? 65535 : undefined"
|
||||
style="width: 100%"
|
||||
:placeholder="String(env.default)"
|
||||
:placeholder="env.default != null ? env.default : ''"
|
||||
/>
|
||||
<!-- Password 类型 -->
|
||||
<n-input
|
||||
@@ -427,19 +427,19 @@ const composeOptions = computed(() => {
|
||||
v-model:value="deployModel.envs[env.name]"
|
||||
type="password"
|
||||
show-password-on="click"
|
||||
:placeholder="String(env.default)"
|
||||
:placeholder="env.default != null ? env.default : ''"
|
||||
/>
|
||||
<!-- URL 类型 -->
|
||||
<n-input
|
||||
v-else-if="env.type === 'url'"
|
||||
v-model:value="deployModel.envs[env.name]"
|
||||
:placeholder="String(env.default)"
|
||||
:placeholder="env.default != null ? env.default : ''"
|
||||
/>
|
||||
<!-- Text 类型 (默认) -->
|
||||
<n-input
|
||||
v-else
|
||||
v-model:value="deployModel.envs[env.name]"
|
||||
:placeholder="String(env.default)"
|
||||
:placeholder="env.default != null ? env.default : ''"
|
||||
/>
|
||||
</n-form-item>
|
||||
</template>
|
||||
@@ -485,7 +485,7 @@ const composeOptions = computed(() => {
|
||||
:key="env.name"
|
||||
:path="`envs.${env.name}`"
|
||||
:label="env.description"
|
||||
:required="env.default == ''"
|
||||
:required="env.default == null || env.default === ''"
|
||||
>
|
||||
<!-- Select 类型 -->
|
||||
<n-select
|
||||
@@ -501,7 +501,7 @@ const composeOptions = computed(() => {
|
||||
:min="env.type === 'port' ? 1 : undefined"
|
||||
:max="env.type === 'port' ? 65535 : undefined"
|
||||
style="width: 100%"
|
||||
:placeholder="String(env.default)"
|
||||
:placeholder="env.default != null ? env.default : ''"
|
||||
/>
|
||||
<!-- Password 类型 -->
|
||||
<n-input
|
||||
@@ -509,19 +509,19 @@ const composeOptions = computed(() => {
|
||||
v-model:value="deployModel.envs[env.name]"
|
||||
type="password"
|
||||
show-password-on="click"
|
||||
:placeholder="String(env.default)"
|
||||
:placeholder="env.default != null ? env.default : ''"
|
||||
/>
|
||||
<!-- URL 类型 -->
|
||||
<n-input
|
||||
v-else-if="env.type === 'url'"
|
||||
v-model:value="deployModel.envs[env.name]"
|
||||
:placeholder="String(env.default)"
|
||||
:placeholder="env.default != null ? env.default : ''"
|
||||
/>
|
||||
<!-- Text 类型 (默认) -->
|
||||
<n-input
|
||||
v-else
|
||||
v-model:value="deployModel.envs[env.name]"
|
||||
:placeholder="String(env.default)"
|
||||
:placeholder="env.default != null ? env.default : ''"
|
||||
/>
|
||||
</n-form-item>
|
||||
</template>
|
||||
|
||||
@@ -1018,7 +1018,7 @@ const removeCustomConfig = (index: number) => {
|
||||
</n-tab-pane>
|
||||
<n-tab-pane v-if="setting.type == 'php'" name="rewrite" :tab="$gettext('Rewrite')">
|
||||
<n-flex vertical>
|
||||
<n-form label-placement="left" label-width="auto">
|
||||
<n-form v-if="isNginx" label-placement="left" label-width="auto">
|
||||
<n-form-item :label="$gettext('Presets')">
|
||||
<n-select
|
||||
v-model:value="rewriteValue"
|
||||
|
||||
Reference in New Issue
Block a user