Skip to content

Commit

Permalink
Fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
micafer committed Mar 27, 2024
1 parent ed647a5 commit ce32920
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def table_exists(self, table_name):
res = self.select('SELECT * FROM information_schema.tables WHERE table_name = %s and table_schema = %s',
(table_name, db))
elif self.db_type == DataBase.MONGO:
return table_name in self.connection.collection_names()
return table_name in self.connection.list_collection_names()
else:
return False

Expand Down
12 changes: 11 additions & 1 deletion app/templates/inflog.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
{% block title %}Infrastructure Log{% endblock %}
{% block content %}

<script>

function goToVM(vm) {
var element = document.getElementById("vm_" + vm);
let dims = element.getBoundingClientRect();
window.scrollTo(window.scrollX, dims.top - 75 + window.scrollY);
}

</script>

<div class="container">

<br>
Expand Down Expand Up @@ -29,7 +39,7 @@ <h4 class="font-weight-bold text-primary">
</button>
<div class="dropdown-menu" aria-labelledby="selectVM">
{% for vm in range(vms) %}
<a class="dropdown-item" onclick="document.getElementById('vm_{{vm}}').scrollIntoView();window.scrollBy(0, -100);">VM: {{vm}}</a>
<a class="dropdown-item" onclick="goToVM('{{vm}}')">VM: {{vm}}</a>
{% endfor %}
</div>
</div>
Expand Down
5 changes: 3 additions & 2 deletions app/templates/infrastructures.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ <h4 class="font-weight-bold text-primary">My Infrastructures</h4>
</div>
<div class="card-body">

<div class="table-responsive px-1">
<div class="table-responsive px-1" style="min-height: 28rem;">
<br>
<table class="table table-striped table-hover" id="tableUserDeployments" width="100%" cellspacing="0" style="padding-bottom: 20px;">
<table class="table table-striped table-hover pb-2" id="tableUserDeployments" width="100%" cellspacing="0">
<!--Table head-->
<thead>
<tr>
Expand Down Expand Up @@ -221,6 +221,7 @@ <h4 class="font-weight-bold text-primary">My Infrastructures</h4>
</div>
</td>
</tr>



<!-- Modal DELETE -->
Expand Down
2 changes: 1 addition & 1 deletion app/tests/test_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def test_mongo_db(self, mongo):
db = DataBase(db_url)
self.assertTrue(db.connect())

database.collection_names.return_value = ['table1']
database.list_collection_names.return_value = ['table1']
res = db.table_exists("test")
self.assertFalse(res)
res = db.table_exists("table1")
Expand Down

0 comments on commit ce32920

Please sign in to comment.