From f33cd5c41feae64b903228f1e9d615134f7b23ef Mon Sep 17 00:00:00 2001 From: rick Date: Sun, 2 Mar 2025 07:32:08 +0800 Subject: [PATCH] support to let user to choose store param from list --- .gitignore | 1 + console/atest-ui/src/views/StoreManager.vue | 18 ++- console/atest-ui/src/views/store.ts | 140 ++++++++++---------- 3 files changed, 85 insertions(+), 74 deletions(-) diff --git a/.gitignore b/.gitignore index 5c0ca3c..88cc394 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ console/atest-desktop/atest console/atest-desktop/atest.exe console/atest-desktop/coverage atest-store-git +.db diff --git a/console/atest-ui/src/views/StoreManager.vue b/console/atest-ui/src/views/StoreManager.vue index 074c6f2..079d776 100644 --- a/console/atest-ui/src/views/StoreManager.vue +++ b/console/atest-ui/src/views/StoreManager.vue @@ -150,6 +150,8 @@ watch(() => storeForm.kind.name, (name) => { value: '', defaultValue: p.defaultValue, description: p.description, + type: p.type, + enum: p.enum } as Pair) } else { pro[index].description = p.description @@ -318,15 +320,21 @@ const storeExtLink = ref('') diff --git a/console/atest-ui/src/views/store.ts b/console/atest-ui/src/views/store.ts index 9d1c128..8dde35f 100644 --- a/console/atest-ui/src/views/store.ts +++ b/console/atest-ui/src/views/store.ts @@ -22,80 +22,82 @@ interface Store { } const storeExtensions = [ - { - name: 'atest-store-git', - params: [{ - key: 'insecure' - }, { - key: 'timeout' - }, { - key: 'targetpath' - }, { - key: 'branch' - }, { - key: 'email', - description: 'See also: git config --local user.email xxx@xxx.com' - }, { - key: 'name', - description: 'See also: git config --local user.name xxx' - }], - link: 'https://github.com/LinuxSuRen/atest-ext-store-git' - }, - { - name: 'atest-store-s3', - params: [{ - key: 'accesskeyid' - }, { - key: 'secretaccesskey' - }, { - key: 'sessiontoken' - }, { - key: 'region' - }, { - key: 'disablessl' - }, { - key: 'forcepathstyle' - }, { - key: 'bucket' - }], - link: 'https://github.com/LinuxSuRen/atest-ext-store-s3' - }, - { - name: 'atest-store-orm', - params: [{ - key: 'driver', - defaultValue: 'mysql', - description: 'Supported: mysql, postgres, sqlite' - }, { - key: 'database', - defaultValue: 'atest' - }, { - key: 'historyLimit', - defaultValue: '', - 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-git', + params: [{ + key: 'insecure' + }, { + key: 'timeout' + }, { + key: 'targetpath' + }, { + key: 'branch' + }, { + key: 'email', + description: 'See also: git config --local user.email xxx@xxx.com' + }, { + key: 'name', + description: 'See also: git config --local user.name xxx' + }], + link: 'https://github.com/LinuxSuRen/atest-ext-store-git' + }, + { + name: 'atest-store-s3', + params: [{ + key: 'accesskeyid' + }, { + key: 'secretaccesskey' + }, { + key: 'sessiontoken' + }, { + key: 'region' + }, { + key: 'disablessl' + }, { + key: 'forcepathstyle' + }, { + key: 'bucket' + }], + link: 'https://github.com/LinuxSuRen/atest-ext-store-s3' + }, + { + name: 'atest-store-orm', + params: [{ + key: 'driver', + defaultValue: 'mysql', + enum: ['mysql', 'postgres', 'sqlite', 'tdengine'], + description: 'Supported: mysql, postgres, sqlite, tdengine' + }, { + key: 'database', + defaultValue: 'atest' + }, { + key: 'historyLimit', + defaultValue: '', + // type: 'number', + 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-redis', params: [], link: 'https://github.com/LinuxSuRen/atest-ext-store-redis' }, - { - name: 'atest-store-mongodb', - params: [{ - key: 'collection' - }, { - key: 'database', - defaultValue: 'atest' - }], - link: 'https://github.com/LinuxSuRen/atest-ext-store-mongodb' - } + { + name: 'atest-store-mongodb', + params: [{ + key: 'collection' + }, { + key: 'database', + defaultValue: 'atest' + }], + link: 'https://github.com/LinuxSuRen/atest-ext-store-mongodb' + } ] as Store[] export function SupportedExtensions() {