Fix app restart API; Add missing loading spinners and confirm dialogs on some pages
This commit is contained in:
parent
917eb62ed5
commit
d188139cdb
|
@ -42,5 +42,14 @@
|
|||
</ol>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="confirm-dialog"></div>
|
||||
|
||||
<div id="loading_spinner_overlay" class="loading_spinner_overlay" style="display:none;">
|
||||
<img id="loading_spinner" class="loading_image" src="{{ url_for('static', filename="images/loading.gif")}}"/>
|
||||
<br/>
|
||||
<span id="loading_spinner_message">Loading...</span>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -42,5 +42,14 @@
|
|||
</ol>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="confirm-dialog"></div>
|
||||
|
||||
<div id="loading_spinner_overlay" class="loading_spinner_overlay" style="display:none;">
|
||||
<img id="loading_spinner" class="loading_image" src="{{ url_for('static', filename="images/loading.gif")}}"/>
|
||||
<br/>
|
||||
<span id="loading_spinner_message">Loading...</span>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -13,6 +13,21 @@ function restart(name, short_name) {
|
|||
}
|
||||
}
|
||||
|
||||
function restart_app_via_api(name, short_name) {
|
||||
if ( confirm("Are you sure you want to restart "+name+"?") ) {
|
||||
$('#loading_spinner_message').html("Restarting...");
|
||||
$('#loading_spinner_overlay').fadeIn();
|
||||
$.get('/api/restart_app?app='+short_name)
|
||||
.done(function( data ) {
|
||||
if (data != "OK") {
|
||||
alert("Error restarting app: "+data)
|
||||
}
|
||||
$('#loading_spinner_overlay').fadeOut();
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// ==========================================
|
||||
// Manage app installations
|
||||
// ==========================================
|
||||
|
|
|
@ -31,18 +31,6 @@
|
|||
<script src="{{ url_for('static', filename='js/hes-gallery.min.js')}}"></script>
|
||||
|
||||
<script>
|
||||
function restart_app_via_api(name, short_name) {
|
||||
if ( confirm("Are you sure you want to restart "+name+"?") ) {
|
||||
$('#loading_spinner_message').html("Restarting...");
|
||||
$('#loading_spinner_overlay').fadeIn();
|
||||
$.getJSON('/api/restart_app?app='+short_name, function( data ) {
|
||||
alert(data)
|
||||
if (data != "OK") {
|
||||
alert("Error restarting app: "+data)
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
$(document).ready(function() {
|
||||
HesGallery.init({
|
||||
disableScrolling: false,
|
||||
|
@ -176,6 +164,8 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div id="confirm-dialog"></div>
|
||||
|
||||
<div id="loading_spinner_overlay" class="loading_spinner_overlay" style="display:none;">
|
||||
<img id="loading_spinner" class="loading_image" src="{{ url_for('static', filename="images/loading.gif")}}"/>
|
||||
<br/>
|
||||
|
|
Loading…
Reference in New Issue
Block a user