fix(client): resolve issues with showing user settings on debug pge
This commit is contained in:
parent
603266bc5a
commit
79b37ea473
|
|
@ -1063,10 +1063,10 @@ const DebugPage: React.FC = () => {
|
||||||
<Grid item xs={12} md={6}>
|
<Grid item xs={12} md={6}>
|
||||||
<Paper sx={{ p: 2 }}>
|
<Paper sx={{ p: 2 }}>
|
||||||
<Typography variant="subtitle1" gutterBottom>Quality Thresholds</Typography>
|
<Typography variant="subtitle1" gutterBottom>Quality Thresholds</Typography>
|
||||||
<Typography><strong>Brightness:</strong> {debugInfo.user_settings?.quality_thresholds?.brightness || 'N/A'}</Typography>
|
<Typography><strong>Brightness:</strong> {debugInfo.user_settings?.ocr_quality_threshold_brightness || 'N/A'}</Typography>
|
||||||
<Typography><strong>Contrast:</strong> {debugInfo.user_settings?.quality_thresholds?.contrast || 'N/A'}</Typography>
|
<Typography><strong>Contrast:</strong> {debugInfo.user_settings?.ocr_quality_threshold_contrast || 'N/A'}</Typography>
|
||||||
<Typography><strong>Noise:</strong> {debugInfo.user_settings?.quality_thresholds?.noise || 'N/A'}</Typography>
|
<Typography><strong>Noise:</strong> {debugInfo.user_settings?.ocr_quality_threshold_noise || 'N/A'}</Typography>
|
||||||
<Typography><strong>Sharpness:</strong> {debugInfo.user_settings?.quality_thresholds?.sharpness || 'N/A'}</Typography>
|
<Typography><strong>Sharpness:</strong> {debugInfo.user_settings?.ocr_quality_threshold_sharpness || 'N/A'}</Typography>
|
||||||
</Paper>
|
</Paper>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,17 @@ pub async fn get_document_debug_info(
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Get user settings
|
||||||
|
let user_settings = state
|
||||||
|
.db
|
||||||
|
.get_user_settings(auth_user.user.id)
|
||||||
|
.await
|
||||||
|
.map_err(|e| {
|
||||||
|
error!("Database error getting user settings: {}", e);
|
||||||
|
StatusCode::INTERNAL_SERVER_ERROR
|
||||||
|
})?
|
||||||
|
.map(|settings| settings.into());
|
||||||
|
|
||||||
// Construct processing steps based on document state
|
// Construct processing steps based on document state
|
||||||
let mut processing_steps = vec!["uploaded".to_string()];
|
let mut processing_steps = vec!["uploaded".to_string()];
|
||||||
|
|
||||||
|
|
@ -96,6 +107,7 @@ pub async fn get_document_debug_info(
|
||||||
file_exists,
|
file_exists,
|
||||||
readable,
|
readable,
|
||||||
permissions,
|
permissions,
|
||||||
|
user_settings,
|
||||||
};
|
};
|
||||||
|
|
||||||
debug!("Debug info generated for document: {}", document_id);
|
debug!("Debug info generated for document: {}", document_id);
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@ pub struct DocumentDebugInfo {
|
||||||
pub file_exists: bool,
|
pub file_exists: bool,
|
||||||
pub readable: bool,
|
pub readable: bool,
|
||||||
pub permissions: Option<String>,
|
pub permissions: Option<String>,
|
||||||
|
pub user_settings: Option<crate::models::SettingsResponse>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, ToSchema)]
|
#[derive(Serialize, Deserialize, ToSchema)]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue