Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 24, 2025

This PR adds a manual mirror feature that allows users to input any URL and mirror it to their selected servers, bypassing the hash requirement for URLs that don't contain SHA256 hashes in the filename.

Changes Made

Frontend

  • New ManualMirror component (ui_src/src/components/manual-mirror.tsx): Complete React component with:

    • URL input field with validation
    • Checkbox interface for server selection
    • Progress indication during mirroring
    • Results display with success/error feedback and SHA256 hashes
    • Proper authentication handling (only shown to logged-in users)
  • Upload page integration (ui_src/src/views/upload.tsx): Added ManualMirror component to the upload page

Key Features

  • URL Validation: Accepts any valid URL using native URL() constructor
  • Server Selection: Multi-select interface to choose target servers for mirroring
  • Real-time Feedback: Shows mirroring progress and displays results with success/error states
  • Hash Display: Shows SHA256 hash for successfully mirrored files
  • Error Handling: Graceful error handling with user-friendly messages

Backend Compatibility

The existing /mirror endpoint already handles URLs without hashes correctly:

  • Attempts to extract hash from URL path but continues if none found
  • Passes None as the expected hash to process_stream for validation bypass
  • No backend changes required

Example Usage

Users can now mirror files like:

https://www.tyt888.com/uploads/file/20250603/20250603154349_1259.zip

The component validates the URL, allows selection of target servers, and displays the mirroring results with proper error handling.

Testing

  • ✅ TypeScript compilation successful
  • ✅ UI build successful
  • ✅ ESLint validation passed
  • ✅ URL validation tested with provided example
  • ✅ Component properly integrated and styled

Fixes #37.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI changed the title [WIP] Manual Mirror Add manual mirror functionality to UI for mirroring arbitrary URLs Jun 24, 2025
@Copilot Copilot AI requested a review from v0l June 24, 2025 13:46
Copilot finished work on behalf of v0l June 24, 2025 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Manual Mirror

2 participants