<commit_before>import _ from 'messages'
import Component from 'base-component'
import Copiable from 'copiable'
import Icon from 'icon'
import Link from 'react-router/lib/Link'
import Page from '../page'
import React from 'react'
import { serverVersion } from 'xo'
import { Container, Row, Col } from 'grid'
import { getXoaPlan } from 'utils'
import pkg from '../../../package'

const HEADER = <Container>
  <Row>
    <Col mediumSize={12}>
      <h2><Icon icon='menu-about' /> {_('aboutPage')} XO {getXoaPlan()}</h2>
    </Col>
  </Row>
</Container>

export default class About extends Component {
  componentWillMount () {
    serverVersion.then(serverVersion => {
      this.setState({ serverVersion })
    })
  }
  render () {
    return <Page header={HEADER}>
      <Container className='text-xs-center'>
        <Row>
          <Col mediumSize={6}>
            <Icon icon='host' size={4} />
            <Copiable tagName='h4' data={`xo-server ${this.state.serverVersion}`}>
              xo-server {this.state.serverVersion || 'unknown'}
            </Copiable>
            <p className='text-muted'>Xen Orchestra server</p>
          </Col>
          <Col mediumSize={6}>
            <Icon icon='vm' size={4} />
            <Copiable tagName='h4' data={`xo-web ${pkg.version}`}>
              xo-web {pkg.version}</Copiable>
            <p className='text-muted'>Xen Orchestra web client</p>
          </Col>
        </Row>
        {process.env.XOA_PLAN > 4
          ? <div>
            <Row>
              <Col>
                <h2 className='text-danger'>No pro support provided!</h2>
                <h4 className='text-danger'>Use in production at your own risks</h4>
                <p className='text-muted'>You can download our turnkey appliance on xen-orchestra.com</p>
              </Col><commit_msg>feat(about): hide xo version numbers for non admin users. Fix #877<commit_after>import _ from 'messages'
import Component from 'base-component'
import Copiable from 'copiable'
import Icon from 'icon'
import Link from 'react-router/lib/Link'
import Page from '../page'
import React from 'react'
import { getUser } from 'selectors'
import { serverVersion } from 'xo'
import { Container, Row, Col } from 'grid'
import { connectStore, getXoaPlan } from 'utils'

import pkg from '../../../package'

const HEADER = <Container>
  <Row>
    <Col mediumSize={12}>
      <h2><Icon icon='menu-about' /> {_('aboutPage')} XO {getXoaPlan()}</h2>
    </Col>
  </Row>
</Container>

@connectStore(() => ({
  user: getUser
}))
export default class About extends Component {
  componentWillMount () {
    serverVersion.then(serverVersion => {
      this.setState({ serverVersion })
    })
  }
  render () {
    const { user } = this.props
    const isAdmin = user && user.permission === 'admin'

    return <Page header={HEADER}>
      <Container className='text-xs-center'>
        {isAdmin && <Row>
          <Col mediumSize={6}>
            <Icon icon='host' size={4} />
            <Copiable tagName='h4' data={`xo-server ${this.state.serverVersion}`}>
              xo-server {this.state.serverVersion || 'unknown'}
            </Copiable>
            <p className='text-muted'>Xen Orchestra server</p>
          </Col>
          <Col mediumSize={6}>
            <Icon icon='vm' size={4} />
            <Copiable tagName='h4' data={`xo-web ${pkg.version}`}>
              xo-web {pkg.version}</Copiable>
            <p className='text-muted'>Xen Orchestra web client</p>
          </Col>
        </Row>
      }
        {process.env.XOA_PLAN > 4
          ? <div>
            <Row>
              <Col>
                <h2 className='text-danger'>No pro support provided!</h2>
                <h4 className='text-danger'>Use in production at your own risks</h4>
                <p className='text-muted'>You can download our turnkey appliance on xen-orchestra.com</p>
              </Col>
{'fraction_non_alphanumeric': 0.15046296296296297, 'fraction_numerical': 0.008487654320987654, 'mean_word_length': 2.3758680555555554, 'pattern_counts': {'":': 0, '<': 77, '<?xml version=': 0, '>': 82, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4594178', 'n_tokens_mistral': 1187, 'n_tokens_neox': 1171, 'n_words': 306}