forked from boos/BoosAPI
feat: 将模型禁用功能从站点管理移至连接管理
- 在连接管理页面为每个账号添加独立的模型管理弹窗 - 弹窗内支持查看可用模型,进行「刷新模型」「全选」「全部禁用」「反选」等快捷操作 - 保存模型禁用配置后,系统会自动在后台触发并重建路由(rebuildRoutes),确保配置立即生效 - 从原站点编辑界面移除过时的禁用功能板块 - 修复因执行自动同步逻辑导致的 SQLite Drizzle Migration `duplicate column token_group` 报错,更新 bootstrap markers 及测试用例
This commit is contained in:
@@ -26,7 +26,7 @@ type MigrationRecord = {
|
||||
hash: string;
|
||||
};
|
||||
|
||||
const VERIFIED_BOOTSTRAP_TAG = '0004_sorting_preferences';
|
||||
const VERIFIED_BOOTSTRAP_TAG = '0007_account_token_group';
|
||||
const VERIFIED_SCHEMA_MARKERS: SchemaMarker[] = [
|
||||
{ table: 'sites' },
|
||||
{ table: 'settings' },
|
||||
@@ -43,8 +43,13 @@ const VERIFIED_SCHEMA_MARKERS: SchemaMarker[] = [
|
||||
{ table: 'sites', column: 'sort_order' },
|
||||
{ table: 'accounts', column: 'is_pinned' },
|
||||
{ table: 'accounts', column: 'sort_order' },
|
||||
// 0006: site_disabled_models table
|
||||
{ table: 'site_disabled_models' },
|
||||
// 0007: token_group column on account_tokens
|
||||
{ table: 'account_tokens', column: 'token_group' },
|
||||
];
|
||||
|
||||
|
||||
function resolveSqliteDbPath(): string {
|
||||
const raw = (config.dbUrl || '').trim();
|
||||
if (!raw) return resolve(`${config.dataDir}/hub.db`);
|
||||
|
||||
@@ -21,6 +21,16 @@ export const sites = sqliteTable('sites', {
|
||||
statusIdx: index('sites_status_idx').on(table.status),
|
||||
}));
|
||||
|
||||
export const siteDisabledModels = sqliteTable('site_disabled_models', {
|
||||
id: integer('id').primaryKey({ autoIncrement: true }),
|
||||
siteId: integer('site_id').notNull().references(() => sites.id, { onDelete: 'cascade' }),
|
||||
modelName: text('model_name').notNull(),
|
||||
createdAt: text('created_at').default(sql`(datetime('now'))`),
|
||||
}, (table) => ({
|
||||
siteModelUnique: uniqueIndex('site_disabled_models_site_model_unique').on(table.siteId, table.modelName),
|
||||
siteIdIdx: index('site_disabled_models_site_id_idx').on(table.siteId),
|
||||
}));
|
||||
|
||||
export const accounts = sqliteTable('accounts', {
|
||||
id: integer('id').primaryKey({ autoIncrement: true }),
|
||||
siteId: integer('site_id').notNull().references(() => sites.id, { onDelete: 'cascade' }),
|
||||
|
||||
Reference in New Issue
Block a user