mirror of
https://github.com/getnora-io/nora.git
synced 2026-04-13 01:30:32 +00:00
docs: add Go module proxy support to README (#62)
* docs: add Go module proxy to README, update dashboard GIF - Add Go Modules to supported registries table - Add Go usage example (GOPROXY) - Add Go config.toml example - Add /go/ endpoint to endpoints table - Update dashboard GIF with 6 registry cards in one row - Fix registries count: 6 package registries * feat(ui): add Raw storage to dashboard, sidebar, and list pages - Raw Storage card on dashboard with file count and size - Raw in sidebar navigation with file icon - Raw list and detail pages (/ui/raw) - Raw mount point in mount points table - Grid updated to 7 columns for all registry cards - README: 7 registries, add Go module proxy docs * docs: add product badges (release, image size, downloads)
This commit is contained in:
@@ -89,6 +89,8 @@ pub fn routes() -> Router<Arc<AppState>> {
|
||||
.route("/ui/pypi/{name}", get(pypi_detail))
|
||||
.route("/ui/go", get(go_list))
|
||||
.route("/ui/go/{*name}", get(go_detail))
|
||||
.route("/ui/raw", get(raw_list))
|
||||
.route("/ui/raw/{*name}", get(raw_detail))
|
||||
// API endpoints for HTMX
|
||||
.route("/api/ui/stats", get(api_stats))
|
||||
.route("/api/ui/dashboard", get(api_dashboard))
|
||||
@@ -338,3 +340,41 @@ async fn go_detail(
|
||||
let detail = get_go_detail(&state.storage, &name).await;
|
||||
Html(render_package_detail("go", &name, &detail, lang))
|
||||
}
|
||||
|
||||
// Raw pages
|
||||
async fn raw_list(
|
||||
State(state): State<Arc<AppState>>,
|
||||
Query(query): Query<ListQuery>,
|
||||
headers: axum::http::HeaderMap,
|
||||
) -> impl IntoResponse {
|
||||
let lang = extract_lang_from_list(&query, headers.get("cookie").and_then(|v| v.to_str().ok()));
|
||||
let page = query.page.unwrap_or(1).max(1);
|
||||
let limit = query.limit.unwrap_or(DEFAULT_PAGE_SIZE).min(100);
|
||||
|
||||
let all_files = state.repo_index.get("raw", &state.storage).await;
|
||||
let (files, total) = paginate(&all_files, page, limit);
|
||||
|
||||
Html(render_registry_list_paginated(
|
||||
"raw",
|
||||
"Raw Storage",
|
||||
&files,
|
||||
page,
|
||||
limit,
|
||||
total,
|
||||
lang,
|
||||
))
|
||||
}
|
||||
|
||||
async fn raw_detail(
|
||||
State(state): State<Arc<AppState>>,
|
||||
Path(name): Path<String>,
|
||||
Query(query): Query<LangQuery>,
|
||||
headers: axum::http::HeaderMap,
|
||||
) -> impl IntoResponse {
|
||||
let lang = extract_lang(
|
||||
&Query(query),
|
||||
headers.get("cookie").and_then(|v| v.to_str().ok()),
|
||||
);
|
||||
let detail = get_raw_detail(&state.storage, &name).await;
|
||||
Html(render_package_detail("raw", &name, &detail, lang))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user