Added Inactive Badge for Syncjobs + Parity with user view
This commit is contained in:
parent
2ebd8345df
commit
735989f6cf
|
@ -2053,6 +2053,7 @@ jQuery(function($){
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: "/api/v1/get/syncjobs/all/no_log",
|
url: "/api/v1/get/syncjobs/all/no_log",
|
||||||
dataSrc: function(json){
|
dataSrc: function(json){
|
||||||
|
console.log(json);
|
||||||
$.each(json, function (i, item) {
|
$.each(json, function (i, item) {
|
||||||
item.log = '<a href="#syncjobLogModal" data-bs-toggle="modal" data-syncjob-id="' + encodeURIComponent(item.id) + '">' + lang.open_logs + '</a>'
|
item.log = '<a href="#syncjobLogModal" data-bs-toggle="modal" data-syncjob-id="' + encodeURIComponent(item.id) + '">' + lang.open_logs + '</a>'
|
||||||
item.user2 = escapeHtml(item.user2);
|
item.user2 = escapeHtml(item.user2);
|
||||||
|
@ -2067,13 +2068,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 +2146,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',
|
||||||
|
|
|
@ -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') ) {
|
||||||
|
@ -254,13 +261,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 +338,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 +347,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,
|
||||||
|
|
|
@ -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",
|
||||||
|
|
|
@ -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",
|
||||||
|
|
|
@ -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">
|
||||||
|
|
Loading…
Reference in New Issue