mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 10:05:41 +00:00
feat: see publication status in sitekey view page
This commit is contained in:
@@ -36,6 +36,7 @@ struct IndexPage {
|
||||
key: String,
|
||||
levels: Vec<Level>,
|
||||
stats: CaptchaStats,
|
||||
publish_benchmarks: bool,
|
||||
}
|
||||
|
||||
impl IndexPage {
|
||||
@@ -44,6 +45,7 @@ impl IndexPage {
|
||||
config: Captcha,
|
||||
levels: Vec<Level>,
|
||||
key: String,
|
||||
publish_benchmarks: bool,
|
||||
) -> Self {
|
||||
IndexPage {
|
||||
duration: config.duration as u32,
|
||||
@@ -51,6 +53,7 @@ impl IndexPage {
|
||||
levels,
|
||||
key,
|
||||
stats,
|
||||
publish_benchmarks,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -70,8 +73,9 @@ pub async fn view_sitekey(
|
||||
let config = data.db.get_captcha_config(&username, &key).await?;
|
||||
let levels = data.db.get_captcha_levels(Some(&username), &key).await?;
|
||||
let stats = data.stats.fetch(&data, &username, &key).await?;
|
||||
let publish_benchmarks = data.db.analytics_captcha_is_published(&key).await?;
|
||||
|
||||
let body = IndexPage::new(stats, config, levels, key)
|
||||
let body = IndexPage::new(stats, config, levels, key, publish_benchmarks)
|
||||
.render_once()
|
||||
.unwrap();
|
||||
Ok(HttpResponse::Ok()
|
||||
|
||||
Reference in New Issue
Block a user