Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues #530

Merged
merged 1 commit into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading