mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-20 15:10:59 +08:00
* feat: Add app data path selection and relaunch functionality * Introduced new IPC channels for selecting and setting the app data path. * Implemented logic to initialize the app data path on startup. * Added confirmation modal for changing the app data directory in the settings. * Updated translations for new app data path features in multiple languages. * feat: Implement user data copying and app data path management * Added IPC channels for copying user data to a new location and setting the app data path. * Enhanced the user interface to support data copying with progress notifications. * Updated translations to reflect new features related to app data management. * Refactored file utility functions to streamline data path handling. * refactor: update IPC channel names and streamline app data path handling - Renamed IPC channels for selecting app data path and copying user data for clarity. - Simplified the logic for selecting and setting app data paths, removing unnecessary success/error handling. - Updated related functions and components to reflect the new IPC channel names and improved data handling. - Removed unused copyUserDataToNewLocation function to clean up the codebase. * fix: update app data directory selection text in multiple locales - Changed the text for selecting the app data directory from "Select Directory" to "Modify Directory" in English, Japanese, Russian, Simplified Chinese, and Traditional Chinese locales to better reflect the action being performed. * refactor: remove redundant success messages in DataSettings component - Eliminated unnecessary success messages related to app data copying and app relaunching to streamline user feedback and improve code clarity. * refactor: streamline file utility functions and update app data initialization - Moved `getDataPath` function to the `utils/index.ts` for better organization and accessibility. - Renamed `initUserDataDir` to `initAppDataDir` for clarity in its purpose. - Removed commented-out code in `ConfigManager` to enhance code cleanliness. * refactor: update import paths and localization strings for app data - Refactored import statements for `getDataPath` to streamline utility access. - Updated localization strings for app data in English, Japanese, Russian, Simplified Chinese, and Traditional Chinese to enhance clarity and consistency. * update i18n * add fc * fix: handle errors in app data path retrieval - Added error handling to the `getAppDataPathFromConfig` function to return null if the configuration file cannot be read or parsed, improving robustness. * refactor: simplify app data path handling in IPC - Removed error handling for setting the app data path in the IPC channel, streamlining the process by directly updating the configuration and user data path without try-catch blocks. * fix: update userData path handling for portable applications - Modified the initAppDataDir function to set the userData path based on the PORTABLE_EXECUTABLE_DIR environment variable, ensuring compatibility with portable application setups. * feat: enhance app data path migration with progress indication - Implemented a loading modal with progress tracking during the app data path migration process. - Added visual feedback using a progress bar to inform users of the copying status. - Improved error handling and user notifications for successful and failed migrations. - Refactored the modal confirmation logic to streamline user interactions during the path selection and migration process. * feat: add migration paths and update UI for data migration process - Introduced new translation keys for migration paths in Japanese, Russian, Simplified Chinese, and Traditional Chinese. - Enhanced the DataSettings component with a structured layout for displaying original and new paths during data migration. - Updated modal titles and content to improve user experience during the migration process. * feat: enhance data migration process with improved UI and progress tracking - Refactored the DataSettings component to streamline the data migration workflow. - Added a new function to display progress during the migration process, enhancing user feedback. - Updated modal logic to improve clarity and user experience when selecting new app data paths. - Implemented error handling and notifications for successful and failed migrations. * feat: add stop quit app functionality during data migration - Introduced a new IPC channel to manage the application's quit behavior during data transfer. - Updated the DataSettings component to prevent the app from quitting while migration is in progress, enhancing user experience. - Improved modal configurations for better responsiveness and visual appeal. * feat: enhance app data path handling and localization updates - Updated IPC handler to use 'filePath' for clarity in app data path management. - Improved validation to ensure the new app data path is not the root path, enhancing user feedback during path selection. - Added new translation keys for error messages related to app data path selection in English, Japanese, Russian, Simplified Chinese, and Traditional Chinese, improving localization support. * feat: add write permission check and enhance quit prevention during data migration - Introduced a new IPC channel to check write permissions for the app data path. - Updated the DataSettings component to validate write permissions before proceeding with data migration. - Enhanced the quit prevention logic to include a reason for blocking the app from quitting during data transfer. - Added new localization keys for error messages related to write permissions in multiple languages, improving user feedback. * feat: enhance confirmation modal in DataSettings component - Updated the confirmation modal to include danger styling for the OK button, improving visual feedback. - Added localized text for the OK and Cancel buttons, enhancing user experience through better accessibility. * feat: add localization keys and improve quit prevention during data migration - Added new localization keys for data migration, including titles and original path labels, enhancing user experience. - Updated the DataSettings component to ensure the app does not quit during data migration, improving reliability and user feedback. * feat(DataSettings): add data copying option and update related messages - Introduced a switch to allow users to choose whether to copy data from the original directory when changing the app data path. - Updated user notifications and progress messages to reflect the new functionality, including warnings about data copying. - Enhanced localization files for multiple languages to include new strings related to data copying options and notifications. * fix(DataSettings): set default for data copying option to true - Updated the DataSettings component to set the default state of the data copying option to true. - Added a new CopyDataContent component to enhance the user interface by displaying the data copying option alongside the existing path settings. - Improved layout by ensuring proper spacing and alignment for better user experience. --------- Co-authored-by: beyondkmp <beyondkmkp@gmail.com>
212 lines
7.2 KiB
TypeScript
212 lines
7.2 KiB
TypeScript
export enum IpcChannel {
|
|
App_GetCacheSize = 'app:get-cache-size',
|
|
App_ClearCache = 'app:clear-cache',
|
|
App_SetLaunchOnBoot = 'app:set-launch-on-boot',
|
|
App_SetLanguage = 'app:set-language',
|
|
App_ShowUpdateDialog = 'app:show-update-dialog',
|
|
App_CheckForUpdate = 'app:check-for-update',
|
|
App_Reload = 'app:reload',
|
|
App_Info = 'app:info',
|
|
App_Proxy = 'app:proxy',
|
|
App_SetLaunchToTray = 'app:set-launch-to-tray',
|
|
App_SetTray = 'app:set-tray',
|
|
App_SetTrayOnClose = 'app:set-tray-on-close',
|
|
App_SetTheme = 'app:set-theme',
|
|
App_SetAutoUpdate = 'app:set-auto-update',
|
|
App_SetFeedUrl = 'app:set-feed-url',
|
|
App_HandleZoomFactor = 'app:handle-zoom-factor',
|
|
App_Select = 'app:select',
|
|
App_HasWritePermission = 'app:has-write-permission',
|
|
App_Copy = 'app:copy',
|
|
App_SetStopQuitApp = 'app:set-stop-quit-app',
|
|
App_SetAppDataPath = 'app:set-app-data-path',
|
|
App_RelaunchApp = 'app:relaunch-app',
|
|
App_IsBinaryExist = 'app:is-binary-exist',
|
|
App_GetBinaryPath = 'app:get-binary-path',
|
|
App_InstallUvBinary = 'app:install-uv-binary',
|
|
App_InstallBunBinary = 'app:install-bun-binary',
|
|
|
|
App_QuoteToMain = 'app:quote-to-main',
|
|
|
|
Notification_Send = 'notification:send',
|
|
Notification_OnClick = 'notification:on-click',
|
|
|
|
Webview_SetOpenLinkExternal = 'webview:set-open-link-external',
|
|
|
|
// Open
|
|
Open_Path = 'open:path',
|
|
Open_Website = 'open:website',
|
|
|
|
Minapp = 'minapp',
|
|
|
|
Config_Set = 'config:set',
|
|
Config_Get = 'config:get',
|
|
|
|
MiniWindow_Show = 'miniwindow:show',
|
|
MiniWindow_Hide = 'miniwindow:hide',
|
|
MiniWindow_Close = 'miniwindow:close',
|
|
MiniWindow_Toggle = 'miniwindow:toggle',
|
|
MiniWindow_SetPin = 'miniwindow:set-pin',
|
|
|
|
// Mcp
|
|
Mcp_AddServer = 'mcp:add-server',
|
|
Mcp_RemoveServer = 'mcp:remove-server',
|
|
Mcp_RestartServer = 'mcp:restart-server',
|
|
Mcp_StopServer = 'mcp:stop-server',
|
|
Mcp_ListTools = 'mcp:list-tools',
|
|
Mcp_CallTool = 'mcp:call-tool',
|
|
Mcp_ListPrompts = 'mcp:list-prompts',
|
|
Mcp_GetPrompt = 'mcp:get-prompt',
|
|
Mcp_ListResources = 'mcp:list-resources',
|
|
Mcp_GetResource = 'mcp:get-resource',
|
|
Mcp_GetInstallInfo = 'mcp:get-install-info',
|
|
Mcp_ServersChanged = 'mcp:servers-changed',
|
|
Mcp_ServersUpdated = 'mcp:servers-updated',
|
|
Mcp_CheckConnectivity = 'mcp:check-connectivity',
|
|
|
|
//copilot
|
|
Copilot_GetAuthMessage = 'copilot:get-auth-message',
|
|
Copilot_GetCopilotToken = 'copilot:get-copilot-token',
|
|
Copilot_SaveCopilotToken = 'copilot:save-copilot-token',
|
|
Copilot_GetToken = 'copilot:get-token',
|
|
Copilot_Logout = 'copilot:logout',
|
|
Copilot_GetUser = 'copilot:get-user',
|
|
|
|
// obsidian
|
|
Obsidian_GetVaults = 'obsidian:get-vaults',
|
|
Obsidian_GetFiles = 'obsidian:get-files',
|
|
|
|
// nutstore
|
|
Nutstore_GetSsoUrl = 'nutstore:get-sso-url',
|
|
Nutstore_DecryptToken = 'nutstore:decrypt-token',
|
|
Nutstore_GetDirectoryContents = 'nutstore:get-directory-contents',
|
|
|
|
//aes
|
|
Aes_Encrypt = 'aes:encrypt',
|
|
Aes_Decrypt = 'aes:decrypt',
|
|
|
|
Gemini_UploadFile = 'gemini:upload-file',
|
|
Gemini_Base64File = 'gemini:base64-file',
|
|
Gemini_RetrieveFile = 'gemini:retrieve-file',
|
|
Gemini_ListFiles = 'gemini:list-files',
|
|
Gemini_DeleteFile = 'gemini:delete-file',
|
|
|
|
// VertexAI
|
|
VertexAI_GetAuthHeaders = 'vertexai:get-auth-headers',
|
|
VertexAI_ClearAuthCache = 'vertexai:clear-auth-cache',
|
|
|
|
Windows_ResetMinimumSize = 'window:reset-minimum-size',
|
|
Windows_SetMinimumSize = 'window:set-minimum-size',
|
|
|
|
KnowledgeBase_Create = 'knowledge-base:create',
|
|
KnowledgeBase_Reset = 'knowledge-base:reset',
|
|
KnowledgeBase_Delete = 'knowledge-base:delete',
|
|
KnowledgeBase_Add = 'knowledge-base:add',
|
|
KnowledgeBase_Remove = 'knowledge-base:remove',
|
|
KnowledgeBase_Search = 'knowledge-base:search',
|
|
KnowledgeBase_Rerank = 'knowledge-base:rerank',
|
|
|
|
//file
|
|
File_Open = 'file:open',
|
|
File_OpenPath = 'file:openPath',
|
|
File_Save = 'file:save',
|
|
File_Select = 'file:select',
|
|
File_Upload = 'file:upload',
|
|
File_Clear = 'file:clear',
|
|
File_Read = 'file:read',
|
|
File_Delete = 'file:delete',
|
|
File_Get = 'file:get',
|
|
File_SelectFolder = 'file:selectFolder',
|
|
File_Create = 'file:create',
|
|
File_Write = 'file:write',
|
|
File_WriteWithId = 'file:writeWithId',
|
|
File_SaveImage = 'file:saveImage',
|
|
File_Base64Image = 'file:base64Image',
|
|
File_SaveBase64Image = 'file:saveBase64Image',
|
|
File_Download = 'file:download',
|
|
File_Copy = 'file:copy',
|
|
File_BinaryImage = 'file:binaryImage',
|
|
File_Base64File = 'file:base64File',
|
|
File_GetPdfInfo = 'file:getPdfInfo',
|
|
Fs_Read = 'fs:read',
|
|
|
|
Export_Word = 'export:word',
|
|
|
|
Shortcuts_Update = 'shortcuts:update',
|
|
|
|
// backup
|
|
Backup_Backup = 'backup:backup',
|
|
Backup_Restore = 'backup:restore',
|
|
Backup_BackupToWebdav = 'backup:backupToWebdav',
|
|
Backup_RestoreFromWebdav = 'backup:restoreFromWebdav',
|
|
Backup_ListWebdavFiles = 'backup:listWebdavFiles',
|
|
Backup_CheckConnection = 'backup:checkConnection',
|
|
Backup_CreateDirectory = 'backup:createDirectory',
|
|
Backup_DeleteWebdavFile = 'backup:deleteWebdavFile',
|
|
|
|
// zip
|
|
Zip_Compress = 'zip:compress',
|
|
Zip_Decompress = 'zip:decompress',
|
|
|
|
// system
|
|
System_GetDeviceType = 'system:getDeviceType',
|
|
System_GetHostname = 'system:getHostname',
|
|
|
|
// DevTools
|
|
System_ToggleDevTools = 'system:toggleDevTools',
|
|
|
|
// events
|
|
BackupProgress = 'backup-progress',
|
|
ThemeUpdated = 'theme:updated',
|
|
UpdateDownloadedCancelled = 'update-downloaded-cancelled',
|
|
RestoreProgress = 'restore-progress',
|
|
UpdateError = 'update-error',
|
|
UpdateAvailable = 'update-available',
|
|
UpdateNotAvailable = 'update-not-available',
|
|
DownloadProgress = 'download-progress',
|
|
UpdateDownloaded = 'update-downloaded',
|
|
DownloadUpdate = 'download-update',
|
|
|
|
DirectoryProcessingPercent = 'directory-processing-percent',
|
|
|
|
FullscreenStatusChanged = 'fullscreen-status-changed',
|
|
|
|
HideMiniWindow = 'hide-mini-window',
|
|
ShowMiniWindow = 'show-mini-window',
|
|
|
|
ReduxStateChange = 'redux-state-change',
|
|
ReduxStoreReady = 'redux-store-ready',
|
|
|
|
// Search Window
|
|
SearchWindow_Open = 'search-window:open',
|
|
SearchWindow_Close = 'search-window:close',
|
|
SearchWindow_OpenUrl = 'search-window:open-url',
|
|
|
|
//Store Sync
|
|
StoreSync_Subscribe = 'store-sync:subscribe',
|
|
StoreSync_Unsubscribe = 'store-sync:unsubscribe',
|
|
StoreSync_OnUpdate = 'store-sync:on-update',
|
|
StoreSync_BroadcastSync = 'store-sync:broadcast-sync',
|
|
|
|
// Provider
|
|
Provider_AddKey = 'provider:add-key',
|
|
|
|
//Selection Assistant
|
|
Selection_TextSelected = 'selection:text-selected',
|
|
Selection_ToolbarHide = 'selection:toolbar-hide',
|
|
Selection_ToolbarVisibilityChange = 'selection:toolbar-visibility-change',
|
|
Selection_ToolbarDetermineSize = 'selection:toolbar-determine-size',
|
|
Selection_WriteToClipboard = 'selection:write-to-clipboard',
|
|
Selection_SetEnabled = 'selection:set-enabled',
|
|
Selection_SetTriggerMode = 'selection:set-trigger-mode',
|
|
Selection_SetFilterMode = 'selection:set-filter-mode',
|
|
Selection_SetFilterList = 'selection:set-filter-list',
|
|
Selection_SetFollowToolbar = 'selection:set-follow-toolbar',
|
|
Selection_SetRemeberWinSize = 'selection:set-remeber-win-size',
|
|
Selection_ActionWindowClose = 'selection:action-window-close',
|
|
Selection_ActionWindowMinimize = 'selection:action-window-minimize',
|
|
Selection_ActionWindowPin = 'selection:action-window-pin',
|
|
Selection_ProcessAction = 'selection:process-action',
|
|
Selection_UpdateActionData = 'selection:update-action-data'
|
|
}
|