Compare commits

..

6 Commits

Author SHA1 Message Date
Niklas Meyer
a57e4212ee Removed Debug Messages 2023-01-20 15:22:55 +01:00
Niklas Meyer
735989f6cf Added Inactive Badge for Syncjobs + Parity with user view 2023-01-20 15:11:25 +01:00
FreddleSpl0it
2ebd8345df Revert "[Generate] Refactor compose version detection using regex"
This reverts commit 4c6f8c4f60.
2023-01-19 15:58:22 +01:00
FreddleSpl0it
f5baeb31c1 Revert "[Update.sh] Implemented optimized Regex Compose Detection"
This reverts commit a76e6b32f7.
2023-01-19 15:57:49 +01:00
DerLinkman
5abda44bc6 Merge branch 'staging' 2023-01-19 14:07:55 +01:00
DerLinkman
520d070081 [Compose] Removed OOMKillDisabled from dockerapi 2023-01-19 14:04:55 +01:00
8 changed files with 75 additions and 51 deletions

View File

@@ -2067,13 +2067,16 @@ jQuery(function($){
'<a href="#" data-action="delete_selected" data-id="single-syncjob" data-api-url="delete/syncjob" data-item="' + item.id + '" class="btn btn-sm btn-xs-half btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' + '<a href="#" data-action="delete_selected" data-id="single-syncjob" data-api-url="delete/syncjob" data-item="' + item.id + '" class="btn btn-sm btn-xs-half btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
'</div>'; '</div>';
item.chkbox = '<input type="checkbox" data-id="syncjob" name="multi_select" value="' + item.id + '" />'; item.chkbox = '<input type="checkbox" data-id="syncjob" name="multi_select" value="' + item.id + '" />';
if (item.is_running == 1) {
if (item.is_running == 1 && item.active == 1) {
item.is_running = '<span id="active-script" class="badge fs-6 bg-success">' + lang.running + '</span>'; item.is_running = '<span id="active-script" class="badge fs-6 bg-success">' + lang.running + '</span>';
} else { } else if (item.is_running == 0 && item.active == 1) {
item.is_running = '<span id="inactive-script" class="badge fs-6 bg-warning">' + lang.waiting + '</span>'; item.is_running = '<span id="inactive-script" class="badge fs-6 bg-warning">' + lang.waiting + '</span>';
} else {
item.is_running = '<span id="inactive-script" class="badge fs-6 bg-danger">' + lang.inactive + '</span>';
} }
if (!item.last_run > 0) { if (!item.last_run) {
item.last_run = lang.waiting; item.last_run = lang.never;
} }
if (item.success == null) { if (item.success == null) {
item.success = '-'; item.success = '-';
@@ -2142,19 +2145,17 @@ jQuery(function($){
data: 'log', data: 'log',
defaultContent: '' defaultContent: ''
}, },
{
title: lang.active,
data: 'active',
defaultContent: '',
render: function (data, type) {
return 1==data?'<i class="bi bi-check-lg"></i>':0==data&&'<i class="bi bi-x-lg"></i>';
}
},
{ {
title: lang.status, title: lang.status,
data: 'is_running', data: 'is_running',
defaultContent: '' defaultContent: ''
}, },
{
title: lang.encryption,
data: 'enc1',
defaultContent: '',
className: 'none'
},
{ {
title: lang.excludes, title: lang.excludes,
data: 'exclude', data: 'exclude',

View File

@@ -127,6 +127,13 @@ jQuery(function($){
} }
} }
$(".refresh_table").on('click', function(e) {
e.preventDefault();
var table_name = $(this).data('table');
if ($.fn.DataTable.isDataTable('#' + table_name))
$('#' + table_name).DataTable().ajax.reload();
});
function draw_tla_table() { function draw_tla_table() {
// just recalc width if instance already exists // just recalc width if instance already exists
if ($.fn.DataTable.isDataTable('#tla_table') ) { if ($.fn.DataTable.isDataTable('#tla_table') ) {
@@ -233,7 +240,6 @@ jQuery(function($){
type: "GET", type: "GET",
url: '/api/v1/get/syncjobs/' + encodeURIComponent(mailcow_cc_username) + '/no_log', url: '/api/v1/get/syncjobs/' + encodeURIComponent(mailcow_cc_username) + '/no_log',
dataSrc: function(data){ dataSrc: function(data){
console.log(data);
$.each(data, function (i, item) { $.each(data, function (i, item) {
item.user1 = escapeHtml(item.user1); item.user1 = escapeHtml(item.user1);
item.log = '<a href="#syncjobLogModal" data-bs-toggle="modal" data-syncjob-id="' + item.id + '">' + lang.open_logs + '</a>' item.log = '<a href="#syncjobLogModal" data-bs-toggle="modal" data-syncjob-id="' + item.id + '">' + lang.open_logs + '</a>'
@@ -254,13 +260,15 @@ jQuery(function($){
item.action = '<span>-</span>'; item.action = '<span>-</span>';
item.chkbox = '<input type="checkbox" disabled />'; item.chkbox = '<input type="checkbox" disabled />';
} }
if (item.is_running == 1) { if (item.is_running == 1 && item.active == 1) {
item.is_running = '<span id="active-script" class="badge fs-6 bg-success">' + lang.running + '</span>'; item.is_running = '<span id="active-script" class="badge fs-6 bg-success">' + lang.running + '</span>';
} else { } else if (item.is_running == 0 && item.active == 1) {
item.is_running = '<span id="inactive-script" class="badge fs-6 bg-warning">' + lang.waiting + '</span>'; item.is_running = '<span id="inactive-script" class="badge fs-6 bg-warning">' + lang.waiting + '</span>';
} else {
item.is_running = '<span id="disabled-script" class="badge fs-6 bg-danger">' + lang.inactive + '</span>';
} }
if (!item.last_run > 0) { if (!item.last_run) {
item.last_run = lang.waiting; item.last_run = lang.never;
} }
if (item.success == null) { if (item.success == null) {
item.success = '-'; item.success = '-';
@@ -329,14 +337,6 @@ jQuery(function($){
data: 'log', data: 'log',
defaultContent: '' defaultContent: ''
}, },
{
title: lang.active,
data: 'active',
defaultContent: '',
render: function (data, type) {
return 1==data?'<i class="bi bi-check-lg"></i>':0==data&&'<i class="bi bi-x-lg"></i>'
}
},
{ {
title: lang.status, title: lang.status,
data: 'is_running', data: 'is_running',
@@ -346,17 +346,20 @@ jQuery(function($){
{ {
title: lang.encryption, title: lang.encryption,
data: 'enc1', data: 'enc1',
defaultContent: '' defaultContent: '',
className: 'none'
}, },
{ {
title: lang.excludes, title: lang.excludes,
data: 'exclude', data: 'exclude',
defaultContent: '' defaultContent: '',
className: 'none'
}, },
{ {
title: lang.interval + " (min)", title: lang.interval + " (min)",
data: 'mins_interval', data: 'mins_interval',
defaultContent: '' defaultContent: '',
className: 'none'
}, },
{ {
title: lang.action, title: lang.action,

View File

@@ -771,6 +771,7 @@
"edit": "Bearbeiten", "edit": "Bearbeiten",
"empty": "Keine Einträge vorhanden", "empty": "Keine Einträge vorhanden",
"enable_x": "Aktivieren", "enable_x": "Aktivieren",
"encryption": "Verschlüsselung",
"excludes": "Ausschlüsse", "excludes": "Ausschlüsse",
"filter_table": "Filtern", "filter_table": "Filtern",
"filters": "Filter", "filters": "Filter",
@@ -1175,6 +1176,7 @@
"recent_successful_connections": "Kürzlich erfolgreiche Verbindungen", "recent_successful_connections": "Kürzlich erfolgreiche Verbindungen",
"remove": "Entfernen", "remove": "Entfernen",
"running": "Wird ausgeführt", "running": "Wird ausgeführt",
"inactive": "Inaktiv",
"save": "Änderungen speichern", "save": "Änderungen speichern",
"save_changes": "Änderungen speichern", "save_changes": "Änderungen speichern",
"sender_acl_disabled": "<span class=\"badge fs-6 bg-danger\">Absenderprüfung deaktiviert</span>", "sender_acl_disabled": "<span class=\"badge fs-6 bg-danger\">Absenderprüfung deaktiviert</span>",
@@ -1220,7 +1222,7 @@
"user_settings": "Benutzereinstellungen", "user_settings": "Benutzereinstellungen",
"username": "Benutzername", "username": "Benutzername",
"verify": "Verifizieren", "verify": "Verifizieren",
"waiting": "Warte auf Ausführung", "waiting": "Wartend",
"week": "Woche", "week": "Woche",
"weekly": "Wöchentlich", "weekly": "Wöchentlich",
"weeks": "Wochen", "weeks": "Wochen",

View File

@@ -779,6 +779,7 @@
"edit": "Edit", "edit": "Edit",
"empty": "No results", "empty": "No results",
"enable_x": "Enable", "enable_x": "Enable",
"encryption": "Encryption",
"excludes": "Excludes", "excludes": "Excludes",
"filter_table": "Filter table", "filter_table": "Filter table",
"filters": "Filters", "filters": "Filters",
@@ -1143,6 +1144,7 @@
"hour": "hour", "hour": "hour",
"hourly": "Hourly", "hourly": "Hourly",
"hours": "hours", "hours": "hours",
"inactive": "Inactive",
"in_use": "Used", "in_use": "Used",
"interval": "Interval", "interval": "Interval",
"is_catch_all": "Catch-all for domain/s", "is_catch_all": "Catch-all for domain/s",

View File

@@ -4,7 +4,11 @@
<button class="btn d-md-none flex-grow-1 text-start" data-bs-target="#collapse-tab-Syncjobs" data-bs-toggle="collapse" aria-controls="collapse-tab-Syncjobs"> <button class="btn d-md-none flex-grow-1 text-start" data-bs-target="#collapse-tab-Syncjobs" data-bs-toggle="collapse" aria-controls="collapse-tab-Syncjobs">
{{ lang.user.sync_jobs }} {{ lang.user.sync_jobs }}
</button> </button>
<span class="d-none d-md-block">{{ lang.user.sync_jobs }} <span class="d-none d-md-block">{{ lang.user.sync_jobs }} <span class="badge bg-info table-lines"></span></span>
<div class="btn-group ms-auto d-flex">
<button class="btn btn-xs btn-secondary refresh_table" data-draw="draw_sync_job_table" data-table="sync_job_table">{{ lang.admin.refresh }}</button>
</div>
</div> </div>
<div id="collapse-tab-Syncjobs" class="card-body collapse" data-bs-parent="#user-content"> <div id="collapse-tab-Syncjobs" class="card-body collapse" data-bs-parent="#user-content">
<div class="mass-actions-user mb-4"> <div class="mass-actions-user mb-4">

View File

@@ -514,7 +514,6 @@ services:
security_opt: security_opt:
- label=disable - label=disable
restart: always restart: always
oom_kill_disable: true
dns: dns:
- ${IPV4_NETWORK:-172.22.1}.254 - ${IPV4_NETWORK:-172.22.1}.254
environment: environment:

View File

@@ -25,9 +25,8 @@ for bin in openssl curl docker git awk sha1sum; do
if [[ -z $(which ${bin}) ]]; then echo "Cannot find ${bin}, exiting..."; exit 1; fi if [[ -z $(which ${bin}) ]]; then echo "Cannot find ${bin}, exiting..."; exit 1; fi
done done
if command -v docker compose > /dev/null 2>&1; then if docker compose > /dev/null 2>&1; then
version=$(docker compose version --short) if docker compose version --short | grep "^2." > /dev/null 2>&1; then
if [[ $version =~ ^2\.([0-9]+)\.([0-9]+) ]]; then
COMPOSE_VERSION=native COMPOSE_VERSION=native
echo -e "\e[31mFound Docker Compose Plugin (native).\e[0m" echo -e "\e[31mFound Docker Compose Plugin (native).\e[0m"
echo -e "\e[31mSetting the DOCKER_COMPOSE_VERSION Variable to native\e[0m" echo -e "\e[31mSetting the DOCKER_COMPOSE_VERSION Variable to native\e[0m"
@@ -35,12 +34,12 @@ if command -v docker compose > /dev/null 2>&1; then
echo -e "\e[33mNotice: You´ll have to update this Compose Version via your Package Manager manually!\e[0m" echo -e "\e[33mNotice: You´ll have to update this Compose Version via your Package Manager manually!\e[0m"
else else
echo -e "\e[31mCannot find Docker Compose with a Version Higher than 2.X.X.\e[0m" echo -e "\e[31mCannot find Docker Compose with a Version Higher than 2.X.X.\e[0m"
echo -e "\e[31mPlease update/install manually regarding to this doc site: https://mailcow.github.io/mailcow-dockerized-docs/i_u_m/i_u_m_install/\e[0m" echo -e "\e[31mPlease update/install it manually regarding to this doc site: https://mailcow.github.io/mailcow-dockerized-docs/i_u_m/i_u_m_install/\e[0m"
exit 1 exit 1
fi fi
elif command -v docker-compose > /dev/null 2>&1; then elif docker-compose > /dev/null 2>&1; then
version=$(docker-compose version --short) if ! [[ $(alias docker-compose 2> /dev/null) ]] ; then
if [[ $version =~ ^2\.([0-9]+)\.([0-9]+) ]]; then if docker-compose version --short | grep "^2." > /dev/null 2>&1; then
COMPOSE_VERSION=standalone COMPOSE_VERSION=standalone
echo -e "\e[31mFound Docker Compose Standalone.\e[0m" echo -e "\e[31mFound Docker Compose Standalone.\e[0m"
echo -e "\e[31mSetting the DOCKER_COMPOSE_VERSION Variable to standalone\e[0m" echo -e "\e[31mSetting the DOCKER_COMPOSE_VERSION Variable to standalone\e[0m"
@@ -51,9 +50,11 @@ elif command -v docker-compose > /dev/null 2>&1; then
echo -e "\e[31mPlease update/install manually regarding to this doc site: https://mailcow.github.io/mailcow-dockerized-docs/i_u_m/i_u_m_install/\e[0m" echo -e "\e[31mPlease update/install manually regarding to this doc site: https://mailcow.github.io/mailcow-dockerized-docs/i_u_m/i_u_m_install/\e[0m"
exit 1 exit 1
fi fi
fi
else else
echo -e "\e[31mCannot find Docker Compose.\e[0m" echo -e "\e[31mCannot find Docker Compose.\e[0m"
echo -e "\e[31mPlease install it manually regarding to this doc site: https://mailcow.github.io/mailcow-dockerized-docs/i_u_m/i_u_m_install/\e[0m" echo -e "\e[31mPlease install it regarding to this doc site: https://mailcow.github.io/mailcow-dockerized-docs/i_u_m/i_u_m_install/\e[0m"
exit 1 exit 1
fi fi
@@ -457,6 +458,15 @@ case ${git_branch} in
mailcow_last_git_version="" mailcow_last_git_version=""
;; ;;
esac esac
# if [ ${git_branch} == "master" ]; then
# mailcow_git_version=$(git describe --tags `git rev-list --tags --max-count=1`)
# elif [ ${git_branch} == "nightly" ]; then
# mailcow_git_version=$(git rev-parse --short $(git rev-parse @{upstream}))
# mailcow_last_git_version=""
# else
# mailcow_git_version=$(git rev-parse --short HEAD)
# mailcow_last_git_version=""
# fi
if [[ $SKIP_BRANCH != "y" ]]; then if [[ $SKIP_BRANCH != "y" ]]; then
mailcow_git_commit=$(git rev-parse origin/${git_branch}) mailcow_git_commit=$(git rev-parse origin/${git_branch})

View File

@@ -177,35 +177,38 @@ remove_obsolete_nginx_ports() {
detect_docker_compose_command(){ detect_docker_compose_command(){
if ! [ "${DOCKER_COMPOSE_VERSION}" == "native" ] && ! [ "${DOCKER_COMPOSE_VERSION}" == "standalone" ]; then if ! [ "${DOCKER_COMPOSE_VERSION}" == "native" ] && ! [ "${DOCKER_COMPOSE_VERSION}" == "standalone" ]; then
if command -v docker compose > /dev/null 2>&1; then if docker compose > /dev/null 2>&1; then
version=$(docker compose version --short) if docker compose version --short | grep "2." > /dev/null 2>&1; then
if [[ $version =~ ^2\.([0-9]+)\.([0-9]+) ]]; then DOCKER_COMPOSE_VERSION=native
COMPOSE_VERSION=native COMPOSE_COMMAND="docker compose"
echo -e "\e[31mFound Docker Compose Plugin (native).\e[0m" echo -e "\e[31mFound Docker Compose Plugin (native).\e[0m"
echo -e "\e[31mSetting the DOCKER_COMPOSE_VERSION Variable to native\e[0m" echo -e "\e[31mSetting the DOCKER_COMPOSE_VERSION Variable to native\e[0m"
sleep 2 sleep 2
echo -e "\e[33mNotice: You´ll have to update this Compose Version via your Package Manager manually!\e[0m" echo -e "\e[33mNotice: You'll have to update this Compose Version via your Package Manager manually!\e[0m"
else else
echo -e "\e[31mCannot find Docker Compose with a Version Higher than 2.X.X.\e[0m" echo -e "\e[31mCannot find Docker Compose with a Version Higher than 2.X.X.\e[0m"
echo -e "\e[31mPlease update/install manually regarding to this doc site: https://mailcow.github.io/mailcow-dockerized-docs/i_u_m/i_u_m_install/\e[0m" echo -e "\e[31mPlease update/install it manually regarding to this doc site: https://mailcow.github.io/mailcow-dockerized-docs/i_u_m/i_u_m_install/\e[0m"
exit 1 exit 1
fi fi
elif command -v docker-compose > /dev/null 2>&1; then elif docker-compose > /dev/null 2>&1; then
version=$(docker-compose version --short) if ! [[ $(alias docker-compose 2> /dev/null) ]] ; then
if [[ $version =~ ^2\.([0-9]+)\.([0-9]+) ]]; then if docker-compose version --short | grep "^2." > /dev/null 2>&1; then
COMPOSE_VERSION=standalone DOCKER_COMPOSE_VERSION=standalone
COMPOSE_COMMAND="docker-compose"
echo -e "\e[31mFound Docker Compose Standalone.\e[0m" echo -e "\e[31mFound Docker Compose Standalone.\e[0m"
echo -e "\e[31mSetting the DOCKER_COMPOSE_VERSION Variable to standalone\e[0m" echo -e "\e[31mSetting the DOCKER_COMPOSE_VERSION Variable to standalone\e[0m"
sleep 2 sleep 2
echo -e "\e[33mNotice: For an automatic update of docker-compose please use the update_compose.sh scripts located at the helper-scripts folder.\e[0m" echo -e "\e[33mNotice: For an automatic update of docker-compose please use the update_compose.sh scripts located at the helper-scripts folder.\e[0m"
else else
echo -e "\e[31mCannot find Docker Compose with a Version Higher than 2.X.X.\e[0m" echo -e "\e[31mCannot find Docker Compose with a Version Higher than 2.X.X.\e[0m"
echo -e "\e[31mPlease update/install manually regarding to this doc site: https://mailcow.github.io/mailcow-dockerized-docs/i_u_m/i_u_m_install/\e[0m" echo -e "\e[31mPlease update/install regarding to this doc site: https://mailcow.github.io/mailcow-dockerized-docs/i_u_m/i_u_m_install/\e[0m"
exit 1 exit 1
fi fi
fi
else else
echo -e "\e[31mCannot find Docker Compose.\e[0m" echo -e "\e[31mCannot find Docker Compose.\e[0m"
echo -e "\e[31mPlease install it manually regarding to this doc site: https://mailcow.github.io/mailcow-dockerized-docs/i_u_m/i_u_m_install/\e[0m" echo -e "\e[31mPlease install it regarding to this doc site: https://mailcow.github.io/mailcow-dockerized-docs/i_u_m/i_u_m_install/\e[0m"
exit 1 exit 1
fi fi