Skip to content
Snippets Groups Projects
Commit ad660234 authored by Chieh Lin's avatar Chieh Lin
Browse files

multiple database fix ERD

parent 4915e75b
No related branches found
No related tags found
No related merge requests found
Pipeline #367085 failed
No preview for this file type
This diff is collapsed.
No preview for this file type
from sqlalchemy.types import UserDefinedType
import re
class CompressedDataType(UserDefinedType):
def get_col_spec(self):
return "_timescaledb_internal.compressed_data"
class RegType(UserDefinedType):
def get_col_spec(self):
return "regtype"
class RegRole(UserDefinedType):
def get_col_spec(self):
return "regrole"
class Theme:
def __init__(self, color, fillcolor, fillcolorC,
bgcolor, icolor, tcolor, style, shape, pencolor, penwidth):
......
......@@ -2,11 +2,12 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Database ERD Viewer</title>
<link rel="stylesheet" href="{{ url_for('static', filename='uikit-3.18.0/css/uikit.min.css') }}" />
<script src="{{ url_for('static', filename='uikit-3.18.0/js/uikit.min.js') }}"></script>
<script src="{{ url_for('static', filename='uikit-3.18.0/js/uikit-icons.min.js') }}"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<script src="https://d3js.org/d3.v5.min.js"></script>
<script src="https://unpkg.com/d3-graphviz@2.6.1/build/d3-graphviz.min.js"></script>
<style>
......@@ -22,7 +23,7 @@
}
#sidebar1 {
/* position: relative; */
width: 15%;
width: 20%;
min-height: 100vh;
border-right: 0px solid #ccc;
background-color: #add8e6;
......@@ -77,6 +78,9 @@
/* padding-top: 0px;
padding-bottom: 0px; */
}
.accordion-button {
height: 8px;
}
.custom-push-button {
font-size: 14px;
width: 30px;
......@@ -214,21 +218,24 @@
</style>
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.8/dist/umd/popper.min.js" integrity="sha384-I7E8VVD/ismYTF4hNIPjVp/Zjvgyol6VFvRkX/vR+Vc4jQkC+hVqc2pM8ODewa9r" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.min.js" integrity="sha384-0pUGZvbkm6XF6gxjEnlmuGrJXVbNuzT9qBBavbLwCsOGabYfZo0T0to5eqruptLy" crossorigin="anonymous"></script>
<div id="sidebar1"> <!--class="uk-panel uk-panel-scrollable" -->
<h4>Database:</h4>
<p style="margin-top: -10px; padding-left: 5px;">{{database}}.db</p>
<ul uk-accordion>
<!-- <ul uk-accordion>
<li class="uk-open">
<a class="uk-accordion-title" href="#" style="margin-top: -8px; margin-bottom: -1px;">Schema:</a>
<div class="uk-accordion-content" style="margin-top: -3px; border: 1px solid black;">
<form method="post">
<label>
<input class="uk-checkbox" style="margin: 2px 2px 2px 5px; border-color: black;" type="checkbox" name="show_all" value="True" onchange="this.form.submit()" {{ 'checked' if show_all else '' }}>
<span class="uk-label" style="margin: 1px;" >show all</span>
<input class="form-check-input" id="flexCheckDefault" style="margin: 2px 2px 2px 5px; border-color: black;" type="checkbox" name="show_all" value="True" onchange="this.form.submit()" {{ 'checked' if show_all else '' }}>
<label class="form-check-label" for="flexCheckDefault" style="margin-top: 3px;">
Primary Tables
</label>
<select class="uk-select" name="schema" onchange='this.form.submit()' style="padding: 0px 1px 2px 1px;">
<select class="form-select" name="schema" onchange='this.form.submit()' style="padding: 0px 1px 2px 1px;">
<option value="">Choose here</option>
{% for schema in schemas %}
<option value="{{ schema }}" {% if schema == schema_Selected %} selected {% endif %}>{{ schema }}</option>
......@@ -246,7 +253,72 @@
<li>
<a class="uk-accordion-title" href="#">Label:</a>
</li>
</ul>
</ul> -->
<div class="accordion" id="accordionExample">
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
Schema
</button>
</h2>
<div id="collapseOne" class="accordion-collapse collapse show" data-bs-parent="#accordionExample">
<div class="accordion-body">
<form method="post">
<!-- <label> -->
<input class="form-check-input" id="flexCheckDefault" style="margin: 2px 2px 2px 5px; border-color: black;" type="checkbox" name="show_all" value="True" onchange="this.form.submit()" {{ 'checked' if show_all else '' }}>
<!-- <span class="uk-label" style="margin: 1px;" >show all</span> -->
<label class="form-check-label" for="flexCheckDefault" style="margin-top: 3px;">
Primary Tables
</label>
<!-- </label> -->
<select class="form-select" name="schema" onchange='this.form.submit()' style="padding: 0px 1px 2px 1px;">
<option value="">Choose here</option>
{% for schema in schemas %}
<option value="{{ schema }}" {% if schema == schema_Selected %} selected {% endif %}>{{ schema }}</option>
{% endfor %}
</select>
</form>
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapseTwo" aria-expanded="true" aria-controls="collapseTwo">
Time
</button>
</h2>
<div id="collapseTwo" class="accordion-collapse collapse show" data-bs-parent="#accordionExample">
<div class="accordion-body">
<!-- <strong>This is the first item's accordion body.</strong> It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the <code>.accordion-body</code>, though the transition does limit overflow. -->
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
Object
</button>
</h2>
<div id="collapseThree" class="accordion-collapse collapse" data-bs-parent="#accordionExample">
<div class="accordion-body">
<!-- <strong>This is the second item's accordion body.</strong> It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the <code>.accordion-body</code>, though the transition does limit overflow. -->
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseFour" aria-expanded="false" aria-controls="collapseFour">
Label
</button>
</h2>
<div id="collapseFour" class="accordion-collapse collapse" data-bs-parent="#accordionExample">
<div class="accordion-body">
<!-- <strong>This is the third item's accordion body.</strong> It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the <code>.accordion-body</code>, though the transition does limit overflow. -->
</div>
</div>
</div>
</div>
<h4 style="margin-top: 0px;">Tables:</h4>
<div id="table_list" style="margin-bottom: 5px; margin-top: -10px;">
......@@ -386,10 +458,15 @@
<!-- set_database.html -->
<form method="post" action="/">
<input type="text" name="database_uri" placeholder="Enter Database URI">
<input type="submit" value="Set Database">
<div class="mb-3">
<label for="exampleInputPassword1" name="database_uri" class="form-label">Database URI</label>
<input type="text" class="form-control" id="exampleInputPassword1" name="database_uri" placeholder="Enter Database URI">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</form>
<div id="resize-handle-left" class="resize-handle-left"></div>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment