[Web] Add search fields to some select forms
[Web] Better container restart js, but still a wip [Web] Allow to set a DOCKER_TIMEOUT in vars.inc.php, default is 60 (seconds)master
parent
7de2607594
commit
cedc38fbaa
|
@ -135,4 +135,7 @@ nav .glyphicon {
|
||||||
}
|
}
|
||||||
#top {
|
#top {
|
||||||
padding-top: 70px;
|
padding-top: 70px;
|
||||||
|
}
|
||||||
|
.bootstrap-select.btn-group .no-results {
|
||||||
|
display: none;
|
||||||
}
|
}
|
|
@ -80,7 +80,7 @@ if (isset($_SESSION['mailcow_cc_role'])) {
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-sm-2" for="domains"><?=$lang['edit']['domains'];?></label>
|
<label class="control-label col-sm-2" for="domains"><?=$lang['edit']['domains'];?></label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<select id="domains" name="domains" multiple required>
|
<select data-live-search="true" id="domains" name="domains" multiple required>
|
||||||
<?php
|
<?php
|
||||||
foreach ($result['selected_domains'] as $domain):
|
foreach ($result['selected_domains'] as $domain):
|
||||||
?>
|
?>
|
||||||
|
@ -186,7 +186,7 @@ if (isset($_SESSION['mailcow_cc_role'])) {
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-sm-2" for="quota">Relayhost</label>
|
<label class="control-label col-sm-2" for="quota">Relayhost</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<select name="relayhost" id="relayhost" class="form-control">
|
<select data-live-search="true" name="relayhost" id="relayhost" class="form-control">
|
||||||
<?php
|
<?php
|
||||||
foreach ($rlyhosts as $rlyhost) {
|
foreach ($rlyhosts as $rlyhost) {
|
||||||
?>
|
?>
|
||||||
|
@ -408,7 +408,7 @@ if (isset($_SESSION['mailcow_cc_role'])) {
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-sm-2" for="sender_acl"><?=$lang['edit']['sender_acl'];?>:</label>
|
<label class="control-label col-sm-2" for="sender_acl"><?=$lang['edit']['sender_acl'];?>:</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<select data-width="100%" style="width:100%" id="sender_acl" name="sender_acl" size="10" multiple>
|
<select data-live-search="true" data-width="100%" style="width:100%" id="sender_acl" name="sender_acl" size="10" multiple>
|
||||||
<?php
|
<?php
|
||||||
$sender_acl_handles = mailbox('get', 'sender_acl_handles', $mailbox);
|
$sender_acl_handles = mailbox('get', 'sender_acl_handles', $mailbox);
|
||||||
|
|
||||||
|
|
|
@ -203,27 +203,29 @@ $(document).ready(function() {
|
||||||
$('#triggerRestartContainer').click(function(){
|
$('#triggerRestartContainer').click(function(){
|
||||||
$(this).prop("disabled",true);
|
$(this).prop("disabled",true);
|
||||||
$(this).html('<span class="glyphicon glyphicon-refresh glyphicon-spin"></span> ');
|
$(this).html('<span class="glyphicon glyphicon-refresh glyphicon-spin"></span> ');
|
||||||
$('#statusTriggerRestartContainer').text('Restarting container, this may take a while... ');
|
$('#statusTriggerRestartContainer').html('<?= $lang['footer']['restarting_container']; ?>');
|
||||||
$('#statusTriggerRestartContainer2').text('Reloading webpage... ');
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: '/inc/ajax/container_ctrl.php',
|
url: '/inc/ajax/container_ctrl.php',
|
||||||
timeout: 10000,
|
timeout: <?= $DOCKER_TIMEOUT * 1000; ?>,
|
||||||
data: {
|
data: {
|
||||||
'service': container,
|
'service': container,
|
||||||
'action': 'restart'
|
'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> ');
|
|
||||||
$('#statusTriggerRestartContainer2').append(data);
|
|
||||||
$('#triggerRestartContainer').html('<span class="glyphicon glyphicon-ok"></span> ');
|
|
||||||
window.location = window.location.href.split("#")[0];
|
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
.always( function (data, status) {
|
||||||
|
$('#statusTriggerRestartContainer').append(data);
|
||||||
|
var htmlResponse = $.parseHTML(data)
|
||||||
|
if ($(htmlResponse).find('span').hasClass('text-success')) {
|
||||||
|
$('#triggerRestartContainer').html('<span class="glyphicon glyphicon-ok"></span> ');
|
||||||
|
setTimeout(function(){
|
||||||
|
$('#RestartContainer').modal('toggle');
|
||||||
|
window.location = window.location.href.split("#")[0];
|
||||||
|
}, 1200);
|
||||||
|
} else {
|
||||||
|
$('#triggerRestartContainer').html('<span class="glyphicon glyphicon-remove"></span> ');
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
function docker($service_name, $action, $attr1 = null, $attr2 = null, $extra_headers = null) {
|
function docker($service_name, $action, $attr1 = null, $attr2 = null, $extra_headers = null) {
|
||||||
|
global $DOCKER_TIMEOUT;
|
||||||
$curl = curl_init();
|
$curl = curl_init();
|
||||||
curl_setopt($curl, CURLOPT_HTTPHEADER,array( 'Content-Type: application/json' ));
|
curl_setopt($curl, CURLOPT_HTTPHEADER,array( 'Content-Type: application/json' ));
|
||||||
switch($action) {
|
switch($action) {
|
||||||
|
@ -7,7 +8,7 @@ function docker($service_name, $action, $attr1 = null, $attr2 = null, $extra_hea
|
||||||
curl_setopt($curl, CURLOPT_URL, 'http://dockerapi:8080/containers/json');
|
curl_setopt($curl, CURLOPT_URL, 'http://dockerapi:8080/containers/json');
|
||||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
||||||
curl_setopt($curl, CURLOPT_POST, 0);
|
curl_setopt($curl, CURLOPT_POST, 0);
|
||||||
curl_setopt($curl, CURLOPT_TIMEOUT, 10);
|
curl_setopt($curl, CURLOPT_TIMEOUT, $DOCKER_TIMEOUT);
|
||||||
$response = curl_exec($curl);
|
$response = curl_exec($curl);
|
||||||
if ($response === false) {
|
if ($response === false) {
|
||||||
$err = curl_error($curl);
|
$err = curl_error($curl);
|
||||||
|
@ -30,7 +31,7 @@ function docker($service_name, $action, $attr1 = null, $attr2 = null, $extra_hea
|
||||||
curl_setopt($curl, CURLOPT_URL, 'http://dockerapi:8080/containers/json');
|
curl_setopt($curl, CURLOPT_URL, 'http://dockerapi:8080/containers/json');
|
||||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
||||||
curl_setopt($curl, CURLOPT_POST, 0);
|
curl_setopt($curl, CURLOPT_POST, 0);
|
||||||
curl_setopt($curl, CURLOPT_TIMEOUT, 10);
|
curl_setopt($curl, CURLOPT_TIMEOUT, $DOCKER_TIMEOUT);
|
||||||
$response = curl_exec($curl);
|
$response = curl_exec($curl);
|
||||||
if ($response === false) {
|
if ($response === false) {
|
||||||
$err = curl_error($curl);
|
$err = curl_error($curl);
|
||||||
|
@ -55,7 +56,7 @@ function docker($service_name, $action, $attr1 = null, $attr2 = null, $extra_hea
|
||||||
curl_setopt($curl, CURLOPT_URL, 'http://dockerapi:8080/containers/' . $container_id . '/json');
|
curl_setopt($curl, CURLOPT_URL, 'http://dockerapi:8080/containers/' . $container_id . '/json');
|
||||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
||||||
curl_setopt($curl, CURLOPT_POST, 0);
|
curl_setopt($curl, CURLOPT_POST, 0);
|
||||||
curl_setopt($curl, CURLOPT_TIMEOUT, 10);
|
curl_setopt($curl, CURLOPT_TIMEOUT, $DOCKER_TIMEOUT);
|
||||||
$response = curl_exec($curl);
|
$response = curl_exec($curl);
|
||||||
if ($response === false) {
|
if ($response === false) {
|
||||||
$err = curl_error($curl);
|
$err = curl_error($curl);
|
||||||
|
@ -82,7 +83,7 @@ function docker($service_name, $action, $attr1 = null, $attr2 = null, $extra_hea
|
||||||
if (ctype_xdigit($container_id) && ctype_alnum($attr1)) {
|
if (ctype_xdigit($container_id) && ctype_alnum($attr1)) {
|
||||||
curl_setopt($curl, CURLOPT_URL, 'http://dockerapi:8080/containers/' . $container_id . '/' . $attr1);
|
curl_setopt($curl, CURLOPT_URL, 'http://dockerapi:8080/containers/' . $container_id . '/' . $attr1);
|
||||||
curl_setopt($curl, CURLOPT_POST, 1);
|
curl_setopt($curl, CURLOPT_POST, 1);
|
||||||
curl_setopt($curl, CURLOPT_TIMEOUT, 10);
|
curl_setopt($curl, CURLOPT_TIMEOUT, $DOCKER_TIMEOUT);
|
||||||
if (!empty($attr2)) {
|
if (!empty($attr2)) {
|
||||||
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($attr2));
|
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($attr2));
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?xml version='1.0' standalone='yes'?>
|
||||||
|
|
||||||
|
<extension name="vacation-seconds">
|
||||||
|
|
||||||
|
<command name="vacation">
|
||||||
|
|
||||||
|
<parameter type="tag" name="seconds" occurrence="optional" regex="seconds">
|
||||||
|
<parameter type="number" name="period" />
|
||||||
|
</parameter>
|
||||||
|
|
||||||
|
<parameter type="tag" name="addresses" occurrence="optional" regex="addresses">
|
||||||
|
<parameter type="stringlist" name="address strings" />
|
||||||
|
</parameter>
|
||||||
|
|
||||||
|
<parameter type="tag" name="subject" occurrence="optional" regex="subject">
|
||||||
|
<parameter type="string" name="subject string" />
|
||||||
|
</parameter>
|
||||||
|
|
||||||
|
<parameter type="tag" name="from" occurrence="optional" regex="from">
|
||||||
|
<parameter type="string" name="from string" />
|
||||||
|
</parameter>
|
||||||
|
|
||||||
|
<parameter type="tag" name="handle" occurrence="optional" regex="handle">
|
||||||
|
<parameter type="string" name="handle string" />
|
||||||
|
</parameter>
|
||||||
|
|
||||||
|
<parameter type="tag" name="mime" occurrence="optional" regex="mime" />
|
||||||
|
|
||||||
|
<parameter type="string" name="reason" />
|
||||||
|
</command>
|
||||||
|
|
||||||
|
</extension>
|
|
@ -116,3 +116,6 @@ $OTP_LABEL = "mailcow UI";
|
||||||
|
|
||||||
// Default "to" address in relay test tool
|
// Default "to" address in relay test tool
|
||||||
$RELAY_TO = "null@hosted.mailcow.de";
|
$RELAY_TO = "null@hosted.mailcow.de";
|
||||||
|
|
||||||
|
// How long to wait (in s) for cURL Docker requests
|
||||||
|
$DOCKER_TIMEOUT = 60;
|
|
@ -8,7 +8,8 @@ $lang['header']['restart_sogo'] = 'SOGo neustarten';
|
||||||
$lang['header']['restart_netfilter'] = 'Netfilter neustarten';
|
$lang['header']['restart_netfilter'] = 'Netfilter neustarten';
|
||||||
$lang['footer']['restart_container'] = 'Container neustarten';
|
$lang['footer']['restart_container'] = 'Container neustarten';
|
||||||
$lang['footer']['restart_now'] = 'Jetzt neustarten';
|
$lang['footer']['restart_now'] = 'Jetzt neustarten';
|
||||||
$lang['footer']['restart_container_info'] = '<b>Wichtig:</b> Ein korrekter Neustart eines Containers kann eine Weile in Anspruch nehmen, bitte warten Sie, bis der Prozess vollständig beendet wurde.';
|
$lang['footer']['restarting_container'] = 'Container wird neugestartet, bitte warten...';
|
||||||
|
$lang['footer']['restart_container_info'] = '<b>Wichtig:</b> Der Neustart eines Containers kann eine Weile in Anspruch nehmen, bitte warten Sie, bis der Prozess vollständig beendet wurde.<br>Die Website wird neugeladen, wenn der Vorgang erfolgreich ist.';
|
||||||
|
|
||||||
$lang['footer']['confirm_delete'] = 'Löschen bestätigen';
|
$lang['footer']['confirm_delete'] = 'Löschen bestätigen';
|
||||||
$lang['footer']['delete_these_items'] = 'Sind Sie sicher, dass die Änderungen an Elementen mit folgender ID durchgeführt werden sollen?';
|
$lang['footer']['delete_these_items'] = 'Sind Sie sicher, dass die Änderungen an Elementen mit folgender ID durchgeführt werden sollen?';
|
||||||
|
|
|
@ -8,7 +8,8 @@ $lang['header']['restart_sogo'] = 'Restart SOGo';
|
||||||
$lang['header']['restart_netfilter'] = 'Restart netfilter';
|
$lang['header']['restart_netfilter'] = 'Restart netfilter';
|
||||||
$lang['footer']['restart_container'] = 'Restart container';
|
$lang['footer']['restart_container'] = 'Restart container';
|
||||||
$lang['footer']['restart_now'] = 'Restart now';
|
$lang['footer']['restart_now'] = 'Restart now';
|
||||||
$lang['footer']['restart_container_info'] = '<b>Important:</b> A graceful restart may take a while to complete, please wait for it to finish.';
|
$lang['footer']['restarting_container'] = 'Restarting container, this may take a while...';
|
||||||
|
$lang['footer']['restart_container_info'] = '<b>Important:</b> A graceful restart may take a while to complete, please wait for it to finish.<br>This website will reload if the process succeeded.';
|
||||||
|
|
||||||
$lang['footer']['confirm_delete'] = 'Confirm deletion';
|
$lang['footer']['confirm_delete'] = 'Confirm deletion';
|
||||||
$lang['footer']['delete_these_items'] = 'Please confirm your changes to the following object id:';
|
$lang['footer']['delete_these_items'] = 'Please confirm your changes to the following object id:';
|
||||||
|
|
|
@ -196,7 +196,6 @@ if (isset($_SESSION['mailcow_cc_role']) && $_SESSION['mailcow_cc_role'] == 'admi
|
||||||
<button class="btn btn-md btn-primary" id="triggerRestartContainer"><?= $lang['footer']['restart_now']; ?></button>
|
<button class="btn btn-md btn-primary" id="triggerRestartContainer"><?= $lang['footer']['restart_now']; ?></button>
|
||||||
<br><br>
|
<br><br>
|
||||||
<div id="statusTriggerRestartContainer"></div>
|
<div id="statusTriggerRestartContainer"></div>
|
||||||
<div id="statusTriggerRestartContainer2"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -23,7 +23,7 @@ if (!isset($_SESSION['mailcow_cc_role'])) {
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-sm-2" for="domain"><?=$lang['add']['domain'];?>:</label>
|
<label class="control-label col-sm-2" for="domain"><?=$lang['add']['domain'];?>:</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<select id="addSelectDomain" name="domain" id="domain" required>
|
<select data-live-search="true" id="addSelectDomain" name="domain" id="domain" required>
|
||||||
<?php
|
<?php
|
||||||
foreach (mailbox('get', 'domains') as $domain) {
|
foreach (mailbox('get', 'domains') as $domain) {
|
||||||
echo "<option>".htmlspecialchars($domain)."</option>";
|
echo "<option>".htmlspecialchars($domain)."</option>";
|
||||||
|
@ -172,7 +172,7 @@ if (!isset($_SESSION['mailcow_cc_role'])) {
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-sm-2" for="domain"><?=$lang['add']['domain'];?>:</label>
|
<label class="control-label col-sm-2" for="domain"><?=$lang['add']['domain'];?>:</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<select name="domain" id="domain" title="<?=$lang['add']['select'];?>" required>
|
<select data-live-search="true" name="domain" id="domain" title="<?=$lang['add']['select'];?>" required>
|
||||||
<?php
|
<?php
|
||||||
foreach (mailbox('get', 'domains') as $domain) {
|
foreach (mailbox('get', 'domains') as $domain) {
|
||||||
echo "<option>".htmlspecialchars($domain)."</option>";
|
echo "<option>".htmlspecialchars($domain)."</option>";
|
||||||
|
@ -289,7 +289,7 @@ if (!isset($_SESSION['mailcow_cc_role'])) {
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-sm-2" for="target_domain"><?=$lang['add']['target_domain'];?></label>
|
<label class="control-label col-sm-2" for="target_domain"><?=$lang['add']['target_domain'];?></label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<select name="target_domain" id="target_domain" title="<?=$lang['add']['select'];?>" required>
|
<select data-live-search="true" name="target_domain" id="target_domain" title="<?=$lang['add']['select'];?>" required>
|
||||||
<?php
|
<?php
|
||||||
foreach (mailbox('get', 'domains') as $domain) {
|
foreach (mailbox('get', 'domains') as $domain) {
|
||||||
echo "<option>".htmlspecialchars($domain)."</option>";
|
echo "<option>".htmlspecialchars($domain)."</option>";
|
||||||
|
@ -329,7 +329,7 @@ if (!isset($_SESSION['mailcow_cc_role'])) {
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-sm-2" for="username"><?=$lang['add']['username'];?>:</label>
|
<label class="control-label col-sm-2" for="username"><?=$lang['add']['username'];?>:</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<select id="addSelectUsername" name="username" id="username" required>
|
<select data-live-search="true" id="addSelectUsername" name="username" id="username" required>
|
||||||
<?php
|
<?php
|
||||||
$domains = mailbox('get', 'domains');
|
$domains = mailbox('get', 'domains');
|
||||||
if (!empty($domains)) {
|
if (!empty($domains)) {
|
||||||
|
@ -477,7 +477,7 @@ if (!isset($_SESSION['mailcow_cc_role'])) {
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-sm-2" for="username"><?=$lang['add']['username'];?>:</label>
|
<label class="control-label col-sm-2" for="username"><?=$lang['add']['username'];?>:</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<select id="addSelectUsername" name="username" id="username" required>
|
<select data-live-search="true" id="addSelectUsername" name="username" id="username" required>
|
||||||
<?php
|
<?php
|
||||||
$domains = mailbox('get', 'domains');
|
$domains = mailbox('get', 'domains');
|
||||||
if (!empty($domains)) {
|
if (!empty($domains)) {
|
||||||
|
@ -545,7 +545,7 @@ if (!isset($_SESSION['mailcow_cc_role'])) {
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-sm-2" for="local_dest"><?=$lang['mailbox']['bcc_local_dest'];?>:</label>
|
<label class="control-label col-sm-2" for="local_dest"><?=$lang['mailbox']['bcc_local_dest'];?>:</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<select id="addSelectLocalDest" name="local_dest" id="local_dest" required>
|
<select data-live-search="true" id="addSelectLocalDest" name="local_dest" id="local_dest" required>
|
||||||
<?php
|
<?php
|
||||||
$domains = mailbox('get', 'domains');
|
$domains = mailbox('get', 'domains');
|
||||||
$alias_domains = mailbox('get', 'alias_domains');
|
$alias_domains = mailbox('get', 'alias_domains');
|
||||||
|
|
Loading…
Reference in New Issue