mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-23 00:58:32 +02:00
Better gRPC status on error
This commit is contained in:
@@ -25,6 +25,30 @@ pub struct GrpcConnection {
|
|||||||
pub uri: Uri,
|
pub uri: Uri,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Default)]
|
||||||
|
pub struct StreamError {
|
||||||
|
pub message: String,
|
||||||
|
pub status: Option<Status>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<String> for StreamError {
|
||||||
|
fn from(value: String) -> Self {
|
||||||
|
StreamError {
|
||||||
|
message: value.to_string(),
|
||||||
|
status: None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<Status> for StreamError {
|
||||||
|
fn from(s: Status) -> Self {
|
||||||
|
StreamError {
|
||||||
|
message: s.message().to_string(),
|
||||||
|
status: Some(s),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl GrpcConnection {
|
impl GrpcConnection {
|
||||||
pub fn service(&self, service: &str) -> Result<ServiceDescriptor, String> {
|
pub fn service(&self, service: &str) -> Result<ServiceDescriptor, String> {
|
||||||
let service = self
|
let service = self
|
||||||
@@ -49,7 +73,7 @@ impl GrpcConnection {
|
|||||||
method: &str,
|
method: &str,
|
||||||
message: &str,
|
message: &str,
|
||||||
metadata: HashMap<String, String>,
|
metadata: HashMap<String, String>,
|
||||||
) -> Result<Response<DynamicMessage>, String> {
|
) -> Result<Response<DynamicMessage>, StreamError> {
|
||||||
let method = &self.method(&service, &method)?;
|
let method = &self.method(&service, &method)?;
|
||||||
let input_message = method.input();
|
let input_message = method.input();
|
||||||
|
|
||||||
@@ -67,10 +91,7 @@ impl GrpcConnection {
|
|||||||
let codec = DynamicCodec::new(method.clone());
|
let codec = DynamicCodec::new(method.clone());
|
||||||
client.ready().await.unwrap();
|
client.ready().await.unwrap();
|
||||||
|
|
||||||
client
|
Ok(client.unary(req, path, codec).await?)
|
||||||
.unary(req, path, codec)
|
|
||||||
.await
|
|
||||||
.map_err(|e| e.to_string())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn streaming(
|
pub async fn streaming(
|
||||||
@@ -79,7 +100,7 @@ impl GrpcConnection {
|
|||||||
method: &str,
|
method: &str,
|
||||||
stream: ReceiverStream<DynamicMessage>,
|
stream: ReceiverStream<DynamicMessage>,
|
||||||
metadata: HashMap<String, String>,
|
metadata: HashMap<String, String>,
|
||||||
) -> Result<Result<Response<Streaming<DynamicMessage>>, Status>, String> {
|
) -> Result<Response<Streaming<DynamicMessage>>, StreamError> {
|
||||||
let method = &self.method(&service, &method)?;
|
let method = &self.method(&service, &method)?;
|
||||||
let mut client = tonic::client::Grpc::with_origin(self.conn.clone(), self.uri.clone());
|
let mut client = tonic::client::Grpc::with_origin(self.conn.clone(), self.uri.clone());
|
||||||
|
|
||||||
@@ -90,7 +111,7 @@ impl GrpcConnection {
|
|||||||
let path = method_desc_to_path(method);
|
let path = method_desc_to_path(method);
|
||||||
let codec = DynamicCodec::new(method.clone());
|
let codec = DynamicCodec::new(method.clone());
|
||||||
client.ready().await.map_err(|e| e.to_string())?;
|
client.ready().await.map_err(|e| e.to_string())?;
|
||||||
Ok(client.streaming(req, path, codec).await)
|
Ok(client.streaming(req, path, codec).await?)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn client_streaming(
|
pub async fn client_streaming(
|
||||||
@@ -99,7 +120,7 @@ impl GrpcConnection {
|
|||||||
method: &str,
|
method: &str,
|
||||||
stream: ReceiverStream<DynamicMessage>,
|
stream: ReceiverStream<DynamicMessage>,
|
||||||
metadata: HashMap<String, String>,
|
metadata: HashMap<String, String>,
|
||||||
) -> Result<Response<DynamicMessage>, String> {
|
) -> Result<Response<DynamicMessage>, StreamError> {
|
||||||
let method = &self.method(&service, &method)?;
|
let method = &self.method(&service, &method)?;
|
||||||
let mut client = tonic::client::Grpc::with_origin(self.conn.clone(), self.uri.clone());
|
let mut client = tonic::client::Grpc::with_origin(self.conn.clone(), self.uri.clone());
|
||||||
let mut req = stream.into_streaming_request();
|
let mut req = stream.into_streaming_request();
|
||||||
@@ -111,7 +132,10 @@ impl GrpcConnection {
|
|||||||
client
|
client
|
||||||
.client_streaming(req, path, codec)
|
.client_streaming(req, path, codec)
|
||||||
.await
|
.await
|
||||||
.map_err(|s| s.to_string())
|
.map_err(|e| StreamError {
|
||||||
|
message: e.message().to_string(),
|
||||||
|
status: Some(e),
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn server_streaming(
|
pub async fn server_streaming(
|
||||||
@@ -120,7 +144,7 @@ impl GrpcConnection {
|
|||||||
method: &str,
|
method: &str,
|
||||||
message: &str,
|
message: &str,
|
||||||
metadata: HashMap<String, String>,
|
metadata: HashMap<String, String>,
|
||||||
) -> Result<Result<Response<Streaming<DynamicMessage>>, Status>, String> {
|
) -> Result<Response<Streaming<DynamicMessage>>, StreamError> {
|
||||||
let method = &self.method(&service, &method)?;
|
let method = &self.method(&service, &method)?;
|
||||||
let input_message = method.input();
|
let input_message = method.input();
|
||||||
|
|
||||||
@@ -137,7 +161,7 @@ impl GrpcConnection {
|
|||||||
let path = method_desc_to_path(method);
|
let path = method_desc_to_path(method);
|
||||||
let codec = DynamicCodec::new(method.clone());
|
let codec = DynamicCodec::new(method.clone());
|
||||||
client.ready().await.map_err(|e| e.to_string())?;
|
client.ready().await.map_err(|e| e.to_string())?;
|
||||||
Ok(client.server_streaming(req, path, codec).await)
|
Ok(client.server_streaming(req, path, codec).await?)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,52 +10,52 @@ extern crate objc;
|
|||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::env::current_dir;
|
use std::env::current_dir;
|
||||||
use std::fs::{create_dir_all, File, read_to_string};
|
use std::fs::{create_dir_all, read_to_string, File};
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::process::exit;
|
use std::process::exit;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use ::http::Uri;
|
|
||||||
use ::http::uri::InvalidUri;
|
use ::http::uri::InvalidUri;
|
||||||
|
use ::http::Uri;
|
||||||
use base64::Engine;
|
use base64::Engine;
|
||||||
use fern::colors::ColoredLevelConfig;
|
use fern::colors::ColoredLevelConfig;
|
||||||
use log::{debug, error, info, warn};
|
use log::{debug, error, info, warn};
|
||||||
use rand::random;
|
use rand::random;
|
||||||
use serde_json::{json, Value};
|
use serde_json::{json, Value};
|
||||||
use sqlx::{Pool, Sqlite, SqlitePool};
|
|
||||||
use sqlx::migrate::Migrator;
|
use sqlx::migrate::Migrator;
|
||||||
use sqlx::types::Json;
|
use sqlx::types::Json;
|
||||||
use tauri::{AppHandle, RunEvent, State, Window, WindowUrl};
|
use sqlx::{Pool, Sqlite, SqlitePool};
|
||||||
use tauri::{Manager, WindowEvent};
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
use tauri::TitleBarStyle;
|
use tauri::TitleBarStyle;
|
||||||
|
use tauri::{AppHandle, RunEvent, State, Window, WindowUrl};
|
||||||
|
use tauri::{Manager, WindowEvent};
|
||||||
use tauri_plugin_log::{fern, LogTarget};
|
use tauri_plugin_log::{fern, LogTarget};
|
||||||
use tauri_plugin_window_state::{StateFlags, WindowExt};
|
use tauri_plugin_window_state::{StateFlags, WindowExt};
|
||||||
use tokio::sync::{Mutex};
|
use tokio::sync::Mutex;
|
||||||
use tokio::time::sleep;
|
use tokio::time::sleep;
|
||||||
use window_shadows::set_shadow;
|
use window_shadows::set_shadow;
|
||||||
|
|
||||||
use ::grpc::{Code, deserialize_message, serialize_message, ServiceDefinition};
|
|
||||||
use ::grpc::manager::{DynamicMessage, GrpcHandle};
|
use ::grpc::manager::{DynamicMessage, GrpcHandle};
|
||||||
|
use ::grpc::{deserialize_message, serialize_message, Code, ServiceDefinition};
|
||||||
use window_ext::TrafficLightWindowExt;
|
use window_ext::TrafficLightWindowExt;
|
||||||
|
|
||||||
use crate::analytics::{AnalyticsAction, AnalyticsResource};
|
use crate::analytics::{AnalyticsAction, AnalyticsResource};
|
||||||
use crate::grpc::metadata_to_map;
|
use crate::grpc::metadata_to_map;
|
||||||
use crate::http::send_http_request;
|
use crate::http::send_http_request;
|
||||||
use crate::models::{
|
use crate::models::{
|
||||||
cancel_pending_grpc_connections, cancel_pending_responses, CookieJar,
|
cancel_pending_grpc_connections, cancel_pending_responses, create_http_response,
|
||||||
create_http_response, delete_all_grpc_connections, delete_all_http_responses, delete_cookie_jar,
|
delete_all_grpc_connections, delete_all_http_responses, delete_cookie_jar, delete_environment,
|
||||||
delete_environment, delete_folder, delete_grpc_connection, delete_grpc_request,
|
delete_folder, delete_grpc_connection, delete_grpc_request, delete_http_request,
|
||||||
delete_http_request, delete_http_response, delete_workspace, duplicate_grpc_request,
|
delete_http_response, delete_workspace, duplicate_grpc_request, duplicate_http_request,
|
||||||
duplicate_http_request, Environment, EnvironmentVariable, Folder, get_cookie_jar,
|
get_cookie_jar, get_environment, get_folder, get_grpc_connection, get_grpc_request,
|
||||||
get_environment, get_folder, get_grpc_connection, get_grpc_request, get_http_request,
|
get_http_request, get_http_response, get_key_value_raw, get_or_create_settings, get_workspace,
|
||||||
get_http_response, get_key_value_raw, get_or_create_settings, get_workspace,
|
get_workspace_export_resources, list_cookie_jars, list_environments, list_folders,
|
||||||
get_workspace_export_resources, GrpcConnection, GrpcEvent, GrpcEventType, GrpcRequest,
|
list_grpc_connections, list_grpc_events, list_grpc_requests, list_requests, list_responses,
|
||||||
HttpRequest, HttpResponse, KeyValue, list_cookie_jars, list_environments,
|
list_workspaces, set_key_value_raw, update_response_if_id, update_settings, upsert_cookie_jar,
|
||||||
list_folders, list_grpc_connections, list_grpc_events, list_grpc_requests,
|
upsert_environment, upsert_folder, upsert_grpc_connection, upsert_grpc_event,
|
||||||
list_requests, list_responses, list_workspaces, set_key_value_raw, Settings,
|
upsert_grpc_request, upsert_http_request, upsert_workspace, CookieJar, Environment,
|
||||||
update_response_if_id, update_settings, upsert_cookie_jar, upsert_environment, upsert_folder, upsert_grpc_connection,
|
EnvironmentVariable, Folder, GrpcConnection, GrpcEvent, GrpcEventType, GrpcRequest,
|
||||||
upsert_grpc_event, upsert_grpc_request, upsert_http_request, upsert_workspace, Workspace, WorkspaceExportResources,
|
HttpRequest, HttpResponse, KeyValue, Settings, Workspace, WorkspaceExportResources,
|
||||||
};
|
};
|
||||||
use crate::plugin::ImportResult;
|
use crate::plugin::ImportResult;
|
||||||
use crate::updates::{update_mode_from_str, UpdateMode, YaakUpdater};
|
use crate::updates::{update_mode_from_str, UpdateMode, YaakUpdater};
|
||||||
@@ -454,16 +454,26 @@ async fn cmd_grpc_go(
|
|||||||
Some(Err(e)) => {
|
Some(Err(e)) => {
|
||||||
upsert_grpc_event(
|
upsert_grpc_event(
|
||||||
&w,
|
&w,
|
||||||
&GrpcEvent {
|
&(match e.status {
|
||||||
content: "Failed to connect".to_string(),
|
Some(s) => GrpcEvent {
|
||||||
event_type: GrpcEventType::ConnectionEnd,
|
error: Some(s.message().to_string()),
|
||||||
error: Some(e.to_string()),
|
status: Some(s.code() as i64),
|
||||||
status: Some(Code::Unknown as i64),
|
content: "Failed to connect".to_string(),
|
||||||
..base_event.clone()
|
metadata: Json(metadata_to_map(s.metadata().clone())),
|
||||||
},
|
event_type: GrpcEventType::ConnectionEnd,
|
||||||
|
..base_event.clone()
|
||||||
|
},
|
||||||
|
None => GrpcEvent {
|
||||||
|
error: Some(e.message),
|
||||||
|
status: Some(Code::Unknown as i64),
|
||||||
|
content: "Failed to connect".to_string(),
|
||||||
|
event_type: GrpcEventType::ConnectionEnd,
|
||||||
|
..base_event.clone()
|
||||||
|
},
|
||||||
|
}),
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
// Server streaming doesn't return initial message
|
// Server streaming doesn't return initial message
|
||||||
@@ -471,7 +481,7 @@ async fn cmd_grpc_go(
|
|||||||
}
|
}
|
||||||
|
|
||||||
let mut stream = match maybe_stream {
|
let mut stream = match maybe_stream {
|
||||||
Some(Ok(Ok(stream))) => {
|
Some(Ok(stream)) => {
|
||||||
upsert_grpc_event(
|
upsert_grpc_event(
|
||||||
&w,
|
&w,
|
||||||
&GrpcEvent {
|
&GrpcEvent {
|
||||||
@@ -490,31 +500,26 @@ async fn cmd_grpc_go(
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
stream.into_inner()
|
stream.into_inner()
|
||||||
}
|
}
|
||||||
Some(Ok(Err(e))) => {
|
|
||||||
upsert_grpc_event(
|
|
||||||
&w,
|
|
||||||
&GrpcEvent {
|
|
||||||
error: Some(e.message().to_string()),
|
|
||||||
status: Some(e.code() as i64),
|
|
||||||
content: e.code().description().to_string(),
|
|
||||||
event_type: GrpcEventType::ConnectionEnd,
|
|
||||||
..base_event.clone()
|
|
||||||
},
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Some(Err(e)) => {
|
Some(Err(e)) => {
|
||||||
upsert_grpc_event(
|
upsert_grpc_event(
|
||||||
&w,
|
&w,
|
||||||
&GrpcEvent {
|
&(match e.status {
|
||||||
error: Some(e),
|
Some(s) => GrpcEvent {
|
||||||
status: Some(Code::Unknown as i64),
|
error: Some(s.message().to_string()),
|
||||||
content: "Unknown error".to_string(),
|
status: Some(s.code() as i64),
|
||||||
event_type: GrpcEventType::ConnectionEnd,
|
content: "Failed to connect".to_string(),
|
||||||
..base_event.clone()
|
metadata: Json(metadata_to_map(s.metadata().clone())),
|
||||||
},
|
event_type: GrpcEventType::ConnectionEnd,
|
||||||
|
..base_event.clone()
|
||||||
|
},
|
||||||
|
None => GrpcEvent {
|
||||||
|
error: Some(e.message),
|
||||||
|
status: Some(Code::Unknown as i64),
|
||||||
|
content: "Failed to connect".to_string(),
|
||||||
|
event_type: GrpcEventType::ConnectionEnd,
|
||||||
|
..base_event.clone()
|
||||||
|
},
|
||||||
|
}),
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
@@ -655,9 +660,12 @@ async fn cmd_send_ephemeral_request(
|
|||||||
};
|
};
|
||||||
|
|
||||||
let (cancel_tx, mut cancel_rx) = tokio::sync::watch::channel(false);
|
let (cancel_tx, mut cancel_rx) = tokio::sync::watch::channel(false);
|
||||||
window.listen_global(format!("cancel_http_response_{}", response.id), move |_event| {
|
window.listen_global(
|
||||||
let _ = cancel_tx.send(true);
|
format!("cancel_http_response_{}", response.id),
|
||||||
});
|
move |_event| {
|
||||||
|
let _ = cancel_tx.send(true);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
send_http_request(
|
send_http_request(
|
||||||
&window,
|
&window,
|
||||||
@@ -860,9 +868,12 @@ async fn cmd_send_http_request(
|
|||||||
};
|
};
|
||||||
|
|
||||||
let (cancel_tx, mut cancel_rx) = tokio::sync::watch::channel(false);
|
let (cancel_tx, mut cancel_rx) = tokio::sync::watch::channel(false);
|
||||||
window.listen_global(format!("cancel_http_response_{}", response.id), move |_event| {
|
window.listen_global(
|
||||||
let _ = cancel_tx.send(true);
|
format!("cancel_http_response_{}", response.id),
|
||||||
});
|
move |_event| {
|
||||||
|
let _ = cancel_tx.send(true);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
send_http_request(
|
send_http_request(
|
||||||
&window,
|
&window,
|
||||||
@@ -905,9 +916,15 @@ async fn cmd_track_event(
|
|||||||
analytics::track_event(&window.app_handle(), resource, action, attributes).await;
|
analytics::track_event(&window.app_handle(), resource, action, attributes).await;
|
||||||
}
|
}
|
||||||
(r, a) => {
|
(r, a) => {
|
||||||
println!("HttpRequest: {:?}", serde_json::to_string(&AnalyticsResource::HttpRequest));
|
println!(
|
||||||
|
"HttpRequest: {:?}",
|
||||||
|
serde_json::to_string(&AnalyticsResource::HttpRequest)
|
||||||
|
);
|
||||||
println!("Send: {:?}", serde_json::to_string(&AnalyticsAction::Send));
|
println!("Send: {:?}", serde_json::to_string(&AnalyticsAction::Send));
|
||||||
error!("Invalid action/resource for track_event: {resource}.{action} = {:?}.{:?}", r, a);
|
error!(
|
||||||
|
"Invalid action/resource for track_event: {resource}.{action} = {:?}.{:?}",
|
||||||
|
r, a
|
||||||
|
);
|
||||||
return Err("Invalid event".to_string());
|
return Err("Invalid event".to_string());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,12 +1,19 @@
|
|||||||
|
import classNames from 'classnames';
|
||||||
import type { ReactNode } from 'react';
|
import type { ReactNode } from 'react';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
|
className?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function EmptyStateText({ children }: Props) {
|
export function EmptyStateText({ children, className }: Props) {
|
||||||
return (
|
return (
|
||||||
<div className="rounded-lg border border-dashed border-highlight h-full py-2 text-gray-400 flex items-center justify-center">
|
<div
|
||||||
|
className={classNames(
|
||||||
|
className,
|
||||||
|
'rounded-lg border border-dashed border-highlight h-full py-2 text-gray-400 flex items-center justify-center',
|
||||||
|
)}
|
||||||
|
>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -106,20 +106,29 @@ export function GrpcConnectionMessagesPane({ style, methodType, activeRequest }:
|
|||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<div className="h-full grid grid-rows-[auto_minmax(0,1fr)]">
|
<div className="h-full grid grid-rows-[auto_minmax(0,1fr)]">
|
||||||
<div className="mb-2 select-text cursor-text font-semibold">
|
<div>
|
||||||
{activeEvent.error ?? activeEvent.content}
|
<div className="select-text cursor-text font-semibold">
|
||||||
|
{activeEvent.content}
|
||||||
|
</div>
|
||||||
|
{activeEvent.error && (
|
||||||
|
<div className="text-xs font-mono py-1 text-orange-700">
|
||||||
|
{activeEvent.error}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div className="py-2 h-full">
|
||||||
|
{Object.keys(activeEvent.metadata).length === 0 ? (
|
||||||
|
<EmptyStateText>
|
||||||
|
No {activeEvent.eventType === 'connection_end' ? 'trailers' : 'metadata'}
|
||||||
|
</EmptyStateText>
|
||||||
|
) : (
|
||||||
|
<KeyValueRows>
|
||||||
|
{Object.entries(activeEvent.metadata).map(([key, value]) => (
|
||||||
|
<KeyValueRow key={key} label={key} value={value} />
|
||||||
|
))}
|
||||||
|
</KeyValueRows>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
{Object.keys(activeEvent.metadata).length === 0 ? (
|
|
||||||
<EmptyStateText>
|
|
||||||
No {activeEvent.eventType === 'connection_end' ? 'trailers' : 'metadata'}
|
|
||||||
</EmptyStateText>
|
|
||||||
) : (
|
|
||||||
<KeyValueRows>
|
|
||||||
{Object.entries(activeEvent.metadata).map(([key, value]) => (
|
|
||||||
<KeyValueRow key={key} label={key} value={value} />
|
|
||||||
))}
|
|
||||||
</KeyValueRows>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -186,7 +195,14 @@ function EventRow({
|
|||||||
: 'info'
|
: 'info'
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<div className={classNames('w-full truncate text-2xs')}>{error ?? content}</div>
|
<div className={classNames('w-full truncate text-2xs')}>
|
||||||
|
{content}
|
||||||
|
{error && (
|
||||||
|
<>
|
||||||
|
<span className="text-orange-600"> ({error})</span>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
<div className={classNames('opacity-50 text-2xs')}>
|
<div className={classNames('opacity-50 text-2xs')}>
|
||||||
{format(createdAt + 'Z', 'HH:mm:ss.SSS')}
|
{format(createdAt + 'Z', 'HH:mm:ss.SSS')}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -29,10 +29,12 @@ interface Props {
|
|||||||
export function KeyValueRow({ label, value, labelClassName }: Props) {
|
export function KeyValueRow({ label, value, labelClassName }: Props) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<td className={classNames('py-1 pr-2 text-gray-700 select-text cursor-text', labelClassName)}>
|
<td
|
||||||
|
className={classNames('py-0.5 pr-2 text-gray-700 select-text cursor-text', labelClassName)}
|
||||||
|
>
|
||||||
{label}
|
{label}
|
||||||
</td>
|
</td>
|
||||||
<td className="py-1 cursor-text select-text break-all min-w-0">{value}</td>
|
<td className="py-0.5 cursor-text select-text break-all min-w-0">{value}</td>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user