Skip to content

Commit f68b1c0

Browse files
authored
Merge pull request #530 from grycap/devel
Fix issues
2 parents ed647a5 + ce32920 commit f68b1c0

4 files changed

Lines changed: 16 additions & 5 deletions

File tree

app/db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def table_exists(self, table_name):
259259
res = self.select('SELECT * FROM information_schema.tables WHERE table_name = %s and table_schema = %s',
260260
(table_name, db))
261261
elif self.db_type == DataBase.MONGO:
262-
return table_name in self.connection.collection_names()
262+
return table_name in self.connection.list_collection_names()
263263
else:
264264
return False
265265

app/templates/inflog.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
{% block title %}Infrastructure Log{% endblock %}
33
{% block content %}
44

5+
<script>
6+
7+
function goToVM(vm) {
8+
var element = document.getElementById("vm_" + vm);
9+
let dims = element.getBoundingClientRect();
10+
window.scrollTo(window.scrollX, dims.top - 75 + window.scrollY);
11+
}
12+
13+
</script>
14+
515
<div class="container">
616

717
<br>
@@ -29,7 +39,7 @@ <h4 class="font-weight-bold text-primary">
2939
</button>
3040
<div class="dropdown-menu" aria-labelledby="selectVM">
3141
{% for vm in range(vms) %}
32-
<a class="dropdown-item" onclick="document.getElementById('vm_{{vm}}').scrollIntoView();window.scrollBy(0, -100);">VM: {{vm}}</a>
42+
<a class="dropdown-item" onclick="goToVM('{{vm}}')">VM: {{vm}}</a>
3343
{% endfor %}
3444
</div>
3545
</div>

app/templates/infrastructures.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ <h4 class="font-weight-bold text-primary">My Infrastructures</h4>
141141
</div>
142142
<div class="card-body">
143143

144-
<div class="table-responsive px-1">
144+
<div class="table-responsive px-1" style="min-height: 28rem;">
145145
<br>
146-
<table class="table table-striped table-hover" id="tableUserDeployments" width="100%" cellspacing="0" style="padding-bottom: 20px;">
146+
<table class="table table-striped table-hover pb-2" id="tableUserDeployments" width="100%" cellspacing="0">
147147
<!--Table head-->
148148
<thead>
149149
<tr>
@@ -221,6 +221,7 @@ <h4 class="font-weight-bold text-primary">My Infrastructures</h4>
221221
</div>
222222
</td>
223223
</tr>
224+
224225

225226

226227
<!-- Modal DELETE -->

app/tests/test_db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def test_mongo_db(self, mongo):
7575
db = DataBase(db_url)
7676
self.assertTrue(db.connect())
7777

78-
database.collection_names.return_value = ['table1']
78+
database.list_collection_names.return_value = ['table1']
7979
res = db.table_exists("test")
8080
self.assertFalse(res)
8181
res = db.table_exists("table1")

0 commit comments

Comments
 (0)