chore(frontend): overflow-x-auto for RulesList
This commit is contained in:
@@ -21,7 +21,6 @@ pub struct Tactics {
|
||||
pub name: String,
|
||||
#[serde_as(as = "BoolFromInt")]
|
||||
pub release_control: bool,
|
||||
// TODO: std::time::Instant
|
||||
pub updated_at: String,
|
||||
#[serde(rename = "usergroup")]
|
||||
pub user_group: u32,
|
||||
@@ -42,7 +41,6 @@ pub struct AppTactics {
|
||||
pub struct App {
|
||||
#[serde(rename = "canuninstall")]
|
||||
can_uninstall: bool,
|
||||
// TODO: std::time::Instant
|
||||
created_at: String,
|
||||
#[serde(rename = "devicetype")]
|
||||
device_type: String,
|
||||
@@ -67,7 +65,6 @@ pub struct App {
|
||||
sort_weight: i32,
|
||||
status: i32,
|
||||
target_sdk_version: i32,
|
||||
// TODO: std::time::Instant
|
||||
updated_at: String,
|
||||
#[serde(rename = "versioncode")]
|
||||
version_code: i32,
|
||||
|
||||
10
src/main.rs
10
src/main.rs
@@ -1,7 +1,7 @@
|
||||
use std::{net::SocketAddr, sync::Arc};
|
||||
|
||||
use anyhow::Context;
|
||||
use axum::Router;
|
||||
use axum::{Router, routing::any};
|
||||
use axum::handler::Handler;
|
||||
use dotenvy::dotenv;
|
||||
use tower_http::compression::CompressionLayer;
|
||||
@@ -80,15 +80,15 @@ async fn main() -> anyhow::Result<()> {
|
||||
commands: Default::default(),
|
||||
});
|
||||
|
||||
let log_middleware =
|
||||
axum::middleware::from_fn_with_state(state.clone(), middleware::log_middleware);
|
||||
let proxy_middleware =
|
||||
axum::middleware::from_fn_with_state(state.clone(), middleware::middleware);
|
||||
|
||||
// Build our application
|
||||
let app = Router::new()
|
||||
// Admin routes
|
||||
.nest("/admin", admin::routes::admin_routes(state.clone()))
|
||||
// Proxy all other routes (fallback)
|
||||
.fallback(proxy::proxy_handler.layer(log_middleware))
|
||||
// Proxy Linspirer APIs
|
||||
.route("/public-interface.php", any(proxy::proxy_handler.layer(proxy_middleware)))
|
||||
.layer(CompressionLayer::new().gzip(true))
|
||||
.with_state(state);
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ enum ResponseBody {
|
||||
Modified(Value),
|
||||
}
|
||||
|
||||
pub async fn log_middleware(
|
||||
pub async fn middleware(
|
||||
State(state): State<Arc<AppState>>,
|
||||
OriginalUri(uri): OriginalUri,
|
||||
req: Request<axum::body::Body>,
|
||||
@@ -39,7 +39,7 @@ pub async fn log_middleware(
|
||||
|
||||
let path = uri.path();
|
||||
|
||||
let (decrypted_request_log, method) = match str::from_utf8(&body_bytes)
|
||||
let (decrypted_request_for_log, method) = match str::from_utf8(&body_bytes)
|
||||
.map_err(anyhow::Error::from)
|
||||
.and_then(|body| process_and_log_request(body, &state.key, &state.iv))
|
||||
{
|
||||
@@ -125,7 +125,7 @@ pub async fn log_middleware(
|
||||
debug!(
|
||||
"{}\nRequest:\n{}\nResponse:\n{}\n{}",
|
||||
path,
|
||||
serde_json::to_string_pretty(&decrypted_request_log).unwrap_or_default(),
|
||||
serde_json::to_string_pretty(&decrypted_request_for_log).unwrap_or_default(),
|
||||
decrypted_response_for_log,
|
||||
"-".repeat(80),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user