new form page row + import page dialog fix

This commit is contained in:
Filipriec
2026-08-22 11:10:45 +02:00
parent adaa2c4ac6
commit 2d850b12ca
11 changed files with 278 additions and 31 deletions

View File

@@ -387,6 +387,22 @@ pub struct GetTableDataCountRequest {
#[prost(string, tag = "2")]
pub table_name: ::prost::alloc::string::String,
}
/// Fetch the last visible row and the exact number of visible rows.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetLastTableDataRequest {
#[prost(string, tag = "1")]
pub profile_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub table_name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetLastTableDataResponse {
#[prost(int64, tag = "1")]
pub total_count: i64,
/// Absent when total_count is zero.
#[prost(message, optional, tag = "2")]
pub row: ::core::option::Option<GetTableDataResponse>,
}
/// Fetch by ordinal position among non-deleted rows (1-based).
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetTableDataByPositionRequest {
@@ -1018,6 +1034,36 @@ pub mod tables_data_client {
);
self.inner.unary(req, path, codec).await
}
/// Fetch the last non-deleted row by id together with the exact row count.
/// This is the efficient form-opening path: unlike GetTableDataByPosition at
/// the final position, it does not walk the table through a large OFFSET, and
/// it avoids a separate client/server round trip for the count.
pub async fn get_last_table_data(
&mut self,
request: impl tonic::IntoRequest<super::GetLastTableDataRequest>,
) -> std::result::Result<
tonic::Response<super::GetLastTableDataResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/komp_ac.tables_data.TablesData/GetLastTableData",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("komp_ac.tables_data.TablesData", "GetLastTableData"),
);
self.inner.unary(req, path, codec).await
}
/// Fetch the N-th non-deleted row by id order (1-based), then return its full data.
///
/// Behavior:
@@ -1236,6 +1282,17 @@ pub mod tables_data_server {
tonic::Response<super::super::common::CountResponse>,
tonic::Status,
>;
/// Fetch the last non-deleted row by id together with the exact row count.
/// This is the efficient form-opening path: unlike GetTableDataByPosition at
/// the final position, it does not walk the table through a large OFFSET, and
/// it avoids a separate client/server round trip for the count.
async fn get_last_table_data(
&self,
request: tonic::Request<super::GetLastTableDataRequest>,
) -> std::result::Result<
tonic::Response<super::GetLastTableDataResponse>,
tonic::Status,
>;
/// Fetch the N-th non-deleted row by id order (1-based), then return its full data.
///
/// Behavior:
@@ -2025,6 +2082,52 @@ pub mod tables_data_server {
};
Box::pin(fut)
}
"/komp_ac.tables_data.TablesData/GetLastTableData" => {
#[allow(non_camel_case_types)]
struct GetLastTableDataSvc<T: TablesData>(pub Arc<T>);
impl<
T: TablesData,
> tonic::server::UnaryService<super::GetLastTableDataRequest>
for GetLastTableDataSvc<T> {
type Response = super::GetLastTableDataResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetLastTableDataRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TablesData>::get_last_table_data(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetLastTableDataSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/komp_ac.tables_data.TablesData/GetTableDataByPosition" => {
#[allow(non_camel_case_types)]
struct GetTableDataByPositionSvc<T: TablesData>(pub Arc<T>);