solrlog-1.0.1/solrlog.views.inc

solrlog.views.inc
<?php

/**
 * @file
 * Provide views data for solrlog.module.
 */

/**
 * Implements hook_views_data().
 *
 * @see dblog_views_data()
 */
function solrlog_views_data() {
  $data = [];

  $data['solrlog']['table']['group'] = t('Solr log');
  $data['solrlog']['table']['wizard_id'] = 'solrlog';

  $data['solrlog']['table']['base'] = [
    'field' => 'wid',
    'title' => t('Log entries'),
    'help' => t('Contains a list of log entries.'),
    'query_id' => 'solrlog',
  ];

  $data['solrlog']['wid'] = [
    'title' => t('WID'),
    'help' => t('Unique solrlog event ID.'),
    'field' => [
      'id' => 'standard',
    ],
    'filter' => [
      'id' => 'numeric',
    ],
    'argument' => [
      'id' => 'numeric',
    ],
    'sort' => [
      'id' => 'standard',
    ],
  ];

  $data['solrlog']['uid'] = [
    'title' => t('UID'),
    'help' => t('The user ID of the user on which the log entry was written.'),
    'field' => [
      'id' => 'standard',
    ],
    'filter' => [
      'id' => 'numeric',
    ],
    'argument' => [
      'id' => 'numeric',
    ],
    'relationship' => [
      'title' => t('User'),
      'help' => t('The user on which the log entry as written.'),
      'base' => 'users_field_data',
      'base field' => 'uid',
      'id' => 'standard',
    ],
  ];

  $data['solrlog']['type'] = [
    'title' => t('Type'),
    'help' => t('The type of the log entry, for example "user" or "page not found".'),
    'field' => [
      'id' => 'standard',
    ],
    'argument' => [
      'id' => 'string',
    ],
    'filter' => [
      'id' => 'solrlog_types',
    ],
    'sort' => [
      'id' => 'standard',
    ],
  ];

  $data['solrlog']['message'] = [
    'title' => t('Message'),
    'help' => t('The actual message of the log entry.'),
    'field' => [
      'id' => 'solrlog_message',
    ],
    'argument' => [
      'id' => 'string',
    ],
    'filter' => [
      'id' => 'string',
    ],
    'sort' => [
      'id' => 'standard',
    ],
  ];

  $data['solrlog']['variables'] = [
    'title' => t('Variables'),
    'help' => t('The variables of the log entry in a serialized format.'),
    'field' => [
      'id' => 'serialized',
      'click sortable' => FALSE,
    ],
    'argument' => [
      'id' => 'string',
    ],
    'filter' => [
      'id' => 'string',
    ],
    'sort' => [
      'id' => 'standard',
    ],
  ];

  $data['solrlog']['severity'] = [
    'title' => t('Severity level'),
    'help' => t('The severity level of the event; ranges from 0 (Emergency) to 7 (Debug).'),
    'field' => [
      'id' => 'machine_name',
      'options callback' => 'Drupal\solrlog\Controller\ViewLogControllerLogController::getLogLevelClassMap',
    ],
    'filter' => [
      'id' => 'in_operator',
      'options callback' => 'Drupal\Core\Logger\RfcLogLevel::getLevels',
    ],
    'sort' => [
      'id' => 'standard',
    ],
  ];

  $data['solrlog']['link'] = [
    'title' => t('Operations'),
    'help' => t('Operation links for the event.'),
    'field' => [
      'id' => 'solrlog_operations',
    ],
    'argument' => [
      'id' => 'string',
    ],
    'filter' => [
      'id' => 'string',
    ],
    'sort' => [
      'id' => 'standard',
    ],
  ];

  $data['solrlog']['location'] = [
    'title' => t('Location'),
    'help' => t('URL of the origin of the event.'),
    'field' => [
      'id' => 'standard',
    ],
    'argument' => [
      'id' => 'string',
    ],
    'filter' => [
      'id' => 'string',
    ],
    'sort' => [
      'id' => 'standard',
    ],
  ];

  $data['solrlog']['referer'] = [
    'title' => t('Referer'),
    'help' => t('URL of the previous page.'),
    'field' => [
      'id' => 'standard',
    ],
    'argument' => [
      'id' => 'string',
    ],
    'filter' => [
      'id' => 'string',
    ],
    'sort' => [
      'id' => 'standard',
    ],
  ];

  $data['solrlog']['hostname'] = [
    'title' => t('Hostname'),
    'help' => t('Hostname of the user who triggered the event.'),
    'field' => [
      'id' => 'standard',
    ],
    'argument' => [
      'id' => 'string',
    ],
    'filter' => [
      'id' => 'string',
    ],
    'sort' => [
      'id' => 'standard',
    ],
  ];

  $data['solrlog']['timestamp'] = [
    'title' => t('Timestamp'),
    'help' => t('Date when the event occurred.'),
    'field' => [
      'id' => 'date',
    ],
    'argument' => [
      'id' => 'date',
    ],
    'filter' => [
      'id' => 'date',
    ],
    'sort' => [
      'id' => 'date',
    ],
  ];

  return $data;
}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc