diff --git a/CLI/Controllers/TopologyController.cs b/CLI/Controllers/TopologyController.cs index 156f37d..21815eb 100644 --- a/CLI/Controllers/TopologyController.cs +++ b/CLI/Controllers/TopologyController.cs @@ -10,7 +10,15 @@ public class TopologyController: ControllerBase [HttpGet("/api/topology")] public IActionResult GetTopology() { - var topology = Project.Current?.GetTopology(); + var topology = Project.Current?.GetTopology(true); + if (topology is null) return NoContent(); + else return Ok(topology); + } + + [HttpGet("/api/topology/modules")] + public IActionResult GetTopologyModules() + { + var topology = Project.Current?.GetTopology(false); if (topology is null) return NoContent(); else return Ok(topology); } diff --git a/CLI/Project.Network.cs b/CLI/Project.Network.cs index 3775455..dd3a999 100644 --- a/CLI/Project.Network.cs +++ b/CLI/Project.Network.cs @@ -9,7 +9,7 @@ namespace CLI { public partial class Project { - public Topology GetTopology() + public Topology GetTopology(bool includeDetails) { var nodes = new List(); var edges = new List(); @@ -27,18 +27,18 @@ public Topology GetTopology() { Arrows = "to" }); - } else if (node is ASTType) + } else if (includeDetails && node is ASTType) { var _type = ((ASTType)node); var _id = $"{m.Name}.{_type.Name}"; nodes.Add(new TopologyNode(_id, _type.Name)); edges.Add(new TopologyEdge(moduleName, _id, "")); - } else if (node is ASTAlias alias) + } else if (includeDetails && node is ASTAlias alias) { var _id = $"{m.Name}.{alias.Name}"; nodes.Add(new TopologyNode(_id, alias.Name, new TopologyColor("#0096a0"))); edges.Add(new TopologyEdge(moduleName, _id, "")); - } else if (node is ASTData data) + } else if (includeDetails && node is ASTData data) { var _id = $"{m.Name}.{data.Name}"; nodes.Add(new TopologyNode(_id, data.Name, new TopologyColor("#fef6e1"))); diff --git a/CLI/wwwroot/build/bundle.css b/CLI/wwwroot/build/bundle.css index 70287e9..0407504 100644 --- a/CLI/wwwroot/build/bundle.css +++ b/CLI/wwwroot/build/bundle.css @@ -1,9 +1,9 @@ main.svelte-1kds1eb{text-align:center;padding:1em;max-width:240px;margin:0 auto}@media(min-width: 640px){main.svelte-1kds1eb{max-width:none}} tr.svelte-1aug0lv:hover{cursor:pointer} textarea.svelte-nhavks{width:750px;min-height:250px} -.errors.svelte-12e3mu{position:fixed;right:1rem;top:6rem}.error.svelte-12e3mu{min-width:300px;max-width:700px}.error.svelte-12e3mu pre.svelte-12e3mu{overflow-wrap:break-word}.editor-container.svelte-12e3mu{margin-top:1rem}.editor-container.svelte-12e3mu,#editor.svelte-12e3mu{width:700px;height:calc(100% - 4rem)} -.preview.svelte-1crxzpc{height:calc(100% - 60px)}iframe.svelte-1crxzpc{width:100%;height:100%;border:none} -.topology.svelte-11qpvbv{height:calc(100% - 4rem)}#topology.svelte-11qpvbv{height:100%}#topology>.svelte-11qpvbv:focus{outline:none !important} +.errors.svelte-1l9twu{position:fixed;right:1rem;top:6rem}.error.svelte-1l9twu{min-width:300px;max-width:700px}.error.svelte-1l9twu pre.svelte-1l9twu{overflow-wrap:break-word}.editor-container.svelte-1l9twu{margin-top:1rem}.editor-container.svelte-1l9twu,#editor.svelte-1l9twu{height:calc(100% - 4rem)} +.preview.svelte-7yoi32{height:calc(100% - 60px)}iframe.svelte-7yoi32{height:100%;width:23cm;padding:0 1cm;border:none;position:absolute;left:50%;transform:translateX(-50%)} +.topology.svelte-sq8u03{height:calc(100% - 4rem)}#topology.svelte-sq8u03{height:100%}#topology>.svelte-sq8u03:focus{outline:none !important}.options-form.svelte-sq8u03{position:fixed;right:10px;bottom:10px} .descriptor.svelte-86a2ch{border:1px solid lightgray;font-size:14px;padding:1;margin:0;width:450px;margin-bottom:1rem;margin-left:50%;transform:translateX(-50%)}.descriptor.svelte-86a2ch:hover{cursor:pointer}.descriptor.svelte-86a2ch h2.svelte-86a2ch{background:#3083db;color:white;padding:0.5em;font-size:1em;margin:0;position:relative}.descriptor.svelte-86a2ch .description.svelte-86a2ch{color:gray;padding:0 1rem}.pill.svelte-86a2ch{background:orange;border:1 px solid rgb(172, 114, 6);color:white;border-radius:50%;font-size:10px;text-transform:lowercase;padding:0.5em 1em 0.6em 1em;position:absolute;left:10px;top:50%;transform:translateY(-50%)}.pill.type.svelte-86a2ch{background:purple}.pill.field.svelte-86a2ch{background:darkgreen} ul.svelte-wjec8i{list-style:none;text-align:left} .overlay.svelte-yjqhyw{position:fixed;top:0;left:0;right:0;bottom:0;height:100%;width:100%;background:rgba(0, 0, 0, 0.4);visibility:hidden}.overlay.show.svelte-yjqhyw{visibility:visible}.overlay.svelte-yjqhyw .window.svelte-yjqhyw{background:#313338;border:1px solid 616265;border-radius:5px;position:absolute;top:10%;width:300px;left:50%;transform:translateX(-50%);font-size:2em;color:white} diff --git a/CLI/wwwroot/build/bundle.css.map b/CLI/wwwroot/build/bundle.css.map index 4cb8533..d6fe97e 100644 --- a/CLI/wwwroot/build/bundle.css.map +++ b/CLI/wwwroot/build/bundle.css.map @@ -16,13 +16,13 @@ "\n\n\n\n
\n\n navigator.navigate('index')}>\n Home\n \n navigator.navigate('module-topology')}>\n Topology\n \n navigator.navigate('lexicon')}>\n Lexicon\n \n {#if navigator.module}\n navigator.navigate('editor')}>\n Editor\n \n navigator.navigate('preview')}>\n Preview\n \n {/if}\n
\n\n{#if route === 'index'}\n \n{:else if route === 'lexicon'}\n \n{:else if route === 'add-lexicon'}\n \n{:else if route === 'edit-lexicon'}\n \n{:else if route === 'lexicon-admin'}\n \n{:else if route === 'preview'}\n \n{:else if route === 'editor'}\n \n{:else if route === 'config'}\n \n{:else if route === 'module-topology'}\n \n{:else if route === 'module-create'}\n \n{:else}\n \n{/if}\n", "\n\n\n\n
\n

Search your lexicon!

\n
\n {\n navigator.navigate('add-lexicon');\n }}>\n Create\n \n

Search your lexicon:

\n e.code === 'Enter' && onkeyup(e.target.value)}\n on:change={e => findData(e.target.value)} />\n
\n
\n\n \n \n \n \n \n \n {#each data as d}\n navigator.navigate('edit-lexicon', d.id)}>\n \n \n \n \n {/each}\n \n
DomainNameDescription
{d.domain}{d.name}{d.description}
\n", "\n\n\n\n

Domains

\n

Please give the domains you would like to restrict your lexicon to.

\n