From bf8b7e0ccd972f83118fc73c065c39d8456dbf0d Mon Sep 17 00:00:00 2001 From: Paolo Date: Mon, 16 Sep 2019 14:00:51 +0200 Subject: [PATCH] Added JobsViewer --- application/controllers/system/JobsViewer.php | 44 +++++++++++++ application/views/system/jobs/jobsViewer.php | 47 +++++++++++++ .../views/system/jobs/jobsViewerData.php | 66 +++++++++++++++++++ 3 files changed, 157 insertions(+) create mode 100644 application/controllers/system/JobsViewer.php create mode 100644 application/views/system/jobs/jobsViewer.php create mode 100644 application/views/system/jobs/jobsViewerData.php diff --git a/application/controllers/system/JobsViewer.php b/application/controllers/system/JobsViewer.php new file mode 100644 index 000000000..2fdfa7181 --- /dev/null +++ b/application/controllers/system/JobsViewer.php @@ -0,0 +1,44 @@ + 'admin:r' + ) + ); + + // Loads WidgetLib + $this->load->library('WidgetLib'); + + // Loads phrases system + $this->loadPhrases( + array( + 'global', + 'ui', + 'filter' + ) + ); + } + + // ----------------------------------------------------------------------------------------------------------------- + // Public methods + + /** + * Main page of the InfoCenter tool + */ + public function index() + { + $this->load->view('system/jobs/jobsViewer.php'); + } +} diff --git a/application/views/system/jobs/jobsViewer.php b/application/views/system/jobs/jobsViewer.php new file mode 100644 index 000000000..f7018a272 --- /dev/null +++ b/application/views/system/jobs/jobsViewer.php @@ -0,0 +1,47 @@ +load->view( + 'templates/FHC-Header', + array( + 'title' => 'JobsViewer', + 'jquery' => true, + 'jqueryui' => true, + 'bootstrap' => true, + 'fontawesome' => true, + 'sbadmintemplate' => true, + 'tablesorter' => true, + 'ajaxlib' => true, + 'filterwidget' => true, + 'navigationwidget' => true, + 'phrases' => array( + 'global' => array('mailAnXversandt'), + 'ui' => array('bitteEintragWaehlen') + ), + 'customCSSs' => 'public/css/sbadmin2/tablesort_bootstrap.css', + 'customJSs' => array('public/js/bootstrapper.js') + ) + ); +?> + + +
+ + widgetlib->widget('NavigationWidget'); ?> + +
+
+
+
+ +
+
+
+ load->view('system/jobs/jobsViewerData.php'); ?> +
+
+
+
+ + +load->view('templates/FHC-Footer'); ?> diff --git a/application/views/system/jobs/jobsViewerData.php b/application/views/system/jobs/jobsViewerData.php new file mode 100644 index 000000000..07815c2f3 --- /dev/null +++ b/application/views/system/jobs/jobsViewerData.php @@ -0,0 +1,66 @@ + ' + SELECT wsl.webservicelog_id AS "LogId", + wsl.request_id AS "RequestId", + wsl.execute_time AS "ExecutionTime", + wsl.execute_user AS "ExecutedBy", + wsl.beschreibung AS "Description", + wsl.request_data AS "Data" + FROM system.tbl_webservicelog wsl + WHERE wsl.webservicetyp_kurzbz = \'job\' + ORDER BY wsl.execute_time DESC + ', + 'requiredPermissions' => 'admin', + 'datasetRepresentation' => 'tablesorter', + 'reloadDataset' => ($this->input->get('reloadDataset') == 'true' ? true : false), + 'columnsAliases' => array( + 'Log id', + 'Request id', + 'Execution time', + 'Executed by', + 'Producer', + 'Data' + ), + 'formatRow' => function($datasetRaw) { + + $datasetRaw->ExecutionTime = date_format(date_create($datasetRaw->ExecutionTime), 'd.m.Y H:i:s'); + + return $datasetRaw; + }, + 'markRow' => function($datasetRaw) { + + $mark = ''; + + if ($datasetRaw->RequestId == 'Cronjob error') + { + $mark = 'text-red'; + } + + if ($datasetRaw->RequestId == 'Cronjob info') + { + $mark = 'text-green'; + } + + if ($datasetRaw->RequestId == 'Cronjob warning') + { + $mark = 'text-orange'; + } + + if ($datasetRaw->RequestId == 'Cronjob debug') + { + $mark = 'text-info'; + } + + return $mark; + } + ); + + $filterWidgetArray['app'] = 'core'; + $filterWidgetArray['datasetName'] = 'jobslogs'; + $filterWidgetArray['filterKurzbz'] = 'all'; + $filterWidgetArray['filter_id'] = $this->input->get('filter_id'); + + echo $this->widgetlib->widget('FilterWidget', $filterWidgetArray); +?>