<commit_before>class EnvironmentsMainView extends JView

  tabData = [
    { name : 'VMs',              lazy : no,   itemClass : VMMainView }
    { name : 'Domains',          lazy : yes,  itemClass : DomainMainView }
  ]

  navData =
    title : "Settings"
    items : ({ title : name } for {name} in tabData)

  constructor:(options={}, data)->

    options.cssClass or= "content-page"
    data or= {}
    super options, data

    @header = new HeaderViewSection type : "big", title : "Environments"
    @nav    = new CommonInnerNavigation
    @tabs   = new KDTabView
      cssClass            : 'environment-content'
      hideHandleContainer : yes
    , data

    @setListeners()
    @createTabs()
    @once 'viewAppended', @bound "_windowDidResize"

  setListeners:->

    @listenWindowResize()
    @nav.on "viewAppended", =>
      navController = @nav.setListController
        itemClass : ListGroupShowMeItem
      , navData

      @nav.addSubView navController.getView()
      navController.selectItem navController.itemsOrdered.first

    @nav.on "NavItemReceivedClick", ({title})=> @tabs.showPaneByName title

  createTabs:->

    data = @getData()

    for {name, lazy, itemClass} in tabData
      @tabs.addPane new KDTabPaneView {
        view : {itemClass, data}
        name
        lazy
      }

  _windowDidResize:->
    contentHeight = @getHeight() - @header.getHeight()
    @$('>section, >aside').height contentHeight
<commit_msg>use new TabView api.<commit_after>class EnvironmentsMainView extends JView

  tabData = [
    name        : 'VMS'
    viewOptions :
      lazy      : no
      viewClass : VMMainView
  ,
    name        : 'Domains'
    viewOptions :
      lazy      : yes
      viewClass : DomainMainView
  ]

  navData =
    title : "Settings"
    items : ({ title : name } for {name} in tabData)

  constructor:(options={}, data)->

    data or= {}
    super options, data

    @header = new HeaderViewSection type : "big", title : "Environments"
    @nav    = new CommonInnerNavigation
    @tabs   = new KDTabView
      cssClass            : 'environment-content'
      hideHandleContainer : yes
    , data

    @setListeners()
    @createTabs()
    @once 'viewAppended', @bound "_windowDidResize"

  setListeners:->

    @listenWindowResize()
    @nav.on "viewAppended", =>
      navController = @nav.setListController
        itemClass : ListGroupShowMeItem
      , navData

      @nav.addSubView navController.getView()
      navController.selectItem navController.itemsOrdered.first

    @nav.on "NavItemReceivedClick", ({title})=> @tabs.showPaneByName title

  createTabs:->

    data = @getData()

    for {name, viewOptions} in tabData
      @tabs.addPane new KDTabPaneView {name, viewOptions}

  _windowDidResize:->
    contentHeight = @getHeight() - @header.getHeight()
    @$('>section, >aside').height contentHeight

{'fraction_non_alphanumeric': 0.11157747464148303, 'fraction_numerical': 0.0, 'mean_word_length': 2.6619718309859155, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 0, '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': '2655375', 'n_tokens_mistral': 885, 'n_tokens_neox': 861, 'n_words': 204}