mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-08-02 10:21:16 +08:00
feat(openclaw): add providerKey input field with validation
- Add providerKey input field in ProviderForm for OpenClaw - Implement duplicate key detection by querying existing providers - Add format validation (lowercase letters, numbers, hyphens only) - Disable field in edit mode (key cannot be changed after creation) - Update mutations.ts to support OpenClaw providerKey - Add i18n translations for zh/en/ja
This commit is contained in:
@@ -16,12 +16,12 @@ export const useAddProviderMutation = (appId: AppId) => {
|
||||
) => {
|
||||
let id: string;
|
||||
|
||||
if (appId === "opencode") {
|
||||
if (appId === "opencode" || appId === "openclaw") {
|
||||
if (providerInput.category === "omo") {
|
||||
id = `omo-${generateUUID()}`;
|
||||
} else {
|
||||
if (!providerInput.providerKey) {
|
||||
throw new Error("Provider key is required for OpenCode");
|
||||
throw new Error(`Provider key is required for ${appId}`);
|
||||
}
|
||||
id = providerInput.providerKey;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user