feat: update tag and timeline share panel copy for clarity and conciseness
Some checks failed
docker-images / resolve-build-targets (push) Successful in 7s
ui-regression / playwright-regression (push) Failing after 13m4s
docker-images / build-and-push (admin) (push) Successful in 1m17s
docker-images / build-and-push (backend) (push) Successful in 28m13s
docker-images / build-and-push (frontend) (push) Successful in 47s
docker-images / submit-indexnow (push) Successful in 13s
Some checks failed
docker-images / resolve-build-targets (push) Successful in 7s
ui-regression / playwright-regression (push) Failing after 13m4s
docker-images / build-and-push (admin) (push) Successful in 1m17s
docker-images / build-and-push (backend) (push) Successful in 28m13s
docker-images / build-and-push (frontend) (push) Successful in 47s
docker-images / submit-indexnow (push) Successful in 13s
style: enhance global CSS for better responsiveness of terminal chips and navigation pills test: remove inline subscription test and add maintenance mode access code test feat: implement media library picker dialog for selecting images from the media library feat: add media URL controls for uploading and managing media assets feat: add migration for music_enabled and maintenance_mode settings in site settings feat: implement maintenance mode functionality with access control feat: create maintenance page with access code input and error handling chore: add TypeScript declaration for QR code module
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
use async_trait::async_trait;
|
||||
use axum::{
|
||||
http::{header, HeaderName, Method},
|
||||
Router as AxumRouter,
|
||||
http::{HeaderName, Method, header},
|
||||
};
|
||||
use loco_rs::{
|
||||
Result,
|
||||
app::{AppContext, Hooks, Initializer},
|
||||
bgworker::{BackgroundWorker, Queue},
|
||||
boot::{create_app, BootResult, StartMode},
|
||||
boot::{BootResult, StartMode, create_app},
|
||||
config::Config,
|
||||
controller::AppRoutes,
|
||||
db::{self, truncate_table},
|
||||
environment::Environment,
|
||||
task::Tasks,
|
||||
Result,
|
||||
};
|
||||
use migration::Migrator;
|
||||
use sea_orm::{
|
||||
@@ -99,7 +99,9 @@ impl Hooks for App {
|
||||
}
|
||||
|
||||
async fn initializers(_ctx: &AppContext) -> Result<Vec<Box<dyn Initializer>>> {
|
||||
Ok(vec![Box::new(initializers::content_sync::ContentSyncInitializer)])
|
||||
Ok(vec![Box::new(
|
||||
initializers::content_sync::ContentSyncInitializer,
|
||||
)])
|
||||
}
|
||||
|
||||
fn routes(_ctx: &AppContext) -> AppRoutes {
|
||||
@@ -152,7 +154,9 @@ impl Hooks for App {
|
||||
}
|
||||
async fn connect_workers(ctx: &AppContext, queue: &Queue) -> Result<()> {
|
||||
queue.register(DownloadWorker::build(ctx)).await?;
|
||||
queue.register(NotificationDeliveryWorker::build(ctx)).await?;
|
||||
queue
|
||||
.register(NotificationDeliveryWorker::build(ctx))
|
||||
.await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -334,8 +338,7 @@ impl Hooks for App {
|
||||
let comment_verification_mode = settings["comment_verification_mode"]
|
||||
.as_str()
|
||||
.map(ToString::to_string);
|
||||
let subscription_verification_mode = settings
|
||||
["subscription_verification_mode"]
|
||||
let subscription_verification_mode = settings["subscription_verification_mode"]
|
||||
.as_str()
|
||||
.map(ToString::to_string);
|
||||
let comment_turnstile_enabled = settings["comment_turnstile_enabled"]
|
||||
@@ -343,8 +346,7 @@ impl Hooks for App {
|
||||
.or(comment_verification_mode
|
||||
.as_deref()
|
||||
.map(|value| value.eq_ignore_ascii_case("turnstile")));
|
||||
let subscription_turnstile_enabled = settings
|
||||
["subscription_turnstile_enabled"]
|
||||
let subscription_turnstile_enabled = settings["subscription_turnstile_enabled"]
|
||||
.as_bool()
|
||||
.or(subscription_verification_mode
|
||||
.as_deref()
|
||||
@@ -381,6 +383,20 @@ impl Hooks for App {
|
||||
})
|
||||
.filter(|items| !items.is_empty())
|
||||
.map(serde_json::Value::Array);
|
||||
let music_enabled = settings["music_enabled"].as_bool().or(Some(true));
|
||||
let maintenance_mode_enabled = settings["maintenance_mode_enabled"]
|
||||
.as_bool()
|
||||
.or(Some(false));
|
||||
let maintenance_access_code = settings["maintenance_access_code"]
|
||||
.as_str()
|
||||
.and_then(|value| {
|
||||
let trimmed = value.trim();
|
||||
if trimmed.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(trimmed.to_string())
|
||||
}
|
||||
});
|
||||
|
||||
let item = site_settings::ActiveModel {
|
||||
id: Set(settings["id"].as_i64().unwrap_or(1) as i32),
|
||||
@@ -422,6 +438,9 @@ impl Hooks for App {
|
||||
location: Set(settings["location"].as_str().map(ToString::to_string)),
|
||||
tech_stack: Set(tech_stack),
|
||||
music_playlist: Set(music_playlist),
|
||||
music_enabled: Set(music_enabled),
|
||||
maintenance_mode_enabled: Set(maintenance_mode_enabled),
|
||||
maintenance_access_code: Set(maintenance_access_code),
|
||||
ai_enabled: Set(settings["ai_enabled"].as_bool()),
|
||||
paragraph_comments_enabled: Set(settings["paragraph_comments_enabled"]
|
||||
.as_bool()
|
||||
|
||||
Reference in New Issue
Block a user