<commit_before>/**
 * @module Jmx
 */
module Jmx {

  export var propertiesColumnDefs = [
    {field: 'name', displayName: 'Property', width: "27%",
      cellTemplate: '<div class="ngCellText" title="{{row.entity.attrDesc}}" ' +
        'data-placement="bottom"><div ng-show="!inDashboard" class="inline" compile="getDashboardWidgets(row.entity)"></div>{{row.entity.name}}</div>'},
    {field: 'value', displayName: 'Value',  width: "70%",
      cellTemplate: '<div class="ngCellText" ng-click="onViewAttribute(row.entity)" title="{{row.entity.attrDesc}}" ng-bind-html-unsafe="row.entity.summary"></div>'
    }
  ];

  export var foldersColumnDefs = [{
      displayName: 'Name',
      cellTemplate: '<div class="ngCellText"><a href="{{folderHref(row)}}"><i class="{{folderIconClass(row)}}"></i> {{row.getProperty("title")}}</a></div>'
    }];

  export function AttributesController($scope, $element, $location, workspace:Workspace, jolokia, jmxWidgets, jmxWidgetTypes) {
    $scope.searchText = '';
    $scope.columnDefs = [];
    $scope.selectedItems = [];

    $scope.lastKey = null;
    $scope.attributesInfoCache = {};

    $scope.entity = {};
    $scope.attributeSchema = {
      properties: {
        'key': {
          description: 'Key',
            tooltip: 'Attribute key',
            type: 'string',
            'input-attributes': { readonly: true }
        },
        'description': {
          description: 'Description',
            tooltip: 'Attribute description',
            type: 'string',
            formTemplate: "<textarea class='input-xlarge' rows='2'></textarea>",
            'input-attributes': { readonly: true }
        },
        'type': {
          description: 'Type',
            tooltip: 'Attribute type',
            type: 'string',
            'input-attributes': { readonly: true }
        },
        'value': {
          description: 'Value',
            tooltip: 'Attribute value',
            type: 'string'
        }
      }
    };

    $scope.gridOptions = {
      selectedItems: $scope.selectedItems,
      //plugins: [$scope.selectToggle],
      showFilter: false,
      //showColumnMenu: false,
      canSelectRows: false,
      enableRowSelection: false,
      keepLastSelected: false,
      multiSelect: false,
      showColumnMenu: true,
      displaySelectionCheckbox: false,
      filterOptions: {
        filterText: ''
      },
      // TODO disabled for now as it causes https://github.com/hawtio/hawtio/issues/262<commit_msg>#883: JMX attribute dialog show type, and work on being able to edit the value.<commit_after>/**
 * @module Jmx
 */
module Jmx {

  export var propertiesColumnDefs = [
    {field: 'name', displayName: 'Property', width: "27%",
      cellTemplate: '<div class="ngCellText" title="{{row.entity.attrDesc}}" ' +
        'data-placement="bottom"><div ng-show="!inDashboard" class="inline" compile="getDashboardWidgets(row.entity)"></div>{{row.entity.name}}</div>'},
    {field: 'value', displayName: 'Value',  width: "70%",
      cellTemplate: '<div class="ngCellText" ng-click="onViewAttribute(row.entity)" title="{{row.entity.attrDesc}}" ng-bind-html-unsafe="row.entity.summary"></div>'
    }
  ];

  export var foldersColumnDefs = [{
      displayName: 'Name',
      cellTemplate: '<div class="ngCellText"><a href="{{folderHref(row)}}"><i class="{{folderIconClass(row)}}"></i> {{row.getProperty("title")}}</a></div>'
    }];

  export function AttributesController($scope, $element, $location, workspace:Workspace, jolokia, jmxWidgets, jmxWidgetTypes) {
    $scope.searchText = '';
    $scope.columnDefs = [];
    $scope.selectedItems = [];

    $scope.lastKey = null;
    $scope.attributesInfoCache = {};

    $scope.entity = {};
    $scope.attributeSchema = {
      properties: {
        'key': {
          description: 'Key',
            tooltip: 'Attribute key',
            type: 'string',
            'input-attributes': { readonly: 'true' }
        },
        'description': {
          description: 'Description',
            tooltip: 'Attribute description',
            type: 'string',
            formTemplate: "<textarea class='input-xlarge' rows='2' readonly='true'></textarea>",
        },
        'type': {
          description: 'Type',
            tooltip: 'Attribute type',
            type: 'string',
            'input-attributes': { readonly: 'true' }
        },
        'value': {
          description: 'Value',
            tooltip: 'Attribute value',
            type: 'string'
        }
      }
    };

    $scope.gridOptions = {
      selectedItems: $scope.selectedItems,
      //plugins: [$scope.selectToggle],
      showFilter: false,
      //showColumnMenu: false,
      canSelectRows: false,
      enableRowSelection: false,
      keepLastSelected: false,
      multiSelect: false,
      showColumnMenu: true,
      displaySelectionCheckbox: false,
      filterOptions: {
        filterText: ''
      },
      // TODO disabled for now as it causes https://github.com/hawtio/hawtio/issues/262
{'fraction_non_alphanumeric': 0.1627023785728563, 'fraction_numerical': 0.003797721367179692, 'mean_word_length': 2.644573925710124, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6641374', 'n_tokens_mistral': 1463, 'n_tokens_neox': 1424, 'n_words': 289}