-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: update DataTab.tsx for import, export settings, api key #1463
base: main
Are you sure you want to change the base?
Conversation
## API Key Import Fix We identified and fixed an issue with the API key import functionality in the DataTab component. The problem was that API keys were being stored in localStorage instead of cookies, and the key format was being incorrectly processed. ### Changes Made: 1. **Updated `handleImportAPIKeys` function**: - Changed to store API keys in cookies instead of localStorage - Modified to use provider names directly as keys (e.g., "OpenAI", "Google") - Added logic to skip comment fields (keys starting with "_") - Added page reload after successful import to apply changes immediately 2. **Updated `handleDownloadTemplate` function**: - Changed template format to use provider names as keys - Added explanatory comment in the template - Removed URL-related keys that weren't being used properly 3. **Fixed template format**: - Template now uses the correct format with provider names as keys - Added support for all available providers including Hyperbolic These changes ensure that when users download the template, fill it with their API keys, and import it back, the keys are properly stored in cookies with the correct format that the application expects.
@Stijnus dont know if I did something wrong, but its not working for me. Here is a sample import file (fake keys), but it should use it, what is not happening for me. |
@leex279 did you download the new template and used this for import? New template structure : { |
No, I used the old one, cause this was the inital requirement, to work with that :D I think it should be backwards comaptible and as far as I see just the comment is new, so you could ignore if not present, right? |
Can you test again please i have made it backwards compatible with the old template. |
Settings Export/Import Improvements We've completely redesigned the settings export and import functionality to ensure all application settings are properly backed up and restored: Key Improvements Comprehensive Export Format: Now captures ALL settings from both localStorage and cookies, organized into logical categories (core, providers, features, UI, connections, debug, updates) Robust Import System: Automatically detects format version and handles both new and legacy formats with detailed error handling Complete Settings Coverage: Properly exports and imports settings from ALL tabs including: Local provider configurations (Ollama, LMStudio, etc.) Cloud provider API keys (OpenAI, Anthropic, etc.) Feature toggles and preferences UI configurations and tab settings Connection settings (GitHub, Netlify) Debug configurations and logs Technical Details Added version tracking to export files for better compatibility Implemented fallback mechanisms if primary import methods fail Added detailed logging for troubleshooting import/export issues Created helper functions for safer data handling Maintained backward compatibility with older export formats Feature Settings: Feature flags and viewed features Developer mode settings Energy saver mode configurations User Preferences: User profile information Theme settings Tab configurations Connection Settings: Netlify connections Git authentication credentials Any other service connections Debug and System Settings: Debug flags and acknowledged issues Error logs and event logs Update settings and preferences
🔄 Enhanced Settings Export/Import SystemWe've completely redesigned the settings backup system to ensure a seamless experience: ✨ What's New
🛠️ Technical Improvements
Now you can easily transfer your complete setup between devices or create reliable backups! Enhanced Settings Reset FunctionalityThis update improves the "Reset Settings" functionality to ensure a complete reset to default values, similar to a fresh installation: Key Improvements:
The reset function now systematically clears all storage mechanisms used by the application while providing flexibility to preserve specific items if needed in the future. This ensures users get a truly fresh start when resetting their settings. |
I think you can revert all the changes in |
Yes i know, but when i tested my PR and it keeps failing that is why i did the code change... |
revert the code back as asked
@thecodacus i have made the changes as requested. |
API Key Import Fix
We identified and fixed an issue with the API key import functionality in the DataTab component. The problem was that API keys were being stored in localStorage instead of cookies, and the key format was being incorrectly processed.
Changes Made:
Updated
handleImportAPIKeys
function:Updated
handleDownloadTemplate
function:Fixed template format:
These changes ensure that when users download the template, fill it with their API keys, and import it back, the keys are properly stored in cookies with the correct format that the application expects.