AdminUI: Convert Job Log page civicrm/admin/joblog
authorAidan Saunders <aidan.saunders@squiffle.uk>
Tue, 4 Jul 2023 23:24:31 +0000 (00:24 +0100)
committerAidan Saunders <aidan.saunders@squiffle.uk>
Tue, 4 Jul 2023 23:25:50 +0000 (00:25 +0100)
ext/civicrm_admin_ui/ang/afsearchScheduledJobsLog.aff.html [new file with mode: 0644]
ext/civicrm_admin_ui/ang/afsearchScheduledJobsLog.aff.json [new file with mode: 0644]
ext/civicrm_admin_ui/managed/SavedSearch_Scheduled_Jobs_Log.mgd.php [new file with mode: 0644]

diff --git a/ext/civicrm_admin_ui/ang/afsearchScheduledJobsLog.aff.html b/ext/civicrm_admin_ui/ang/afsearchScheduledJobsLog.aff.html
new file mode 100644 (file)
index 0000000..c29768d
--- /dev/null
@@ -0,0 +1,13 @@
+<div af-fieldset="">
+  <div class="btn-group pull-right">
+    
+    
+    <a class="btn btn-primary" ng-href="{{:: crmUrl('civicrm/admin/job', {reset: 1}) }}">
+      <i class="crm-i fa-list-alt"/>
+      {{:: ts('Scheduled Jobs Listing') }}
+    </a>
+  
+  
+  </div>
+  <crm-search-display-table search-name="Scheduled_Jobs_Log" display-name="Scheduled_Jobs_Log_Table_1"></crm-search-display-table>
+</div>
diff --git a/ext/civicrm_admin_ui/ang/afsearchScheduledJobsLog.aff.json b/ext/civicrm_admin_ui/ang/afsearchScheduledJobsLog.aff.json
new file mode 100644 (file)
index 0000000..3bde1de
--- /dev/null
@@ -0,0 +1,19 @@
+{
+    "type": "search",
+    "requires": [],
+    "entity_type": null,
+    "join_entity": null,
+    "title": "Scheduled Jobs Log",
+    "description": "",
+    "is_dashlet": false,
+    "is_public": false,
+    "is_token": false,
+    "contact_summary": null,
+    "summary_contact_type": null,
+    "icon": "fa-list-alt",
+    "server_route": "civicrm/admin/joblog",
+    "permission": "admin CiviCRM",
+    "redirect": null,
+    "create_submission": false,
+    "navigation": null
+}
diff --git a/ext/civicrm_admin_ui/managed/SavedSearch_Scheduled_Jobs_Log.mgd.php b/ext/civicrm_admin_ui/managed/SavedSearch_Scheduled_Jobs_Log.mgd.php
new file mode 100644 (file)
index 0000000..dc47e1c
--- /dev/null
@@ -0,0 +1,105 @@
+<?php
+
+use CRM_CivicrmAdminUi_ExtensionUtil as E;
+
+return [
+  [
+    'name' => 'SavedSearch_Scheduled_Jobs_Log',
+    'entity' => 'SavedSearch',
+    'cleanup' => 'always',
+    'update' => 'unmodified',
+    'params' => [
+      'version' => 4,
+      'values' => [
+        'name' => 'Scheduled_Jobs_Log',
+        'label' => E::ts('Scheduled Jobs Log'),
+        'form_values' => NULL,
+        'mapping_id' => NULL,
+        'search_custom_id' => NULL,
+        'api_entity' => 'JobLog',
+        'api_params' => [
+          'version' => 4,
+          'select' => [
+            'run_time',
+            'name',
+            'command',
+            'description',
+            'data',
+          ],
+          'orderBy' => [],
+          'where' => [],
+          'groupBy' => [],
+          'join' => [],
+          'having' => [],
+        ],
+        'expires_date' => NULL,
+        'description' => NULL,
+      ],
+      'match' => [
+        'name',
+      ],
+    ],
+  ],
+  [
+    'name' => 'SavedSearch_Scheduled_Jobs_Log_SearchDisplay_Scheduled_Jobs_Log_Table_1',
+    'entity' => 'SearchDisplay',
+    'cleanup' => 'always',
+    'update' => 'unmodified',
+    'params' => [
+      'version' => 4,
+      'values' => [
+        'name' => 'Scheduled_Jobs_Log_Table_1',
+        'label' => E::ts('Scheduled Jobs Log Table 1'),
+        'saved_search_id.name' => 'Scheduled_Jobs_Log',
+        'type' => 'table',
+        'settings' => [
+          'description' => NULL,
+          'sort' => [
+            [
+              'run_time',
+              'DESC',
+            ],
+          ],
+          'limit' => 50,
+          'pager' => [],
+          'placeholder' => 5,
+          'columns' => [
+            [
+              'type' => 'field',
+              'key' => 'run_time',
+              'dataType' => 'Timestamp',
+              'label' => E::ts('Date'),
+              'sortable' => TRUE,
+            ],
+            [
+              'type' => 'html',
+              'key' => 'name',
+              'dataType' => 'String',
+              'label' => E::ts('Job Name and Command'),
+              'sortable' => TRUE,
+              'rewrite' => '[name]<br><br>[command]',
+            ],
+            [
+              'type' => 'html',
+              'key' => 'description',
+              'dataType' => 'String',
+              'label' => E::ts('Output'),
+              'sortable' => TRUE,
+              'rewrite' => '<b>' . E::ts("Summary:") . '</b> [description]<br><b>' . E::ts("Details:") . '</b><pre>[data]</pre>',
+            ],
+          ],
+          'actions' => FALSE,
+          'classes' => [
+            'table',
+            'table-striped',
+          ],
+        ],
+        'acl_bypass' => FALSE,
+      ],
+      'match' => [
+        'name',
+        'saved_search_id',
+      ],
+    ],
+  ],
+];