disabled button for active monitoring hosts (#4720)

This commit is contained in:
gabryon99 2020-11-17 18:48:50 +01:00
parent 256ebd0c8a
commit 8d907cb938
2 changed files with 8 additions and 4 deletions

View file

@ -478,10 +478,13 @@ $(document).ready(function() {
sortable: false,
name: 'actions',
class: 'text-center',
render: function() {
render: function(_, type, host) {
const disabled = (host.readonly) ? 'disabled' : '';
return DataTableUtils.createActionButtons([
{ class: 'btn-info', icon: 'fa-edit', modal: '#am-edit-modal' },
{ class: 'btn-danger', icon: 'fa-trash', modal: '#am-delete-modal'}
{ class: `btn-info ${disabled}`, icon: 'fa-edit', modal: '#am-edit-modal', },
{ class: `btn-danger ${disabled}`, icon: 'fa-trash', modal: '#am-delete-modal', }
]);
}
}

View file

@ -104,7 +104,8 @@ for key, am_host in pairs(am_hosts) do
hours = hourly_stats or {},
unit = i18n(m_info.i18n_unit) or m_info.i18n_unit,
jitter = column_jitter,
pool = pool_id
pool = pool_id,
readonly = am_host.readonly
}
::continue::