đ feat: Introduce full Model & Vendor Management suite (backend + frontend) and UI refinements
Backend
⢠Add `model/model_meta.go` and `model/vendor_meta.go` defining Model & Vendor entities with CRUD helpers, soft-delete and time stamps
⢠Create corresponding controllers `controller/model_meta.go`, `controller/vendor_meta.go` and register routes in `router/api-router.go`
⢠Auto-migrate new tables in DB startup logic
Frontend
⢠Build complete âModel Managementâ module under `/console/models`
- New pages, tables, filters, actions, hooks (`useModelsData`) and dynamic vendor tabs
- Modals `EditModelModal.jsx` & unified `EditVendorModal.jsx`; latter now uses default confirm/cancel footer and mobile-friendly modal sizing (`full-width` / `small`) via `useIsMobile`
⢠Update sidebar (`SiderBar.js`) and routing (`App.js`) to surface the feature
⢠Add helper updates (`render.js`) incl. `stringToColor`, dynamic LobeHub icon retrieval, and tag color palettes
Table UX improvements
⢠Replace separate status column with inline Enable / Disable buttons in operation column (matching channel table style)
⢠Limit visible tags to max 3; overflow represented as â+xâ tag with padded `Popover` showing remaining tags
⢠Color all tags deterministically using `stringToColor` for consistent theming
⢠Change vendor column tag color to white for better contrast
Misc
⢠Minor layout tweaks, compact-mode toggle relocation, lint fixes and TypeScript/ESLint clean-up
These changes collectively deliver end-to-end model & vendor administration while unifying visual language across management tables.
2025-07-31 22:28:09 +08:00
|
|
|
/*
|
|
|
|
|
Copyright (C) 2025 QuantumNous
|
|
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU Affero General Public License as
|
|
|
|
|
published by the Free Software Foundation, either version 3 of the
|
|
|
|
|
License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
For commercial licensing, please contact support@quantumnous.com
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import React, { useState } from 'react';
|
2025-08-18 04:14:35 +08:00
|
|
|
import MissingModelsModal from './modals/MissingModelsModal';
|
|
|
|
|
import PrefillGroupManagement from './modals/PrefillGroupManagement';
|
|
|
|
|
import EditPrefillGroupModal from './modals/EditPrefillGroupModal';
|
⨠feat(sync): multi-language sync wizard, backend locale support, and conflict modal UX improvements
Frontend (web)
- ModelsActions.jsx
- Replace âSync Officialâ with âSyncâ and open a new two-step SyncWizard.
- Pass selected locale through to preview, sync, and overwrite flows.
- Keep conflict resolution flow; inject locale into overwrite submission.
- New: models/modals/SyncWizardModal.jsx
- Two-step wizard: (1) method selection (config-sync disabled for now), (2) language selection (en/zh/ja).
- Horizontal, centered Radio cards; returns { option, locale } via onConfirm.
- UpstreamConflictModal.jsx
- Add search input (model fuzzy search) and native pagination.
- Column header checkbox now only applies to rows in the current filtered result.
- Fix âCannot access âfilteredDataSourceâ before initializationâ.
- Refactor with useMemo/useCallback; extract helpers to remove duplicated logic:
- getPresentRowsForField, getHeaderState, applyHeaderChange
- Minor code cleanups and stability improvements.
- i18n (en.json)
- Add strings for the sync wizard and related actions (Sync, Sync Wizard, Select method/source/language, etc.).
- Adjust minor translations.
Hooks
- useModelsData.jsx
- Extend previewUpstreamDiff, syncUpstream, applyUpstreamOverwrite to accept options with locale.
- Send locale via query/body accordingly.
Backend (Go)
- controller/model_sync.go
- Accept locale from query/body and resolve i18n upstream URLs.
- Add SYNC_UPSTREAM_BASE for upstream base override (default: https://basellm.github.io/llm-metadata).
- Make HTTP timeouts/retries/limits configurable:
- SYNC_HTTP_TIMEOUT_SECONDS, SYNC_HTTP_RETRY, SYNC_HTTP_MAX_MB
- Add ETag-based caching and support both envelope and pure array JSON formats.
- Concurrently fetch vendors and models; improve error responses with locale and source URLs.
- Include source meta (locale, models_url, vendors_url) in success payloads.
Notes
- No breaking changes expected.
- Lint passes for touched files.
2025-09-02 18:49:37 +08:00
|
|
|
import { Button, Modal, Popover, RadioGroup, Radio } from '@douyinfe/semi-ui';
|
2025-08-06 03:29:45 +08:00
|
|
|
import { showSuccess, showError, copy } from '../../../helpers';
|
đ feat: Introduce full Model & Vendor Management suite (backend + frontend) and UI refinements
Backend
⢠Add `model/model_meta.go` and `model/vendor_meta.go` defining Model & Vendor entities with CRUD helpers, soft-delete and time stamps
⢠Create corresponding controllers `controller/model_meta.go`, `controller/vendor_meta.go` and register routes in `router/api-router.go`
⢠Auto-migrate new tables in DB startup logic
Frontend
⢠Build complete âModel Managementâ module under `/console/models`
- New pages, tables, filters, actions, hooks (`useModelsData`) and dynamic vendor tabs
- Modals `EditModelModal.jsx` & unified `EditVendorModal.jsx`; latter now uses default confirm/cancel footer and mobile-friendly modal sizing (`full-width` / `small`) via `useIsMobile`
⢠Update sidebar (`SiderBar.js`) and routing (`App.js`) to surface the feature
⢠Add helper updates (`render.js`) incl. `stringToColor`, dynamic LobeHub icon retrieval, and tag color palettes
Table UX improvements
⢠Replace separate status column with inline Enable / Disable buttons in operation column (matching channel table style)
⢠Limit visible tags to max 3; overflow represented as â+xâ tag with padded `Popover` showing remaining tags
⢠Color all tags deterministically using `stringToColor` for consistent theming
⢠Change vendor column tag color to white for better contrast
Misc
⢠Minor layout tweaks, compact-mode toggle relocation, lint fixes and TypeScript/ESLint clean-up
These changes collectively deliver end-to-end model & vendor administration while unifying visual language across management tables.
2025-07-31 22:28:09 +08:00
|
|
|
import CompactModeToggle from '../../common/ui/CompactModeToggle';
|
2025-08-18 04:14:35 +08:00
|
|
|
import SelectionNotification from './components/SelectionNotification';
|
⨠feat(models-sync): official upstream sync with conflict resolution UI, optâout flag, and backend resiliency
Backend
- Add endpoints:
- GET /api/models/sync_upstream/preview â diff preview (filters out models with sync_official = 0)
- POST /api/models/sync_upstream â apply sync (create missing; optionally overwrite selected fields)
- Respect optâout: skip models with sync_official = 0 in both preview and apply
- Return detailed stats: created_models, created_vendors, updated_models, skipped_models, plus created_list / updated_list
- Add model.Model.SyncOfficial (default 1); autoâmigrated by GORM
- Make HTTP fetching robust:
- Shared http.Client (connection reuse) with 3x exponential backoff retry
- 10MB response cap; keep existing IPv4âfirst for *.github.io
- Vendor handling:
- New ensureVendorID helper (cache lookup â DB lookup â create), reduces roundâtrips
- Transactional overwrite to avoid partial updates
- Small cleanups and clearer helpers (containsField, coalesce, chooseStatus)
Frontend
- ModelsActions: add âSync officialâ button with Popover (pâ2) explaining community contribution; loading = syncing || previewing; preview â conflict modal â apply flow
- New UpstreamConflictModal:
- Perâfield columns (description/icon/tags/vendor/name_rule/status) with columnâlevel checkbox to select all
- Cell with Checkbox + Tag (âClick to view differencesâ) and Popover (pâ2) showing Local vs Official values
- Autoâhide columns with no conflicts; responsive width; use native Semi Modal footer
- Full i18n coverage
- useModelsData: add syncing/previewing states; new methods previewUpstreamDiff, applyUpstreamOverwrite, syncUpstream; refresh vendors/models after apply
- EditModelModal: add âParticipate in official syncâ switch; persisted as sync_official
- ModelsColumnDefs: add âParticipate in official syncâ column
i18n
- Add missing English keys for the new UI and messages; fix quoting issues
Refs
- Upstream metadata: https://github.com/basellm/llm-metadata
2025-09-02 02:04:22 +08:00
|
|
|
import UpstreamConflictModal from './modals/UpstreamConflictModal';
|
⨠feat(sync): multi-language sync wizard, backend locale support, and conflict modal UX improvements
Frontend (web)
- ModelsActions.jsx
- Replace âSync Officialâ with âSyncâ and open a new two-step SyncWizard.
- Pass selected locale through to preview, sync, and overwrite flows.
- Keep conflict resolution flow; inject locale into overwrite submission.
- New: models/modals/SyncWizardModal.jsx
- Two-step wizard: (1) method selection (config-sync disabled for now), (2) language selection (en/zh/ja).
- Horizontal, centered Radio cards; returns { option, locale } via onConfirm.
- UpstreamConflictModal.jsx
- Add search input (model fuzzy search) and native pagination.
- Column header checkbox now only applies to rows in the current filtered result.
- Fix âCannot access âfilteredDataSourceâ before initializationâ.
- Refactor with useMemo/useCallback; extract helpers to remove duplicated logic:
- getPresentRowsForField, getHeaderState, applyHeaderChange
- Minor code cleanups and stability improvements.
- i18n (en.json)
- Add strings for the sync wizard and related actions (Sync, Sync Wizard, Select method/source/language, etc.).
- Adjust minor translations.
Hooks
- useModelsData.jsx
- Extend previewUpstreamDiff, syncUpstream, applyUpstreamOverwrite to accept options with locale.
- Send locale via query/body accordingly.
Backend (Go)
- controller/model_sync.go
- Accept locale from query/body and resolve i18n upstream URLs.
- Add SYNC_UPSTREAM_BASE for upstream base override (default: https://basellm.github.io/llm-metadata).
- Make HTTP timeouts/retries/limits configurable:
- SYNC_HTTP_TIMEOUT_SECONDS, SYNC_HTTP_RETRY, SYNC_HTTP_MAX_MB
- Add ETag-based caching and support both envelope and pure array JSON formats.
- Concurrently fetch vendors and models; improve error responses with locale and source URLs.
- Include source meta (locale, models_url, vendors_url) in success payloads.
Notes
- No breaking changes expected.
- Lint passes for touched files.
2025-09-02 18:49:37 +08:00
|
|
|
import SyncWizardModal from './modals/SyncWizardModal';
|
đ feat: Introduce full Model & Vendor Management suite (backend + frontend) and UI refinements
Backend
⢠Add `model/model_meta.go` and `model/vendor_meta.go` defining Model & Vendor entities with CRUD helpers, soft-delete and time stamps
⢠Create corresponding controllers `controller/model_meta.go`, `controller/vendor_meta.go` and register routes in `router/api-router.go`
⢠Auto-migrate new tables in DB startup logic
Frontend
⢠Build complete âModel Managementâ module under `/console/models`
- New pages, tables, filters, actions, hooks (`useModelsData`) and dynamic vendor tabs
- Modals `EditModelModal.jsx` & unified `EditVendorModal.jsx`; latter now uses default confirm/cancel footer and mobile-friendly modal sizing (`full-width` / `small`) via `useIsMobile`
⢠Update sidebar (`SiderBar.js`) and routing (`App.js`) to surface the feature
⢠Add helper updates (`render.js`) incl. `stringToColor`, dynamic LobeHub icon retrieval, and tag color palettes
Table UX improvements
⢠Replace separate status column with inline Enable / Disable buttons in operation column (matching channel table style)
⢠Limit visible tags to max 3; overflow represented as â+xâ tag with padded `Popover` showing remaining tags
⢠Color all tags deterministically using `stringToColor` for consistent theming
⢠Change vendor column tag color to white for better contrast
Misc
⢠Minor layout tweaks, compact-mode toggle relocation, lint fixes and TypeScript/ESLint clean-up
These changes collectively deliver end-to-end model & vendor administration while unifying visual language across management tables.
2025-07-31 22:28:09 +08:00
|
|
|
|
|
|
|
|
const ModelsActions = ({
|
|
|
|
|
selectedKeys,
|
2025-08-06 03:29:45 +08:00
|
|
|
setSelectedKeys,
|
đ feat: Introduce full Model & Vendor Management suite (backend + frontend) and UI refinements
Backend
⢠Add `model/model_meta.go` and `model/vendor_meta.go` defining Model & Vendor entities with CRUD helpers, soft-delete and time stamps
⢠Create corresponding controllers `controller/model_meta.go`, `controller/vendor_meta.go` and register routes in `router/api-router.go`
⢠Auto-migrate new tables in DB startup logic
Frontend
⢠Build complete âModel Managementâ module under `/console/models`
- New pages, tables, filters, actions, hooks (`useModelsData`) and dynamic vendor tabs
- Modals `EditModelModal.jsx` & unified `EditVendorModal.jsx`; latter now uses default confirm/cancel footer and mobile-friendly modal sizing (`full-width` / `small`) via `useIsMobile`
⢠Update sidebar (`SiderBar.js`) and routing (`App.js`) to surface the feature
⢠Add helper updates (`render.js`) incl. `stringToColor`, dynamic LobeHub icon retrieval, and tag color palettes
Table UX improvements
⢠Replace separate status column with inline Enable / Disable buttons in operation column (matching channel table style)
⢠Limit visible tags to max 3; overflow represented as â+xâ tag with padded `Popover` showing remaining tags
⢠Color all tags deterministically using `stringToColor` for consistent theming
⢠Change vendor column tag color to white for better contrast
Misc
⢠Minor layout tweaks, compact-mode toggle relocation, lint fixes and TypeScript/ESLint clean-up
These changes collectively deliver end-to-end model & vendor administration while unifying visual language across management tables.
2025-07-31 22:28:09 +08:00
|
|
|
setEditingModel,
|
|
|
|
|
setShowEdit,
|
|
|
|
|
batchDeleteModels,
|
⨠feat(models-sync): official upstream sync with conflict resolution UI, optâout flag, and backend resiliency
Backend
- Add endpoints:
- GET /api/models/sync_upstream/preview â diff preview (filters out models with sync_official = 0)
- POST /api/models/sync_upstream â apply sync (create missing; optionally overwrite selected fields)
- Respect optâout: skip models with sync_official = 0 in both preview and apply
- Return detailed stats: created_models, created_vendors, updated_models, skipped_models, plus created_list / updated_list
- Add model.Model.SyncOfficial (default 1); autoâmigrated by GORM
- Make HTTP fetching robust:
- Shared http.Client (connection reuse) with 3x exponential backoff retry
- 10MB response cap; keep existing IPv4âfirst for *.github.io
- Vendor handling:
- New ensureVendorID helper (cache lookup â DB lookup â create), reduces roundâtrips
- Transactional overwrite to avoid partial updates
- Small cleanups and clearer helpers (containsField, coalesce, chooseStatus)
Frontend
- ModelsActions: add âSync officialâ button with Popover (pâ2) explaining community contribution; loading = syncing || previewing; preview â conflict modal â apply flow
- New UpstreamConflictModal:
- Perâfield columns (description/icon/tags/vendor/name_rule/status) with columnâlevel checkbox to select all
- Cell with Checkbox + Tag (âClick to view differencesâ) and Popover (pâ2) showing Local vs Official values
- Autoâhide columns with no conflicts; responsive width; use native Semi Modal footer
- Full i18n coverage
- useModelsData: add syncing/previewing states; new methods previewUpstreamDiff, applyUpstreamOverwrite, syncUpstream; refresh vendors/models after apply
- EditModelModal: add âParticipate in official syncâ switch; persisted as sync_official
- ModelsColumnDefs: add âParticipate in official syncâ column
i18n
- Add missing English keys for the new UI and messages; fix quoting issues
Refs
- Upstream metadata: https://github.com/basellm/llm-metadata
2025-09-02 02:04:22 +08:00
|
|
|
syncing,
|
|
|
|
|
previewing,
|
|
|
|
|
syncUpstream,
|
|
|
|
|
previewUpstreamDiff,
|
|
|
|
|
applyUpstreamOverwrite,
|
đ feat: Introduce full Model & Vendor Management suite (backend + frontend) and UI refinements
Backend
⢠Add `model/model_meta.go` and `model/vendor_meta.go` defining Model & Vendor entities with CRUD helpers, soft-delete and time stamps
⢠Create corresponding controllers `controller/model_meta.go`, `controller/vendor_meta.go` and register routes in `router/api-router.go`
⢠Auto-migrate new tables in DB startup logic
Frontend
⢠Build complete âModel Managementâ module under `/console/models`
- New pages, tables, filters, actions, hooks (`useModelsData`) and dynamic vendor tabs
- Modals `EditModelModal.jsx` & unified `EditVendorModal.jsx`; latter now uses default confirm/cancel footer and mobile-friendly modal sizing (`full-width` / `small`) via `useIsMobile`
⢠Update sidebar (`SiderBar.js`) and routing (`App.js`) to surface the feature
⢠Add helper updates (`render.js`) incl. `stringToColor`, dynamic LobeHub icon retrieval, and tag color palettes
Table UX improvements
⢠Replace separate status column with inline Enable / Disable buttons in operation column (matching channel table style)
⢠Limit visible tags to max 3; overflow represented as â+xâ tag with padded `Popover` showing remaining tags
⢠Color all tags deterministically using `stringToColor` for consistent theming
⢠Change vendor column tag color to white for better contrast
Misc
⢠Minor layout tweaks, compact-mode toggle relocation, lint fixes and TypeScript/ESLint clean-up
These changes collectively deliver end-to-end model & vendor administration while unifying visual language across management tables.
2025-07-31 22:28:09 +08:00
|
|
|
compactMode,
|
|
|
|
|
setCompactMode,
|
|
|
|
|
t,
|
|
|
|
|
}) => {
|
|
|
|
|
// Modal states
|
|
|
|
|
const [showDeleteModal, setShowDeleteModal] = useState(false);
|
2025-08-03 22:51:24 +08:00
|
|
|
const [showMissingModal, setShowMissingModal] = useState(false);
|
2025-08-04 02:54:37 +08:00
|
|
|
const [showGroupManagement, setShowGroupManagement] = useState(false);
|
2025-08-06 03:29:45 +08:00
|
|
|
const [showAddPrefill, setShowAddPrefill] = useState(false);
|
|
|
|
|
const [prefillInit, setPrefillInit] = useState({ id: undefined });
|
⨠feat(models-sync): official upstream sync with conflict resolution UI, optâout flag, and backend resiliency
Backend
- Add endpoints:
- GET /api/models/sync_upstream/preview â diff preview (filters out models with sync_official = 0)
- POST /api/models/sync_upstream â apply sync (create missing; optionally overwrite selected fields)
- Respect optâout: skip models with sync_official = 0 in both preview and apply
- Return detailed stats: created_models, created_vendors, updated_models, skipped_models, plus created_list / updated_list
- Add model.Model.SyncOfficial (default 1); autoâmigrated by GORM
- Make HTTP fetching robust:
- Shared http.Client (connection reuse) with 3x exponential backoff retry
- 10MB response cap; keep existing IPv4âfirst for *.github.io
- Vendor handling:
- New ensureVendorID helper (cache lookup â DB lookup â create), reduces roundâtrips
- Transactional overwrite to avoid partial updates
- Small cleanups and clearer helpers (containsField, coalesce, chooseStatus)
Frontend
- ModelsActions: add âSync officialâ button with Popover (pâ2) explaining community contribution; loading = syncing || previewing; preview â conflict modal â apply flow
- New UpstreamConflictModal:
- Perâfield columns (description/icon/tags/vendor/name_rule/status) with columnâlevel checkbox to select all
- Cell with Checkbox + Tag (âClick to view differencesâ) and Popover (pâ2) showing Local vs Official values
- Autoâhide columns with no conflicts; responsive width; use native Semi Modal footer
- Full i18n coverage
- useModelsData: add syncing/previewing states; new methods previewUpstreamDiff, applyUpstreamOverwrite, syncUpstream; refresh vendors/models after apply
- EditModelModal: add âParticipate in official syncâ switch; persisted as sync_official
- ModelsColumnDefs: add âParticipate in official syncâ column
i18n
- Add missing English keys for the new UI and messages; fix quoting issues
Refs
- Upstream metadata: https://github.com/basellm/llm-metadata
2025-09-02 02:04:22 +08:00
|
|
|
const [showConflict, setShowConflict] = useState(false);
|
|
|
|
|
const [conflicts, setConflicts] = useState([]);
|
⨠feat(sync): multi-language sync wizard, backend locale support, and conflict modal UX improvements
Frontend (web)
- ModelsActions.jsx
- Replace âSync Officialâ with âSyncâ and open a new two-step SyncWizard.
- Pass selected locale through to preview, sync, and overwrite flows.
- Keep conflict resolution flow; inject locale into overwrite submission.
- New: models/modals/SyncWizardModal.jsx
- Two-step wizard: (1) method selection (config-sync disabled for now), (2) language selection (en/zh/ja).
- Horizontal, centered Radio cards; returns { option, locale } via onConfirm.
- UpstreamConflictModal.jsx
- Add search input (model fuzzy search) and native pagination.
- Column header checkbox now only applies to rows in the current filtered result.
- Fix âCannot access âfilteredDataSourceâ before initializationâ.
- Refactor with useMemo/useCallback; extract helpers to remove duplicated logic:
- getPresentRowsForField, getHeaderState, applyHeaderChange
- Minor code cleanups and stability improvements.
- i18n (en.json)
- Add strings for the sync wizard and related actions (Sync, Sync Wizard, Select method/source/language, etc.).
- Adjust minor translations.
Hooks
- useModelsData.jsx
- Extend previewUpstreamDiff, syncUpstream, applyUpstreamOverwrite to accept options with locale.
- Send locale via query/body accordingly.
Backend (Go)
- controller/model_sync.go
- Accept locale from query/body and resolve i18n upstream URLs.
- Add SYNC_UPSTREAM_BASE for upstream base override (default: https://basellm.github.io/llm-metadata).
- Make HTTP timeouts/retries/limits configurable:
- SYNC_HTTP_TIMEOUT_SECONDS, SYNC_HTTP_RETRY, SYNC_HTTP_MAX_MB
- Add ETag-based caching and support both envelope and pure array JSON formats.
- Concurrently fetch vendors and models; improve error responses with locale and source URLs.
- Include source meta (locale, models_url, vendors_url) in success payloads.
Notes
- No breaking changes expected.
- Lint passes for touched files.
2025-09-02 18:49:37 +08:00
|
|
|
const [showSyncModal, setShowSyncModal] = useState(false);
|
|
|
|
|
const [syncLocale, setSyncLocale] = useState('zh');
|
⨠feat(models-sync): official upstream sync with conflict resolution UI, optâout flag, and backend resiliency
Backend
- Add endpoints:
- GET /api/models/sync_upstream/preview â diff preview (filters out models with sync_official = 0)
- POST /api/models/sync_upstream â apply sync (create missing; optionally overwrite selected fields)
- Respect optâout: skip models with sync_official = 0 in both preview and apply
- Return detailed stats: created_models, created_vendors, updated_models, skipped_models, plus created_list / updated_list
- Add model.Model.SyncOfficial (default 1); autoâmigrated by GORM
- Make HTTP fetching robust:
- Shared http.Client (connection reuse) with 3x exponential backoff retry
- 10MB response cap; keep existing IPv4âfirst for *.github.io
- Vendor handling:
- New ensureVendorID helper (cache lookup â DB lookup â create), reduces roundâtrips
- Transactional overwrite to avoid partial updates
- Small cleanups and clearer helpers (containsField, coalesce, chooseStatus)
Frontend
- ModelsActions: add âSync officialâ button with Popover (pâ2) explaining community contribution; loading = syncing || previewing; preview â conflict modal â apply flow
- New UpstreamConflictModal:
- Perâfield columns (description/icon/tags/vendor/name_rule/status) with columnâlevel checkbox to select all
- Cell with Checkbox + Tag (âClick to view differencesâ) and Popover (pâ2) showing Local vs Official values
- Autoâhide columns with no conflicts; responsive width; use native Semi Modal footer
- Full i18n coverage
- useModelsData: add syncing/previewing states; new methods previewUpstreamDiff, applyUpstreamOverwrite, syncUpstream; refresh vendors/models after apply
- EditModelModal: add âParticipate in official syncâ switch; persisted as sync_official
- ModelsColumnDefs: add âParticipate in official syncâ column
i18n
- Add missing English keys for the new UI and messages; fix quoting issues
Refs
- Upstream metadata: https://github.com/basellm/llm-metadata
2025-09-02 02:04:22 +08:00
|
|
|
|
⨠feat(sync): multi-language sync wizard, backend locale support, and conflict modal UX improvements
Frontend (web)
- ModelsActions.jsx
- Replace âSync Officialâ with âSyncâ and open a new two-step SyncWizard.
- Pass selected locale through to preview, sync, and overwrite flows.
- Keep conflict resolution flow; inject locale into overwrite submission.
- New: models/modals/SyncWizardModal.jsx
- Two-step wizard: (1) method selection (config-sync disabled for now), (2) language selection (en/zh/ja).
- Horizontal, centered Radio cards; returns { option, locale } via onConfirm.
- UpstreamConflictModal.jsx
- Add search input (model fuzzy search) and native pagination.
- Column header checkbox now only applies to rows in the current filtered result.
- Fix âCannot access âfilteredDataSourceâ before initializationâ.
- Refactor with useMemo/useCallback; extract helpers to remove duplicated logic:
- getPresentRowsForField, getHeaderState, applyHeaderChange
- Minor code cleanups and stability improvements.
- i18n (en.json)
- Add strings for the sync wizard and related actions (Sync, Sync Wizard, Select method/source/language, etc.).
- Adjust minor translations.
Hooks
- useModelsData.jsx
- Extend previewUpstreamDiff, syncUpstream, applyUpstreamOverwrite to accept options with locale.
- Send locale via query/body accordingly.
Backend (Go)
- controller/model_sync.go
- Accept locale from query/body and resolve i18n upstream URLs.
- Add SYNC_UPSTREAM_BASE for upstream base override (default: https://basellm.github.io/llm-metadata).
- Make HTTP timeouts/retries/limits configurable:
- SYNC_HTTP_TIMEOUT_SECONDS, SYNC_HTTP_RETRY, SYNC_HTTP_MAX_MB
- Add ETag-based caching and support both envelope and pure array JSON formats.
- Concurrently fetch vendors and models; improve error responses with locale and source URLs.
- Include source meta (locale, models_url, vendors_url) in success payloads.
Notes
- No breaking changes expected.
- Lint passes for touched files.
2025-09-02 18:49:37 +08:00
|
|
|
const handleSyncUpstream = async (locale) => {
|
⨠feat(models-sync): official upstream sync with conflict resolution UI, optâout flag, and backend resiliency
Backend
- Add endpoints:
- GET /api/models/sync_upstream/preview â diff preview (filters out models with sync_official = 0)
- POST /api/models/sync_upstream â apply sync (create missing; optionally overwrite selected fields)
- Respect optâout: skip models with sync_official = 0 in both preview and apply
- Return detailed stats: created_models, created_vendors, updated_models, skipped_models, plus created_list / updated_list
- Add model.Model.SyncOfficial (default 1); autoâmigrated by GORM
- Make HTTP fetching robust:
- Shared http.Client (connection reuse) with 3x exponential backoff retry
- 10MB response cap; keep existing IPv4âfirst for *.github.io
- Vendor handling:
- New ensureVendorID helper (cache lookup â DB lookup â create), reduces roundâtrips
- Transactional overwrite to avoid partial updates
- Small cleanups and clearer helpers (containsField, coalesce, chooseStatus)
Frontend
- ModelsActions: add âSync officialâ button with Popover (pâ2) explaining community contribution; loading = syncing || previewing; preview â conflict modal â apply flow
- New UpstreamConflictModal:
- Perâfield columns (description/icon/tags/vendor/name_rule/status) with columnâlevel checkbox to select all
- Cell with Checkbox + Tag (âClick to view differencesâ) and Popover (pâ2) showing Local vs Official values
- Autoâhide columns with no conflicts; responsive width; use native Semi Modal footer
- Full i18n coverage
- useModelsData: add syncing/previewing states; new methods previewUpstreamDiff, applyUpstreamOverwrite, syncUpstream; refresh vendors/models after apply
- EditModelModal: add âParticipate in official syncâ switch; persisted as sync_official
- ModelsColumnDefs: add âParticipate in official syncâ column
i18n
- Add missing English keys for the new UI and messages; fix quoting issues
Refs
- Upstream metadata: https://github.com/basellm/llm-metadata
2025-09-02 02:04:22 +08:00
|
|
|
// ĺ
é˘č§
|
⨠feat(sync): multi-language sync wizard, backend locale support, and conflict modal UX improvements
Frontend (web)
- ModelsActions.jsx
- Replace âSync Officialâ with âSyncâ and open a new two-step SyncWizard.
- Pass selected locale through to preview, sync, and overwrite flows.
- Keep conflict resolution flow; inject locale into overwrite submission.
- New: models/modals/SyncWizardModal.jsx
- Two-step wizard: (1) method selection (config-sync disabled for now), (2) language selection (en/zh/ja).
- Horizontal, centered Radio cards; returns { option, locale } via onConfirm.
- UpstreamConflictModal.jsx
- Add search input (model fuzzy search) and native pagination.
- Column header checkbox now only applies to rows in the current filtered result.
- Fix âCannot access âfilteredDataSourceâ before initializationâ.
- Refactor with useMemo/useCallback; extract helpers to remove duplicated logic:
- getPresentRowsForField, getHeaderState, applyHeaderChange
- Minor code cleanups and stability improvements.
- i18n (en.json)
- Add strings for the sync wizard and related actions (Sync, Sync Wizard, Select method/source/language, etc.).
- Adjust minor translations.
Hooks
- useModelsData.jsx
- Extend previewUpstreamDiff, syncUpstream, applyUpstreamOverwrite to accept options with locale.
- Send locale via query/body accordingly.
Backend (Go)
- controller/model_sync.go
- Accept locale from query/body and resolve i18n upstream URLs.
- Add SYNC_UPSTREAM_BASE for upstream base override (default: https://basellm.github.io/llm-metadata).
- Make HTTP timeouts/retries/limits configurable:
- SYNC_HTTP_TIMEOUT_SECONDS, SYNC_HTTP_RETRY, SYNC_HTTP_MAX_MB
- Add ETag-based caching and support both envelope and pure array JSON formats.
- Concurrently fetch vendors and models; improve error responses with locale and source URLs.
- Include source meta (locale, models_url, vendors_url) in success payloads.
Notes
- No breaking changes expected.
- Lint passes for touched files.
2025-09-02 18:49:37 +08:00
|
|
|
const data = await previewUpstreamDiff?.({ locale });
|
⨠feat(models-sync): official upstream sync with conflict resolution UI, optâout flag, and backend resiliency
Backend
- Add endpoints:
- GET /api/models/sync_upstream/preview â diff preview (filters out models with sync_official = 0)
- POST /api/models/sync_upstream â apply sync (create missing; optionally overwrite selected fields)
- Respect optâout: skip models with sync_official = 0 in both preview and apply
- Return detailed stats: created_models, created_vendors, updated_models, skipped_models, plus created_list / updated_list
- Add model.Model.SyncOfficial (default 1); autoâmigrated by GORM
- Make HTTP fetching robust:
- Shared http.Client (connection reuse) with 3x exponential backoff retry
- 10MB response cap; keep existing IPv4âfirst for *.github.io
- Vendor handling:
- New ensureVendorID helper (cache lookup â DB lookup â create), reduces roundâtrips
- Transactional overwrite to avoid partial updates
- Small cleanups and clearer helpers (containsField, coalesce, chooseStatus)
Frontend
- ModelsActions: add âSync officialâ button with Popover (pâ2) explaining community contribution; loading = syncing || previewing; preview â conflict modal â apply flow
- New UpstreamConflictModal:
- Perâfield columns (description/icon/tags/vendor/name_rule/status) with columnâlevel checkbox to select all
- Cell with Checkbox + Tag (âClick to view differencesâ) and Popover (pâ2) showing Local vs Official values
- Autoâhide columns with no conflicts; responsive width; use native Semi Modal footer
- Full i18n coverage
- useModelsData: add syncing/previewing states; new methods previewUpstreamDiff, applyUpstreamOverwrite, syncUpstream; refresh vendors/models after apply
- EditModelModal: add âParticipate in official syncâ switch; persisted as sync_official
- ModelsColumnDefs: add âParticipate in official syncâ column
i18n
- Add missing English keys for the new UI and messages; fix quoting issues
Refs
- Upstream metadata: https://github.com/basellm/llm-metadata
2025-09-02 02:04:22 +08:00
|
|
|
const conflictItems = data?.conflicts || [];
|
|
|
|
|
if (conflictItems.length > 0) {
|
|
|
|
|
setConflicts(conflictItems);
|
|
|
|
|
setShowConflict(true);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// ć ĺ˛çŞďźç´ćĽĺćĽçźşĺ¤ą
|
⨠feat(sync): multi-language sync wizard, backend locale support, and conflict modal UX improvements
Frontend (web)
- ModelsActions.jsx
- Replace âSync Officialâ with âSyncâ and open a new two-step SyncWizard.
- Pass selected locale through to preview, sync, and overwrite flows.
- Keep conflict resolution flow; inject locale into overwrite submission.
- New: models/modals/SyncWizardModal.jsx
- Two-step wizard: (1) method selection (config-sync disabled for now), (2) language selection (en/zh/ja).
- Horizontal, centered Radio cards; returns { option, locale } via onConfirm.
- UpstreamConflictModal.jsx
- Add search input (model fuzzy search) and native pagination.
- Column header checkbox now only applies to rows in the current filtered result.
- Fix âCannot access âfilteredDataSourceâ before initializationâ.
- Refactor with useMemo/useCallback; extract helpers to remove duplicated logic:
- getPresentRowsForField, getHeaderState, applyHeaderChange
- Minor code cleanups and stability improvements.
- i18n (en.json)
- Add strings for the sync wizard and related actions (Sync, Sync Wizard, Select method/source/language, etc.).
- Adjust minor translations.
Hooks
- useModelsData.jsx
- Extend previewUpstreamDiff, syncUpstream, applyUpstreamOverwrite to accept options with locale.
- Send locale via query/body accordingly.
Backend (Go)
- controller/model_sync.go
- Accept locale from query/body and resolve i18n upstream URLs.
- Add SYNC_UPSTREAM_BASE for upstream base override (default: https://basellm.github.io/llm-metadata).
- Make HTTP timeouts/retries/limits configurable:
- SYNC_HTTP_TIMEOUT_SECONDS, SYNC_HTTP_RETRY, SYNC_HTTP_MAX_MB
- Add ETag-based caching and support both envelope and pure array JSON formats.
- Concurrently fetch vendors and models; improve error responses with locale and source URLs.
- Include source meta (locale, models_url, vendors_url) in success payloads.
Notes
- No breaking changes expected.
- Lint passes for touched files.
2025-09-02 18:49:37 +08:00
|
|
|
await syncUpstream?.({ locale });
|
⨠feat(models-sync): official upstream sync with conflict resolution UI, optâout flag, and backend resiliency
Backend
- Add endpoints:
- GET /api/models/sync_upstream/preview â diff preview (filters out models with sync_official = 0)
- POST /api/models/sync_upstream â apply sync (create missing; optionally overwrite selected fields)
- Respect optâout: skip models with sync_official = 0 in both preview and apply
- Return detailed stats: created_models, created_vendors, updated_models, skipped_models, plus created_list / updated_list
- Add model.Model.SyncOfficial (default 1); autoâmigrated by GORM
- Make HTTP fetching robust:
- Shared http.Client (connection reuse) with 3x exponential backoff retry
- 10MB response cap; keep existing IPv4âfirst for *.github.io
- Vendor handling:
- New ensureVendorID helper (cache lookup â DB lookup â create), reduces roundâtrips
- Transactional overwrite to avoid partial updates
- Small cleanups and clearer helpers (containsField, coalesce, chooseStatus)
Frontend
- ModelsActions: add âSync officialâ button with Popover (pâ2) explaining community contribution; loading = syncing || previewing; preview â conflict modal â apply flow
- New UpstreamConflictModal:
- Perâfield columns (description/icon/tags/vendor/name_rule/status) with columnâlevel checkbox to select all
- Cell with Checkbox + Tag (âClick to view differencesâ) and Popover (pâ2) showing Local vs Official values
- Autoâhide columns with no conflicts; responsive width; use native Semi Modal footer
- Full i18n coverage
- useModelsData: add syncing/previewing states; new methods previewUpstreamDiff, applyUpstreamOverwrite, syncUpstream; refresh vendors/models after apply
- EditModelModal: add âParticipate in official syncâ switch; persisted as sync_official
- ModelsColumnDefs: add âParticipate in official syncâ column
i18n
- Add missing English keys for the new UI and messages; fix quoting issues
Refs
- Upstream metadata: https://github.com/basellm/llm-metadata
2025-09-02 02:04:22 +08:00
|
|
|
};
|
đ feat: Introduce full Model & Vendor Management suite (backend + frontend) and UI refinements
Backend
⢠Add `model/model_meta.go` and `model/vendor_meta.go` defining Model & Vendor entities with CRUD helpers, soft-delete and time stamps
⢠Create corresponding controllers `controller/model_meta.go`, `controller/vendor_meta.go` and register routes in `router/api-router.go`
⢠Auto-migrate new tables in DB startup logic
Frontend
⢠Build complete âModel Managementâ module under `/console/models`
- New pages, tables, filters, actions, hooks (`useModelsData`) and dynamic vendor tabs
- Modals `EditModelModal.jsx` & unified `EditVendorModal.jsx`; latter now uses default confirm/cancel footer and mobile-friendly modal sizing (`full-width` / `small`) via `useIsMobile`
⢠Update sidebar (`SiderBar.js`) and routing (`App.js`) to surface the feature
⢠Add helper updates (`render.js`) incl. `stringToColor`, dynamic LobeHub icon retrieval, and tag color palettes
Table UX improvements
⢠Replace separate status column with inline Enable / Disable buttons in operation column (matching channel table style)
⢠Limit visible tags to max 3; overflow represented as â+xâ tag with padded `Popover` showing remaining tags
⢠Color all tags deterministically using `stringToColor` for consistent theming
⢠Change vendor column tag color to white for better contrast
Misc
⢠Minor layout tweaks, compact-mode toggle relocation, lint fixes and TypeScript/ESLint clean-up
These changes collectively deliver end-to-end model & vendor administration while unifying visual language across management tables.
2025-07-31 22:28:09 +08:00
|
|
|
|
|
|
|
|
// Handle delete selected models with confirmation
|
|
|
|
|
const handleDeleteSelectedModels = () => {
|
|
|
|
|
setShowDeleteModal(true);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Handle delete confirmation
|
|
|
|
|
const handleConfirmDelete = () => {
|
|
|
|
|
batchDeleteModels();
|
|
|
|
|
setShowDeleteModal(false);
|
|
|
|
|
};
|
|
|
|
|
|
2025-08-06 03:29:45 +08:00
|
|
|
// Handle clear selection
|
|
|
|
|
const handleClearSelected = () => {
|
|
|
|
|
setSelectedKeys([]);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Handle add selected models to prefill group
|
|
|
|
|
const handleCopyNames = async () => {
|
2025-08-30 21:15:10 +08:00
|
|
|
const text = selectedKeys.map((m) => m.model_name).join(',');
|
2025-08-06 03:29:45 +08:00
|
|
|
if (!text) return;
|
|
|
|
|
const ok = await copy(text);
|
|
|
|
|
if (ok) {
|
|
|
|
|
showSuccess(t('塲ĺ¤ĺść¨Ąĺĺç§°'));
|
|
|
|
|
} else {
|
|
|
|
|
showError(t('ĺ¤ĺśĺ¤ąč´Ľ'));
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleAddToPrefill = () => {
|
|
|
|
|
// Prepare initial data
|
|
|
|
|
const items = selectedKeys.map((m) => m.model_name);
|
|
|
|
|
setPrefillInit({ id: undefined, type: 'model', items });
|
|
|
|
|
setShowAddPrefill(true);
|
|
|
|
|
};
|
|
|
|
|
|
đ feat: Introduce full Model & Vendor Management suite (backend + frontend) and UI refinements
Backend
⢠Add `model/model_meta.go` and `model/vendor_meta.go` defining Model & Vendor entities with CRUD helpers, soft-delete and time stamps
⢠Create corresponding controllers `controller/model_meta.go`, `controller/vendor_meta.go` and register routes in `router/api-router.go`
⢠Auto-migrate new tables in DB startup logic
Frontend
⢠Build complete âModel Managementâ module under `/console/models`
- New pages, tables, filters, actions, hooks (`useModelsData`) and dynamic vendor tabs
- Modals `EditModelModal.jsx` & unified `EditVendorModal.jsx`; latter now uses default confirm/cancel footer and mobile-friendly modal sizing (`full-width` / `small`) via `useIsMobile`
⢠Update sidebar (`SiderBar.js`) and routing (`App.js`) to surface the feature
⢠Add helper updates (`render.js`) incl. `stringToColor`, dynamic LobeHub icon retrieval, and tag color palettes
Table UX improvements
⢠Replace separate status column with inline Enable / Disable buttons in operation column (matching channel table style)
⢠Limit visible tags to max 3; overflow represented as â+xâ tag with padded `Popover` showing remaining tags
⢠Color all tags deterministically using `stringToColor` for consistent theming
⢠Change vendor column tag color to white for better contrast
Misc
⢠Minor layout tweaks, compact-mode toggle relocation, lint fixes and TypeScript/ESLint clean-up
These changes collectively deliver end-to-end model & vendor administration while unifying visual language across management tables.
2025-07-31 22:28:09 +08:00
|
|
|
return (
|
|
|
|
|
<>
|
2025-08-30 21:15:10 +08:00
|
|
|
<div className='flex flex-wrap gap-2 w-full md:w-auto order-2 md:order-1'>
|
đ feat: Introduce full Model & Vendor Management suite (backend + frontend) and UI refinements
Backend
⢠Add `model/model_meta.go` and `model/vendor_meta.go` defining Model & Vendor entities with CRUD helpers, soft-delete and time stamps
⢠Create corresponding controllers `controller/model_meta.go`, `controller/vendor_meta.go` and register routes in `router/api-router.go`
⢠Auto-migrate new tables in DB startup logic
Frontend
⢠Build complete âModel Managementâ module under `/console/models`
- New pages, tables, filters, actions, hooks (`useModelsData`) and dynamic vendor tabs
- Modals `EditModelModal.jsx` & unified `EditVendorModal.jsx`; latter now uses default confirm/cancel footer and mobile-friendly modal sizing (`full-width` / `small`) via `useIsMobile`
⢠Update sidebar (`SiderBar.js`) and routing (`App.js`) to surface the feature
⢠Add helper updates (`render.js`) incl. `stringToColor`, dynamic LobeHub icon retrieval, and tag color palettes
Table UX improvements
⢠Replace separate status column with inline Enable / Disable buttons in operation column (matching channel table style)
⢠Limit visible tags to max 3; overflow represented as â+xâ tag with padded `Popover` showing remaining tags
⢠Color all tags deterministically using `stringToColor` for consistent theming
⢠Change vendor column tag color to white for better contrast
Misc
⢠Minor layout tweaks, compact-mode toggle relocation, lint fixes and TypeScript/ESLint clean-up
These changes collectively deliver end-to-end model & vendor administration while unifying visual language across management tables.
2025-07-31 22:28:09 +08:00
|
|
|
<Button
|
2025-08-30 21:15:10 +08:00
|
|
|
type='primary'
|
|
|
|
|
className='flex-1 md:flex-initial'
|
đ feat: Introduce full Model & Vendor Management suite (backend + frontend) and UI refinements
Backend
⢠Add `model/model_meta.go` and `model/vendor_meta.go` defining Model & Vendor entities with CRUD helpers, soft-delete and time stamps
⢠Create corresponding controllers `controller/model_meta.go`, `controller/vendor_meta.go` and register routes in `router/api-router.go`
⢠Auto-migrate new tables in DB startup logic
Frontend
⢠Build complete âModel Managementâ module under `/console/models`
- New pages, tables, filters, actions, hooks (`useModelsData`) and dynamic vendor tabs
- Modals `EditModelModal.jsx` & unified `EditVendorModal.jsx`; latter now uses default confirm/cancel footer and mobile-friendly modal sizing (`full-width` / `small`) via `useIsMobile`
⢠Update sidebar (`SiderBar.js`) and routing (`App.js`) to surface the feature
⢠Add helper updates (`render.js`) incl. `stringToColor`, dynamic LobeHub icon retrieval, and tag color palettes
Table UX improvements
⢠Replace separate status column with inline Enable / Disable buttons in operation column (matching channel table style)
⢠Limit visible tags to max 3; overflow represented as â+xâ tag with padded `Popover` showing remaining tags
⢠Color all tags deterministically using `stringToColor` for consistent theming
⢠Change vendor column tag color to white for better contrast
Misc
⢠Minor layout tweaks, compact-mode toggle relocation, lint fixes and TypeScript/ESLint clean-up
These changes collectively deliver end-to-end model & vendor administration while unifying visual language across management tables.
2025-07-31 22:28:09 +08:00
|
|
|
onClick={() => {
|
|
|
|
|
setEditingModel({
|
|
|
|
|
id: undefined,
|
|
|
|
|
});
|
|
|
|
|
setShowEdit(true);
|
|
|
|
|
}}
|
2025-08-30 21:15:10 +08:00
|
|
|
size='small'
|
đ feat: Introduce full Model & Vendor Management suite (backend + frontend) and UI refinements
Backend
⢠Add `model/model_meta.go` and `model/vendor_meta.go` defining Model & Vendor entities with CRUD helpers, soft-delete and time stamps
⢠Create corresponding controllers `controller/model_meta.go`, `controller/vendor_meta.go` and register routes in `router/api-router.go`
⢠Auto-migrate new tables in DB startup logic
Frontend
⢠Build complete âModel Managementâ module under `/console/models`
- New pages, tables, filters, actions, hooks (`useModelsData`) and dynamic vendor tabs
- Modals `EditModelModal.jsx` & unified `EditVendorModal.jsx`; latter now uses default confirm/cancel footer and mobile-friendly modal sizing (`full-width` / `small`) via `useIsMobile`
⢠Update sidebar (`SiderBar.js`) and routing (`App.js`) to surface the feature
⢠Add helper updates (`render.js`) incl. `stringToColor`, dynamic LobeHub icon retrieval, and tag color palettes
Table UX improvements
⢠Replace separate status column with inline Enable / Disable buttons in operation column (matching channel table style)
⢠Limit visible tags to max 3; overflow represented as â+xâ tag with padded `Popover` showing remaining tags
⢠Color all tags deterministically using `stringToColor` for consistent theming
⢠Change vendor column tag color to white for better contrast
Misc
⢠Minor layout tweaks, compact-mode toggle relocation, lint fixes and TypeScript/ESLint clean-up
These changes collectively deliver end-to-end model & vendor administration while unifying visual language across management tables.
2025-07-31 22:28:09 +08:00
|
|
|
>
|
|
|
|
|
{t('桝ĺ 樥ĺ')}
|
|
|
|
|
</Button>
|
|
|
|
|
|
2025-08-03 22:51:24 +08:00
|
|
|
<Button
|
2025-08-30 21:15:10 +08:00
|
|
|
type='secondary'
|
|
|
|
|
className='flex-1 md:flex-initial'
|
|
|
|
|
size='small'
|
2025-08-03 22:51:24 +08:00
|
|
|
onClick={() => setShowMissingModal(true)}
|
|
|
|
|
>
|
|
|
|
|
{t('ćŞé
罎樥ĺ')}
|
|
|
|
|
</Button>
|
|
|
|
|
|
⨠feat(models-sync): official upstream sync with conflict resolution UI, optâout flag, and backend resiliency
Backend
- Add endpoints:
- GET /api/models/sync_upstream/preview â diff preview (filters out models with sync_official = 0)
- POST /api/models/sync_upstream â apply sync (create missing; optionally overwrite selected fields)
- Respect optâout: skip models with sync_official = 0 in both preview and apply
- Return detailed stats: created_models, created_vendors, updated_models, skipped_models, plus created_list / updated_list
- Add model.Model.SyncOfficial (default 1); autoâmigrated by GORM
- Make HTTP fetching robust:
- Shared http.Client (connection reuse) with 3x exponential backoff retry
- 10MB response cap; keep existing IPv4âfirst for *.github.io
- Vendor handling:
- New ensureVendorID helper (cache lookup â DB lookup â create), reduces roundâtrips
- Transactional overwrite to avoid partial updates
- Small cleanups and clearer helpers (containsField, coalesce, chooseStatus)
Frontend
- ModelsActions: add âSync officialâ button with Popover (pâ2) explaining community contribution; loading = syncing || previewing; preview â conflict modal â apply flow
- New UpstreamConflictModal:
- Perâfield columns (description/icon/tags/vendor/name_rule/status) with columnâlevel checkbox to select all
- Cell with Checkbox + Tag (âClick to view differencesâ) and Popover (pâ2) showing Local vs Official values
- Autoâhide columns with no conflicts; responsive width; use native Semi Modal footer
- Full i18n coverage
- useModelsData: add syncing/previewing states; new methods previewUpstreamDiff, applyUpstreamOverwrite, syncUpstream; refresh vendors/models after apply
- EditModelModal: add âParticipate in official syncâ switch; persisted as sync_official
- ModelsColumnDefs: add âParticipate in official syncâ column
i18n
- Add missing English keys for the new UI and messages; fix quoting issues
Refs
- Upstream metadata: https://github.com/basellm/llm-metadata
2025-09-02 02:04:22 +08:00
|
|
|
<Popover
|
|
|
|
|
position='bottom'
|
|
|
|
|
trigger='hover'
|
|
|
|
|
content={
|
|
|
|
|
<div className='p-2 max-w-[360px]'>
|
|
|
|
|
<div className='text-[var(--semi-color-text-2)] text-sm'>
|
|
|
|
|
{t(
|
|
|
|
|
'樥ĺ礞ĺşéčŚĺ¤§ĺŽśçĺ
ąĺçť´ć¤ďźĺŚĺç°ć°ćŽć误ććłč´ĄçŽć°ç樥ĺć°ćŽďźčŻˇčŽżéŽďź',
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
<a
|
|
|
|
|
href='https://github.com/basellm/llm-metadata'
|
|
|
|
|
target='_blank'
|
|
|
|
|
rel='noreferrer'
|
|
|
|
|
className='text-blue-600 underline'
|
|
|
|
|
>
|
|
|
|
|
https://github.com/basellm/llm-metadata
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
<Button
|
|
|
|
|
type='secondary'
|
|
|
|
|
className='flex-1 md:flex-initial'
|
|
|
|
|
size='small'
|
|
|
|
|
loading={syncing || previewing}
|
⨠feat(sync): multi-language sync wizard, backend locale support, and conflict modal UX improvements
Frontend (web)
- ModelsActions.jsx
- Replace âSync Officialâ with âSyncâ and open a new two-step SyncWizard.
- Pass selected locale through to preview, sync, and overwrite flows.
- Keep conflict resolution flow; inject locale into overwrite submission.
- New: models/modals/SyncWizardModal.jsx
- Two-step wizard: (1) method selection (config-sync disabled for now), (2) language selection (en/zh/ja).
- Horizontal, centered Radio cards; returns { option, locale } via onConfirm.
- UpstreamConflictModal.jsx
- Add search input (model fuzzy search) and native pagination.
- Column header checkbox now only applies to rows in the current filtered result.
- Fix âCannot access âfilteredDataSourceâ before initializationâ.
- Refactor with useMemo/useCallback; extract helpers to remove duplicated logic:
- getPresentRowsForField, getHeaderState, applyHeaderChange
- Minor code cleanups and stability improvements.
- i18n (en.json)
- Add strings for the sync wizard and related actions (Sync, Sync Wizard, Select method/source/language, etc.).
- Adjust minor translations.
Hooks
- useModelsData.jsx
- Extend previewUpstreamDiff, syncUpstream, applyUpstreamOverwrite to accept options with locale.
- Send locale via query/body accordingly.
Backend (Go)
- controller/model_sync.go
- Accept locale from query/body and resolve i18n upstream URLs.
- Add SYNC_UPSTREAM_BASE for upstream base override (default: https://basellm.github.io/llm-metadata).
- Make HTTP timeouts/retries/limits configurable:
- SYNC_HTTP_TIMEOUT_SECONDS, SYNC_HTTP_RETRY, SYNC_HTTP_MAX_MB
- Add ETag-based caching and support both envelope and pure array JSON formats.
- Concurrently fetch vendors and models; improve error responses with locale and source URLs.
- Include source meta (locale, models_url, vendors_url) in success payloads.
Notes
- No breaking changes expected.
- Lint passes for touched files.
2025-09-02 18:49:37 +08:00
|
|
|
onClick={() => {
|
|
|
|
|
setSyncLocale('zh');
|
|
|
|
|
setShowSyncModal(true);
|
|
|
|
|
}}
|
⨠feat(models-sync): official upstream sync with conflict resolution UI, optâout flag, and backend resiliency
Backend
- Add endpoints:
- GET /api/models/sync_upstream/preview â diff preview (filters out models with sync_official = 0)
- POST /api/models/sync_upstream â apply sync (create missing; optionally overwrite selected fields)
- Respect optâout: skip models with sync_official = 0 in both preview and apply
- Return detailed stats: created_models, created_vendors, updated_models, skipped_models, plus created_list / updated_list
- Add model.Model.SyncOfficial (default 1); autoâmigrated by GORM
- Make HTTP fetching robust:
- Shared http.Client (connection reuse) with 3x exponential backoff retry
- 10MB response cap; keep existing IPv4âfirst for *.github.io
- Vendor handling:
- New ensureVendorID helper (cache lookup â DB lookup â create), reduces roundâtrips
- Transactional overwrite to avoid partial updates
- Small cleanups and clearer helpers (containsField, coalesce, chooseStatus)
Frontend
- ModelsActions: add âSync officialâ button with Popover (pâ2) explaining community contribution; loading = syncing || previewing; preview â conflict modal â apply flow
- New UpstreamConflictModal:
- Perâfield columns (description/icon/tags/vendor/name_rule/status) with columnâlevel checkbox to select all
- Cell with Checkbox + Tag (âClick to view differencesâ) and Popover (pâ2) showing Local vs Official values
- Autoâhide columns with no conflicts; responsive width; use native Semi Modal footer
- Full i18n coverage
- useModelsData: add syncing/previewing states; new methods previewUpstreamDiff, applyUpstreamOverwrite, syncUpstream; refresh vendors/models after apply
- EditModelModal: add âParticipate in official syncâ switch; persisted as sync_official
- ModelsColumnDefs: add âParticipate in official syncâ column
i18n
- Add missing English keys for the new UI and messages; fix quoting issues
Refs
- Upstream metadata: https://github.com/basellm/llm-metadata
2025-09-02 02:04:22 +08:00
|
|
|
>
|
⨠feat(sync): multi-language sync wizard, backend locale support, and conflict modal UX improvements
Frontend (web)
- ModelsActions.jsx
- Replace âSync Officialâ with âSyncâ and open a new two-step SyncWizard.
- Pass selected locale through to preview, sync, and overwrite flows.
- Keep conflict resolution flow; inject locale into overwrite submission.
- New: models/modals/SyncWizardModal.jsx
- Two-step wizard: (1) method selection (config-sync disabled for now), (2) language selection (en/zh/ja).
- Horizontal, centered Radio cards; returns { option, locale } via onConfirm.
- UpstreamConflictModal.jsx
- Add search input (model fuzzy search) and native pagination.
- Column header checkbox now only applies to rows in the current filtered result.
- Fix âCannot access âfilteredDataSourceâ before initializationâ.
- Refactor with useMemo/useCallback; extract helpers to remove duplicated logic:
- getPresentRowsForField, getHeaderState, applyHeaderChange
- Minor code cleanups and stability improvements.
- i18n (en.json)
- Add strings for the sync wizard and related actions (Sync, Sync Wizard, Select method/source/language, etc.).
- Adjust minor translations.
Hooks
- useModelsData.jsx
- Extend previewUpstreamDiff, syncUpstream, applyUpstreamOverwrite to accept options with locale.
- Send locale via query/body accordingly.
Backend (Go)
- controller/model_sync.go
- Accept locale from query/body and resolve i18n upstream URLs.
- Add SYNC_UPSTREAM_BASE for upstream base override (default: https://basellm.github.io/llm-metadata).
- Make HTTP timeouts/retries/limits configurable:
- SYNC_HTTP_TIMEOUT_SECONDS, SYNC_HTTP_RETRY, SYNC_HTTP_MAX_MB
- Add ETag-based caching and support both envelope and pure array JSON formats.
- Concurrently fetch vendors and models; improve error responses with locale and source URLs.
- Include source meta (locale, models_url, vendors_url) in success payloads.
Notes
- No breaking changes expected.
- Lint passes for touched files.
2025-09-02 18:49:37 +08:00
|
|
|
{t('ĺćĽ')}
|
⨠feat(models-sync): official upstream sync with conflict resolution UI, optâout flag, and backend resiliency
Backend
- Add endpoints:
- GET /api/models/sync_upstream/preview â diff preview (filters out models with sync_official = 0)
- POST /api/models/sync_upstream â apply sync (create missing; optionally overwrite selected fields)
- Respect optâout: skip models with sync_official = 0 in both preview and apply
- Return detailed stats: created_models, created_vendors, updated_models, skipped_models, plus created_list / updated_list
- Add model.Model.SyncOfficial (default 1); autoâmigrated by GORM
- Make HTTP fetching robust:
- Shared http.Client (connection reuse) with 3x exponential backoff retry
- 10MB response cap; keep existing IPv4âfirst for *.github.io
- Vendor handling:
- New ensureVendorID helper (cache lookup â DB lookup â create), reduces roundâtrips
- Transactional overwrite to avoid partial updates
- Small cleanups and clearer helpers (containsField, coalesce, chooseStatus)
Frontend
- ModelsActions: add âSync officialâ button with Popover (pâ2) explaining community contribution; loading = syncing || previewing; preview â conflict modal â apply flow
- New UpstreamConflictModal:
- Perâfield columns (description/icon/tags/vendor/name_rule/status) with columnâlevel checkbox to select all
- Cell with Checkbox + Tag (âClick to view differencesâ) and Popover (pâ2) showing Local vs Official values
- Autoâhide columns with no conflicts; responsive width; use native Semi Modal footer
- Full i18n coverage
- useModelsData: add syncing/previewing states; new methods previewUpstreamDiff, applyUpstreamOverwrite, syncUpstream; refresh vendors/models after apply
- EditModelModal: add âParticipate in official syncâ switch; persisted as sync_official
- ModelsColumnDefs: add âParticipate in official syncâ column
i18n
- Add missing English keys for the new UI and messages; fix quoting issues
Refs
- Upstream metadata: https://github.com/basellm/llm-metadata
2025-09-02 02:04:22 +08:00
|
|
|
</Button>
|
|
|
|
|
</Popover>
|
|
|
|
|
|
2025-08-04 02:54:37 +08:00
|
|
|
<Button
|
2025-08-30 21:15:10 +08:00
|
|
|
type='secondary'
|
|
|
|
|
className='flex-1 md:flex-initial'
|
|
|
|
|
size='small'
|
2025-08-04 02:54:37 +08:00
|
|
|
onClick={() => setShowGroupManagement(true)}
|
|
|
|
|
>
|
|
|
|
|
{t('é˘ĺĄŤçťçŽĄç')}
|
|
|
|
|
</Button>
|
|
|
|
|
|
đ feat: Introduce full Model & Vendor Management suite (backend + frontend) and UI refinements
Backend
⢠Add `model/model_meta.go` and `model/vendor_meta.go` defining Model & Vendor entities with CRUD helpers, soft-delete and time stamps
⢠Create corresponding controllers `controller/model_meta.go`, `controller/vendor_meta.go` and register routes in `router/api-router.go`
⢠Auto-migrate new tables in DB startup logic
Frontend
⢠Build complete âModel Managementâ module under `/console/models`
- New pages, tables, filters, actions, hooks (`useModelsData`) and dynamic vendor tabs
- Modals `EditModelModal.jsx` & unified `EditVendorModal.jsx`; latter now uses default confirm/cancel footer and mobile-friendly modal sizing (`full-width` / `small`) via `useIsMobile`
⢠Update sidebar (`SiderBar.js`) and routing (`App.js`) to surface the feature
⢠Add helper updates (`render.js`) incl. `stringToColor`, dynamic LobeHub icon retrieval, and tag color palettes
Table UX improvements
⢠Replace separate status column with inline Enable / Disable buttons in operation column (matching channel table style)
⢠Limit visible tags to max 3; overflow represented as â+xâ tag with padded `Popover` showing remaining tags
⢠Color all tags deterministically using `stringToColor` for consistent theming
⢠Change vendor column tag color to white for better contrast
Misc
⢠Minor layout tweaks, compact-mode toggle relocation, lint fixes and TypeScript/ESLint clean-up
These changes collectively deliver end-to-end model & vendor administration while unifying visual language across management tables.
2025-07-31 22:28:09 +08:00
|
|
|
<CompactModeToggle
|
|
|
|
|
compactMode={compactMode}
|
|
|
|
|
setCompactMode={setCompactMode}
|
|
|
|
|
t={t}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
đ refactor: migrate vendor-count aggregation to model layer & align frontend logic
Summary
⢠Backend
â Moved duplicate-name validation and total vendor-count aggregation from controllers (`controller/model_meta.go`, `controller/vendor_meta.go`, `controller/prefill_group.go`) to model layer (`model/model_meta.go`, `model/vendor_meta.go`, `model/prefill_group.go`).
â Added `GetVendorModelCounts()` and `Is*NameDuplicated()` helpers; controllers now call these instead of duplicating queries.
â API response for `/api/models` now returns `vendor_counts` with per-vendor totals across all pages, plus `all` summary.
â Removed redundant checks and unused imports, eliminating `go vet` warnings.
⢠Frontend
â `useModelsData.js` updated to consume backend-supplied `vendor_counts`, calculate the `all` total once, and drop legacy client-side counting logic.
â Simplified initial data flow: first render now triggers only one models request.
â Deleted obsolete `updateVendorCounts` helper and related comments.
â Ensured search flow also sets `vendorCounts`, keeping tab badges accurate.
Why
This refactor enforces single-responsibility (aggregation in model layer), delivers consistent totals irrespective of pagination, and removes redundant client queries, leading to cleaner code and better performance.
2025-08-06 01:40:08 +08:00
|
|
|
<SelectionNotification
|
|
|
|
|
selectedKeys={selectedKeys}
|
|
|
|
|
t={t}
|
|
|
|
|
onDelete={handleDeleteSelectedModels}
|
2025-08-06 03:29:45 +08:00
|
|
|
onAddPrefill={handleAddToPrefill}
|
|
|
|
|
onClear={handleClearSelected}
|
|
|
|
|
onCopy={handleCopyNames}
|
đ refactor: migrate vendor-count aggregation to model layer & align frontend logic
Summary
⢠Backend
â Moved duplicate-name validation and total vendor-count aggregation from controllers (`controller/model_meta.go`, `controller/vendor_meta.go`, `controller/prefill_group.go`) to model layer (`model/model_meta.go`, `model/vendor_meta.go`, `model/prefill_group.go`).
â Added `GetVendorModelCounts()` and `Is*NameDuplicated()` helpers; controllers now call these instead of duplicating queries.
â API response for `/api/models` now returns `vendor_counts` with per-vendor totals across all pages, plus `all` summary.
â Removed redundant checks and unused imports, eliminating `go vet` warnings.
⢠Frontend
â `useModelsData.js` updated to consume backend-supplied `vendor_counts`, calculate the `all` total once, and drop legacy client-side counting logic.
â Simplified initial data flow: first render now triggers only one models request.
â Deleted obsolete `updateVendorCounts` helper and related comments.
â Ensured search flow also sets `vendorCounts`, keeping tab badges accurate.
Why
This refactor enforces single-responsibility (aggregation in model layer), delivers consistent totals irrespective of pagination, and removes redundant client queries, leading to cleaner code and better performance.
2025-08-06 01:40:08 +08:00
|
|
|
/>
|
|
|
|
|
|
đ feat: Introduce full Model & Vendor Management suite (backend + frontend) and UI refinements
Backend
⢠Add `model/model_meta.go` and `model/vendor_meta.go` defining Model & Vendor entities with CRUD helpers, soft-delete and time stamps
⢠Create corresponding controllers `controller/model_meta.go`, `controller/vendor_meta.go` and register routes in `router/api-router.go`
⢠Auto-migrate new tables in DB startup logic
Frontend
⢠Build complete âModel Managementâ module under `/console/models`
- New pages, tables, filters, actions, hooks (`useModelsData`) and dynamic vendor tabs
- Modals `EditModelModal.jsx` & unified `EditVendorModal.jsx`; latter now uses default confirm/cancel footer and mobile-friendly modal sizing (`full-width` / `small`) via `useIsMobile`
⢠Update sidebar (`SiderBar.js`) and routing (`App.js`) to surface the feature
⢠Add helper updates (`render.js`) incl. `stringToColor`, dynamic LobeHub icon retrieval, and tag color palettes
Table UX improvements
⢠Replace separate status column with inline Enable / Disable buttons in operation column (matching channel table style)
⢠Limit visible tags to max 3; overflow represented as â+xâ tag with padded `Popover` showing remaining tags
⢠Color all tags deterministically using `stringToColor` for consistent theming
⢠Change vendor column tag color to white for better contrast
Misc
⢠Minor layout tweaks, compact-mode toggle relocation, lint fixes and TypeScript/ESLint clean-up
These changes collectively deliver end-to-end model & vendor administration while unifying visual language across management tables.
2025-07-31 22:28:09 +08:00
|
|
|
<Modal
|
|
|
|
|
title={t('ćšéĺ é¤ć¨Ąĺ')}
|
|
|
|
|
visible={showDeleteModal}
|
|
|
|
|
onCancel={() => setShowDeleteModal(false)}
|
|
|
|
|
onOk={handleConfirmDelete}
|
2025-08-30 21:15:10 +08:00
|
|
|
type='warning'
|
đ feat: Introduce full Model & Vendor Management suite (backend + frontend) and UI refinements
Backend
⢠Add `model/model_meta.go` and `model/vendor_meta.go` defining Model & Vendor entities with CRUD helpers, soft-delete and time stamps
⢠Create corresponding controllers `controller/model_meta.go`, `controller/vendor_meta.go` and register routes in `router/api-router.go`
⢠Auto-migrate new tables in DB startup logic
Frontend
⢠Build complete âModel Managementâ module under `/console/models`
- New pages, tables, filters, actions, hooks (`useModelsData`) and dynamic vendor tabs
- Modals `EditModelModal.jsx` & unified `EditVendorModal.jsx`; latter now uses default confirm/cancel footer and mobile-friendly modal sizing (`full-width` / `small`) via `useIsMobile`
⢠Update sidebar (`SiderBar.js`) and routing (`App.js`) to surface the feature
⢠Add helper updates (`render.js`) incl. `stringToColor`, dynamic LobeHub icon retrieval, and tag color palettes
Table UX improvements
⢠Replace separate status column with inline Enable / Disable buttons in operation column (matching channel table style)
⢠Limit visible tags to max 3; overflow represented as â+xâ tag with padded `Popover` showing remaining tags
⢠Color all tags deterministically using `stringToColor` for consistent theming
⢠Change vendor column tag color to white for better contrast
Misc
⢠Minor layout tweaks, compact-mode toggle relocation, lint fixes and TypeScript/ESLint clean-up
These changes collectively deliver end-to-end model & vendor administration while unifying visual language across management tables.
2025-07-31 22:28:09 +08:00
|
|
|
>
|
|
|
|
|
<div>
|
2025-08-30 21:15:10 +08:00
|
|
|
{t('祎ĺŽčŚĺ é¤ćéç {{count}} 个樥ĺĺďź', {
|
|
|
|
|
count: selectedKeys.length,
|
|
|
|
|
})}
|
đ feat: Introduce full Model & Vendor Management suite (backend + frontend) and UI refinements
Backend
⢠Add `model/model_meta.go` and `model/vendor_meta.go` defining Model & Vendor entities with CRUD helpers, soft-delete and time stamps
⢠Create corresponding controllers `controller/model_meta.go`, `controller/vendor_meta.go` and register routes in `router/api-router.go`
⢠Auto-migrate new tables in DB startup logic
Frontend
⢠Build complete âModel Managementâ module under `/console/models`
- New pages, tables, filters, actions, hooks (`useModelsData`) and dynamic vendor tabs
- Modals `EditModelModal.jsx` & unified `EditVendorModal.jsx`; latter now uses default confirm/cancel footer and mobile-friendly modal sizing (`full-width` / `small`) via `useIsMobile`
⢠Update sidebar (`SiderBar.js`) and routing (`App.js`) to surface the feature
⢠Add helper updates (`render.js`) incl. `stringToColor`, dynamic LobeHub icon retrieval, and tag color palettes
Table UX improvements
⢠Replace separate status column with inline Enable / Disable buttons in operation column (matching channel table style)
⢠Limit visible tags to max 3; overflow represented as â+xâ tag with padded `Popover` showing remaining tags
⢠Color all tags deterministically using `stringToColor` for consistent theming
⢠Change vendor column tag color to white for better contrast
Misc
⢠Minor layout tweaks, compact-mode toggle relocation, lint fixes and TypeScript/ESLint clean-up
These changes collectively deliver end-to-end model & vendor administration while unifying visual language across management tables.
2025-07-31 22:28:09 +08:00
|
|
|
</div>
|
|
|
|
|
</Modal>
|
2025-08-03 22:51:24 +08:00
|
|
|
|
⨠feat(sync): multi-language sync wizard, backend locale support, and conflict modal UX improvements
Frontend (web)
- ModelsActions.jsx
- Replace âSync Officialâ with âSyncâ and open a new two-step SyncWizard.
- Pass selected locale through to preview, sync, and overwrite flows.
- Keep conflict resolution flow; inject locale into overwrite submission.
- New: models/modals/SyncWizardModal.jsx
- Two-step wizard: (1) method selection (config-sync disabled for now), (2) language selection (en/zh/ja).
- Horizontal, centered Radio cards; returns { option, locale } via onConfirm.
- UpstreamConflictModal.jsx
- Add search input (model fuzzy search) and native pagination.
- Column header checkbox now only applies to rows in the current filtered result.
- Fix âCannot access âfilteredDataSourceâ before initializationâ.
- Refactor with useMemo/useCallback; extract helpers to remove duplicated logic:
- getPresentRowsForField, getHeaderState, applyHeaderChange
- Minor code cleanups and stability improvements.
- i18n (en.json)
- Add strings for the sync wizard and related actions (Sync, Sync Wizard, Select method/source/language, etc.).
- Adjust minor translations.
Hooks
- useModelsData.jsx
- Extend previewUpstreamDiff, syncUpstream, applyUpstreamOverwrite to accept options with locale.
- Send locale via query/body accordingly.
Backend (Go)
- controller/model_sync.go
- Accept locale from query/body and resolve i18n upstream URLs.
- Add SYNC_UPSTREAM_BASE for upstream base override (default: https://basellm.github.io/llm-metadata).
- Make HTTP timeouts/retries/limits configurable:
- SYNC_HTTP_TIMEOUT_SECONDS, SYNC_HTTP_RETRY, SYNC_HTTP_MAX_MB
- Add ETag-based caching and support both envelope and pure array JSON formats.
- Concurrently fetch vendors and models; improve error responses with locale and source URLs.
- Include source meta (locale, models_url, vendors_url) in success payloads.
Notes
- No breaking changes expected.
- Lint passes for touched files.
2025-09-02 18:49:37 +08:00
|
|
|
<SyncWizardModal
|
|
|
|
|
visible={showSyncModal}
|
|
|
|
|
onClose={() => setShowSyncModal(false)}
|
|
|
|
|
loading={syncing || previewing}
|
|
|
|
|
t={t}
|
|
|
|
|
onConfirm={async ({ option, locale }) => {
|
|
|
|
|
setSyncLocale(locale);
|
|
|
|
|
if (option === 'official') {
|
|
|
|
|
await handleSyncUpstream(locale);
|
|
|
|
|
}
|
|
|
|
|
setShowSyncModal(false);
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
|
2025-08-03 22:51:24 +08:00
|
|
|
<MissingModelsModal
|
|
|
|
|
visible={showMissingModal}
|
|
|
|
|
onClose={() => setShowMissingModal(false)}
|
|
|
|
|
onConfigureModel={(name) => {
|
|
|
|
|
setEditingModel({ id: undefined, model_name: name });
|
|
|
|
|
setShowEdit(true);
|
|
|
|
|
setShowMissingModal(false);
|
|
|
|
|
}}
|
|
|
|
|
t={t}
|
|
|
|
|
/>
|
2025-08-04 02:54:37 +08:00
|
|
|
|
|
|
|
|
<PrefillGroupManagement
|
|
|
|
|
visible={showGroupManagement}
|
|
|
|
|
onClose={() => setShowGroupManagement(false)}
|
|
|
|
|
/>
|
2025-08-06 03:29:45 +08:00
|
|
|
|
|
|
|
|
<EditPrefillGroupModal
|
|
|
|
|
visible={showAddPrefill}
|
|
|
|
|
onClose={() => setShowAddPrefill(false)}
|
|
|
|
|
editingGroup={prefillInit}
|
|
|
|
|
onSuccess={() => setShowAddPrefill(false)}
|
|
|
|
|
/>
|
⨠feat(models-sync): official upstream sync with conflict resolution UI, optâout flag, and backend resiliency
Backend
- Add endpoints:
- GET /api/models/sync_upstream/preview â diff preview (filters out models with sync_official = 0)
- POST /api/models/sync_upstream â apply sync (create missing; optionally overwrite selected fields)
- Respect optâout: skip models with sync_official = 0 in both preview and apply
- Return detailed stats: created_models, created_vendors, updated_models, skipped_models, plus created_list / updated_list
- Add model.Model.SyncOfficial (default 1); autoâmigrated by GORM
- Make HTTP fetching robust:
- Shared http.Client (connection reuse) with 3x exponential backoff retry
- 10MB response cap; keep existing IPv4âfirst for *.github.io
- Vendor handling:
- New ensureVendorID helper (cache lookup â DB lookup â create), reduces roundâtrips
- Transactional overwrite to avoid partial updates
- Small cleanups and clearer helpers (containsField, coalesce, chooseStatus)
Frontend
- ModelsActions: add âSync officialâ button with Popover (pâ2) explaining community contribution; loading = syncing || previewing; preview â conflict modal â apply flow
- New UpstreamConflictModal:
- Perâfield columns (description/icon/tags/vendor/name_rule/status) with columnâlevel checkbox to select all
- Cell with Checkbox + Tag (âClick to view differencesâ) and Popover (pâ2) showing Local vs Official values
- Autoâhide columns with no conflicts; responsive width; use native Semi Modal footer
- Full i18n coverage
- useModelsData: add syncing/previewing states; new methods previewUpstreamDiff, applyUpstreamOverwrite, syncUpstream; refresh vendors/models after apply
- EditModelModal: add âParticipate in official syncâ switch; persisted as sync_official
- ModelsColumnDefs: add âParticipate in official syncâ column
i18n
- Add missing English keys for the new UI and messages; fix quoting issues
Refs
- Upstream metadata: https://github.com/basellm/llm-metadata
2025-09-02 02:04:22 +08:00
|
|
|
|
|
|
|
|
<UpstreamConflictModal
|
|
|
|
|
visible={showConflict}
|
|
|
|
|
onClose={() => setShowConflict(false)}
|
|
|
|
|
conflicts={conflicts}
|
|
|
|
|
onSubmit={async (payload) => {
|
⨠feat(sync): multi-language sync wizard, backend locale support, and conflict modal UX improvements
Frontend (web)
- ModelsActions.jsx
- Replace âSync Officialâ with âSyncâ and open a new two-step SyncWizard.
- Pass selected locale through to preview, sync, and overwrite flows.
- Keep conflict resolution flow; inject locale into overwrite submission.
- New: models/modals/SyncWizardModal.jsx
- Two-step wizard: (1) method selection (config-sync disabled for now), (2) language selection (en/zh/ja).
- Horizontal, centered Radio cards; returns { option, locale } via onConfirm.
- UpstreamConflictModal.jsx
- Add search input (model fuzzy search) and native pagination.
- Column header checkbox now only applies to rows in the current filtered result.
- Fix âCannot access âfilteredDataSourceâ before initializationâ.
- Refactor with useMemo/useCallback; extract helpers to remove duplicated logic:
- getPresentRowsForField, getHeaderState, applyHeaderChange
- Minor code cleanups and stability improvements.
- i18n (en.json)
- Add strings for the sync wizard and related actions (Sync, Sync Wizard, Select method/source/language, etc.).
- Adjust minor translations.
Hooks
- useModelsData.jsx
- Extend previewUpstreamDiff, syncUpstream, applyUpstreamOverwrite to accept options with locale.
- Send locale via query/body accordingly.
Backend (Go)
- controller/model_sync.go
- Accept locale from query/body and resolve i18n upstream URLs.
- Add SYNC_UPSTREAM_BASE for upstream base override (default: https://basellm.github.io/llm-metadata).
- Make HTTP timeouts/retries/limits configurable:
- SYNC_HTTP_TIMEOUT_SECONDS, SYNC_HTTP_RETRY, SYNC_HTTP_MAX_MB
- Add ETag-based caching and support both envelope and pure array JSON formats.
- Concurrently fetch vendors and models; improve error responses with locale and source URLs.
- Include source meta (locale, models_url, vendors_url) in success payloads.
Notes
- No breaking changes expected.
- Lint passes for touched files.
2025-09-02 18:49:37 +08:00
|
|
|
return await applyUpstreamOverwrite?.({
|
2025-09-02 19:07:17 +08:00
|
|
|
overwrite: payload,
|
⨠feat(sync): multi-language sync wizard, backend locale support, and conflict modal UX improvements
Frontend (web)
- ModelsActions.jsx
- Replace âSync Officialâ with âSyncâ and open a new two-step SyncWizard.
- Pass selected locale through to preview, sync, and overwrite flows.
- Keep conflict resolution flow; inject locale into overwrite submission.
- New: models/modals/SyncWizardModal.jsx
- Two-step wizard: (1) method selection (config-sync disabled for now), (2) language selection (en/zh/ja).
- Horizontal, centered Radio cards; returns { option, locale } via onConfirm.
- UpstreamConflictModal.jsx
- Add search input (model fuzzy search) and native pagination.
- Column header checkbox now only applies to rows in the current filtered result.
- Fix âCannot access âfilteredDataSourceâ before initializationâ.
- Refactor with useMemo/useCallback; extract helpers to remove duplicated logic:
- getPresentRowsForField, getHeaderState, applyHeaderChange
- Minor code cleanups and stability improvements.
- i18n (en.json)
- Add strings for the sync wizard and related actions (Sync, Sync Wizard, Select method/source/language, etc.).
- Adjust minor translations.
Hooks
- useModelsData.jsx
- Extend previewUpstreamDiff, syncUpstream, applyUpstreamOverwrite to accept options with locale.
- Send locale via query/body accordingly.
Backend (Go)
- controller/model_sync.go
- Accept locale from query/body and resolve i18n upstream URLs.
- Add SYNC_UPSTREAM_BASE for upstream base override (default: https://basellm.github.io/llm-metadata).
- Make HTTP timeouts/retries/limits configurable:
- SYNC_HTTP_TIMEOUT_SECONDS, SYNC_HTTP_RETRY, SYNC_HTTP_MAX_MB
- Add ETag-based caching and support both envelope and pure array JSON formats.
- Concurrently fetch vendors and models; improve error responses with locale and source URLs.
- Include source meta (locale, models_url, vendors_url) in success payloads.
Notes
- No breaking changes expected.
- Lint passes for touched files.
2025-09-02 18:49:37 +08:00
|
|
|
locale: syncLocale,
|
|
|
|
|
});
|
⨠feat(models-sync): official upstream sync with conflict resolution UI, optâout flag, and backend resiliency
Backend
- Add endpoints:
- GET /api/models/sync_upstream/preview â diff preview (filters out models with sync_official = 0)
- POST /api/models/sync_upstream â apply sync (create missing; optionally overwrite selected fields)
- Respect optâout: skip models with sync_official = 0 in both preview and apply
- Return detailed stats: created_models, created_vendors, updated_models, skipped_models, plus created_list / updated_list
- Add model.Model.SyncOfficial (default 1); autoâmigrated by GORM
- Make HTTP fetching robust:
- Shared http.Client (connection reuse) with 3x exponential backoff retry
- 10MB response cap; keep existing IPv4âfirst for *.github.io
- Vendor handling:
- New ensureVendorID helper (cache lookup â DB lookup â create), reduces roundâtrips
- Transactional overwrite to avoid partial updates
- Small cleanups and clearer helpers (containsField, coalesce, chooseStatus)
Frontend
- ModelsActions: add âSync officialâ button with Popover (pâ2) explaining community contribution; loading = syncing || previewing; preview â conflict modal â apply flow
- New UpstreamConflictModal:
- Perâfield columns (description/icon/tags/vendor/name_rule/status) with columnâlevel checkbox to select all
- Cell with Checkbox + Tag (âClick to view differencesâ) and Popover (pâ2) showing Local vs Official values
- Autoâhide columns with no conflicts; responsive width; use native Semi Modal footer
- Full i18n coverage
- useModelsData: add syncing/previewing states; new methods previewUpstreamDiff, applyUpstreamOverwrite, syncUpstream; refresh vendors/models after apply
- EditModelModal: add âParticipate in official syncâ switch; persisted as sync_official
- ModelsColumnDefs: add âParticipate in official syncâ column
i18n
- Add missing English keys for the new UI and messages; fix quoting issues
Refs
- Upstream metadata: https://github.com/basellm/llm-metadata
2025-09-02 02:04:22 +08:00
|
|
|
}}
|
|
|
|
|
t={t}
|
|
|
|
|
loading={syncing}
|
|
|
|
|
/>
|
đ feat: Introduce full Model & Vendor Management suite (backend + frontend) and UI refinements
Backend
⢠Add `model/model_meta.go` and `model/vendor_meta.go` defining Model & Vendor entities with CRUD helpers, soft-delete and time stamps
⢠Create corresponding controllers `controller/model_meta.go`, `controller/vendor_meta.go` and register routes in `router/api-router.go`
⢠Auto-migrate new tables in DB startup logic
Frontend
⢠Build complete âModel Managementâ module under `/console/models`
- New pages, tables, filters, actions, hooks (`useModelsData`) and dynamic vendor tabs
- Modals `EditModelModal.jsx` & unified `EditVendorModal.jsx`; latter now uses default confirm/cancel footer and mobile-friendly modal sizing (`full-width` / `small`) via `useIsMobile`
⢠Update sidebar (`SiderBar.js`) and routing (`App.js`) to surface the feature
⢠Add helper updates (`render.js`) incl. `stringToColor`, dynamic LobeHub icon retrieval, and tag color palettes
Table UX improvements
⢠Replace separate status column with inline Enable / Disable buttons in operation column (matching channel table style)
⢠Limit visible tags to max 3; overflow represented as â+xâ tag with padded `Popover` showing remaining tags
⢠Color all tags deterministically using `stringToColor` for consistent theming
⢠Change vendor column tag color to white for better contrast
Misc
⢠Minor layout tweaks, compact-mode toggle relocation, lint fixes and TypeScript/ESLint clean-up
These changes collectively deliver end-to-end model & vendor administration while unifying visual language across management tables.
2025-07-31 22:28:09 +08:00
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
2025-08-30 21:15:10 +08:00
|
|
|
export default ModelsActions;
|