Compare commits
3 commits
ea595b39a7
...
a3a1338c28
Author | SHA1 | Date | |
---|---|---|---|
a3a1338c28 | |||
f56e808bc6 | |||
3dfb432b0f |
2 changed files with 5 additions and 5 deletions
|
@ -25,11 +25,10 @@ pub async fn serve(ctx: upub::Context, bind: String) -> upub::Result<()> {
|
||||||
use tower_http::{cors::CorsLayer, trace::TraceLayer};
|
use tower_http::{cors::CorsLayer, trace::TraceLayer};
|
||||||
|
|
||||||
let router = axum::Router::new()
|
let router = axum::Router::new()
|
||||||
.layer(CorsLayer::permissive())
|
|
||||||
.layer(
|
.layer(
|
||||||
// TODO 4xx errors aren't really failures but since upub is in development it's useful to log
|
// TODO 4xx errors aren't really failures but since upub is in development it's useful to log
|
||||||
// these too, in case something's broken
|
// these too, in case something's broken
|
||||||
TraceLayer::new(SharedClassifier::new(StatusInRangeAsFailures::new(300..=u16::MAX)))
|
TraceLayer::new(SharedClassifier::new(StatusInRangeAsFailures::new(300..=999)))
|
||||||
.make_span_with(|req: &axum::http::Request<_>| {
|
.make_span_with(|req: &axum::http::Request<_>| {
|
||||||
tracing::span!(
|
tracing::span!(
|
||||||
tracing::Level::INFO,
|
tracing::Level::INFO,
|
||||||
|
@ -39,6 +38,7 @@ pub async fn serve(ctx: upub::Context, bind: String) -> upub::Result<()> {
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
.layer(CorsLayer::permissive())
|
||||||
.ap_routes()
|
.ap_routes()
|
||||||
.mastodon_routes() // no-op if mastodon feature is disabled
|
.mastodon_routes() // no-op if mastodon feature is disabled
|
||||||
.with_state(ctx);
|
.with_state(ctx);
|
||||||
|
|
|
@ -76,10 +76,10 @@ pub fn ConfigPage(setter: WriteSignal<crate::Config>) -> impl IntoView {
|
||||||
let mut val = event_target_value(&ev);
|
let mut val = event_target_value(&ev);
|
||||||
if val.is_empty() { val = DEFAULT_COLOR.to_string() };
|
if val.is_empty() { val = DEFAULT_COLOR.to_string() };
|
||||||
let mut mock = config.get();
|
let mut mock = config.get();
|
||||||
mock.accent_color = val.clone();
|
|
||||||
setter.set(mock);
|
|
||||||
set_color_rgb.set(parse_hex(&val));
|
set_color_rgb.set(parse_hex(&val));
|
||||||
set_color.set(val);
|
set_color.set(val.clone());
|
||||||
|
mock.accent_color = val;
|
||||||
|
setter.set(mock);
|
||||||
} />
|
} />
|
||||||
</p>
|
</p>
|
||||||
<hr />
|
<hr />
|
||||||
|
|
Loading…
Reference in a new issue