mirror of
https://github.com/sosedoff/pgweb.git
synced 2024-12-14 19:21:46 +03:00
Add disconnect button to close active connection
This commit is contained in:
parent
da43314332
commit
f08c9d36a6
File diff suppressed because one or more lines are too long
@ -471,10 +471,13 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
#edit_connection {
|
||||
.connection-actions {
|
||||
position: fixed;
|
||||
right: 8px;
|
||||
top: 10px;
|
||||
}
|
||||
|
||||
#edit_connection, #close_connection {
|
||||
background: #79589f;
|
||||
color: #fff;
|
||||
border-color: #fff;
|
||||
|
@ -29,7 +29,10 @@
|
||||
<li id="table_connection">Connection</li>
|
||||
</ul>
|
||||
|
||||
<a href="#" id="edit_connection" class="btn btn-default btn-sm"><i class="fa fa-globe"></i> Edit Connection</a>
|
||||
<div class="connection-actions">
|
||||
<a href="#" id="edit_connection" class="btn btn-default btn-sm"><i class="fa fa-database"></i> Connect</a>
|
||||
<a href="#" id="close_connection" class="btn btn-default btn-sm">Disconnect</a>
|
||||
</div>
|
||||
</div>
|
||||
<div id="sidebar">
|
||||
<div class="tables-list">
|
||||
|
@ -93,6 +93,7 @@ function getHistory(cb) { apiCall("get", "/history", {}, cb)
|
||||
function getBookmarks(cb) { apiCall("get", "/bookmarks", {}, cb); }
|
||||
function executeQuery(query, cb) { apiCall("post", "/query", { query: query }, cb); }
|
||||
function explainQuery(query, cb) { apiCall("post", "/explain", { query: query }, cb); }
|
||||
function disconnect(cb) { apiCall("post", "/disconnect", {}, cb); }
|
||||
|
||||
function encodeQuery(query) {
|
||||
return window.btoa(query);
|
||||
@ -883,6 +884,12 @@ $(document).ready(function() {
|
||||
showConnectionSettings();
|
||||
});
|
||||
|
||||
$("#close_connection").on("click", function() {
|
||||
disconnect(function() {
|
||||
showConnectionSettings();
|
||||
});
|
||||
});
|
||||
|
||||
$("#close_connection_window").on("click", function() {
|
||||
$("#connection_window").hide();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user