add missing reload buttons (#4676)

This commit is contained in:
gabryon99 2020-11-04 21:56:07 +01:00
parent 320ce4cc25
commit 3517435314
6 changed files with 99 additions and 28 deletions

View file

@ -1604,8 +1604,32 @@ $(document).ready(function () {
}
},
order: [[0, "asc"]],
buttons: [
],
buttons: {
buttons: [
{
text: '<i class="fas fa-sync"></i>',
className: 'btn-link',
action: function (e, dt, node, config) {
$script_table.ajax.reload(function() {
const [enabled_count, disabled_count] = count_scripts();
// enable the disable all button if there are more than one enabled scripts
if (enabled_count > 0) $(`#btn-disable-all`).removeAttr('disabled');
$("#all-scripts").html(`${i18n.all} (${enabled_count + disabled_count})`)
$(`#enabled-scripts`).html(`${i18n.enabled} (${enabled_count})`);
$(`#disabled-scripts`).html(`${i18n.disabled} (${disabled_count})`);
}, false);
}
}
],
dom: {
button: {
className: 'btn btn-link'
},
container: {
className: 'border-left ml-1 float-right'
}
}
},
columns: [
{
data: 'title',