*/
const DEF_TIME_IN_JOB_LOG = 0;
+ /**
+ * Default value for enabling messages log.
+ */
+ const DEF_ENABLE_MESSAGES_LOG = 1;
/**
* Default date and time format.
'max_jobs' => self::DEF_MAX_JOBS,
'size_values_unit' => self::DEF_SIZE_VAL_UNIT,
'time_in_job_log' => self::DEF_TIME_IN_JOB_LOG,
- 'date_time_format' => self::DEF_DATE_TIME_FORMAT
+ 'date_time_format' => self::DEF_DATE_TIME_FORMAT,
+ 'enable_messages_log' => self::DEF_ENABLE_MESSAGES_LOG
];
if (key_exists('baculum', $config)) {
$config['baculum'] = array_merge($baculum, $config['baculum']);
return (isset($config['security']['def_access']) && $config['security']['def_access'] === self::DEF_ACCESS_DEFAULT_SETTINGS);
}
+ /**
+ * Check if messages log is enabled.
+ *
+ * @return boolean true if is messages log enabled, otherwise false
+ */
+ public function isMessagesLogEnabled() {
+ $enabled = self::DEF_ENABLE_MESSAGES_LOG;
+ $config = $this->getConfig();
+ if (isset($config['baculum']['enable_messages_log'])) {
+ $enabled = $config['baculum']['enable_messages_log'];
+ }
+ return (intval($enabled) == 1);
+ }
+
/**
* Set culture for whole page.
* Uses currently set language settings.
msgid "Add Operator directive"
msgstr "Add Operator directive"
+
+msgid "Enable Bacula messages log window:"
+msgstr "Enable Bacula messages log window:"
+
+msgid "The messages log window enables to review Bacula logs in one place available from almost every part on the interface. To collect logs is used the bconsole 'messages' command. The messages log window is displayed after clicking on the envelope icon at the top right side of the interface. This function is enabled by default. If enabled, it is available only for users with the Administrator role assigned."
+msgstr "The messages log window enables to review Bacula logs in one place available from almost every part on the interface. To collect logs is used the bconsole 'messages' command. The messages log window is displayed after clicking on the envelope icon at the top right side of the interface. This function is enabled by default. If enabled, it is available only for users with the Administrator role assigned."
msgid "Add Operator directive"
msgstr "Add Operator directive"
+
+msgid "Enable Bacula messages log window:"
+msgstr "Enable Bacula messages log window:"
+
+msgid "The messages log window enables to review Bacula logs in one place available from almost every part on the interface. To collect logs is used the bconsole 'messages' command. The messages log window is displayed after clicking on the envelope icon at the top right side of the interface. This function is enabled by default. If enabled, it is available only for users with the Administrator role assigned."
+msgstr "The messages log window enables to review Bacula logs in one place available from almost every part on the interface. To collect logs is used the bconsole 'messages' command. The messages log window is displayed after clicking on the envelope icon at the top right side of the interface. This function is enabled by default. If enabled, it is available only for users with the Administrator role assigned."
msgid "Add Operator directive"
msgstr "Add Operator directive"
+
+msgid "Enable Bacula messages log window:"
+msgstr "Enable Bacula messages log window:"
+
+msgid "The messages log window enables to review Bacula logs in one place available from almost every part on the interface. To collect logs is used the bconsole 'messages' command. The messages log window is displayed after clicking on the envelope icon at the top right side of the interface. This function is enabled by default. If enabled, it is available only for users with the Administrator role assigned."
+msgstr "The messages log window enables to review Bacula logs in one place available from almost every part on the interface. To collect logs is used the bconsole 'messages' command. The messages log window is displayed after clicking on the envelope icon at the top right side of the interface. This function is enabled by default. If enabled, it is available only for users with the Administrator role assigned."
msgid "Add Operator directive"
msgstr "Add Operator directive"
+
+msgid "Enable Bacula messages log window:"
+msgstr "Enable Bacula messages log window:"
+
+msgid "The messages log window enables to review Bacula logs in one place available from almost every part on the interface. To collect logs is used the bconsole 'messages' command. The messages log window is displayed after clicking on the envelope icon at the top right side of the interface. This function is enabled by default. If enabled, it is available only for users with the Administrator role assigned."
+msgstr "The messages log window enables to review Bacula logs in one place available from almost every part on the interface. To collect logs is used the bconsole 'messages' command. The messages log window is displayed after clicking on the envelope icon at the top right side of the interface. This function is enabled by default. If enabled, it is available only for users with the Administrator role assigned."
msgid "Add Operator directive"
msgstr "Add Operator directive"
+
+msgid "Enable Bacula messages log window:"
+msgstr "Enable Bacula messages log window:"
+
+msgid "The messages log window enables to review Bacula logs in one place available from almost every part on the interface. To collect logs is used the bconsole 'messages' command. The messages log window is displayed after clicking on the envelope icon at the top right side of the interface. This function is enabled by default. If enabled, it is available only for users with the Administrator role assigned."
+msgstr "The messages log window enables to review Bacula logs in one place available from almost every part on the interface. To collect logs is used the bconsole 'messages' command. The messages log window is displayed after clicking on the envelope icon at the top right side of the interface. This function is enabled by default. If enabled, it is available only for users with the Administrator role assigned."
<span class="w3-tag w3-large w3-purple w3-right w3-padding-small w3-margin-top w3-margin-right">
<i class="fa fa-cogs w3-large"></i> <%[ Running jobs: ]%> <span id="running_jobs"></span>
</span>
- <span id="msg_envelope" class="w3-tag w3-large w3-green w3-text-white w3-right w3-padding-small w3-margin-top w3-margin-right" style="cursor: pointer;<%=$this->User->isInRole(WebUserRoles::ADMIN) === false ? 'display: none' : ''%>" title="<%[ Display messages log window ]%>">
+ <span id="msg_envelope" class="w3-tag w3-large w3-green w3-text-white w3-right w3-padding-small w3-margin-top w3-margin-right" style="cursor: pointer;<%=((!$this->Application->getModule('web_config')->isMessagesLogEnabled() || !$this->User->isInRole(WebUserRoles::ADMIN)) ? 'display: none' : '')%>" title="<%[ Display messages log window ]%>">
<i class="fas fa-envelope w3-large"></i>
</span>
<com:TLabel ID="UserAPIHostsContainter"CssClass="w3-right w3-margin-top w3-margin-right">
<div id="small" class="w3-hide-large"></div>
<com:Application.Web.Portlets.ErrorMessageBox />
<com:Application.Web.Portlets.ResourceMonitor />
-<com:Application.Web.Portlets.MsgEnvelope Visible="<%=$this->User->isInRole(WebUserRoles::ADMIN)%>" />
+<com:Application.Web.Portlets.MsgEnvelope Visible="<%=($this->Application->getModule('web_config')->isMessagesLogEnabled() && $this->User->isInRole(WebUserRoles::ADMIN))%>" />
<script>
var is_small = $('#small').is(':visible');
$(function() {
});
</script>
</div>
+ <div class="w3-container w3-row w3-padding">
+ <div class="w3-third w3-col"><%[ Enable Bacula messages log window: ]%></div>
+ <div class="w3-third w3-col">
+ <com:TCheckBox
+ ID="EnableMessagesLog"
+ CssClass="w3-check"
+ />
+ <i class="fas fa-info-circle help_icon w3-text-green" onclick="$(this).next().slideToggle('fast');"></i>
+ <div class="directive_help" style="display: none">
+ <dd><%[ The messages log window enables to review Bacula logs in one place available from almost every part on the interface. To collect logs is used the bconsole 'messages' command. The messages log window is displayed after clicking on the envelope icon at the top right side of the interface. This function is enabled by default. If enabled, it is available only for users with the Administrator role assigned. ]%></dd>
+ </div>
+ </div>
+ </div>
<div class="w3-center">
<com:TActiveLinkButton
CssClass="w3-button w3-green"
} else {
$this->DateTimeFormat->Text = WebConfig::DEF_DATE_TIME_FORMAT;
}
+ $this->EnableMessagesLog->Checked = $this->getModule('web_config')->isMessagesLogEnabled();
}
}
$this->web_config['baculum']['size_values_unit'] = $this->BinaryBytes->Checked ? 'binary' : 'decimal';
$this->web_config['baculum']['time_in_job_log'] = ($this->TimeInJobLog->Checked === true) ? 1 : 0;
$this->web_config['baculum']['date_time_format'] = $this->DateTimeFormat->Text;
+ $this->web_config['baculum']['enable_messages_log'] = ($this->EnableMessagesLog->Checked === true) ? 1 : 0;
$this->getModule('web_config')->setConfig($this->web_config);
}
}
$error = $result;
}
}
- if (!$error && $this->User->isInRole(WebUserRoles::ADMIN)) {
+ if (!$error && $this->getModule('web_config')->isMessagesLogEnabled() && $this->User->isInRole(WebUserRoles::ADMIN)) {
$result = $this->getModule('api')->get(['joblog', 'messages']);
if ($result->error === 0) {
$ml = [];
Display="Dynamic"
HeaderText="<%[ There is not possible to run selected action because: ]%>"
/>
- <div class="w3-row w3-section">
+ <div class="w3-row w3-section directive_field">
<div class="w3-col w3-quarter"><com:TLabel ForControl="VolumeStatus" Text="<%[ Volume status: ]%>" /></div>
<div class="w3-half">
<com:TActiveDropDownList ID="VolumeStatus" AutoPostBack="false" CssClass="w3-select w3-border" />
</div>
</div>
- <div class="w3-row w3-section">
+ <div class="w3-row w3-section directive_field">
<div class="w3-col w3-quarter"><com:TLabel ForControl="Pool" Text="<%[ Pool: ]%>" /></div>
<div class="w3-half">
<com:TActiveDropDownList ID="Pool" AutoPostBack="false" CssClass="w3-select w3-border" />
class MsgEnvelope extends Portlets {
public function truncate() {
- if (!$this->User->isInRole(WebUserRoles::ADMIN)) {
+ if (!$this->getModule('web_config')->isMessagesLogEnabled() || !$this->User->isInRole(WebUserRoles::ADMIN)) {
return;
}
$this->getModule('messages_log')->truncate();