mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-04 19:41:02 +08:00
feat: improve model/exchange deletion and selection logic
- Add soft delete support for AI models * Add deleted field to ai_models table * Implement soft delete with sensitive data cleanup * Filter deleted records in queries - Replace browser confirm dialogs with custom styled modals * Create DeleteConfirmModal component with Binance theme * Add proper warning messages and icons * Improve user experience with consistent styling - Fix duplicate model/exchange display in selection dropdowns * Use supportedModels/supportedExchanges for modal selectors * Use configuredModels/configuredExchanges for panel display * Remove redundant selectableModels/selectableExchanges logic - Enhance data management * Refresh data after deletion operations * Proper state cleanup after modal operations * Clear sensitive data during soft delete 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: tinkle-community <tinklefund@gmail.com>
This commit is contained in:
@@ -22,6 +22,7 @@ CREATE TABLE IF NOT EXISTS ai_models (
|
||||
api_key TEXT DEFAULT '',
|
||||
custom_api_url TEXT DEFAULT '',
|
||||
custom_model_name TEXT DEFAULT '',
|
||||
deleted BOOLEAN DEFAULT FALSE,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
|
||||
@@ -167,6 +168,9 @@ INSERT INTO system_config (key, value) VALUES
|
||||
('jwt_secret', '')
|
||||
ON CONFLICT (key) DO NOTHING;
|
||||
|
||||
-- 数据库迁移:添加 deleted 字段到现有 ai_models 表
|
||||
ALTER TABLE ai_models ADD COLUMN IF NOT EXISTS deleted BOOLEAN DEFAULT FALSE;
|
||||
|
||||
-- 创建索引
|
||||
CREATE INDEX IF NOT EXISTS idx_ai_models_user_id ON ai_models(user_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_exchanges_user_id ON exchanges(user_id);
|
||||
|
||||
Reference in New Issue
Block a user