Main README covers quick start, API overview, and links to example READMEs. Each example (paste, filemanager, can-sync, canfs) gets its own README with setup instructions, architecture, and configuration details. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
53 lines
1.7 KiB
Markdown
53 lines
1.7 KiB
Markdown
# File Manager
|
|
|
|
A web-based file browser for [CAN Service](../../) assets. Grid and list views, search, filters, and a detail modal with previews.
|
|
|
|
## Features
|
|
|
|
- **Grid and list views** -- toggle between thumbnail cards and a compact file list
|
|
- **Virtual folder tree** -- assets organized into `CAN/`, `APPLICATION/`, `DATES/`, `TAGS/`, and `TYPE/` folders
|
|
- **Search** -- filter by filename, description, or hash prefix
|
|
- **Filters** -- narrow by application, MIME type, tag, or date range
|
|
- **Detail modal** -- click any file to see full metadata, preview images, and download
|
|
|
|
## Running
|
|
|
|
Make sure CAN Service is running on port 3210 first:
|
|
|
|
```bash
|
|
# From the repo root
|
|
cargo run
|
|
```
|
|
|
|
Then start the File Manager:
|
|
|
|
```bash
|
|
cd examples/filemanager
|
|
cargo run
|
|
```
|
|
|
|
Opens automatically at [http://127.0.0.1:3212](http://127.0.0.1:3212).
|
|
|
|
## How It Works
|
|
|
|
The Rust backend serves a single-page app and proxies all data requests to CAN Service:
|
|
|
|
| File Manager Route | Proxies To | Purpose |
|
|
|--------------------|-----------|---------|
|
|
| `GET /` | -- | Serve the HTML/JS/CSS frontend |
|
|
| `GET /fm/list` | `GET /api/v1/can/0/list` | Paginated asset listing |
|
|
| `GET /fm/search` | `GET /api/v1/can/0/search` | Search with filters |
|
|
| `GET /fm/asset/{hash}` | `GET /api/v1/can/0/asset/{hash}` | Download/preview a file |
|
|
| `GET /fm/asset/{hash}/meta` | `GET /api/v1/can/0/asset/{hash}/meta` | Asset metadata |
|
|
| `GET /fm/thumb/{hash}` | `GET /api/v1/can/0/asset/{hash}/thumb/200/200` | Thumbnail |
|
|
|
|
The virtual folder tree is built entirely in the browser from the flat asset list -- no folder structure exists on disk.
|
|
|
|
## Project Structure
|
|
|
|
```
|
|
src/
|
|
main.rs HTTP server: proxy handlers and query forwarding
|
|
html.rs Single-page frontend (HTML + CSS + JS, embedded as a string)
|
|
```
|