Various...
This commit is contained in:
@@ -8,6 +8,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/modals/footer.php';
|
||||
<script src="/js/bootstrap-select.min.js"></script>
|
||||
<script src="/js/bootstrap-filestyle.min.js"></script>
|
||||
<script src="/js/notifications.min.js"></script>
|
||||
<script src="/js/formcache.min.js"></script>
|
||||
<script src="/js/numberedtextarea.min.js"></script>
|
||||
<script src="/js/u2f-api.js"></script>
|
||||
<script src="/js/api.js"></script>
|
||||
@@ -26,11 +27,19 @@ $(document).ready(function() {
|
||||
msg = $('<span/>').html(message).text();
|
||||
if (type == 'danger') {
|
||||
auto_hide = 0;
|
||||
$('#' + localStorage.getItem("add_modal")).modal('show');
|
||||
localStorage.removeItem("add_modal");
|
||||
} else {
|
||||
auto_hide = 5000;
|
||||
}
|
||||
$.ajax({
|
||||
url: '/inc/ajax/log_driver.php',
|
||||
data: {"type": type,"msg": msg},
|
||||
type: "GET"
|
||||
});
|
||||
$.notify({message: msg},{z_index: 20000, delay: auto_hide, type: type,placement: {from: "bottom",align: "right"},animate: {enter: 'animated fadeInUp',exit: 'animated fadeOutDown'}});
|
||||
}
|
||||
$('[data-cached-form="true"]').formcache({key: $(this).data('id')});
|
||||
<?php if (isset($_SESSION['return'])): ?>
|
||||
mailcow_alert_box(<?=json_encode($_SESSION['return']['msg']); ?>, "<?= $_SESSION['return']['type']; ?>");
|
||||
<?php endif; unset($_SESSION['return']); ?>
|
||||
@@ -118,13 +127,8 @@ $(document).ready(function() {
|
||||
}
|
||||
});
|
||||
|
||||
// Activate tooltips
|
||||
$(function () {
|
||||
$('[data-toggle="tooltip"]').tooltip()
|
||||
})
|
||||
// Hide alerts after n seconds
|
||||
$("#alert-fade").fadeTo(7000, 500).slideUp(500, function(){
|
||||
$("#alert-fade").alert('close');
|
||||
});
|
||||
|
||||
// Remember last navigation pill
|
||||
@@ -173,36 +177,32 @@ $(document).ready(function() {
|
||||
// Init Bootstrap Selectpicker
|
||||
$('select').selectpicker();
|
||||
|
||||
// Trigger SOGo restart
|
||||
$('#triggerRestartSogo').click(function(){
|
||||
$(this).prop("disabled",true);
|
||||
$(this).html('<span class="glyphicon glyphicon-refresh glyphicon-spin"></span> ');
|
||||
$('#statusTriggerRestartSogo').text('Stopping SOGo workers, this may take a while... ');
|
||||
$.ajax({
|
||||
method: 'get',
|
||||
url: '/inc/ajax/sogo_ctrl.php',
|
||||
data: {
|
||||
'ajax': true,
|
||||
'ACTION': 'stop'
|
||||
},
|
||||
success: function(data) {
|
||||
$('#statusTriggerRestartSogo').append(data);
|
||||
$('#statusTriggerRestartSogo').append('<br>Starting SOGo...');
|
||||
$.ajax({
|
||||
method: 'get',
|
||||
url: '/inc/ajax/sogo_ctrl.php',
|
||||
data: {
|
||||
'ajax': true,
|
||||
'ACTION': 'start'
|
||||
},
|
||||
success: function(data) {
|
||||
$('#statusTriggerRestartSogo').append(data);
|
||||
$('#triggerRestartSogo').html('<span class="glyphicon glyphicon-ok"></span> ');
|
||||
}
|
||||
});
|
||||
}
|
||||
// Trigger container restart
|
||||
$('#RestartContainer').on('show.bs.modal', function(e) {
|
||||
var container = $(e.relatedTarget).data('container');
|
||||
$('#containerName').text(container);
|
||||
$('#triggerRestartContainer').click(function(){
|
||||
$(this).prop("disabled",true);
|
||||
$(this).html('<span class="glyphicon glyphicon-refresh glyphicon-spin"></span> ');
|
||||
$('#statusTriggerRestartContainer').text('Restarting container, this may take a while... ');
|
||||
$.ajax({
|
||||
method: 'get',
|
||||
url: '/inc/ajax/container_ctrl.php',
|
||||
timeout: 3000,
|
||||
data: {
|
||||
'service': container,
|
||||
'action': 'restart'
|
||||
},
|
||||
error: function() {
|
||||
window.location = window.location.href.split("#")[0];
|
||||
},
|
||||
success: function(data) {
|
||||
$('#statusTriggerRestartContainer').append(data);
|
||||
$('#triggerRestartContainer').html('<span class="glyphicon glyphicon-ok"></span> ');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
})
|
||||
|
||||
// CSRF
|
||||
$('<input type="hidden" value="<?= $_SESSION['CSRF']['TOKEN']; ?>">').attr('id', 'csrf_token').attr('name', 'csrf_token').appendTo('form');
|
||||
@@ -216,4 +216,4 @@ $(document).ready(function() {
|
||||
</html>
|
||||
<?php
|
||||
$stmt = null;
|
||||
$pdo = null;
|
||||
$pdo = null;
|
||||
|
Reference in New Issue
Block a user