support to let user to choose store param from list

This commit is contained in:
rick 2025-03-02 07:32:08 +08:00
parent ad85fb89cb
commit f33cd5c41f
No known key found for this signature in database
GPG Key ID: 260A80C757EC6783
3 changed files with 85 additions and 74 deletions

1
.gitignore vendored
View File

@ -20,3 +20,4 @@ console/atest-desktop/atest
console/atest-desktop/atest.exe console/atest-desktop/atest.exe
console/atest-desktop/coverage console/atest-desktop/coverage
atest-store-git atest-store-git
.db

View File

@ -150,6 +150,8 @@ watch(() => storeForm.kind.name, (name) => {
value: '', value: '',
defaultValue: p.defaultValue, defaultValue: p.defaultValue,
description: p.description, description: p.description,
type: p.type,
enum: p.enum
} as Pair) } as Pair)
} else { } else {
pro[index].description = p.description pro[index].description = p.description
@ -318,15 +320,21 @@ const storeExtLink = ref('')
<el-table-column label="Value"> <el-table-column label="Value">
<template #default="scope"> <template #default="scope">
<div style="display: flex; align-items: center"> <div style="display: flex; align-items: center">
<el-input v-model="scope.row.value" :placeholder="scope.row.defaultValue"> <el-select v-model="scope.row.value" v-if="scope.row.enum">
<template #append v-if="scope.row.description"> <el-option
<el-tooltip :content="scope.row.description"> v-for="item in scope.row.enum"
:key="item"
:label="item"
:value="item"
/>
</el-select>
<el-input-number v-model="scope.row.value" v-else-if="scope.row.type === 'number'"/>
<el-input v-model="scope.row.value" :placeholder="scope.row.defaultValue" v-else/>
<el-tooltip :content="scope.row.description" v-if="scope.row.description">
<el-icon> <el-icon>
<QuestionFilled/> <QuestionFilled/>
</el-icon> </el-icon>
</el-tooltip> </el-tooltip>
</template>
</el-input>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>

View File

@ -22,80 +22,82 @@ interface Store {
} }
const storeExtensions = [ const storeExtensions = [
{ {
name: 'atest-store-git', name: 'atest-store-git',
params: [{ params: [{
key: 'insecure' key: 'insecure'
}, { }, {
key: 'timeout' key: 'timeout'
}, { }, {
key: 'targetpath' key: 'targetpath'
}, { }, {
key: 'branch' key: 'branch'
}, { }, {
key: 'email', key: 'email',
description: 'See also: git config --local user.email xxx@xxx.com' description: 'See also: git config --local user.email xxx@xxx.com'
}, { }, {
key: 'name', key: 'name',
description: 'See also: git config --local user.name xxx' description: 'See also: git config --local user.name xxx'
}], }],
link: 'https://github.com/LinuxSuRen/atest-ext-store-git' link: 'https://github.com/LinuxSuRen/atest-ext-store-git'
}, },
{ {
name: 'atest-store-s3', name: 'atest-store-s3',
params: [{ params: [{
key: 'accesskeyid' key: 'accesskeyid'
}, { }, {
key: 'secretaccesskey' key: 'secretaccesskey'
}, { }, {
key: 'sessiontoken' key: 'sessiontoken'
}, { }, {
key: 'region' key: 'region'
}, { }, {
key: 'disablessl' key: 'disablessl'
}, { }, {
key: 'forcepathstyle' key: 'forcepathstyle'
}, { }, {
key: 'bucket' key: 'bucket'
}], }],
link: 'https://github.com/LinuxSuRen/atest-ext-store-s3' link: 'https://github.com/LinuxSuRen/atest-ext-store-s3'
}, },
{ {
name: 'atest-store-orm', name: 'atest-store-orm',
params: [{ params: [{
key: 'driver', key: 'driver',
defaultValue: 'mysql', defaultValue: 'mysql',
description: 'Supported: mysql, postgres, sqlite' enum: ['mysql', 'postgres', 'sqlite', 'tdengine'],
}, { description: 'Supported: mysql, postgres, sqlite, tdengine'
key: 'database', }, {
defaultValue: 'atest' key: 'database',
}, { defaultValue: 'atest'
key: 'historyLimit', }, {
defaultValue: '', key: 'historyLimit',
description: 'Set the limit of the history record count' defaultValue: '',
}], // type: 'number',
link: 'https://github.com/LinuxSuRen/atest-ext-store-orm' description: 'Set the limit of the history record count'
}, }],
{ link: 'https://github.com/LinuxSuRen/atest-ext-store-orm'
name: 'atest-store-etcd', },
params: [], {
link: 'https://github.com/LinuxSuRen/atest-ext-store-etcd' name: 'atest-store-etcd',
}, params: [],
link: 'https://github.com/LinuxSuRen/atest-ext-store-etcd'
},
{ {
name: 'atest-store-redis', name: 'atest-store-redis',
params: [], params: [],
link: 'https://github.com/LinuxSuRen/atest-ext-store-redis' link: 'https://github.com/LinuxSuRen/atest-ext-store-redis'
}, },
{ {
name: 'atest-store-mongodb', name: 'atest-store-mongodb',
params: [{ params: [{
key: 'collection' key: 'collection'
}, { }, {
key: 'database', key: 'database',
defaultValue: 'atest' defaultValue: 'atest'
}], }],
link: 'https://github.com/LinuxSuRen/atest-ext-store-mongodb' link: 'https://github.com/LinuxSuRen/atest-ext-store-mongodb'
} }
] as Store[] ] as Store[]
export function SupportedExtensions() { export function SupportedExtensions() {