<commit_before>import React from 'react'
import Widget from 'app/containers/serverboard/board/widget'
import AddWidget from 'app/containers/serverboard/board/add_widget'
import EditWidget from 'app/containers/serverboard/board/edit_widget'
import Loading from 'app/components/loading'
import Command from 'app/utils/command'
import BoardHeader from './header'
import ReactGridLayout from 'react-grid-layout'
import {object_is_equal} from 'app/utils'
import {set_modal} from 'app/utils/store'

require('sass/board.sass')
require('sass/gridlayout.sass')

const Board = React.createClass({
  handleEdit(uuid){
    const widget=this.props.widgets.find( (w) => w.uuid == uuid )
    set_modal("serverboard.widget.edit", {uuid, widget})
  },
  handleAddWidget(){
    set_modal('serverboard.widget.add',{serverboard: this.props.serverboard})
  },
  getLayout(props){
    const layout = this.props.widgets && this.props.widgets.map( (w) => w.ui ).filter( Boolean )
    return layout
  },
  getInitialState(){
    return {
      layout: this.getLayout(this.props)
    }<commit_msg>Fix rpc was not defined<commit_after>import React from 'react'
import Widget from 'app/containers/serverboard/board/widget'
import AddWidget from 'app/containers/serverboard/board/add_widget'
import EditWidget from 'app/containers/serverboard/board/edit_widget'
import Loading from 'app/components/loading'
import Command from 'app/utils/command'
import BoardHeader from './header'
import ReactGridLayout from 'react-grid-layout'
import {object_is_equal} from 'app/utils'
import {set_modal} from 'app/utils/store'
import rpc from 'app/rpc'

require('sass/board.sass')
require('sass/gridlayout.sass')

const Board = React.createClass({
  handleEdit(uuid){
    const widget=this.props.widgets.find( (w) => w.uuid == uuid )
    set_modal("serverboard.widget.edit", {uuid, widget})
  },
  handleAddWidget(){
    set_modal('serverboard.widget.add',{serverboard: this.props.serverboard})
  },
  getLayout(props){
    const layout = this.props.widgets && this.props.widgets.map( (w) => w.ui ).filter( Boolean )
    return layout
  },
  getInitialState(){
    return {
      layout: this.getLayout(this.props)
    }
{'fraction_non_alphanumeric': 0.13360881542699724, 'fraction_numerical': 0.0, 'mean_word_length': 4.85752688172043, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '6267069', 'n_tokens_mistral': 690, 'n_tokens_neox': 684, 'n_words': 152}