deferRender: true,
dom: 'lBfrtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],
update_job_access: function() {
// get last 15 jobs
var data = this.stats.jobs.slice(0, 15);
- oLastJobsList.init(data);
+ $(function() {
+ oLastJobsList.init(data);
+ });
},
update_jobs: function() {
var jobs = this.stats.jobs_occupancy;
msgid "last %time %unit"
msgstr "last %time %unit"
+
+msgid "Keep custom table settings:"
+msgstr "Keep custom table settings:"
+
+msgid "No time limit (persistent settings)"
+msgstr "No time limit (persistent settings)"
+
+msgid "Until end of web browser session"
+msgstr "Until end of web browser session"
+
+msgid "For specific time"
+msgstr "For specific time"
+
+msgid "The value must be positive integer or zero."
+msgstr "The value must be positive integer or zero."
+
+msgid "Keep table settings for"
+msgstr "Keep table settings for"
msgid "last %time %unit"
msgstr "last %time %unit"
+
+msgid "Keep custom table settings:"
+msgstr "Keep custom table settings:"
+
+msgid "No time limit (persistent settings)"
+msgstr "No time limit (persistent settings)"
+
+msgid "Until end of web browser session"
+msgstr "Until end of web browser session"
+
+msgid "For specific time"
+msgstr "For specific time"
+
+msgid "The value must be positive integer or zero."
+msgstr "The value must be positive integer or zero."
+
+msgid "Keep table settings for"
+msgstr "Keep table settings for"
msgid "last %time %unit"
msgstr "ostatni %time %unit"
+
+msgid "Keep custom table settings:"
+msgstr "Keep custom table settings:"
+
+msgid "No time limit (persistent settings)"
+msgstr "No time limit (persistent settings)"
+
+msgid "Until end of web browser session"
+msgstr "Until end of web browser session"
+
+msgid "For specific time"
+msgstr "For specific time"
+
+msgid "The value must be positive integer or zero."
+msgstr "The value must be positive integer or zero."
+
+msgid "Keep table settings for"
+msgstr "Keep table settings for"
msgid "last %time %unit"
msgstr "last %time %unit"
+
+msgid "Keep custom table settings:"
+msgstr "Keep custom table settings:"
+
+msgid "No time limit (persistent settings)"
+msgstr "No time limit (persistent settings)"
+
+msgid "Until end of web browser session"
+msgstr "Until end of web browser session"
+
+msgid "For specific time"
+msgstr "For specific time"
+
+msgid "The value must be positive integer or zero."
+msgstr "The value must be positive integer or zero."
+
+msgid "Keep table settings for"
+msgstr "Keep table settings for"
msgid "last %time %unit"
msgstr "last %time %unit"
+
+msgid "Keep custom table settings:"
+msgstr "Keep custom table settings:"
+
+msgid "No time limit (persistent settings)"
+msgstr "No time limit (persistent settings)"
+
+msgid "Until end of web browser session"
+msgstr "Until end of web browser session"
+
+msgid "For specific time"
+msgstr "For specific time"
+
+msgid "The value must be positive integer or zero."
+msgstr "The value must be positive integer or zero."
+
+msgid "Keep table settings for"
+msgstr "Keep table settings for"
/>
</com:TLabel>
<script type="text/javascript">
- var SIZE_VALUES_UNIT = '<%=(count($this->web_config) > 0 && key_exists('size_values_unit', $this->web_config['baculum'])) ? $this->web_config['baculum']['size_values_unit'] : WebConfig::DEF_SIZE_VAL_UNIT%>';
- var DATE_TIME_FORMAT = '<%=(count($this->web_config) > 0 && key_exists('date_time_format', $this->web_config['baculum'])) ? $this->web_config['baculum']['date_time_format'] : WebConfig::DEF_DATE_TIME_FORMAT%>';
+ const SIZE_VALUES_UNIT = '<%=(count($this->web_config) > 0 && key_exists('size_values_unit', $this->web_config['baculum'])) ? $this->web_config['baculum']['size_values_unit'] : WebConfig::DEF_SIZE_VAL_UNIT%>';
+ const DATE_TIME_FORMAT = '<%=(count($this->web_config) > 0 && key_exists('date_time_format', $this->web_config['baculum'])) ? $this->web_config['baculum']['date_time_format'] : WebConfig::DEF_DATE_TIME_FORMAT%>';
+ const KEEP_TABLE_SETTINGS = <%=(count($this->web_config) > 0 && key_exists('keep_table_settings', $this->web_config['baculum'])) ? $this->web_config['baculum']['keep_table_settings'] : WebConfig::DEF_KEEP_TABLE_SETTINGS%>;
</script>
<com:TContentPlaceHolder ID="Main" />
<!-- Footer -->
</com:THead>
<body class="w3-light-grey">
<script type="text/javascript">
- var SIZE_VALUES_UNIT = '<%=(count($this->web_config) > 0 && key_exists('size_values_unit', $this->web_config['baculum'])) ? $this->web_config['baculum']['size_values_unit'] : WebConfig::DEF_SIZE_VAL_UNIT%>';
- var DATE_TIME_FORMAT = '<%=(count($this->web_config) > 0 && key_exists('date_time_format', $this->web_config['baculum'])) ? $this->web_config['baculum']['date_time_format'] : WebConfig::DEF_DATE_TIME_FORMAT%>';
+ const SIZE_VALUES_UNIT = '<%=(count($this->web_config) > 0 && key_exists('size_values_unit', $this->web_config['baculum'])) ? $this->web_config['baculum']['size_values_unit'] : WebConfig::DEF_SIZE_VAL_UNIT%>';
+ const DATE_TIME_FORMAT = '<%=(count($this->web_config) > 0 && key_exists('date_time_format', $this->web_config['baculum'])) ? $this->web_config['baculum']['date_time_format'] : WebConfig::DEF_DATE_TIME_FORMAT%>';
+ const KEEP_TABLE_SETTINGS = <%=(count($this->web_config) > 0 && key_exists('keep_table_settings', $this->web_config['baculum'])) ? $this->web_config['baculum']['keep_table_settings'] : WebConfig::DEF_KEEP_TABLE_SETTINGS%>;
</script>
<com:TForm>
<com:TClientScript PradoScripts="ajax, effects" />
*/
const DEF_SIZE_VAL_UNIT = 'decimal';
+ /**
+ * Default keep table settings for specific time.
+ * Values:
+ * -1 - keep value in sessionStorage. Settings are forget when web browser is closed.
+ * 0 - keep value in localStorage. Settings are persistent.
+ * int > 0 - keep value in localStorage for specific given time.
+ */
+ public const DEF_KEEP_TABLE_SETTINGS = 7200;
+
/**
* Default value for showing time in job log.
*/
/>
</div>
</div>
+ <div class="w3-container w3-row w3-padding">
+ <div class="w3-quarter w3-col"><%[ Keep custom table settings: ]%></div>
+ <div class="w3-quarter w3-col">
+ <p><com:TRadioButton
+ ID="KeepTableSettingsNoLimit"
+ CssClass="w3-radio"
+ GroupName="KeepTableSettings"
+ Attributes.onclick="$('#keep_table_settings_specific_time').hide(); if (Prado.Validation.validateControl('<%=$this->KeepTableSettingsFor->Directive->ClientID%>') === false) { reset_keep_time_settings_for_field(); }"
+ /> <com:TLabel ForControl="KeepTableSettingsNoLimit"><%[ No time limit (persistent settings) ]%></com:TLabel></p>
+ <p>
+ <com:TRadioButton
+ ID="KeepTableSettingsEndOfSession"
+ CssClass="w3-radio"
+ GroupName="KeepTableSettings"
+ Attributes.onclick="$('#keep_table_settings_specific_time').hide(); if (Prado.Validation.validateControl('<%=$this->KeepTableSettingsFor->Directive->ClientID%>') === false) { reset_keep_time_settings_for_field(); }"
+ /> <com:TLabel ForControl="KeepTableSettingsEndOfSession"><%[ Until end of web browser session ]%></com:TLabel></p>
+ <com:TRadioButton
+ ID="KeepTableSettingsSpecificTime"
+ CssClass="w3-radio"
+ GroupName="KeepTableSettings"
+ Attributes.onclick="$('#keep_table_settings_specific_time').show(); Prado.Validation.validateControl('<%=$this->KeepTableSettingsFor->Directive->ClientID%>')"
+ /> <com:TLabel ForControl="KeepTableSettingsSpecificTime"><%[ For specific time ]%></com:TLabel></p>
+ </div>
+ <div id="keep_table_settings_specific_time" style="display: <%=$this->KeepTableSettingsSpecificTime->Checked ? 'block' : 'none'%>;">
+ <com:Baculum.Web.Portlets.DirectiveTimePeriod
+ ID="KeepTableSettingsFor"
+ DirectiveName="KeepTableSettingsFor"
+ Label="<%[ Keep table settings for ]%>"
+ ValidationGroup="AppSetting"
+ DefaultValue="<%=WebConfig::DEF_KEEP_TABLE_SETTINGS%>"
+ Show="true"
+ Required="true"
+ ShowResetButton="false"
+ ShowRemoveButton="false"
+ TimeFormat="hour"
+ Doc="<%[ Set time for which table settings will be preserved. Setting 0 (zero) is equivalent to no time limit option. ]%>"
+ />
+ </div>
+ <script>
+ function reset_keep_time_settings_for_field() {
+ const ctl_id = '<%=$this->KeepTableSettingsFor->Directive->ClientID%>';
+ const ctl_format_id = '<%=$this->KeepTableSettingsFor->TimeFormat->ClientID%>';
+ const val = '<%=$this->KeepTableSettingsFor->getValue() ?: $this->KeepTableSettingsFor->DefaultValue%>';
+ const ftime = Units.format_time_period(parseInt(val, 'seconds'));
+ $('#' + ctl_id).val(ftime.value);
+ $('#' + ctl_format_id).val(ftime.format);
+ }
+ </script>
+ </div>
<div class="w3-container w3-row w3-padding">
<div class="w3-quarter w3-col"><%[ Show size values as: ]%></div>
<div class="w3-quarter w3-col">
if(count($this->web_config) > 0) {
$this->Debug->Checked = ($this->web_config['baculum']['debug'] == 1);
$this->MaxJobs->Text = (key_exists('max_jobs', $this->web_config['baculum']) ? intval($this->web_config['baculum']['max_jobs']) : WebConfig::DEF_MAX_JOBS);
+ if (key_exists('keep_table_settings', $this->web_config['baculum'])) {
+ if ($this->web_config['baculum']['keep_table_settings'] === '-1') {
+ // keep settings until end of web browser session
+ $this->KeepTableSettingsEndOfSession->Checked = true;
+ } elseif ($this->web_config['baculum']['keep_table_settings'] === '0') {
+ // keep settings with no time limit (persistent settings)
+ $this->KeepTableSettingsNoLimit->Checked = true;
+ } else {
+ // keep settings for specific time (default 2 hours)
+ $this->KeepTableSettingsSpecificTime->Checked = true;
+ $this->KeepTableSettingsFor->setDirectiveValue($this->web_config['baculum']['keep_table_settings']);
+ }
+ } else {
+ // default setting
+ $this->KeepTableSettingsSpecificTime->Checked = true;
+ $this->KeepTableSettingsFor->setDirectiveValue(WebConfig::DEF_KEEP_TABLE_SETTINGS);
+ }
if (key_exists('size_values_unit', $this->web_config['baculum'])) {
$this->DecimalBytes->Checked = ($this->web_config['baculum']['size_values_unit'] === 'decimal');
$this->BinaryBytes->Checked = ($this->web_config['baculum']['size_values_unit'] === 'binary');
if (count($this->web_config) > 0) {
$this->web_config['baculum']['debug'] = ($this->Debug->Checked === true) ? 1 : 0;
$max_jobs = intval($this->MaxJobs->Text);
+ $keep_table_settings = null;
+ if ($this->KeepTableSettingsNoLimit->Checked) {
+ $keep_table_settings = '0';
+ } elseif ($this->KeepTableSettingsEndOfSession->Checked) {
+ $keep_table_settings = '-1';
+ } elseif ($this->KeepTableSettingsSpecificTime->Checked) {
+ $keep_table_settings = $this->KeepTableSettingsFor->getValue();
+ }
$this->web_config['baculum']['max_jobs'] = $max_jobs;
+ $this->web_config['baculum']['keep_table_settings'] = $keep_table_settings;
$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;
deferRender: true,
dom: 'lBfrtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],
deferRender: true,
dom: 'lBfrtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],
deferRender: true,
dom: 'lBfrtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],
deferRender: true,
dom: 'lB<"table_toolbar"><"#table_mode"><"#table_adv_filters">frtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],
deferRender: true,
dom: 'lBfrtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],
deferRender: true,
dom: 'lBfrtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],
deferRender: true,
dom: 'lBfrtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],
deferRender: true,
dom: 'lBfrtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],
deferRender: true,
dom: 'lBfrtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],
deferRender: true,
dom: 'lBfrtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],
deferRender: true,
dom: 'lBfrtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],
deferRender: true,
dom: 'lBfrtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],
deferRender: true,
dom: 'lBfrtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],
deferRender: true,
dom: 'lBfrtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],
deferRender: true,
dom: 'lBfrtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],
deferRender: true,
dom: 'lBfrtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],
'copy', 'csv', 'colvis'
],
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
columns: [
{
className: 'details-control',
deferRender: true,
dom: 'lBfrtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],
deferRender: true,
dom: 'lB<"table_toolbar">frtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],
deferRender: true,
dom: 'lB<"table_toolbar">frtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],
deferRender: true,
dom: 'lB<"table_toolbar">frtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],
deferRender: true,
dom: 'lB<"table_toolbar">frtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],
deferRender: true,
dom: 'lB<"table_toolbar">frtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],
deferRender: true,
dom: 'lB<"table_toolbar">frtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],
deferRender: true,
dom: 'lBfrtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],
deferRender: true,
dom: 'lBfrtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],
deferRender: true,
dom: 'lB<"table_toolbar">frtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],
deferRender: true,
dom: 'lB<"table_toolbar">frtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],
deferRender: true,
dom: 'lBfrtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],
deferRender: true,
dom: 'lBfrtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],
deferRender: true,
dom: 'lBfrtip',
stateSave: true,
+ stateDuration: KEEP_TABLE_SETTINGS,
buttons: [
'copy', 'csv', 'colvis'
],