diff --git a/devtools/src/server.rs b/devtools/src/server.rs
index c1b290b4..5e9ffcd6 100644
--- a/devtools/src/server.rs
+++ b/devtools/src/server.rs
@@ -5,6 +5,7 @@ use futures::{FutureExt, Stream, TryStreamExt};
use std::net::SocketAddr;
use std::path::PathBuf;
use std::sync::Arc;
+use std::time::Duration;
use tauri::http::header::HeaderValue;
use tauri::{AppHandle, Runtime};
use tauri_devtools_wire_format as wire;
@@ -12,7 +13,10 @@ use tauri_devtools_wire_format::instrument;
use tauri_devtools_wire_format::instrument::instrument_server::InstrumentServer;
use tauri_devtools_wire_format::instrument::{instrument_server, InstrumentRequest};
use tauri_devtools_wire_format::meta::metadata_server::MetadataServer;
-use tauri_devtools_wire_format::meta::{metadata_server, AppMetadata, AppMetadataRequest};
+use tauri_devtools_wire_format::meta::{
+ metadata_server, AppMetadata, AppMetadataRequest, InstrumentationMetadata,
+ InstrumentationMetadataRequest,
+};
use tauri_devtools_wire_format::sources::sources_server::SourcesServer;
use tauri_devtools_wire_format::sources::{Chunk, Entry, EntryRequest, FileType};
use tauri_devtools_wire_format::tauri::tauri_server::TauriServer;
@@ -65,12 +69,14 @@ struct SourcesService {
struct MetaService {
app_handle: AppHandle,
+ publish_interval: Duration,
}
impl Server {
pub fn new(
cmd_tx: mpsc::Sender,
app_handle: AppHandle,
+ publish_interval: Duration,
metrics: Arc>,
) -> Self {
let (mut health_reporter, health_service) = tonic_health::server::health_reporter();
@@ -95,6 +101,7 @@ impl Server {
}, // the TauriServer doesn't need a health_reporter. It can never fail.
meta: MetaService {
app_handle: app_handle.clone(),
+ publish_interval,
},
sources: SourcesService { app_handle },
health: unsafe { std::mem::transmute(health_service) },
@@ -392,6 +399,21 @@ impl metadata_server::Metadata for MetaService {
Ok(Response::new(meta))
}
+
+ async fn get_instrumentation_metadata(
+ &self,
+ _req: Request,
+ ) -> Result, Status> {
+ let duration = prost_types::Duration {
+ seconds: self.publish_interval.as_secs() as i64,
+ nanos: self.publish_interval.subsec_nanos() as i32,
+ };
+
+ Ok(Response::new(InstrumentationMetadata {
+ version: env!("CARGO_PKG_VERSION").to_string(),
+ publish_interval: Some(duration),
+ }))
+ }
}
#[cfg(test)]
diff --git a/devtools/src/tauri_plugin.rs b/devtools/src/tauri_plugin.rs
index 982f9199..f1988c26 100644
--- a/devtools/src/tauri_plugin.rs
+++ b/devtools/src/tauri_plugin.rs
@@ -25,7 +25,7 @@ pub(crate) fn init(
let m = metrics.clone();
tauri::plugin::Builder::new("probe")
.setup(move |app_handle| {
- let server = Server::new(cmd_tx, app_handle.clone(), m);
+ let server = Server::new(cmd_tx, app_handle.clone(), publish_interval, m);
// spawn the server and aggregator in a separate thread
// so we don't interfere with the application we're trying to instrument
diff --git a/web-client/package.json b/web-client/package.json
index 5e7ad261..2547e7a0 100644
--- a/web-client/package.json
+++ b/web-client/package.json
@@ -43,7 +43,9 @@
},
"dependencies": {
"@crabnebula/file-icons": "^0.1.0",
+ "@iarna/toml": "^2.2.5",
"@kobalte/core": "^0.11.2",
+ "@kobalte/tailwindcss": "^0.9.0",
"@protobuf-ts/grpcweb-transport": "^2.9.1",
"@protobuf-ts/plugin": "^2.9.1",
"@protobuf-ts/runtime": "^2.9.1",
diff --git a/web-client/pnpm-lock.yaml b/web-client/pnpm-lock.yaml
index c6c1b3c4..bd48ab7c 100644
--- a/web-client/pnpm-lock.yaml
+++ b/web-client/pnpm-lock.yaml
@@ -8,9 +8,15 @@ dependencies:
'@crabnebula/file-icons':
specifier: ^0.1.0
version: 0.1.0
+ '@iarna/toml':
+ specifier: ^2.2.5
+ version: 2.2.5
'@kobalte/core':
specifier: ^0.11.2
version: 0.11.2(solid-js@1.8.5)
+ '@kobalte/tailwindcss':
+ specifier: ^0.9.0
+ version: 0.9.0(tailwindcss@3.3.5)
'@protobuf-ts/grpcweb-transport':
specifier: ^2.9.1
version: 2.9.1
@@ -786,6 +792,10 @@ packages:
resolution: {integrity: sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==}
dev: true
+ /@iarna/toml@2.2.5:
+ resolution: {integrity: sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==}
+ dev: false
+
/@internationalized/date@3.5.0:
resolution: {integrity: sha512-nw0Q+oRkizBWMioseI8+2TeUPEyopJVz5YxoYVzR0W1v+2YytiYah7s/ot35F149q/xAg4F1gT/6eTd+tsUpFQ==}
dependencies:
@@ -874,6 +884,14 @@ packages:
solid-js: 1.8.5
dev: false
+ /@kobalte/tailwindcss@0.9.0(tailwindcss@3.3.5):
+ resolution: {integrity: sha512-WbueJTVRiO4yrmfHIBwp07y3M5iibJ/gauEAQ7mOyg1tZulvpO7SM/UdgzX95a9a0KDt1mQFxwO7RmpOUXWOWA==}
+ peerDependencies:
+ tailwindcss: ^3.3.3
+ dependencies:
+ tailwindcss: 3.3.5
+ dev: false
+
/@kobalte/utils@0.9.0(solid-js@1.8.5):
resolution: {integrity: sha512-TYVCpQcpqo1+0HBn3NXoGEBzxd4tH6Um1oc07nrYw1V7Qq0qbMaYAOnfBc1qhlh7sGV4XZldmb0j13Of0FrZQg==}
peerDependencies:
diff --git a/web-client/src/components/autoscroll-pane.tsx b/web-client/src/components/autoscroll-pane.tsx
index 8c21abb2..ab748f08 100644
--- a/web-client/src/components/autoscroll-pane.tsx
+++ b/web-client/src/components/autoscroll-pane.tsx
@@ -1,4 +1,4 @@
-import { Accessor, JSX, createEffect, on } from "solid-js";
+import { Accessor, JSXElement, createEffect, on } from "solid-js";
function scrollEnd(ref?: HTMLElement, smooth?: boolean) {
ref?.scroll({
@@ -14,7 +14,7 @@ function scrollEnd(ref?: HTMLElement, smooth?: boolean) {
type AutoScrollPaneProps = {
dataStream: unknown;
shouldAutoScroll: Accessor;
- children: JSX.Element;
+ children: JSXElement;
};
export function AutoscrollPane(props: AutoScrollPaneProps) {
diff --git a/web-client/src/components/boot-time.tsx b/web-client/src/components/boot-time.tsx
index b8fc312a..12af1dfd 100644
--- a/web-client/src/components/boot-time.tsx
+++ b/web-client/src/components/boot-time.tsx
@@ -1,16 +1,16 @@
import { Show } from "solid-js";
-import { useMonitor } from "~/lib/connection/monitor";
+import { Loader } from "./loader";
+import { useMonitor } from "~/context/monitor-provider";
export function BootTime() {
const { monitorData } = useMonitor();
-
return (
-
+ }>
{(e) => (
Loading time:
- {Number(e().seconds) * 1000 + e().nanos / 1e6}ms
+ {(Number(e().seconds) * 1000 + e().nanos / 1e6).toFixed(2)}ms
)}
diff --git a/web-client/src/components/disconnect-button.tsx b/web-client/src/components/disconnect-button.tsx
index 647d6084..31bdb682 100644
--- a/web-client/src/components/disconnect-button.tsx
+++ b/web-client/src/components/disconnect-button.tsx
@@ -1,16 +1,19 @@
import { Button } from "@kobalte/core";
+import { useNavigate } from "@solidjs/router";
+import { useConnection } from "~/context/connection-provider";
-type DisconnectProps = {
- closeSession: () => void;
-};
-
-export function DisconnectButton(props: DisconnectProps) {
+export function DisconnectButton() {
+ const { connectionStore } = useConnection();
+ const goto = useNavigate();
return (
{
+ connectionStore.abortController.abort();
+ goto("/");
+ }}
>
Close connection
-