global table content
This commit is contained in:
@@ -29,6 +29,8 @@ use super::{
|
||||
pub(crate) struct NewTableQuery {
|
||||
#[serde(default)]
|
||||
profile: String,
|
||||
#[serde(default)]
|
||||
global: bool,
|
||||
}
|
||||
|
||||
/// GET /admin/tables/new
|
||||
@@ -39,6 +41,7 @@ pub(crate) async fn new_table_page(
|
||||
) -> Response {
|
||||
let mut draft = TableDraft::new();
|
||||
draft.profile_name = query.profile.trim().to_string();
|
||||
draft.global = query.global;
|
||||
|
||||
match load_page(state, &headers, draft, None, None).await {
|
||||
Ok(page) => Html(ui::render_page(&page)).into_response(),
|
||||
@@ -91,7 +94,11 @@ pub(crate) async fn create_table(
|
||||
}
|
||||
};
|
||||
|
||||
let profile_name = request.profile_name.clone();
|
||||
let profile_name = if request.global {
|
||||
"__global".to_string()
|
||||
} else {
|
||||
request.profile_name.clone()
|
||||
};
|
||||
let request = match authenticated_request(&headers, request) {
|
||||
Ok(request) => request,
|
||||
Err(_) => return Redirect::to("/login").into_response(),
|
||||
|
||||
Reference in New Issue
Block a user