Skip to content

Conversation

@xrgzs
Copy link
Member

@xrgzs xrgzs commented Jan 1, 2026

Description / 描述

增加存储配置导入导出功能

Motivation and Context / 背景

方便迁移、克隆存储以及BUG反馈

Close: OpenListTeam/OpenList#1909

How Has This Been Tested? / 测试

image
image 1 image 2
  • 导入自动删除 iddisabledmodifiedstatus 字段,避免导入失败

  • 修复了驱动选择的 Item 组件不支持响应式更改值的问题

  • 让用户自行复制粘贴 textarea 里面的 JSON,避免部分浏览器不支持操作剪贴板

Checklist / 检查清单

  • I have read the CONTRIBUTING document.
    我已阅读 CONTRIBUTING 文档。
  • I have formatted my code with go fmt or prettier.
    我已使用 go fmtprettier 格式化提交的代码。
  • I have added appropriate labels to this PR (or mentioned needed labels in the description if lacking permissions).
    我已为此 PR 添加了适当的标签(如无权限或需要的标签不存在,请在描述中说明,管理员将后续处理)。
  • I have requested review from relevant code authors using the "Request review" feature when applicable.
    我已在适当情况下使用"Request review"功能请求相关代码作者进行审查。
  • I have updated the repository accordingly (If it’s needed).
    我已相应更新了相关仓库(若适用)。

@xrgzs xrgzs added the enhancement New feature or request label Jan 1, 2026
@xrgzs xrgzs requested a review from Copilot January 1, 2026 08:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds export and import functionality for storage configurations in the AddOrEdit page, making it easier to migrate, clone storage configurations, and report bugs. The implementation includes three main changes: UI buttons with modal dialogs for import/export, support for reactive values in form components, and English translations for the new features.

Key Changes

  • Added Export and Import buttons with modal dialogs that allow users to copy/paste JSON configuration
  • Modified the Item component to support both direct values and reactive Accessor functions, fixing an issue where the driver selection component didn't support reactive value changes
  • Import automatically strips server-managed fields (id, disabled, modified, status) to prevent import failures

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/pages/manage/storages/AddOrEdit.tsx Added export/import buttons with ModalInput dialogs, restructured button layout into HStack, and implemented JSON serialization logic for storage configurations
src/pages/manage/storages/Item.tsx Enhanced type definitions to accept both direct values and Accessor functions, added getVal helper function, and changed Switch component from defaultChecked to checked for proper reactivity
src/lang/en/storages.json Added English translations for export, import buttons and modal titles

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

xrgzs added 8 commits January 1, 2026 23:33
Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>
Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>
Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>
Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>
Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>
Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>
Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>
Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>
@xrgzs xrgzs force-pushed the feat/storages-im-export branch from abee9a1 to 5ecfc18 Compare January 1, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] 希望在“存储”设置中,添加复制(并同时修改的)功能。

1 participant