"ValueType": "str",
"DefaultValue": 0,
"FieldType": "ComboBox",
- "Data": ["Gzip1", "Gzip2", "Gzip3", "Gzip4", "Gzip5", "Gzip6", "Gzip7", "Gzip8", "Gzip9", "Lzo"]
+ "Data": ["Gzip", "Gzip1", "Gzip2", "Gzip3", "Gzip4", "Gzip5", "Gzip6", "Gzip7", "Gzip8", "Gzip9", "Lzo"]
},
"Signature": {
"Required": false,
}
};
+var oLastJobsList = {
+ last_jobs_table: null,
+ ids: {
+ last_jobs_list: 'last_jobs_list',
+ last_jobs_list_body: 'lats_jobs_list_body'
+ },
+ init: function(data) {
+ this.destroy();
+ this.set_table(data);
+ },
+ destroy: function() {
+ if (this.last_jobs_table) {
+ this.last_jobs_table.destroy();
+ }
+ },
+ set_table: function(data) {
+ this.last_jobs_table = $('#' + this.ids.last_jobs_list).DataTable({
+ data: data,
+ bInfo: false,
+ paging: false,
+ searching: false,
+ deferRender: true,
+ columns: [
+ {
+ className: 'details-control',
+ orderable: false,
+ data: null,
+ defaultContent: '<button type="button" class="w3-button w3-blue"><i class="fa fa-angle-down"></i></button>'
+ },
+ {
+ data: 'jobid',
+ responsivePriority: 1
+ },
+ {
+ data: 'name',
+ responsivePriority: 2
+ },
+ {
+ data: 'level',
+ render: function(data, type, row) {
+ return JobLevel.get_level(data);
+ },
+ responsivePriority: 3
+ },
+ {
+ data: 'starttime',
+ responsivePriority: 5
+ },
+ {
+ data: 'jobstatus',
+ render: function (data, type, row) {
+ var ret;
+ if (type == 'display') {
+ ret = JobStatus.get_icon(data).outerHTML;
+ } else {
+ ret = data;
+ }
+ return ret;
+ },
+ responsivePriority: 4
+ }
+ ],
+ responsive: {
+ details: {
+ type: 'column'
+ }
+ },
+ columnDefs: [{
+ className: 'control',
+ orderable: false,
+ targets: 0
+ },
+ {
+ className: "dt-center",
+ targets: [ 1, 3, 4, 5 ]
+ }],
+ order: [1, 'desc']
+ });
+ this.set_events();
+ },
+ set_events: function() {
+ var self = this;
+ $('#' + this.ids.last_jobs_list + ' tbody').on('click', 'tr', function (e) {
+ var node_name = e.target.nodeName.toUpperCase();
+ if (node_name === 'BUTTON' || node_name === 'SVG' || node_name === 'PATH') {
+ // clicking on button doesn't cause directing to job details
+ return;
+ }
+ var data = self.last_jobs_table.row(this).data();
+ document.location.href = '/web/job/history/' + data.jobid + '/'
+ });
+ }
+};
+
var Dashboard = {
stats: null,
txt: null,
jobs: {
no: 'job_no',
most: 'job_most',
- most_count: 'job_most_count',
- all: 'all_jobs'
+ most_count: 'job_most_count'
},
jobtotals: {
total_bytes: 'jobs_total_bytes',
},
pie_summary: 'jobs_summary_graph'
},
+ last_jobs_table: null,
dbtype: {
pgsql: 'PostgreSQL',
mysql: 'MySQL',
document.getElementById(this.ids.clients.jobs).textContent = occupancy;
},
update_job_access: function() {
- var job_table= document.getElementById(this.ids.jobs.all);
- job_table.innerHTML = '';
- var last_jobs = this.stats.jobs.slice(0, 10);
- var add_job_dest_page = function(i) {
- tr.addEventListener('click', function(e) {
- var url = '/web/job/history/%jobid/'.replace('%jobid', last_jobs[i].jobid);
- document.location.href = url;
- });
- }
- for (var i = 0; i < last_jobs.length; i++) {
- var tr = document.createElement('TR');
- tr.style.cursor = 'pointer';
- add_job_dest_page(i);
- var td_jobid = document.createElement('TD');
- var td_name = document.createElement('TD');
- var td_level = document.createElement('TD');
- var td_starttime = document.createElement('TD');
- var td_jobstatus = document.createElement('TD');
- td_jobid.textContent = last_jobs[i].jobid;
- td_name.textContent = Strings.get_short_label(last_jobs[i].name);
- td_level.textContent = last_jobs[i].level;
- td_level.className = 'w3-center';
- td_starttime.textContent = last_jobs[i].starttime;
- td_starttime.className = 'w3-center';
- td_jobstatus.appendChild(JobStatus.get_icon(last_jobs[i].jobstatus));
- td_jobstatus.className = 'w3-center';
- tr.appendChild(td_jobid);
- tr.appendChild(td_name);
- tr.appendChild(td_level);
- tr.appendChild(td_starttime);
- tr.appendChild(td_jobstatus);
- job_table.appendChild(tr);
- }
+ // get last 10 jobs
+ var data = this.stats.jobs.slice(0, 10);
+ oLastJobsList.init(data);
},
update_jobs: function() {
var jobs = this.stats.jobs_occupancy;
<div class="w3-bar w3-green w3-margin-bottom">
<a class="w3-bar-item w3-button tab_btn" href="<%=$this->Service->constructUrl('ClientList')%>"><i class="fa fa-angle-left"></i></a>
<button id="btn_client_actions" type="button" class="w3-bar-item w3-button tab_btn w3-grey" onclick="W3Tabs.open(this.id, 'client_actions'); clear_node('#new_client div.directive_value');"><%[ Actions ]%></button>
- <button id="btn_client_jobs" type="button" class="w3-bar-item w3-button tab_btn" onclick="W3Tabs.open(this.id, 'client_jobs'); clear_node('#new_client div.directive_value');"><%[ Jobs for Client ]%></button>
+ <button id="btn_client_jobs" type="button" class="w3-bar-item w3-button tab_btn" onclick="W3Tabs.open(this.id, 'client_jobs'); clear_node('#new_client div.directive_value');oJobForClientList.table.responsive.recalc();"><%[ Jobs for Client ]%></button>
<com:TLinkButton
CssClass="w3-bar-item w3-button tab_btn"
Attributes.onclick="W3Tabs.open(this.id, 'client_config'); clear_node('#new_client div.directive_value'); return false;"
},
clientid: 0,
data: [],
+ table: null,
init: function(clientid) {
this.clientid = clientid;
this.prepare_data();
}
},
set_table: function() {
- var table = $('#' + this.ids.job_list).DataTable({
+ this.table = $('#' + this.ids.job_list).DataTable({
data: this.data,
deferRender: true,
columns: [
</div>
<div class="w3-twothird">
<h5><%[ Last 10 jobs ]%></h5>
- <table class="w3-table w3-striped w3-hoverable w3-white w3-margin-bottom">
+ <table id="last_jobs_list" class="w3-table w3-striped w3-hoverable w3-white w3-margin-bottom" style="width: 100%">
<thead>
<tr>
+ <th></th>
<th><%[ JobId ]%></th>
<th><%[ Name ]%></th>
- <th class="w3-center"><%[ Level ]%></th>
- <th class="w3-center"><%[ Start time ]%></th>
- <th class="w3-center"><%[ Job status ]%></th>
+ <th><%[ Level ]%></th>
+ <th><%[ Start time ]%></th>
+ <th><%[ Job status ]%></th>
</tr>
</thead>
- <tbody id="all_jobs">
+ <tbody id="last_jobs_list_body">
</tbody>
</table>
<button type="button" class="w3-button w3-dark-grey w3-right w3-margin-bottom" onclick="document.location.href='<%=$this->Service->constructUrl('JobHistoryList')%>'"><%[ More jobs ]%> <i class="fa fa-arrow-right"></i></button>
<div class="w3-bar w3-green w3-margin-bottom">
<a class="w3-bar-item w3-button tab_btn" href="<%=$this->Service->constructUrl('PoolList')%>"><i class="fa fa-angle-left"></i></a>
<button id="btn_pool_actions" type="button" class="w3-bar-item w3-button tab_btn w3-grey" onclick="W3Tabs.open(this.id, 'pool_actions');"><%[ Actions ]%></button>
- <button id="btn_volumes_in_pool" type="button" class="w3-bar-item w3-button tab_btn" onclick="W3Tabs.open(this.id, 'volumes_in_pool');"><%[ Volumes in pool ]%></button>
+ <button id="btn_volumes_in_pool" type="button" class="w3-bar-item w3-button tab_btn" onclick="W3Tabs.open(this.id, 'volumes_in_pool');oVolumeList.table.responsive.recalc();"><%[ Volumes in pool ]%></button>
<com:TLinkButton
CssClass="w3-bar-item w3-button tab_btn"
Attributes.onclick="W3Tabs.open(this.id, 'pool_config'); return false;"
<th><%[ Actions ]%></th>
</tr>
</thead>
- <tbody id="pool_list_body">
+ <tbody id="volume_list_body">
</tbody>
</table>
</div>
Formatters.set_formatters();
});
var oVolumeList = {
+ table: null,
ids: {
volume_list: 'volume_list',
volume_list_body: 'volume_list_body'
this.set_table();
},
set_table: function() {
- var table = $('#' + this.ids.volume_list).DataTable({
+ this.table = $('#' + this.ids.volume_list).DataTable({
data: <%=json_encode($this->volumes_in_pool)%>,
deferRender: true,
columns: [
<div class="w3-bar w3-green w3-margin-bottom">
<a class="w3-bar-item w3-button tab_btn" href="<%=$this->Service->constructUrl('VolumeList')%>"><i class="fa fa-angle-left"></i></a>
<button id="btn_volume_actions" type="button" class="w3-bar-item w3-button tab_btn w3-grey" onclick="W3Tabs.open(this.id, 'volume_actions');"><%[ Actions ]%></button>
- <button id="btn_jobs_on_volume" type="button" class="w3-bar-item w3-button tab_btn" onclick="W3Tabs.open(this.id, 'jobs_on_volume');"><%[ Jobs on volume ]%></button>
+ <button id="btn_jobs_on_volume" type="button" class="w3-bar-item w3-button tab_btn" onclick="W3Tabs.open(this.id, 'jobs_on_volume');oJobsOnVolumeList.table.responsive.recalc();"><%[ Jobs on volume ]%></button>
<button id="btn_volume_config" type="button" class="w3-bar-item w3-button tab_btn" onclick="W3Tabs.open(this.id, 'volume_config');"><%[ Configure volume ]%></button>
</div>
<div class="w3-container tab_item" id="volume_actions">
</div>
<script type="text/javascript">
var oJobsOnVolumeList = {
+ table: null,
ids: {
jobs_on_volume_list: 'jobs_on_volume_list',
jobs_on_volume_list_body: 'jobs_on_volume_list_body'
this.set_table();
},
set_table: function() {
- var table = $('#' + this.ids.jobs_on_volume_list).DataTable({
+ this.table = $('#' + this.ids.jobs_on_volume_list).DataTable({
data: <%=json_encode($this->jobs_on_volume)%>,
deferRender: true,
columns: [
div.config_directives {
padding: 10px;
}
+
+#last_jobs_list tbody tr {
+ cursor: pointer;
+}