mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-19 16:29:17 +08:00
fix: 表单输入增加前后空格过滤
This commit is contained in:
parent
cecfecfe94
commit
2fe594df04
@ -110,8 +110,8 @@ func (u *ImageService) ImageBuild(req dto.ImageBuild) (string, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
path := fmt.Sprintf("%s/Dockerfile", dir)
|
pathItem := fmt.Sprintf("%s/Dockerfile", dir)
|
||||||
file, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0666)
|
file, err := os.OpenFile(pathItem, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0666)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
@ -134,8 +134,8 @@ func (u *ImageService) ImageBuild(req dto.ImageBuild) (string, error) {
|
|||||||
}
|
}
|
||||||
logName := fmt.Sprintf("%s/build.log", req.Dockerfile)
|
logName := fmt.Sprintf("%s/build.log", req.Dockerfile)
|
||||||
|
|
||||||
path := logName
|
pathItem := logName
|
||||||
file, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0666)
|
file, err := os.OpenFile(pathItem, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0666)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
@ -165,8 +165,10 @@ func (u *ImageService) ImagePull(req dto.ImagePull) (string, error) {
|
|||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
path := fmt.Sprintf("%s/image_pull_%s_%s.log", dockerLogDir, strings.ReplaceAll(req.ImageName, ":", "_"), time.Now().Format("20060102150405"))
|
imageItemName := strings.ReplaceAll(req.ImageName, ":", "_")
|
||||||
file, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0666)
|
imageItemName = strings.ReplaceAll(imageItemName, "/", "@")
|
||||||
|
pathItem := fmt.Sprintf("%s/image_pull_%s_%s.log", dockerLogDir, imageItemName, time.Now().Format("20060102150405"))
|
||||||
|
file, err := os.OpenFile(pathItem, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0666)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
@ -182,7 +184,7 @@ func (u *ImageService) ImagePull(req dto.ImagePull) (string, error) {
|
|||||||
global.LOG.Debugf("pull image %s successful!", req.ImageName)
|
global.LOG.Debugf("pull image %s successful!", req.ImageName)
|
||||||
_, _ = io.Copy(file, out)
|
_, _ = io.Copy(file, out)
|
||||||
}()
|
}()
|
||||||
return path, nil
|
return pathItem, nil
|
||||||
}
|
}
|
||||||
repo, err := imageRepoRepo.Get(commonRepo.WithByID(req.RepoID))
|
repo, err := imageRepoRepo.Get(commonRepo.WithByID(req.RepoID))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -213,7 +215,7 @@ func (u *ImageService) ImagePull(req dto.ImagePull) (string, error) {
|
|||||||
global.LOG.Debugf("pull image %s successful!", req.ImageName)
|
global.LOG.Debugf("pull image %s successful!", req.ImageName)
|
||||||
_, _ = io.Copy(file, out)
|
_, _ = io.Copy(file, out)
|
||||||
}()
|
}()
|
||||||
return path, nil
|
return pathItem, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *ImageService) ImageLoad(req dto.ImageLoad) error {
|
func (u *ImageService) ImageLoad(req dto.ImageLoad) error {
|
||||||
@ -294,14 +296,15 @@ func (u *ImageService) ImagePush(req dto.ImagePush) (string, error) {
|
|||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := os.Stat(dockerLogDir); err != nil && os.IsNotExist(err) {
|
if _, err := os.Stat(dockerLogDir); err != nil && os.IsNotExist(err) {
|
||||||
if err = os.MkdirAll(dockerLogDir, os.ModePerm); err != nil {
|
if err = os.MkdirAll(dockerLogDir, os.ModePerm); err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
path := fmt.Sprintf("%s/image_push_%s_%s.log", dockerLogDir, strings.ReplaceAll(req.Name, ":", "_"), time.Now().Format("20060102150405"))
|
imageItemName := strings.ReplaceAll(req.Name, ":", "_")
|
||||||
file, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0666)
|
imageItemName = strings.ReplaceAll(imageItemName, "/", "@")
|
||||||
|
pathItem := fmt.Sprintf("%s/image_push_%s_%s.log", dockerLogDir, imageItemName, time.Now().Format("20060102150405"))
|
||||||
|
file, err := os.OpenFile(pathItem, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0666)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
@ -317,7 +320,7 @@ func (u *ImageService) ImagePush(req dto.ImagePush) (string, error) {
|
|||||||
_, _ = io.Copy(file, out)
|
_, _ = io.Copy(file, out)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
return path, nil
|
return pathItem, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *ImageService) ImageRemove(req dto.BatchDelete) error {
|
func (u *ImageService) ImageRemove(req dto.BatchDelete) error {
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
v-if="p.type == 'password'"
|
v-if="p.type == 'password'"
|
||||||
:type="p.type"
|
:type="p.type"
|
||||||
show-password
|
show-password
|
||||||
|
clearable
|
||||||
@change="updateParam"
|
@change="updateParam"
|
||||||
></el-input>
|
></el-input>
|
||||||
<el-select
|
<el-select
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<div v-loading="loading">
|
<div v-loading="loading">
|
||||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="formRef" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item :label="$t('container.name')" prop="name">
|
<el-form-item :label="$t('container.name')" prop="name">
|
||||||
<el-input v-model="form.name"></el-input>
|
<el-input v-model.trim="form.name"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('container.from')">
|
<el-form-item :label="$t('container.from')">
|
||||||
<el-radio-group v-model="form.from">
|
<el-radio-group v-model="form.from">
|
||||||
@ -19,7 +19,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="form.from === 'path'" prop="path">
|
<el-form-item v-if="form.from === 'path'" prop="path">
|
||||||
<el-input
|
<el-input
|
||||||
clearable
|
disabled
|
||||||
:placeholder="$t('commons.example') + '/tmp/docker-compose.yml'"
|
:placeholder="$t('commons.example') + '/tmp/docker-compose.yml'"
|
||||||
v-model="form.path"
|
v-model="form.path"
|
||||||
>
|
>
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<el-form ref="formRef" v-loading="loading" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="formRef" v-loading="loading" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item :label="$t('container.name')" prop="name">
|
<el-form-item :label="$t('container.name')" prop="name">
|
||||||
<el-input clearable v-model="form.name" />
|
<el-input clearable v-model.trim="form.name" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('container.image')" prop="image">
|
<el-form-item :label="$t('container.image')" prop="image">
|
||||||
<el-select style="width: 100%" filterable v-model="form.image">
|
<el-select style="width: 100%" filterable v-model="form.image">
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<el-form ref="formRef" :model="form" label-width="80px" :rules="rules">
|
<el-form ref="formRef" :model="form" label-width="80px" :rules="rules">
|
||||||
<el-form-item :label="$t('container.name')" prop="name">
|
<el-form-item :label="$t('container.name')" prop="name">
|
||||||
<el-input :placeholder="$t('container.imageNameHelper')" v-model="form.name" clearable />
|
<el-input :placeholder="$t('container.imageNameHelper')" v-model.trim="form.name" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="Dockerfile" prop="from">
|
<el-form-item label="Dockerfile" prop="from">
|
||||||
<el-radio-group v-model="form.from">
|
<el-radio-group v-model="form.from">
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<span style="font-size: 14px">{{ $t('container.startIn') }}</span>
|
<span style="font-size: 14px">{{ $t('container.startIn') }}</span>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-card style="margin-top: 20px" :class="{ mask: dockerStatus != 'Running' }">
|
<el-card style="margin-top: 20px" :class="{ mask: dockerStatus != 'Running' }">
|
||||||
<ComplexTable :pagination-config="paginationConfig" v-model:selects="selects" :data="data" @search="search">
|
<ComplexTable :pagination-config="paginationConfig" :data="data" @search="search">
|
||||||
<template #toolbar>
|
<template #toolbar>
|
||||||
<el-button @click="onOpenPull">
|
<el-button @click="onOpenPull">
|
||||||
{{ $t('container.imagePull') }}
|
{{ $t('container.imagePull') }}
|
||||||
@ -21,7 +21,6 @@
|
|||||||
{{ $t('container.build') }}
|
{{ $t('container.build') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<el-table-column type="selection" fix />
|
|
||||||
<el-table-column label="ID" show-overflow-tooltip prop="id" min-width="60" />
|
<el-table-column label="ID" show-overflow-tooltip prop="id" min-width="60" />
|
||||||
<el-table-column :label="$t('container.tag')" prop="tags" min-width="160" fix>
|
<el-table-column :label="$t('container.tag')" prop="tags" min-width="160" fix>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
@ -99,7 +98,6 @@ const loading = ref(false);
|
|||||||
|
|
||||||
const data = ref();
|
const data = ref();
|
||||||
const repos = ref();
|
const repos = ref();
|
||||||
const selects = ref<any>([]);
|
|
||||||
const paginationConfig = reactive({
|
const paginationConfig = reactive({
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<el-form v-loading="loading" ref="formRef" :model="form" label-width="80px">
|
<el-form v-loading="loading" ref="formRef" :model="form" label-width="80px">
|
||||||
<el-form-item :label="$t('container.path')" :rules="Rules.requiredSelect" prop="path">
|
<el-form-item :label="$t('container.path')" :rules="Rules.requiredSelect" prop="path">
|
||||||
<el-input clearable v-model="form.path">
|
<el-input disabled v-model="form.path">
|
||||||
<template #append>
|
<template #append>
|
||||||
<FileList @choose="loadLoadDir" :dir="false"></FileList>
|
<FileList @choose="loadLoadDir" :dir="false"></FileList>
|
||||||
</template>
|
</template>
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('container.imageName')" :rules="Rules.requiredInput" prop="imageName">
|
<el-form-item :label="$t('container.imageName')" :rules="Rules.requiredInput" prop="imageName">
|
||||||
<el-input v-model="form.imageName">
|
<el-input v-model.trim="form.imageName">
|
||||||
<template v-if="form.fromRepo" #prepend>{{ loadDetailInfo(form.repoID) }}/</template>
|
<template v-if="form.fromRepo" #prepend>{{ loadDetailInfo(form.repoID) }}/</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('container.label')" :rules="Rules.requiredInput" prop="name">
|
<el-form-item :label="$t('container.label')" :rules="Rules.requiredInput" prop="name">
|
||||||
<el-input v-model="form.name">
|
<el-input v-model.trim="form.name">
|
||||||
<template #prepend>{{ loadDetailInfo(form.repoID) }}/</template>
|
<template #prepend>{{ loadDetailInfo(form.repoID) }}/</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('container.path')" :rules="Rules.requiredSelect" prop="path">
|
<el-form-item :label="$t('container.path')" :rules="Rules.requiredSelect" prop="path">
|
||||||
<el-input clearable v-model="form.path">
|
<el-input disabled v-model="form.path">
|
||||||
<template #append>
|
<template #append>
|
||||||
<FileList @choose="loadSaveDir" :dir="true"></FileList>
|
<FileList @choose="loadSaveDir" :dir="true"></FileList>
|
||||||
</template>
|
</template>
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<el-form ref="formRef" v-loading="loading" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="formRef" v-loading="loading" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item :label="$t('container.networkName')" prop="name">
|
<el-form-item :label="$t('container.networkName')" prop="name">
|
||||||
<el-input clearable v-model="form.name" />
|
<el-input clearable v-model.trim="form.name" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('container.driver')" prop="driver">
|
<el-form-item :label="$t('container.driver')" prop="driver">
|
||||||
<el-select v-model="form.driver">
|
<el-select v-model="form.driver">
|
||||||
@ -26,13 +26,13 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('container.subnet')" prop="subnet">
|
<el-form-item :label="$t('container.subnet')" prop="subnet">
|
||||||
<el-input clearable v-model="form.subnet" />
|
<el-input clearable v-model.trim="form.subnet" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('container.gateway')" prop="gateway">
|
<el-form-item :label="$t('container.gateway')" prop="gateway">
|
||||||
<el-input clearable v-model="form.gateway" />
|
<el-input clearable v-model.trim="form.gateway" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('container.scope')" prop="scope">
|
<el-form-item :label="$t('container.scope')" prop="scope">
|
||||||
<el-input clearable v-model="form.scope" />
|
<el-input clearable v-model.trim="form.scope" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('container.tag')" prop="labelStr">
|
<el-form-item :label="$t('container.tag')" prop="labelStr">
|
||||||
<el-input
|
<el-input
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<el-input
|
<el-input
|
||||||
clearable
|
clearable
|
||||||
:disabled="dialogData.title === 'edit'"
|
:disabled="dialogData.title === 'edit'"
|
||||||
v-model="dialogData.rowData!.name"
|
v-model.trim="dialogData.rowData!.name"
|
||||||
></el-input>
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('container.auth')" prop="auth">
|
<el-form-item :label="$t('container.auth')" prop="auth">
|
||||||
@ -20,15 +20,20 @@
|
|||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="dialogData.rowData!.auth" :label="$t('commons.login.username')" prop="username">
|
<el-form-item v-if="dialogData.rowData!.auth" :label="$t('commons.login.username')" prop="username">
|
||||||
<el-input clearable v-model="dialogData.rowData!.username"></el-input>
|
<el-input clearable v-model.trim="dialogData.rowData!.username"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="dialogData.rowData!.auth" :label="$t('commons.login.password')" prop="password">
|
<el-form-item v-if="dialogData.rowData!.auth" :label="$t('commons.login.password')" prop="password">
|
||||||
<el-input clearable type="password" show-password v-model="dialogData.rowData!.password"></el-input>
|
<el-input
|
||||||
|
clearable
|
||||||
|
type="password"
|
||||||
|
show-password
|
||||||
|
v-model.trim="dialogData.rowData!.password"
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('container.downloadUrl')" prop="downloadUrl">
|
<el-form-item :label="$t('container.downloadUrl')" prop="downloadUrl">
|
||||||
<el-input
|
<el-input
|
||||||
clearable
|
clearable
|
||||||
v-model="dialogData.rowData!.downloadUrl"
|
v-model.trim="dialogData.rowData!.downloadUrl"
|
||||||
:placeholder="'172.16.10.10:8081'"
|
:placeholder="'172.16.10.10:8081'"
|
||||||
></el-input>
|
></el-input>
|
||||||
<span v-if="dialogData.rowData!.downloadUrl" class="input-help">
|
<span v-if="dialogData.rowData!.downloadUrl" class="input-help">
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('container.daemonJsonPath')">
|
<el-form-item :label="$t('container.daemonJsonPath')">
|
||||||
<el-input clearable v-model="daemonJsonPath">
|
<el-input disabled v-model="daemonJsonPath">
|
||||||
<template #append>
|
<template #append>
|
||||||
<FileList @choose="loadLoadDir" :dir="false"></FileList>
|
<FileList @choose="loadLoadDir" :dir="false"></FileList>
|
||||||
</template>
|
</template>
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<el-form v-loading="loading" ref="formRef" :model="dialogData.rowData" :rules="rules" label-width="80px">
|
<el-form v-loading="loading" ref="formRef" :model="dialogData.rowData" :rules="rules" label-width="80px">
|
||||||
<el-form-item :label="$t('container.name')" prop="name">
|
<el-form-item :label="$t('container.name')" prop="name">
|
||||||
<el-input :disabled="dialogData.title === 'edit'" v-model="dialogData.rowData!.name"></el-input>
|
<el-input :disabled="dialogData.title === 'edit'" v-model.trim="dialogData.rowData!.name"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('container.description')">
|
<el-form-item :label="$t('container.description')">
|
||||||
<el-input v-model="dialogData.rowData!.description"></el-input>
|
<el-input v-model="dialogData.rowData!.description"></el-input>
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<el-form ref="formRef" v-loading="loading" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="formRef" v-loading="loading" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item :label="$t('container.volumeName')" prop="name">
|
<el-form-item :label="$t('container.volumeName')" prop="name">
|
||||||
<el-input clearable v-model="form.name" />
|
<el-input clearable v-model.trim="form.name" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('container.driver')" prop="driver">
|
<el-form-item :label="$t('container.driver')" prop="driver">
|
||||||
<el-select v-model="form.driver">
|
<el-select v-model="form.driver">
|
||||||
|
@ -139,9 +139,9 @@ const onOpenDialog = async (
|
|||||||
rowData: Partial<Cronjob.CronjobInfo> = {
|
rowData: Partial<Cronjob.CronjobInfo> = {
|
||||||
specType: 'perMonth',
|
specType: 'perMonth',
|
||||||
week: 1,
|
week: 1,
|
||||||
day: 1,
|
day: 3,
|
||||||
hour: 2,
|
hour: 1,
|
||||||
minute: 3,
|
minute: 30,
|
||||||
keepLocal: true,
|
keepLocal: true,
|
||||||
retainCopies: 7,
|
retainCopies: 7,
|
||||||
},
|
},
|
||||||
|
@ -7,21 +7,17 @@
|
|||||||
</template>
|
</template>
|
||||||
<el-form ref="formRef" :model="dialogData.rowData" label-position="left" :rules="rules" label-width="120px">
|
<el-form ref="formRef" :model="dialogData.rowData" label-position="left" :rules="rules" label-width="120px">
|
||||||
<el-form-item :label="$t('cronjob.taskType')" prop="type">
|
<el-form-item :label="$t('cronjob.taskType')" prop="type">
|
||||||
<el-select
|
<el-select style="width: 100%" v-model="dialogData.rowData!.type">
|
||||||
@change="changeName(true, dialogData.rowData!.type)"
|
|
||||||
style="width: 100%"
|
|
||||||
v-model="dialogData.rowData!.type"
|
|
||||||
>
|
|
||||||
<el-option value="shell" :label="$t('cronjob.shell')" />
|
<el-option value="shell" :label="$t('cronjob.shell')" />
|
||||||
<el-option value="website" :label="$t('cronjob.website')" />
|
<el-option value="website" :label="$t('cronjob.website')" />
|
||||||
<el-option value="database" :label="$t('cronjob.database')" />
|
<el-option value="database" :label="$t('cronjob.database')" />
|
||||||
<el-option value="directory" :label="$t('cronjob.directory')" />
|
<el-option value="directory" :label="$t('cronjob.directory')" />
|
||||||
<el-option value="curl" :label="$t('cronjob.curl')" />
|
<el-option value="curl" :label="$t('cronjob.curl') + ' URL'" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item :label="$t('cronjob.taskName')" prop="name">
|
<el-form-item :label="$t('cronjob.taskName')" prop="name">
|
||||||
<el-input style="width: 100%" clearable v-model="dialogData.rowData!.name" />
|
<el-input style="width: 100%" clearable v-model.trim="dialogData.rowData!.name" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item :label="$t('cronjob.cronSpec')" prop="spec">
|
<el-form-item :label="$t('cronjob.cronSpec')" prop="spec">
|
||||||
@ -65,11 +61,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item v-if="dialogData.rowData!.type === 'website'" :label="$t('cronjob.website')" prop="website">
|
<el-form-item v-if="dialogData.rowData!.type === 'website'" :label="$t('cronjob.website')" prop="website">
|
||||||
<el-select
|
<el-select style="width: 100%" v-model="dialogData.rowData!.website">
|
||||||
@change="changeName(false, dialogData.rowData!.type)"
|
|
||||||
style="width: 100%"
|
|
||||||
v-model="dialogData.rowData!.website"
|
|
||||||
>
|
|
||||||
<el-option v-for="item in websiteOptions" :key="item" :value="item" :label="item" />
|
<el-option v-for="item in websiteOptions" :key="item" :value="item" :label="item" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -87,12 +79,7 @@
|
|||||||
:label="$t('cronjob.sourceDir')"
|
:label="$t('cronjob.sourceDir')"
|
||||||
prop="sourceDir"
|
prop="sourceDir"
|
||||||
>
|
>
|
||||||
<el-input
|
<el-input style="width: 100%" disabled v-model="dialogData.rowData!.sourceDir">
|
||||||
@input="changeName(false, dialogData.rowData!.type)"
|
|
||||||
style="width: 100%"
|
|
||||||
clearable
|
|
||||||
v-model="dialogData.rowData!.sourceDir"
|
|
||||||
>
|
|
||||||
<template #append>
|
<template #append>
|
||||||
<FileList @choose="loadDir" :dir="true"></FileList>
|
<FileList @choose="loadDir" :dir="true"></FileList>
|
||||||
</template>
|
</template>
|
||||||
@ -124,8 +111,8 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-form-item v-if="dialogData.rowData!.type === 'curl'" :label="$t('cronjob.url') + 'URL'" prop="url">
|
<el-form-item v-if="dialogData.rowData!.type === 'curl'" :label="$t('cronjob.url')" prop="url">
|
||||||
<el-input style="width: 100%" clearable v-model="dialogData.rowData!.url" />
|
<el-input style="width: 100%" clearable v-model.trim="dialogData.rowData!.url" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item
|
<el-form-item
|
||||||
@ -344,16 +331,6 @@ function isBackup() {
|
|||||||
function hasScript() {
|
function hasScript() {
|
||||||
return dialogData.value.rowData!.type === 'shell';
|
return dialogData.value.rowData!.type === 'shell';
|
||||||
}
|
}
|
||||||
function changeName(isChangeType: boolean, type: string) {
|
|
||||||
if (isChangeType) {
|
|
||||||
if (isBackup()) {
|
|
||||||
if (backupOptions.value.length === 0) {
|
|
||||||
ElMessage.error(i18n.global.t('cronjob.missBackupAccount'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
dialogData.value.rowData!.name = `${type}_test`;
|
|
||||||
}
|
|
||||||
|
|
||||||
const onSubmit = async (formEl: FormInstance | undefined) => {
|
const onSubmit = async (formEl: FormInstance | undefined) => {
|
||||||
if (!formEl) return;
|
if (!formEl) return;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="formRef" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item :label="$t('commons.table.name')" prop="name">
|
<el-form-item :label="$t('commons.table.name')" prop="name">
|
||||||
<el-input clearable v-model="form.name">
|
<el-input clearable v-model.trim="form.name">
|
||||||
<template #append>
|
<template #append>
|
||||||
<el-select v-model="form.format" style="width: 125px">
|
<el-select v-model="form.format" style="width: 125px">
|
||||||
<el-option label="utf8mb4" value="utf8mb4" />
|
<el-option label="utf8mb4" value="utf8mb4" />
|
||||||
@ -19,10 +19,10 @@
|
|||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('commons.login.username')" prop="username">
|
<el-form-item :label="$t('commons.login.username')" prop="username">
|
||||||
<el-input clearable v-model="form.username" />
|
<el-input clearable v-model.trim="form.username" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('commons.login.password')" prop="password">
|
<el-form-item :label="$t('commons.login.password')" prop="password">
|
||||||
<el-input type="password" clearable show-password v-model="form.password" />
|
<el-input type="password" clearable show-password v-model.trim="form.password" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item :label="$t('database.permission')" prop="permission">
|
<el-form-item :label="$t('database.permission')" prop="permission">
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
prop="varsJson['dir']"
|
prop="varsJson['dir']"
|
||||||
:rules="Rules.requiredInput"
|
:rules="Rules.requiredInput"
|
||||||
>
|
>
|
||||||
<el-input v-model="dialogData.rowData!.varsJson['dir']">
|
<el-input disabled v-model="dialogData.rowData!.varsJson['dir']">
|
||||||
<template #append>
|
<template #append>
|
||||||
<FileList @choose="loadDir" :dir="true"></FileList>
|
<FileList @choose="loadDir" :dir="true"></FileList>
|
||||||
</template>
|
</template>
|
||||||
@ -34,7 +34,7 @@
|
|||||||
prop="accessKey"
|
prop="accessKey"
|
||||||
:rules="Rules.requiredInput"
|
:rules="Rules.requiredInput"
|
||||||
>
|
>
|
||||||
<el-input v-model="dialogData.rowData!.accessKey" />
|
<el-input v-model.trim="dialogData.rowData!.accessKey" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="hasBucket(dialogData.rowData!.type)"
|
v-if="hasBucket(dialogData.rowData!.type)"
|
||||||
@ -42,7 +42,7 @@
|
|||||||
prop="credential"
|
prop="credential"
|
||||||
:rules="Rules.requiredInput"
|
:rules="Rules.requiredInput"
|
||||||
>
|
>
|
||||||
<el-input show-password clearable v-model="dialogData.rowData!.credential" />
|
<el-input show-password clearable v-model.trim="dialogData.rowData!.credential" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="dialogData.rowData!.type === 'S3'"
|
v-if="dialogData.rowData!.type === 'S3'"
|
||||||
@ -50,7 +50,7 @@
|
|||||||
prop="varsJson.region"
|
prop="varsJson.region"
|
||||||
:rules="Rules.requiredInput"
|
:rules="Rules.requiredInput"
|
||||||
>
|
>
|
||||||
<el-input v-model="dialogData.rowData!.varsJson['region']" />
|
<el-input v-model.trim="dialogData.rowData!.varsJson['region']" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="hasBucket(dialogData.rowData!.type) && dialogData.rowData!.type !== 'MINIO'"
|
v-if="hasBucket(dialogData.rowData!.type) && dialogData.rowData!.type !== 'MINIO'"
|
||||||
@ -58,7 +58,7 @@
|
|||||||
prop="varsJson.endpoint"
|
prop="varsJson.endpoint"
|
||||||
:rules="Rules.requiredInput"
|
:rules="Rules.requiredInput"
|
||||||
>
|
>
|
||||||
<el-input v-model="dialogData.rowData!.varsJson['endpoint']" />
|
<el-input v-model.trim="dialogData.rowData!.varsJson['endpoint']" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="dialogData.rowData!.type === 'MINIO'"
|
v-if="dialogData.rowData!.type === 'MINIO'"
|
||||||
@ -68,7 +68,7 @@
|
|||||||
>
|
>
|
||||||
<el-input v-model="dialogData.rowData!.varsJson['endpointItem']">
|
<el-input v-model="dialogData.rowData!.varsJson['endpointItem']">
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<el-select v-model="endpoints" style="width: 80px">
|
<el-select v-model.trim="endpoints" style="width: 80px">
|
||||||
<el-option label="http" value="http" />
|
<el-option label="http" value="http" />
|
||||||
<el-option label="https" value="https" />
|
<el-option label="https" value="https" />
|
||||||
</el-select>
|
</el-select>
|
||||||
@ -90,7 +90,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<div v-if="dialogData.rowData!.type === 'SFTP'">
|
<div v-if="dialogData.rowData!.type === 'SFTP'">
|
||||||
<el-form-item :label="$t('setting.address')" prop="varsJson.address" :rules="Rules.requiredInput">
|
<el-form-item :label="$t('setting.address')" prop="varsJson.address" :rules="Rules.requiredInput">
|
||||||
<el-input v-model="dialogData.rowData!.varsJson['address']" />
|
<el-input v-model.trim="dialogData.rowData!.varsJson['address']" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('setting.port')" prop="varsJson.port" :rules="[Rules.number]">
|
<el-form-item :label="$t('setting.port')" prop="varsJson.port" :rules="[Rules.number]">
|
||||||
<el-input-number :min="0" :max="65535" v-model.number="dialogData.rowData!.varsJson['port']" />
|
<el-input-number :min="0" :max="65535" v-model.number="dialogData.rowData!.varsJson['port']" />
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
<template>
|
|
||||||
<LayoutContent></LayoutContent>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import LayoutContent from '@/layout/layout-content.vue';
|
|
||||||
</script>
|
|
Loading…
x
Reference in New Issue
Block a user