mirror of
https://codeberg.org/slatian/service.echoip-slatecave.git
synced 2025-07-16 14:03:28 +02:00
Added query settings to the generaliued templating mechanism
This commit is contained in:
@ -2,6 +2,7 @@ use serde::{Deserialize,Serialize};
|
||||
|
||||
use std::sync::Arc;
|
||||
use crate::mycelium::HtmlTextJsonFormat;
|
||||
use crate::mycelium::MycQuerySettings;
|
||||
|
||||
/* Response format */
|
||||
|
||||
@ -24,3 +25,16 @@ pub struct Selectable {
|
||||
pub weight: i32,
|
||||
}
|
||||
|
||||
impl MycQuerySettings<ResponseFormat> for QuerySettings {
|
||||
|
||||
fn initalize_template_context(&self, context: &mut tera::Context) {
|
||||
context.insert("language", &self.lang);
|
||||
context.insert("dns_resolvers", &self.available_dns_resolvers);
|
||||
context.insert("dns_resolver_id", &self.dns_resolver_id);
|
||||
}
|
||||
|
||||
fn get_format(&self) -> ResponseFormat {
|
||||
self.format.clone()
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user