]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Loading table data performance improvements
authorMarcin Haba <marcin.haba@bacula.pl>
Tue, 24 Apr 2018 18:37:03 +0000 (20:37 +0200)
committerMarcin Haba <marcin.haba@bacula.pl>
Wed, 25 Apr 2018 17:12:56 +0000 (19:12 +0200)
13 files changed:
gui/baculum/protected/Web/Pages/ClientList.page
gui/baculum/protected/Web/Pages/ClientView.page
gui/baculum/protected/Web/Pages/FileSetList.page
gui/baculum/protected/Web/Pages/JobHistoryList.page
gui/baculum/protected/Web/Pages/JobList.page
gui/baculum/protected/Web/Pages/Monitor.php
gui/baculum/protected/Web/Pages/PoolList.page
gui/baculum/protected/Web/Pages/PoolView.page
gui/baculum/protected/Web/Pages/RestoreWizard.page
gui/baculum/protected/Web/Pages/ScheduleList.page
gui/baculum/protected/Web/Pages/StorageList.page
gui/baculum/protected/Web/Pages/VolumeList.page
gui/baculum/protected/Web/Pages/VolumeView.page

index 7c1373024231d1ae967f7be0d836a4be7f71f81c..6fbaefd21611fb2a4f3fb94adee9b7f6385490f0 100644 (file)
@@ -39,6 +39,7 @@ var oClientList = {
        set_table: function() {
                var table = $('#' + this.ids.client_list).DataTable({
                        data: oData.clients,
+                       deferRender: true,
                        columns: [
                                {
                                        className: 'details-control',
index 51f64f9d16d75cf38b554ee82a3e7b4a2c358ef3..b8ea4320b4359a122745736e6243ba84ef9b80ff 100644 (file)
@@ -80,6 +80,7 @@ var oJobForClientList = {
        set_table: function() {
                var table = $('#' + this.ids.job_list).DataTable({
                        data: this.data,
+                       deferRender: true,
                        columns: [
                                {
                                        className: 'details-control',
index cafe5f678d734b22e522105b5c068bc5170afd30..55c962d434c12609728bb72b3eadfe4901504558 100644 (file)
@@ -35,6 +35,7 @@ var oFileSetList = {
        set_table: function() {
                var table = $('#' + this.ids.fileset_list).DataTable({
                        data: <%=json_encode($this->filesets)%>,
+                       deferRender: true,
                        columns: [
                                {
                                        className: 'details-control',
index a2e40d2c4d76c06acf706da33d4942b325553f73..ec0e19d16db3c9bd7e6f96fe63724bd889214f26 100644 (file)
@@ -50,6 +50,7 @@ var oJobList = {
        set_table: function() {
                var table = $('#' + this.ids.job_list).DataTable({
                        data: oData.jobs,
+                       deferRender: true,
                        columns: [
                                {
                                        className: 'details-control',
index 39c8a3c051474b1c71ed1e333981ebdd6cdffdd4..451573b3c35a4b7bd14f98ad60ce5c167e06718e 100644 (file)
@@ -43,6 +43,7 @@ var oJobHistoryList = {
        set_table: function() {
                var table = $('#' + this.ids.job_history_list).DataTable({
                        data: <%=json_encode($this->jobs)%>,
+                       deferRender: true,
                        columns: [
                                {
                                        className: 'details-control',
index 70b8910be0970d795e058e3cb9747dd5354c7383..e2993939569616337e62714735937d795f259e56 100644 (file)
@@ -26,7 +26,7 @@ class Monitor extends BaculumWebPage {
 
        public function onInit($param) {
                parent::onInit($param);
-               $_SESSION['monitor_data'] = array(
+               $monitor_data = array(
                        'jobs' => array(),
                        'running_jobs' => array(),
                        'terminated_jobs' => array(),
@@ -37,32 +37,32 @@ class Monitor extends BaculumWebPage {
 
                $params = $this->Request->contains('params') ? $this->Request['params'] : array();
                if (in_array('jobs', $params)) {
-                       $_SESSION['monitor_data']['jobs'] = $this->getModule('api')->get(array('jobs'))->output;
+                       $monitor_data['jobs'] = $this->getModule('api')->get(array('jobs'))->output;
                }
-               $_SESSION['monitor_data']['running_jobs'] = $this->getModule('api')->get(array('jobs', '?jobstatus=CR'))->output;
+               $monitor_data['running_jobs'] = $this->getModule('api')->get(array('jobs', '?jobstatus=CR'))->output;
                if (in_array('clients', $params)) {
-                       $_SESSION['monitor_data']['clients'] = $this->getModule('api')->get(array('clients'))->output;
+                       $monitor_data['clients'] = $this->getModule('api')->get(array('clients'))->output;
                }
                if (in_array('pools', $params)) {
-                       $_SESSION['monitor_data']['pools'] = $this->getModule('api')->get(array('pools'))->output;
+                       $monitor_data['pools'] = $this->getModule('api')->get(array('pools'))->output;
                }
                if (in_array('job_totals', $params)) {
-                       $_SESSION['monitor_data']['jobtotals'] = $this->getModule('api')->get(array('jobs', 'totals'))->output;
+                       $monitor_data['jobtotals'] = $this->getModule('api')->get(array('jobs', 'totals'))->output;
                }
                if ($_SESSION['admin'] && in_array('dbsize', $params)) {
-                       $_SESSION['monitor_data']['dbsize'] = $this->getModule('api')->get(array('dbsize'))->output;
+                       $monitor_data['dbsize'] = $this->getModule('api')->get(array('dbsize'))->output;
                }
 
                $runningJobStates = $this->Application->getModule('misc')->getRunningJobStates();
 
                if (in_array('jobs', $params)) {
-                       for ($i = 0; $i < count($_SESSION['monitor_data']['jobs']); $i++) {
-                               if (!in_array($_SESSION['monitor_data']['jobs'][$i]->jobstatus, $runningJobStates)) {
-                                       $_SESSION['monitor_data']['terminated_jobs'][] = $_SESSION['monitor_data']['jobs'][$i];
+                       for ($i = 0; $i < count($monitor_data['jobs']); $i++) {
+                               if (!in_array($monitor_data['jobs'][$i]->jobstatus, $runningJobStates)) {
+                                       $monitor_data['terminated_jobs'][] = $monitor_data['jobs'][$i];
                                }
                        }
                }
-               echo json_encode($_SESSION['monitor_data']);
+               echo json_encode($monitor_data);
                exit();
        }
 }
index 5f1c76fbffb614351fd73aaf9aba4738c5d04447..3ddbf6e1cb4af3b1f58a98ffeb866be84b1fa68e 100644 (file)
@@ -40,6 +40,7 @@ var oPoolList = {
        set_table: function() {
                var table = $('#' + this.ids.pool_list).DataTable({
                        data: oData.pools,
+                       deferRender: true,
                        columns: [
                                {
                                        className: 'details-control',
index 8778744b7b37e528f9a3abfbf08350617f91d841..c58956569abfc7b84b4b79793e47a50d0f8256fb 100644 (file)
@@ -158,6 +158,7 @@ var oVolumeList = {
        set_table: function() {
                var table = $('#' + this.ids.volume_list).DataTable({
                        data: <%=json_encode($this->volumes_in_pool)%>,
+                       deferRender: true,
                        columns: [
                                {
                                        className: 'details-control',
index cffbb6b3fe79ff7b83faf6ecc6f78486ae0b8835..289ed115bc6e30071b44b0009e56e94959c75fdf 100644 (file)
@@ -185,6 +185,7 @@ var oJobsToRestoreList = {
        set_table: function() {
                var table = $('#' + this.ids.job_list).DataTable({
                        data: <%=json_encode(array_values($this->getPage()->jobs_to_restore))%>,
+                       deferRender: true,
                        columns: [
                                {
                                        className: 'details-control',
index 0b7cf32fa8ee2840665c69a08dfd71ad15fe86b2..b794eb612c88b3e8f654c18c43671058a15a6131 100644 (file)
@@ -34,6 +34,7 @@ var oScheduleList = {
        set_table: function() {
                var table = $('#' + this.ids.schedule_list).DataTable({
                        data: <%=json_encode($this->schedules)%>,
+                       deferRender: true,
                        columns: [
                                {
                                        className: 'details-control',
index 9ed58d8f3cbb28bc9f5ac5fa7c195d7cead4327b..35268fc70d1e69faba7b6b478d1c8dc442b65147 100644 (file)
@@ -38,6 +38,7 @@ var oStorageList = {
        set_table: function() {
                var table = $('#' + this.ids.storage_list).DataTable({
                        data: <%=json_encode($this->storages)%>,
+                       deferRender: true,
                        columns: [
                                {
                                        className: 'details-control',
index f8f78e5ccc3580b544601c8d83f8717230c0c591..be2c523147686fe1c86fd5df265f9cf6658fc709 100644 (file)
@@ -42,6 +42,7 @@ var oVolumeList = {
        set_table: function() {
                var table = $('#' + this.ids.volume_list).DataTable({
                        data: <%=json_encode($this->volumes)%>,
+                       deferRender: true,
                        columns: [
                                {
                                        className: 'details-control',
index 1d56fbdef4c2659cc8fb283605480c27ddec7125..278efb8b650b815114a410c5493ba3148066dbc2 100644 (file)
@@ -359,6 +359,7 @@ var oJobsOnVolumeList = {
        set_table: function() {
                var table = $('#' + this.ids.jobs_on_volume_list).DataTable({
                        data: <%=json_encode($this->jobs_on_volume)%>,
+                       deferRender: true,
                        columns: [
                                {
                                        className: 'details-control',