Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
-- Step 1: 创建枚举类型(幂等)
DO $$ BEGIN
CREATE TYPE "public"."notification_type" AS ENUM('circuit_breaker', 'daily_leaderboard', 'cost_alert');
CREATE TYPE "public"."notification_type" AS ENUM('circuit_breaker', 'daily_leaderboard', 'cost_alert');
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint

WHEN duplicate_object THEN NULL;
END $$;--> statement-breakpoint
DO $$ BEGIN
CREATE TYPE "public"."webhook_provider_type" AS ENUM('wechat', 'feishu', 'dingtalk', 'telegram', 'custom');
CREATE TYPE "public"."webhook_provider_type" AS ENUM('wechat', 'feishu', 'dingtalk', 'telegram', 'custom');
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint

-- Step 2: 创建表(幂等)
WHEN duplicate_object THEN NULL;
END $$;--> statement-breakpoint
CREATE TABLE IF NOT EXISTS "notification_target_bindings" (
"id" serial PRIMARY KEY NOT NULL,
"notification_type" "notification_type" NOT NULL,
Expand Down Expand Up @@ -44,19 +38,16 @@ CREATE TABLE IF NOT EXISTS "webhook_targets" (
"updated_at" timestamp with time zone DEFAULT now()
);
--> statement-breakpoint

-- Step 3: 兼容旧配置(幂等)
ALTER TABLE "notification_settings" ADD COLUMN IF NOT EXISTS "use_legacy_mode" boolean DEFAULT true NOT NULL;--> statement-breakpoint

-- Step 4: 外键约束(幂等)
DO $$ BEGIN
ALTER TABLE "notification_target_bindings" ADD CONSTRAINT "notification_target_bindings_target_id_webhook_targets_id_fk" FOREIGN KEY ("target_id") REFERENCES "public"."webhook_targets"("id") ON DELETE cascade ON UPDATE no action;
ALTER TABLE "notification_settings" ADD COLUMN "use_legacy_mode" boolean DEFAULT false NOT NULL;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint

-- Step 5: 索引(幂等)
WHEN duplicate_column THEN NULL;
END $$;--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "notification_target_bindings" ADD CONSTRAINT "notification_target_bindings_target_id_webhook_targets_id_fk" FOREIGN KEY ("target_id") REFERENCES "public"."webhook_targets"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN NULL;
END $$;--> statement-breakpoint
CREATE UNIQUE INDEX IF NOT EXISTS "unique_notification_target_binding" ON "notification_target_bindings" USING btree ("notification_type","target_id");--> statement-breakpoint
CREATE INDEX IF NOT EXISTS "idx_notification_bindings_type" ON "notification_target_bindings" USING btree ("notification_type","is_enabled");--> statement-breakpoint
CREATE INDEX IF NOT EXISTS "idx_notification_bindings_target" ON "notification_target_bindings" USING btree ("target_id","is_enabled");--> statement-breakpoint
CREATE INDEX IF NOT EXISTS "idx_notification_bindings_target" ON "notification_target_bindings" USING btree ("target_id","is_enabled");
4 changes: 2 additions & 2 deletions drizzle/meta/0043_snapshot.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "1f7c9b64-5c00-4a95-993c-802a3be11622",
"id": "ecc7b05c-cbc9-482c-8c1f-30965c519670",
"prevId": "21302171-827d-483a-aa6c-1e9c4084bebc",
"version": "7",
"dialect": "postgresql",
Expand Down Expand Up @@ -871,7 +871,7 @@
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
"default": false
},
"circuit_breaker_enabled": {
"name": "circuit_breaker_enabled",
Expand Down
4 changes: 2 additions & 2 deletions drizzle/meta/_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@
{
"idx": 43,
"version": "7",
"when": 1767349351775,
"tag": "0043_lonely_rick_jones",
"when": 1767362174718,
"tag": "0043_faithful_mother_askani",
"breakpoints": true
}
]
Expand Down
64 changes: 39 additions & 25 deletions messages/en/dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -1305,31 +1305,6 @@
"creating": "Creating...",
"create": "Create"
},
"onboarding": {
"skip": "Skip",
"next": "Next",
"prev": "Previous",
"finish": "Start Creating",
"stepIndicator": "Step {current} of {total}",
"steps": {
"welcome": {
"title": "Users & Keys",
"description": "Users are the main entities for API access. Each user can have multiple API Keys. User-level limits affect all keys, while key-level limits provide finer control."
},
"limits": {
"title": "Limit Management",
"description": "Six types of limits are supported: 5-hour, daily, weekly, monthly, total, and concurrent sessions. Add limit rules as needed to flexibly control usage."
},
"groups": {
"title": "Provider Groups",
"description": "Use the group feature to restrict users to specific providers. Key-level groups take priority over user-level groups."
},
"keyFeatures": {
"title": "Key Features",
"description": "Each key can be independently configured with Cache TTL override, Web UI login permission, and other advanced features."
}
}
},
"limitRules": {
"addRule": "Add limit rule",
"ruleTypes": {
Expand Down Expand Up @@ -1575,5 +1550,44 @@
"overwriteHint": "This type already exists, saving will overwrite the existing value"
}
}
},
"webhookMigration": {
"title": "Webhook System Upgrade",
"description": "We have launched a new Webhook notification system with multi-target delivery, independent configuration, and improved reliability.",
"step1": {
"title": "Legacy Webhook Configuration Detected",
"description": "The system detected that you are using legacy Webhook configuration. The new system offers more powerful features, and we recommend migrating."
},
"step2": {
"title": "Select Platform Type",
"description": "The following Webhook URLs could not be automatically identified. Please select the platform manually:"
},
"platformOptions": {
"wechat": "WeChat Work",
"feishu": "Feishu",
"dingtalk": "DingTalk",
"telegram": "Telegram",
"custom": "Custom"
},
"migrateButton": "Start Migration",
"skipButton": "Maybe Later",
"nextButton": "Next",
"goToSettingsButton": "Go to Settings",
"migrating": "Migrating...",
"success": "Migration Complete",
"successDescription": "Your Webhook configuration has been successfully migrated to the new system.",
"error": "Migration Failed",
"errorGeneric": "Migration failed. Please try again later.",
"detectedWebhooks": "Detected Webhooks",
"notificationTypes": {
"circuit_breaker": "Circuit Breaker Alert",
"daily_leaderboard": "Daily Leaderboard",
"cost_alert": "Cost Alert"
},
"urlLabel": "Webhook URL",
"platformLabel": "Platform Type",
"autoDetected": "Auto-detected",
"selectPlatform": "Select platform",
"successStats": "Created {targets} targets, {bindings} bindings"
}
}
64 changes: 39 additions & 25 deletions messages/ja/dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -1267,31 +1267,6 @@
"creating": "作成中...",
"create": "作成"
},
"onboarding": {
"skip": "スキップ",
"next": "次へ",
"prev": "前へ",
"finish": "作成を開始",
"stepIndicator": "ステップ {current} / {total}",
"steps": {
"welcome": {
"title": "ユーザーとキー",
"description": "ユーザーは API アクセスの主体です。各ユーザーは複数の API キーを持つことができます。ユーザーレベルの上限はすべてのキーに影響し、キーレベルの上限でより細かく制御できます。"
},
"limits": {
"title": "上限管理",
"description": "6 種類の上限をサポート:5 時間、日次、週次、月次、総上限、同時セッション。上限ルールを必要に応じて追加し、柔軟に使用量を制御できます。"
},
"groups": {
"title": "プロバイダーグループ",
"description": "グループ機能を使用して、ユーザーが特定のプロバイダーのみを使用するよう制限できます。キーレベルのグループはユーザーレベルのグループより優先されます。"
},
"keyFeatures": {
"title": "キーの特殊機能",
"description": "各キーは、キャッシュ TTL の上書き、Web UI へのログイン許可など、高度な機能を個別に設定できます。"
}
}
},
"limitRules": {
"addRule": "上限ルールを追加",
"ruleTypes": {
Expand Down Expand Up @@ -1535,5 +1510,44 @@
"overwriteHint": "このタイプは既に存在します。保存すると既存の値が上書きされます"
}
}
},
"webhookMigration": {
"title": "Webhook システムアップグレード",
"description": "新しい Webhook 通知システムをリリースしました。マルチターゲット配信、個別設定、信頼性の向上をサポートしています。",
"step1": {
"title": "レガシー Webhook 設定を検出",
"description": "システムはレガシー Webhook 設定を検出しました。新システムはより強力な機能を提供しており、移行をお勧めします。"
},
"step2": {
"title": "プラットフォームタイプを選択",
"description": "以下の Webhook URL は自動的に識別できませんでした。手動でプラットフォームを選択してください:"
},
"platformOptions": {
"wechat": "WeCom",
"feishu": "Feishu",
"dingtalk": "DingTalk",
"telegram": "Telegram",
"custom": "カスタム"
},
"migrateButton": "移行を開始",
"skipButton": "後で",
"nextButton": "次へ",
"goToSettingsButton": "設定へ移動",
"migrating": "移行中...",
"success": "移行完了",
"successDescription": "Webhook 設定が新システムに正常に移行されました。",
"error": "移行失敗",
"errorGeneric": "移行に失敗しました。しばらくしてからもう一度お試しください。",
"detectedWebhooks": "検出された Webhook",
"notificationTypes": {
"circuit_breaker": "サーキットブレーカーアラート",
"daily_leaderboard": "デイリーリーダーボード",
"cost_alert": "コストアラート"
},
"urlLabel": "Webhook URL",
"platformLabel": "プラットフォームタイプ",
"autoDetected": "自動検出",
"selectPlatform": "プラットフォームを選択",
"successStats": "{targets} 個のターゲット、{bindings} 個のバインディングを作成しました"
}
}
6 changes: 3 additions & 3 deletions messages/ja/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -484,9 +484,9 @@
"enable": "コストアラートを有効にする",
"webhook": "Webhook URL",
"webhookPlaceholder": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=...",
"webhookTypeWeCom": "企業微信",
"webhookTypeFeishu": "飛書",
"webhookTypeUnknown": "不明なプラットフォーム。企業微信または飛書のWebhook URLを使用してください",
"webhookTypeWeCom": "WeCom",
"webhookTypeFeishu": "Feishu",
"webhookTypeUnknown": "Unknown platform. Please use a WeCom or Feishu Webhook URL",
"threshold": "アラートしきい値",
"thresholdLabel": "アラートしきい値: {percent}%",
"thresholdHelp": "消費がクォータの{percent}%に達した時にアラート",
Expand Down
64 changes: 39 additions & 25 deletions messages/ru/dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -1278,31 +1278,6 @@
"creating": "Создание...",
"create": "Создать"
},
"onboarding": {
"skip": "Пропустить",
"next": "Далее",
"prev": "Назад",
"finish": "Начать создание",
"stepIndicator": "Шаг {current} из {total}",
"steps": {
"welcome": {
"title": "Пользователи и ключи",
"description": "Пользователи - основные субъекты для доступа к API. Каждый пользователь может иметь несколько API ключей. Лимиты на уровне пользователя влияют на все ключи, а лимиты на уровне ключа обеспечивают более точный контроль использования."
},
"limits": {
"title": "Управление лимитами",
"description": "Поддерживается 6 типов лимитов: за 5 часов, ежедневный, еженедельный, ежемесячный, общий и одновременные сессии. Добавляйте правила лимитов по необходимости для гибкого контроля использования."
},
"groups": {
"title": "Группы провайдеров",
"description": "Используйте функцию групп для ограничения пользователей определенными провайдерами. Группы на уровне ключа имеют приоритет над группами на уровне пользователя."
},
"keyFeatures": {
"title": "Функции ключей",
"description": "Каждый ключ можно настроить индивидуально: переопределение TTL кэша, разрешение входа в Web UI и другие расширенные функции."
}
}
},
"limitRules": {
"addRule": "Добавить правило лимита",
"ruleTypes": {
Expand Down Expand Up @@ -1547,5 +1522,44 @@
"overwriteHint": "Этот тип уже существует, сохранение перезапишет существующее значение"
}
}
},
"webhookMigration": {
"title": "Обновление системы Webhook",
"description": "Мы запустили новую систему уведомлений Webhook с поддержкой многоцелевой доставки, независимой настройки и улучшенной надежности.",
"step1": {
"title": "Обнаружена устаревшая конфигурация Webhook",
"description": "Система обнаружила, что вы используете устаревшую конфигурацию Webhook. Новая система предлагает более мощные функции, рекомендуем выполнить миграцию."
},
"step2": {
"title": "Выберите тип платформы",
"description": "Следующие URL-адреса Webhook не удалось автоматически идентифицировать. Пожалуйста, выберите платформу вручную:"
},
"platformOptions": {
"wechat": "WeChat Work",
"feishu": "Feishu",
"dingtalk": "DingTalk",
"telegram": "Telegram",
"custom": "Пользовательский"
},
"migrateButton": "Начать миграцию",
"skipButton": "Позже",
"nextButton": "Далее",
"goToSettingsButton": "Перейти к настройкам",
"migrating": "Миграция...",
"success": "Миграция завершена",
"successDescription": "Ваша конфигурация Webhook успешно перенесена в новую систему.",
"error": "Ошибка миграции",
"errorGeneric": "Не удалось выполнить миграцию. Пожалуйста, попробуйте позже.",
"detectedWebhooks": "Обнаруженные Webhook",
"notificationTypes": {
"circuit_breaker": "Оповещение о размыкателе цепи",
"daily_leaderboard": "Ежедневный рейтинг",
"cost_alert": "Оповещение о стоимости"
},
"urlLabel": "URL Webhook",
"platformLabel": "Тип платформы",
"autoDetected": "Автоматически определено",
"selectPlatform": "Выберите платформу",
"successStats": "Создано {targets} целей, {bindings} привязок"
}
}
Loading
Loading