Add QR codes, link expiry, password protection, previews, audit trail and bulk operations

This commit is contained in:
thakares committed 2026-06-12 19:57:53 +05:30
1 parent 157aa81252
commit bcbcc90d98
88 files changed
+5354 -815

No files matched your search

+6 -2
View File
@@ -1,7 +1,7 @@
use askama::Template;
use axum::{
response::{IntoResponse, Response, Html},
http::StatusCode,
response::{Html, IntoResponse, Response},
};
#[derive(Template)]
@@ -23,7 +23,11 @@ impl IntoResponse for DashboardTemplate {
fn into_response(self) -> Response {
match self.render() {
Ok(html) => Html(html).into_response(),
Err(e) => (StatusCode::INTERNAL_SERVER_ERROR, format!("Render error: {}", e)).into_response(),
Err(e) => (
StatusCode::INTERNAL_SERVER_ERROR,
format!("Render error: {}", e),
)
.into_response(),
}
}
}
+54 -6
View File
@@ -1,19 +1,19 @@
pub mod dashboard;
pub mod urls;
pub mod pages;
pub mod stats;
pub mod settings;
pub mod stats;
pub mod urls;
pub use dashboard::DashboardTemplate;
pub use urls::UrlsTemplate;
pub use pages::PagesTemplate;
pub use stats::{StatusTemplate, AuditTemplate};
pub use settings::SettingsTemplate;
pub use stats::{AuditTemplate, StatusTemplate};
pub use urls::UrlsTemplate;
use askama::Template;
use axum::{
response::{IntoResponse, Response, Html},
http::StatusCode,
response::{Html, IntoResponse, Response},
};
#[derive(Template)]
@@ -27,7 +27,55 @@ impl IntoResponse for LoginTemplate {
fn into_response(self) -> Response {
match self.render() {
Ok(html) => Html(html).into_response(),
Err(e) => (StatusCode::INTERNAL_SERVER_ERROR, format!("Render error: {}", e)).into_response(),
Err(e) => (
StatusCode::INTERNAL_SERVER_ERROR,
format!("Render error: {}", e),
)
.into_response(),
}
}
}
#[derive(Template)]
#[template(path = "gate.html")]
pub struct GateTemplate {
pub code: String,
pub error: Option<String>,
}
impl IntoResponse for GateTemplate {
fn into_response(self) -> Response {
match self.render() {
Ok(html) => Html(html).into_response(),
Err(e) => (
StatusCode::INTERNAL_SERVER_ERROR,
format!("Render error: {}", e),
)
.into_response(),
}
}
}
#[derive(Template)]
#[template(path = "preview.html")]
pub struct PreviewTemplate {
pub code: String,
pub title: Option<String>,
pub description: Option<String>,
pub logo_url: Option<String>,
pub button_text: String,
pub destination: String,
}
impl IntoResponse for PreviewTemplate {
fn into_response(self) -> Response {
match self.render() {
Ok(html) => Html(html).into_response(),
Err(e) => (
StatusCode::INTERNAL_SERVER_ERROR,
format!("Render error: {}", e),
)
.into_response(),
}
}
}
+7 -3
View File
@@ -1,9 +1,9 @@
use crate::models::LandingPage;
use askama::Template;
use axum::{
response::{IntoResponse, Response, Html},
http::StatusCode,
response::{Html, IntoResponse, Response},
};
use crate::models::LandingPage;
#[derive(Template)]
#[template(path = "pages.html")]
@@ -18,7 +18,11 @@ impl IntoResponse for PagesTemplate {
fn into_response(self) -> Response {
match self.render() {
Ok(html) => Html(html).into_response(),
Err(e) => (StatusCode::INTERNAL_SERVER_ERROR, format!("Render error: {}", e)).into_response(),
Err(e) => (
StatusCode::INTERNAL_SERVER_ERROR,
format!("Render error: {}", e),
)
.into_response(),
}
}
}
+7 -3
View File
@@ -1,9 +1,9 @@
use crate::models::ApiKey;
use askama::Template;
use axum::{
response::{IntoResponse, Response, Html},
http::StatusCode,
response::{Html, IntoResponse, Response},
};
use crate::models::ApiKey;
#[derive(Template)]
#[template(path = "settings.html")]
@@ -20,7 +20,11 @@ impl IntoResponse for SettingsTemplate {
fn into_response(self) -> Response {
match self.render() {
Ok(html) => Html(html).into_response(),
Err(e) => (StatusCode::INTERNAL_SERVER_ERROR, format!("Render error: {}", e)).into_response(),
Err(e) => (
StatusCode::INTERNAL_SERVER_ERROR,
format!("Render error: {}", e),
)
.into_response(),
}
}
}
+13 -4
View File
@@ -1,9 +1,9 @@
use crate::models::AuditLog;
use askama::Template;
use axum::{
response::{IntoResponse, Response, Html},
http::StatusCode,
response::{Html, IntoResponse, Response},
};
use crate::models::AuditLog;
#[derive(Template)]
#[template(path = "status_ui.html")]
@@ -16,6 +16,7 @@ pub struct StatusTemplate {
pub uptime: String,
pub version: &'static str,
pub git_commit: &'static str,
pub urls: Vec<crate::models::Url>,
}
#[derive(Template)]
@@ -29,7 +30,11 @@ impl IntoResponse for StatusTemplate {
fn into_response(self) -> Response {
match self.render() {
Ok(html) => Html(html).into_response(),
Err(e) => (StatusCode::INTERNAL_SERVER_ERROR, format!("Render error: {}", e)).into_response(),
Err(e) => (
StatusCode::INTERNAL_SERVER_ERROR,
format!("Render error: {}", e),
)
.into_response(),
}
}
}
@@ -38,7 +43,11 @@ impl IntoResponse for AuditTemplate {
fn into_response(self) -> Response {
match self.render() {
Ok(html) => Html(html).into_response(),
Err(e) => (StatusCode::INTERNAL_SERVER_ERROR, format!("Render error: {}", e)).into_response(),
Err(e) => (
StatusCode::INTERNAL_SERVER_ERROR,
format!("Render error: {}", e),
)
.into_response(),
}
}
}
+8 -3
View File
@@ -1,9 +1,9 @@
use crate::models::Url;
use askama::Template;
use axum::{
response::{IntoResponse, Response, Html},
http::StatusCode,
response::{Html, IntoResponse, Response},
};
use crate::models::Url;
#[derive(Template)]
#[template(path = "urls.html")]
@@ -13,13 +13,18 @@ pub struct UrlsTemplate {
pub csrf_token: String,
pub error: Option<String>,
pub tag_filter: Option<String>,
pub base_url: String,
}
impl IntoResponse for UrlsTemplate {
fn into_response(self) -> Response {
match self.render() {
Ok(html) => Html(html).into_response(),
Err(e) => (StatusCode::INTERNAL_SERVER_ERROR, format!("Render error: {}", e)).into_response(),
Err(e) => (
StatusCode::INTERNAL_SERVER_ERROR,
format!("Render error: {}", e),
)
.into_response(),
}
}
}