-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(eda.create-db-report): add orphan page and fix foreign key bug
- Loading branch information
Andrey Pham
committed
Aug 10, 2022
1 parent
00ce912
commit 4778fec
Showing
12 changed files
with
123 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<!-- Content Header (Page header) --> | ||
<section class="content-header"> | ||
<h1>Utility Tables</h1> | ||
</section> | ||
<!-- Main content --> | ||
<section class="content"> | ||
{% if diagram_tables %} | ||
<div class="box box-primary"> | ||
<div class="box-header with-border"> | ||
<i class="fa fa-code-fork"></i> | ||
<h3 class="box-title">Orphan Tables</h3> | ||
</div> | ||
<section class="interactive-diagrams"> | ||
<label for="diagram-layout-list">Layout</label> | ||
<select id="diagram-layout-list"> | ||
<option value="CircularLayout">Circular</option> | ||
<option value="LayeredDigraphLayout">Layered Digraph</option> | ||
<option value="GridLayout">Grid</option> | ||
<option value="TreeLayout">Tree</option> | ||
<option value="ForceDirectedLayout">Force-Directed</option> | ||
</select> | ||
<div id="interactive-diagrams" class="p-4 w-full"> | ||
<div id="myDiagramDiv" | ||
style="background-color: white; border: 1px solid black; width: 100%; height: 1000px; position: relative; cursor: auto;"> | ||
<canvas tabindex="0" width="2108" height="1396" | ||
style="position: absolute; top: 0px; left: 0px; z-index: 2; touch-action: none; width: 1054px; height: 698px; cursor: auto;"> | ||
This text is displayed if your browser does not support the Canvas HTML element. | ||
</canvas> | ||
<div style="position: absolute; overflow: auto; width: 1054px; height: 698px; z-index: 1;"> | ||
<div style="position: absolute; width: 1px; height: 1px;"></div> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
</div> | ||
{% endif %} | ||
{% if not diagram_tables %} | ||
<div class="alert alert-warning alert-dismissible"> | ||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | ||
<h4><i class="icon fa fa-warning"></i>Not all diagrams were created</h4> | ||
<p>SchemaSpy was unable to generate diagrams for all orphan tables.<br /> | ||
Check application output for details. | ||
</p> | ||
</div> | ||
{% endif %} | ||
</section> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import json | ||
from typing import List, Any | ||
from ..page_models.page_data import PageData | ||
from ..page_models.page_template import PageTemplate | ||
|
||
|
||
class OrphanPage: | ||
def __init__(self, template_object: PageTemplate) -> None: | ||
self.template_object = template_object | ||
|
||
def page_writer( | ||
self, | ||
json_tables: List[Any], | ||
json_relationships: List[Any], | ||
new_file: str, | ||
): | ||
""" | ||
Compile the data needed by the pystache template for orphan page | ||
""" | ||
page_data = PageData("orphan.html", "") | ||
page_data.add_scope("diagram_tables", json.dumps(json_tables)) | ||
page_data.add_scope("diagram_relationships", json.dumps(json_relationships)) | ||
page_data.set_depth(0) | ||
|
||
return self.template_object.write_data(page_data, new_file, "", {}) |