diff --git a/AGENTS.md b/AGENTS.md index 333408e3..2f4e2ee1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -47,11 +47,15 @@ ## Commit & Pull Request Guidelines - Use Conventional Commits (e.g., `feat: add user settings`). - Always work on a feature branch; do not commit directly to `main`. +- If no feature branch exists for the task, create one before making changes. - Create or switch to a feature branch before any changes and always confirm the current branch before committing (e.g., `git checkout -b feature/my-change`). - New features target the `feature` branch; other changes target `main`. - PRs should include a clear description, link related issues, and note any UI changes with screenshots. - Commit with signed-off and signed commits: `git commit -s -S -m "feat: ..."`. +## Git Permissions & Operations +- Direct modification of the `.git` directory is not permitted; use git commands for all branch switches, staging, and commits. + ## Configuration & Environment - Backend secrets live in `service/.env` (copy from `service/.env.example`). - Frontend API base URL is in root `.env` as `VITE_GLOB_API_URL`. diff --git a/auto-imports.d.ts b/auto-imports.d.ts index 800980eb..b5599b20 100644 --- a/auto-imports.d.ts +++ b/auto-imports.d.ts @@ -14,6 +14,7 @@ declare global { const IconMdiReorderHorizontal: typeof import('~icons/mdi/reorder-horizontal').default const IconRiContrastLine: typeof import('~icons/ri/contrast-line').default const IconRiDeleteBinLine: typeof import('~icons/ri/delete-bin-line').default + const IconRiEdit2Line: typeof import('~icons/ri/edit2-line').default const IconRiExternalLinkLine: typeof import('~icons/ri/external-link-line').default const IconRiFileCopy2Line: typeof import('~icons/ri/file-copy2-line').default const IconRiMoonFoggyLine: typeof import('~icons/ri/moon-foggy-line').default diff --git a/components.d.ts b/components.d.ts index 0304de69..7cd26df6 100644 --- a/components.d.ts +++ b/components.d.ts @@ -19,6 +19,7 @@ declare module 'vue' { IconMdiLightbulbOutline: typeof import('~icons/mdi/lightbulb-outline')['default'] IconMdiReorderHorizontal: typeof import('~icons/mdi/reorder-horizontal')['default'] IconMdiWeb: typeof import('~icons/mdi/web')['default'] + IconRiAddLine: typeof import('~icons/ri/add-line')['default'] IconRiAlignJustify: typeof import('~icons/ri/align-justify')['default'] IconRiAlignRight: typeof import('~icons/ri/align-right')['default'] IconRiArrowDownSLine: typeof import('~icons/ri/arrow-down-s-line')['default'] @@ -36,7 +37,6 @@ declare module 'vue' { IconRiDownload2Line: typeof import('~icons/ri/download2-line')['default'] IconRiDownloadLine: typeof import('~icons/ri/download-line')['default'] IconRiEditLine: typeof import('~icons/ri/edit-line')['default'] - IconRiEqualizerLine: typeof import('~icons/ri/equalizer-line')['default'] IconRiFileUserLine: typeof import('~icons/ri/file-user-line')['default'] IconRiImageEditLine: typeof import('~icons/ri/image-edit-line')['default'] IconRiInboxLine: typeof import('~icons/ri/inbox-line')['default'] @@ -48,6 +48,7 @@ declare module 'vue' { IconRiQuestionAnswerLine: typeof import('~icons/ri/question-answer-line')['default'] IconRiRestartLine: typeof import('~icons/ri/restart-line')['default'] IconRiSaveLine: typeof import('~icons/ri/save-line')['default'] + IconRiSearchLine: typeof import('~icons/ri/search-line')['default'] IconRiSendPlaneFill: typeof import('~icons/ri/send-plane-fill')['default'] IconRiSettings4Line: typeof import('~icons/ri/settings4-line')['default'] IconRiSettingsLine: typeof import('~icons/ri/settings-line')['default'] diff --git a/service/src/storage/config.ts b/service/src/storage/config.ts index 27c4fd4d..93bdb143 100644 --- a/service/src/storage/config.ts +++ b/service/src/storage/config.ts @@ -140,7 +140,6 @@ export async function getApiKeys() { if (result.keys.length <= 0) { const defaultModel = config.siteConfig.chatModels.split(',')[0] || '' result.keys.push(await upsertKey(new KeyConfig(config.apiKey, 'ChatGPTAPI', defaultModel, [], ''))) - result.total++ } result.keys.forEach((key) => { if (key.userRoles == null || key.userRoles.length <= 0) { diff --git a/service/src/storage/mongo.ts b/service/src/storage/mongo.ts index c5430519..13ea3511 100644 --- a/service/src/storage/mongo.ts +++ b/service/src/storage/mongo.ts @@ -1162,14 +1162,13 @@ export async function getUserStatisticsByModel(start?: number, end?: number): Pr return result } -export async function getKeys(): Promise<{ keys: KeyConfig[], total: number }> { +export async function getKeys(): Promise<{ keys: KeyConfig[] }> { const query = { status: { $ne: Status.Disabled } } const cursor = keyCol.find(query) - const total = await keyCol.countDocuments(query) const keys = [] for await (const doc of cursor) keys.push(doc) - return { keys, total } + return { keys } } export async function upsertKey(key: KeyConfig): Promise { diff --git a/src/api/index.ts b/src/api/index.ts index 24bcfd3c..eb40be06 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -516,10 +516,9 @@ export function fetchUserStatisticsByModel(start?: number, end?: number }) } -export function fetchGetKeys(page: number, size: number) { +export function fetchGetKeys() { return get({ url: '/setting-keys', - data: { page, size }, }) } diff --git a/src/components/common/Setting/BuiltInPrompt.vue b/src/components/common/Setting/BuiltInPrompt.vue index 458dd845..37aff953 100644 --- a/src/components/common/Setting/BuiltInPrompt.vue +++ b/src/components/common/Setting/BuiltInPrompt.vue @@ -293,7 +293,7 @@ function createColumns(): DataTableColumns { type: 'info', onClick: () => openModal('edit', row), }, - { default: () => t('common.edit') }, + { default: () => [h(IconRiEdit2Line, { class: 'mr-1 text-base' }), t('common.edit')] }, ), h( NButton, { @@ -302,7 +302,7 @@ function createColumns(): DataTableColumns { type: 'error', onClick: () => handleDeletePrompt(row), }, - { default: () => t('common.delete') }, + { default: () => [h(IconRiDeleteBinLine, { class: 'mr-1 text-base' }), t('common.delete')] }, )], }) }, @@ -377,24 +377,24 @@ onMounted(async () => {