A document reads into one value, Datum: JSON through serde_json, its keys now kept in their written order, and YAML's block style through a small reader that says which line it could not read. JsonViewer and YamlViewer draw it as one tree: each key with its value, maps and lists with their counts; a search keeps what holds its words and opens the way; Enter on a value copies its JSONPath. XmlViewer reads elements, attributes and text and says where tags cross. JsonEditor writes JSON in the code editor with Format and Minify and says whether it reads. DocumentViewer is JsonViewer.
31 lines
762 B
Rust
31 lines
762 B
Rust
use gpui::{AnyElement, App, Window, div, prelude::*};
|
|
|
|
mod data;
|
|
mod db;
|
|
mod formats;
|
|
|
|
use super::Page;
|
|
use crate::script::Step;
|
|
|
|
pub const PAGE: Page = Page {
|
|
number: 33,
|
|
slug: "devtools",
|
|
title: "DB & Dev Tools",
|
|
summary: "Connections, schemas and queries, data to read, requests to send, and the machines that run them.",
|
|
render,
|
|
script: SCRIPT,
|
|
};
|
|
|
|
const SCRIPT: &[Step] = &[];
|
|
|
|
fn render(window: &mut Window, cx: &mut App) -> AnyElement {
|
|
div()
|
|
.child(db::connections(window, cx))
|
|
.child(db::schema(window, cx))
|
|
.child(data::queries(window, cx))
|
|
.child(db::structure(window, cx))
|
|
.child(data::redis(window, cx))
|
|
.child(formats::documents(window, cx))
|
|
.into_any_element()
|
|
}
|