feat: Compose 环境变量编辑增加是否 1Panel 创建校验 (#6605)

This commit is contained in:
ssongliu 2024-09-28 09:37:40 +08:00 committed by GitHub
parent c557b737f6
commit 634849c347
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,7 +19,7 @@
placeholder="#Define or paste the content of your docker-compose file here" placeholder="#Define or paste the content of your docker-compose file here"
:indent-with-tab="true" :indent-with-tab="true"
:tabSize="4" :tabSize="4"
style="width: 100%; height: calc(100vh - 300px)" :style="{ width: '100%', height: `calc(100vh - ${loadHeight()})` }"
:lineWrapping="true" :lineWrapping="true"
:matchBrackets="true" :matchBrackets="true"
theme="cobalt" theme="cobalt"
@ -28,26 +28,34 @@
v-model="content" v-model="content"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="$t('container.env')" prop="environmentStr" v-if="createdBy === '1Panel'"> <div v-if="createdBy === '1Panel'">
<el-input <el-form-item
type="textarea" :label="$t('container.env')"
:placeholder="$t('container.tagHelper')" prop="environmentStr"
:rows="3" v-if="createdBy === '1Panel'"
v-model="environmentStr" >
/> <el-input
</el-form-item> type="textarea"
<span class="input-help whitespace-break-spaces">{{ $t('container.editComposeHelper') }}</span> :placeholder="$t('container.tagHelper')"
<codemirror :rows="3"
v-model="envFileContent" v-model="environmentStr"
:autofocus="true" />
:indent-with-tab="true" </el-form-item>
:tabSize="4" <span class="input-help whitespace-break-spaces">
:lineWrapping="true" {{ $t('container.editComposeHelper') }}
:matchBrackets="true" </span>
theme="cobalt" <codemirror
:styleActiveLine="true" v-model="envFileContent"
:extensions="extensions" :autofocus="true"
></codemirror> :indent-with-tab="true"
:tabSize="4"
:lineWrapping="true"
:matchBrackets="true"
theme="cobalt"
:styleActiveLine="true"
:extensions="extensions"
></codemirror>
</div>
</el-form> </el-form>
</el-col> </el-col>
</el-row> </el-row>
@ -120,6 +128,9 @@ interface DialogProps {
createdBy: string; createdBy: string;
} }
const loadHeight = () => {
return createdBy.value === '1Panel' ? '300px' : '200px';
};
const acceptParams = (props: DialogProps): void => { const acceptParams = (props: DialogProps): void => {
composeVisible.value = true; composeVisible.value = true;
path.value = props.path; path.value = props.path;