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:
Jason
2026-02-05 21:42:54 +08:00
parent 227f08e910
commit 7b2cf66812
5 changed files with 116 additions and 2 deletions
+2 -2
View File
@@ -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;
}