diff --git a/src/main/js/routes/schema/schema.js b/src/main/js/routes/schema/schema.js index e77235b..0b82fdb 100644 --- a/src/main/js/routes/schema/schema.js +++ b/src/main/js/routes/schema/schema.js @@ -3,12 +3,15 @@ import {useOutletContext, useParams} from "react-router-dom"; import TabView from "../../components/tabs/tab-view"; import Preview from "./preview"; import Query from "./query"; +import SyntaxHighlighter from "react-syntax-highlighter"; +import {androidstudio} from "react-syntax-highlighter/dist/cjs/styles/hljs"; function Schema() { const vespaState = useOutletContext() const params = useParams() const containerUrl = getQueryableContainer(vespaState) const schema = params.schema + const schemaDetails = findSchemaDetails(vespaState, schema) return (<> - },]} /> + }, + { + "header": "Schema", + "content": + {schemaDetails} + + } + ]} /> ) /* finds a valid container to issue the query */ @@ -35,6 +45,16 @@ function Schema() { return "" } } + + function findSchemaDetails(vespaState, schema) { + for (let cluster of vespaState.content.clusters) { + for (let data of cluster.contentData) { + if (data.schema.schemaName === schema) { + return data.schema.schemaContent + } + } + } + } }